text
stringlengths
79
3.72M
<vulnerable_code> __tablename__ = 'users' __table_args__ = {'sqlite_autoincrement': True} ADMIN_ROLE = 0 MAINTAINER_ROLE = 5 USER_ROLE = 10 'maintainer': MAINTAINER_ROLE, 'user': USER_ROLE, } DISABLED_MFA = 0 ENABLED_MFA = 1 userid = Column('UserID', Integer, primary...
<vulnerable_code> u_int length = h->len; if_printer printer; const pktap_header_t *hdr; if (caplen < sizeof(pktap_header_t) || length < sizeof(pktap_header_t)) { ND_PRINT((ndo, "[|pktap]")); case PKT_REC_PACKET: if ((printer = lookup_printer(dlt)) != NULL) { hdrlen += printer(ndo, h, p); } else { if (...
<vulnerable_code> req::vector<String> sitems; sitems.reserve(size); int len = 0; int lenDelim = delim.size(); for (ArrayIter iter(items); iter; ++iter) { sitems.emplace_back(iter.second().toString()); len += sitems.back().size() + lenDelim;<commit_title>[PATCH] Fix integer overflow in StringUtil::impl...
<vulnerable_code> if(status != PDFHummus::eFailure) { mCurrentDependencies = &ioDependenciesInfo; return interpreter.Intepret(*GetGlyphCharString(inFontIndex,inCharStringIndex),this); } else return status;<commit_title>[PATCH] Fix segfault for getGlyphCharString returning NULL<commit_description><fixed_code> ...
<vulnerable_code> }, this)); }, });<commit_title>[PATCH] Fix XSS escaping issues in the admin data tables.<commit_description>I mistakenly thought DataTables escaped things by default, but this is not the case. Escape all data tables fields now and add capybara integrations tests to ensure this is effective. Sett...
<vulnerable_code> { data: 'api_scope_display_names', title: 'API Scopes', render: function(names, type) { if(type === 'display' && names && names !== '-') { return names.join('<br>'); } return names; } }, {...
<vulnerable_code> data: 'email', title: 'E-mail', defaultContent: '-', }, { data: 'name', title: 'Name', defaultContent: '-', }, { data: 'group_names', title: 'Groups', render: function(names, type) ...
<vulnerable_code> data: 'host', title: 'Host', defaultContent: '-', }, { data: 'path_prefix', title: 'Path Prefix', defaultContent: '-', } ] });<commit_title>[PATCH] Fix XSS escaping issues in the admin data tables.<commit_desc...
<vulnerable_code> data: 'first_name', title: 'First Name', defaultContent: '-', }, { data: 'last_name', title: 'Last Name', defaultContent: '-', }, { data: 'use_description', title: 'Purpose', defaul...
<vulnerable_code> data: 'frontend_host', title: 'Host', defaultContent: '-', }, { data: 'frontend_prefixes', title: 'Prefixes', defaultContent: '-', }, { data: 'sort_order', title: 'Matching Order', ...
<vulnerable_code> serverSide: true, ajax: { url: '/admin/stats/logs.json', data: _.bind(function(data) { var query = this.get('controller.query.params'); return _.extend({}, data, query); type: 'date', title: 'Time', defaultContent: '-', ...
<vulnerable_code> if ( current_user is not None and not current_user.is_anonymous and (current_user.get_name() == username or current_user.is_admin) ): if "application/json" not in request.headers["Content-Type"]: abort(400, description="Expected content-type JSON") ...
<vulnerable_code> OctoPrintAccessUsersClient.prototype.changePassword = function ( name, password, opts ) { if (!name || !password) { throw new OctoPrintClient.InvalidArgumentError( "user name and password must be set" ); } ...
<vulnerable_code> groups: ko.observableArray([]), permissions: ko.observableArray([]), password: ko.observable(undefined), repeatedPassword: ko.observable(undefined), passwordMismatch: ko.pureComputed(function () { return...
<vulnerable_code> self.access_password = ko.observable(undefined); self.access_repeatedPassword = ko.observable(undefined); self.access_apikey = ko.observable(undefined); self.interface_language = ko.observable(undefined); self.currentUser.subscribe(function (newUser) { ...
<vulnerable_code> !(rctx->compression==IWBMP_BI_RLE4 && rctx->bitcount==4)) { iw_set_error(rctx->ctx,"Compression type incompatible with image type"); } if(rctx->topdown) { // The documentation says that top-down images may not be compressed. iw_set_error(rctx->ctx,"Compression not allowed with top-down imag...
<vulnerable_code> return retval; } // 'handle_alpha_flag' must be set if an alpha channel exists and this is not // the alpha channel. static int iw_process_rows_intermediate_to_final(struct iw_context *ctx, int intermed_channel, const struct iw_csdescr *out_csdescr) { iw_tmpsample *out_pix = NULL; int num_in_pix; ...
<vulnerable_code> var kw = keywords[word] return ret(kw.type, kw.style, word) } if (word == "async" && stream.match(/^(\s|\/\*.*?\*\/)*[\[\(\w]/, false)) return ret("async", "keyword", word) } return ret("variable", "variable", word)<commit_title>[PATCH] [javascr...
<vulnerable_code> def get_by_name(self, name, project): return ( Person.query.filter(Person.name == name) .filter(Project.id == project.id) .one() ) project = g.project return ( Person.query.filte...
<vulnerable_code>#include <cassert> #include <cstdint> #include <cstdlib> #include <stdexcept> #include <folly/Conv.h> #include <folly/hash/SpookyHashV2.h> #include <folly/io/Cursor.h> #include <folly/lang/Align.h> #include <folly/lang/Exception.h> #include <folly/memory/Malloc.h> #include <folly/memory/SanitizeAddres...
<vulnerable_code> import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.folio.cql2pgjson.model.DbFkInfo; return null; } /** * Find a list of {@link ForeignKeys} from source table to target table alias * */ public static List<DbFkInfo> findForeignKeysFromSourceTableT...
<vulnerable_code>package org.folio.cql2pgjson.util; import static org.junit.Assert.*; import java.util.Arrays; import java.util.List; import org.folio.rest.tools.utils.ObjectMapperTool; import org.folio.util.ResourceUtil; import org.junit.Before; import org.junit.Test; public class DbSchemaUtilsTest { private st...
<vulnerable_code>package org.folio.rest.persist.ddlgen; /** * A foreign key relation from the current table (= child table) to a target table (=parent table). */ private String targetTable; private String targetTableAlias; private String tableAlias; public ForeignKeys() { super(); this.tableAlias = ...
<vulnerable_code> import static org.junit.jupiter.api.Assertions.*; import org.junit.jupiter.api.Test; class ForeignKeysTest { fk.setTargetTableAlias("c"); assertEquals("c", fk.getTargetTableAlias()); String result = fk.toString(); assertTrue(result.contains("tableAlias=a")); assertTrue(result.co...
<vulnerable_code>public class ForeignKeyGenerationIT extends DatabaseTestBase { private CQL2PgJSON cql2pgJsonTablea; private CQL2PgJSON cql2pgJsonTableb; @BeforeClass public static void runOnceBeforeClass() throws Exception { cql2pgJsonTablea.setDbSchemaPath("templates/db_scripts/foreignKey.json"); cql...
<vulnerable_code> @Test public void foreignKeyChildParentDisabled() throws Exception { CQL2PgJSON cql2pgJson = new CQL2PgJSON("tablec.json"); cql2pgJson.setDbSchemaPath("templates/db_scripts/foreignKey.json"); String sql = cql2pgJson.toSql("tableb.id = *").getWhere(); assertEquals("true", sql); } ...
<vulnerable_code> return new Object[]{Boolean.valueOf(ret), content}; } static void populateMetaData(Object entity, Map<String, String> okapiHeaders, String path) { //try to populate meta data section of the passed in json (converted to pojo already as this stage) //will only succeed if the pojo (json s...
<vulnerable_code> Map<String, String> okapiHeaders = new HashMap<>(); okapiHeaders.put(RestVerticle.OKAPI_HEADER_TOKEN, EMPTY_TOKEN); Book book = new Book(); RestVerticle.populateMetaData(book, okapiHeaders, null); assertThat(book.getMetadata(), is(nullValue())); } @Test Map<String, String> ...
<vulnerable_code> import static io.restassured.RestAssured.*; import static org.hamcrest.Matchers.*; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; then() .statusCode(201); given(r). when().get("/myitems/" + id). then(). statusCode(200). body("id", equalT...
<vulnerable_code> setSize(20); setDisplayType("input"); setPicker(true); setSeparator(COMMA); setSeparators(COMMA); } /** this(null); } @Override public List<String> getList(XWikiContext context) {<commit_title>[PATCH] XWIKI-15576: The groups disp...
<vulnerable_code> { super(XCLASSNAME, "Levels List", wclass); setSize(6); setSeparator(COMMA); setSeparators(COMMA); } public LevelsClass() this(null); } @Override public List<String> getList(XWikiContext context) {<commit_title>[PATCH] XWIKI-15576: T...
<vulnerable_code> return getListFromString(value, null, true); } /** * @param value the string holding a serialized list * @param separators the separator characters (given as a string) used to delimit the list's items inside the input if (property instanceof ListProperty) { ...
<vulnerable_code> /** Logging helper object. */ private static final Logger LOGGER = LoggerFactory.getLogger(UsersClass.class); private static final String COMMA = ","; /** * The meta property that specifies if the list box that is used to select the users should be filled with all the * avai...
<vulnerable_code> directory = host_val break full = os.path.join(directory, filename) if not os.path.exists(full): return self.not_found(environ, start_response) if os.path.isdir(full):<commit_title>[PATCH] Contain directory traversal for stati...
<vulnerable_code> for (var i = 0, l = codeLines.length; i < l; i++) { // Add spans to allow distinction of input/output text for styling if (outputLines.hasOwnProperty(i)) { codeLines[i] = '<span class="token output">' + outputLines[i] + '</span>'; } else { codeLines[i] = '<span class="token comm...
<vulnerable_code>!function(){if("undefined"!=typeof Prism&&"undefined"!=typeof document){var v=/(?:^|\s)command-line(?:\s|$)/,g="command-line-prompt",p="".startsWith?function(e,t){return e.startsWith(t)}:function(e,t){return 0===e.indexOf(t)},d="".endsWith?function(e,t){return e.endsWith(t)}:function(e,t){var n=e.lengt...
<vulnerable_code> RExC_parse++; /* Skip past the '{' */ endbrace = strchr(RExC_parse, '}'); if (! endbrace) { /* no trailing brace */ vFAIL2("Missing right brace on \\%c{}", 'N'); } else { STRLEN length; char name = *RExC_parse; char *...
<vulnerable_code> def test_http_request_parser_utf8_request_line(parser: Any) -> None: messages, upgrade, tail = parser.feed_data( # note the truncated unicode sequence b"GET /P\xc3\xbcnktchen\xa0\xef\xb7 HTTP/1.1\r\n" +<commit_title>[PATCH] CI: un-parametrize the other broken request, too<commit_d...
<vulnerable_code> CloseHandle (thread); if (this->synch_cs) { DeleteCriticalSection (this->synch_cs); g_free (this->synch_cs); this->synch_cs = NULL; } g_free (this->name); } static void mono_thread_start (MonoThread *thread)<commit_title>[PATCH] Fix access to freed members of a dead thread<commit_descript...
<vulnerable_code> // char, e.g., "thes," -> "these". p = fword + sp->ts_fidx; MB_PTR_BACK(fword, p); if (!spell_iswordp(p, curwin)) { p = preword + STRLEN(preword); MB_PTR_BACK(preword, p);<commit_title>[PATCH] patch 8.2.3582: reading uninitialized memory when giving<commit_descriptio...
<vulnerable_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 3581, /**/<commit_title>[PATCH] patch 8.2.3582: reading uninitialized memory when giving<commit_description><fixed_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 3582...
<vulnerable_code> if (interpolation) { result = result .replace(/\\/g, "\\\\") .replace(/^(~|#)/g, "\\$1") .replace(/(\*|\?)/g, "\\$1") .replace(/(\$|\;|\&|\|)/g, "\\$1") .replace(/(\(|\)|\<|\>)/g, "\\$1") if (interpolation) { result = result .replace(/\\/g, "\\\\") ...
<vulnerable_code> import os import re import stat import shlex import tempfile # squashfs-root-0). UNIQUE_PATH_DELIMITER = '%%' TITLE = 'Extraction' ORDER = 9 PRIMARY = False ] def load(self): # Holds a list of extraction rules loaded either from a file or when # manually s...
<vulnerable_code> if (!note) { return; } // title $("#noteTitle").val(note.Title); // 当前正在编辑的 // tags me.starNotesO.html(''); for (var i = 0; i < notes.length; ++i) { var note = notes[i]; var t = tt(me.starItemT, note.NoteId, note.Title || getMsg('Untitled')); ...
<vulnerable_code> return -1; } gdGetBuf(tga->ident, tga->identsize, ctx); } return 1;<commit_title>[PATCH] fix read out-of-bands in reading tga header file<commit_description><fixed_code> return -1; } if (gdGetBuf(tga->ident, tga->identsize, ctx) != tga->identsize) { gd_error("fail to read heade...
<vulnerable_code> for utility, version in binary_versions.items(): version_number = version if version_number is None else version_number if version_number.find('.'): version_number = version_number.split('.', 1)[0] try:<commit_title>[PATCH] Handle a missing case in previous comm...
<vulnerable_code>} #if defined(FEAT_FIND_ID) || defined(PROTO) /* * Find identifiers or defines in included files. * If p_ic && compl_status_sol() then ptr must be in lowercase. end_lnum = curbuf->b_ml.ml_line_count; if (lnum > end_lnum) // do at least one line lnum = end_lnum; line = ml_get(lnum); f...
<vulnerable_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 5049, /**/<commit_title>[PATCH] patch 8.2.5050: using freed memory when searching for pattern<commit_description><fixed_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ ...
<vulnerable_code> pixels=GetQuantumPixels(quantum_info); for (y=0; y < (ssize_t) image->rows; y++) { p=GetVirtualPixels(image,0,y,image->columns,1,&image->exception); if (p == (const PixelPacket *) NULL) break; (void) ExportQuantumPixels(image,(const CacheView *) NULL,quantum_info, quantum_...
<vulnerable_code> if (stat == '1') { document.getElementById('divErr').innerHTML = "Member added successfuly."; } else if (stat == '2') { document.getElementById('divErr').innerHTML = "<font style='color:red'>Member deleted successfuly.</font>"; ...
<vulnerable_code>} // --------------------------------------------------- USER ----------------------------------------------------------------------------------- // function usercheck_init(i) { var obj = document.getElementById('ajax_output'); obj.innerHTML = ''; var pqr = i.value; ajax_call('Vali...
<vulnerable_code> { if (error != '') { error = error + ', START DATE'; } else { error = 'START DATE'; } } <commit_title>[PATCH] Version 9.0 release<commit_description>Older version shifted to branch: Version_8.0<fixed_code> { if ...
<vulnerable_code> function show_div(name, mp_id) { if (document.getElementById(name).checked) { document.getElementById("grade_div").style.display = "block"; if (document.getElementById('divtables[' + mp_id + '][DOES_EXAM]')) document.getElementById('tables[' + mp_id + '][DOES_EXAM]')....
<vulnerable_code> ); //frmvalidator.addValidation("values[E_MAIL]", "email", "Please enter email in proper format"); var school_id = document.getElementById("h1").value; frmvalidator.addValidation( "month_values[JOINING_DATE]", "req", "Please select the joining date" ); frmvalidator.addValidat...
<vulnerable_code> } case "req": case "required": { objValue.value = objValue.value.replace(/\s+/g,' ').trim(); if (eval(objValue.value.length) == 0) { if (!strError || strError.length == 0) { strError = objValue.name + " : Required Field";<commit_title>[PATCH] Version 9.0 releas...
<vulnerable_code><commit_title>[PATCH] Version 9.0 release<commit_description>Older version shifted to branch: Version_8.0<fixed_code> function toggleWriteability(id_of_patient, checked) { document.getElementById(id_of_patient).disabled = checked; } // vim: et sw=4 sts=4
<vulnerable_code> config->listeners[config->listener_count-1].use_identity_as_username = config->default_listener.use_identity_as_username; config->listeners[config->listener_count-1].use_subject_as_username = config->default_listener.use_subject_as_username; #endif config->listeners[config->listener_count-1].secu...
<vulnerable_code> } if (filtering.date.from != null || filtering.date.from != null) { var text = ""; if (filtering.date.from != "") text = "From: " + filtering.date.from; if (filtering.date.until != "") { if (text != "") text += " "; text += "Until: " + filtering.date.until; } } $('#value_dat...
<vulnerable_code>import itertools import re from typing import Any, Callable, Generator, Iterable, List, Optional from langchain.document_loaders.web_base import WebBaseLoader from langchain.schema import Document from urllib.parse import urlparse def _default_parsing_function(content: Any) -> str: return str(co...
<vulnerable_code>import pytest from langchain.document_loaders import SitemapLoader from langchain.document_loaders.sitemap import _extract_domain def test_sitemap() -> None: """Test sitemap loader.""" loader = SitemapLoader("https://langchain.readthedocs.io/sitemap.xml") documents = loader.load() as...
<vulnerable_code> if (marker == JPEG_MARKER_SOS) { length = AV_RB16(frag->data + start); data_ref = NULL; data = av_malloc(end - start + AV_INPUT_BUFFER_PADDING_SIZE);<commit_title>[PATCH] avcodec/cbs_jpeg: Check length for SOS<commit_desc...
<vulnerable_code> } } } p = gf_filter_pid_get_property(ctx->ipid, GF_PROP_PID_FILE_CACHED); if (p && p->value.boolean) ctx->file_loaded = GF_TRUE; } } if (!ctx->in_seek) { dst_pck = gf_filter_pck_new_alloc(ctx->opid, size, &output); if (!dst_pck) return GF_OUT_OF_MEM; if (ctx->src_pck) gf_filter_...
<vulnerable_code> /* Copy the first part of user declarations. */ #line 17 "grammar.y" /* yacc.c:339 */ #include <assert.h> #include <stdio.h> #include <stdint.h> #include <string.h> #include <limits.h> #include <stddef.h> #include <yara/utils.h> #include <yara/strutils.h> #include <yara/compiler.h> union YYST...
<vulnerable_code> #define MIN(x,y) (((x)<(y))?(x):(y)) #define ALLOCCHECK(x) { if(!x) { printf("Out of Memory\n"); exit(-1); } } #define SIZECHECK(x) { if ((((char *)d - (char *)data) + x) > size) { printf("Corrupted file\n"); exit(-1); } } void TNEFFillMapi(TNEFStruct *TNEF, BYTE *data, DWORD size, MAPIProps *p); v...
<vulnerable_code> // We must set the endpoint dynamically, because "uploadMediaFolderId" is null at start and is async loaded using AJAX. this.setEndpoint('/backend/ajax?fork[module]=MediaLibrary&fork[action]=MediaItemUpload&fork[language]=' + jsBackend.current.language + '&folder_id=' + mediaFolder...
<vulnerable_code>#endif ) { // Can't edit another file when "curbuf_lock" is set. Only ":edit" // can bring us here, others are stopped earlier. if (*eap->arg != NUL && curbuf_locked()) return; n = readonlymode;<commit_title>[PATCH] patch 8.2.5126: substitute may overrun destination buffer<commit_de...
<vulnerable_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 5125, /**/<commit_title>[PATCH] patch 8.2.5126: substitute may overrun destination buffer<commit_description>Problem: Substitute may overrun destination buffer. Solution: Disallow switching buffers in a substi...
<vulnerable_code> r'(?P<resource>[a-z0-9_.-]*)' r'[:/]*' r'(?P<port>[\d]+){0,1}' r'(?P<pathname>\/((?P<owner>[\w\-]+)\/)?' r'((?P<name>[\w\-\.]+?)(\.git|\/)?)?)$'), re.compile(r'(git\+)?' r'((?P<protocol>\w+)://)' '...
<vulnerable_code>version = '4.1' # The full version, including alpha/beta/rc tags. release = '4.1.8' # -- General configuration --------------------------------------------------- <commit_title>[PATCH 1/8] chore: fix composer dev package versions<commit_description><fixed_code> version = '4.1' # The full version, in...
<vulnerable_code> IntensityCompare); colormap=(PixelInfo *) AcquireQuantumMemory(image->colors,sizeof(*colormap)); if (colormap == (PixelInfo *) NULL) ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed", image->filename); j=0; colormap[j]=image->colormap[0]; for (i=0; i < (ssize_t) i...
<vulnerable_code>{ "use strict"; function HueBridge(config) { var scope = this; var events = require('events'); let huejay = require('huejay'); // INTERVAL AND EVENT EMITTER this.nodeActive = true; this.lights = []; this.sensors = []; this.groups = []; this.rules = []; this.events = new events....
<vulnerable_code> { RED.nodes.createNode(this, config); var scope = this; let bridge = RED.nodes.getNode(config.bridge); let { HueBridgeMessage, HueBrightnessMessage, HueGroupMessage, HueLightMessage, HueMotionMessage, HueRulesMessage, HueSwitchMessage, HueTapMessage, HueTemperatureMessage } = require('../util...
<vulnerable_code> { RED.nodes.createNode(this, config); var scope = this; let bridge = RED.nodes.getNode(config.bridge); let { HueBrightnessMessage } = require('../utils/messages'); var universalMode = false; // SAVE LAST STATE var lastState = false; // // CHECK CONFIG // UNIVERSAL MODE? if(!co...
<vulnerable_code>module.exports = function(RED) { "use strict"; function HueButton(config) { RED.nodes.createNode(this, config); var scope = this; let bridge = RED.nodes.getNode(config.bridge); let { HueButtonMessage } = require('../utils/messages'); var universalMode = false; // SAVE LAST STATE var...
<vulnerable_code><commit_title>[PATCH] Update to v4.0.0<commit_description><fixed_code> module.exports = function(RED) { "use strict"; function HueButtons(config) { RED.nodes.createNode(this, config); const scope = this; const bridge = RED.nodes.getNode(config.bridge); // NODE UI STATUS TIMEOUT this.tim...
<vulnerable_code> { RED.nodes.createNode(this, config); var scope = this; let bridge = RED.nodes.getNode(config.bridge); let path = require('path'); let { HueGroupMessage } = require('../utils/messages'); var universalMode = false; // SAVE LAST STATE var lastState = false; var futureState = null; ...
<vulnerable_code> { RED.nodes.createNode(this, config); var scope = this; let bridge = RED.nodes.getNode(config.bridge); let path = require('path'); let { HueLightMessage } = require('../utils/messages'); var universalMode = false; // SAVE LAST STATE var lastState = false; var futureState = null; ...
<vulnerable_code> { RED.nodes.createNode(this, config); var scope = this; let async = require('async'); var isEndless = config.endless; var restoreState = config.restore; // STEPS INITIALIZATION this.steps = config.steps; } // // ENABLE HUE MAGIC ANIMATION this.on('input', function(msg, send, d...
<vulnerable_code> function HueMotion(config) { RED.nodes.createNode(this, config); var scope = this; let bridge = RED.nodes.getNode(config.bridge); let { HueMotionMessage } = require('../utils/messages'); var universalMode = false; // SAVE LAST STATE var lastState = false; // // CHECK CONFIG // U...
<vulnerable_code> { RED.nodes.createNode(this, config); var scope = this; let bridge = RED.nodes.getNode(config.bridge); let { HueRulesMessage } = require('../utils/messages'); // SAVE LAST STATE var lastState = false; // // CHECK CONFIG if(!config.ruleid || bridge == null) { this.status({fill...
<vulnerable_code> { RED.nodes.createNode(this, config); var scope = this; let bridge = RED.nodes.getNode(config.bridge); let { HueSceneMessage } = require('../utils/messages'); // // CHECK CONFIG // ENABLE SCENE this.on('input', function(msg, send, done) { // Node-RED < 1.0 send = send || func...
<vulnerable_code>module.exports = function(RED) { "use strict"; function HueSwitch(config) { RED.nodes.createNode(this, config); var scope = this; let bridge = RED.nodes.getNode(config.bridge); let { HueSwitchMessage } = require('../utils/messages'); var universalMode = false; // SAVE LAST STATE var...
<vulnerable_code>module.exports = function(RED) { "use strict"; function HueTap(config) { RED.nodes.createNode(this, config); var scope = this; var bridge = RED.nodes.getNode(config.bridge); let { HueTapMessage } = require('../utils/messages'); var universalMode = false; // SAVE LAST STATE var lastS...
<vulnerable_code> { RED.nodes.createNode(this, config); var scope = this; let bridge = RED.nodes.getNode(config.bridge); let { HueTemperatureMessage } = require('../utils/messages'); let moment = require('moment'); var universalMode = false; // SAVE LAST STATE var lastState = false; // // MEMORY ...
<vulnerable_code><commit_title>[PATCH] Update to v4.0.0<commit_description><fixed_code> const axios = require('axios'); const dayjs = require('dayjs'); const https = require('https'); const EventSource = require('eventsource'); function API() { // STORAGE this.bridge = null; this.ipAddress = null; this.accessKey =...
<vulnerable_code><commit_title>[PATCH] Update to v4.0.0<commit_description><fixed_code> // EXTERNAL HELPERS const colornames = require("colornames"); const colornamer = require('color-namer'); const getColors = require('get-image-colors'); // RGB -> XY function rgbToXy(red, green, blue, gamut = null) { var colorGamut...
<vulnerable_code>module.exports = { deep: mergeDeep }; function mergeDeep(...objects) { // CLEANUP FROM HTTP NODE return prev; }, {}); }<commit_title>[PATCH] Update to v4.0.0<commit_description><fixed_code> function mergeDeep(...objects) { // CLEANUP FROM HTTP NODE return prev; },...
<vulnerable_code><commit_title>[PATCH] Update to v4.0.0<commit_description><fixed_code> const dayjs = require('dayjs'); const colorUtils = require("./color"); // // HUE BRIDGE class HueBridgeMessage { constructor(ressource, options = {}) { this.message = {}; this.message.payload = {}; this.message.payload.id =...
<vulnerable_code>module.exports = { /** * Generates a random 6 digit hex string * @return {string} */ randomHexColor: function () { return '#' + (Math.random() * 0xFFFFFF << 0).toString(16).padStart(6, "0"); } }<commit_title>[PATCH] Update to v4.0.0<commit_description><fixed_code>
<vulnerable_code>let moment = require('moment'); let rgb = require('./rgb'); let rgbHex = require('rgb-hex'); let hexRGB = require('hex-rgb'); let colornames = require("colornames"); let colornamer = require('color-namer'); // // HUE BRIDGE class HueBridgeMessage { constructor(bridgeInformation, config) { this.me...
<vulnerable_code>var colorPointsGamut_A = [[0.703, 0.296], [0.214, 0.709], [0.139, 0.081]]; var colorPointsGamut_B = [[0.674, 0.322], [0.408, 0.517], [0.168, 0.041]]; var colorPointsGamut_C = [[0.692, 0.308], [0.17, 0.7], [0.153, 0.048]]; var colorPointsDefault = [[1.0, 0.0], [0.0, 1.0], [0.0, 0.0]]; var GAMUT_A_BULBS...
<vulnerable_code> static void CleanNode( TidyDocImpl* doc, Node *node ) { Node *child, *next; if (node->content) { for (child = node->content; child != NULL; child = next) { next = child->next; if (TY_(nodeIsElement)(child)) { if (nodeIsS...
<vulnerable_code>#ifdef NSIS_CONFIG_UNINSTALL_SUPPORT if (uninstall_mode) { cur_header->str_uninstchild = add_asciistring(_T("$TEMP\\Un_$1.exe")); cur_header->str_uninstcmd = add_asciistring(_T("\"$TEMP\\Un_$1.exe\" $0 _?=$INSTDIR\\")); } #endif//NSIS_CONFIG_UNINSTALL_SUPPORT #ifdef NSIS_SUPPORT_MOVEONREB...
<vulnerable_code> } else { int x, admin = UserIsAdminGrpMember(); mystrcat(state_temp_dir,_T("~nsu")); if (admin) mystrcat(state_temp_dir,_T("A")); // Don't lock down the directory used by non-admins mystrcat(state_temp_dir,_T(".tmp")); // check if already running from uninsta...
<vulnerable_code> DWORD NSISCALL CreateRestrictedDirectory(LPCTSTR path) { const SECURITY_INFORMATION si = OWNER_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION|DACL_SECURITY_INFORMATION|PROTECTED_DACL_SECURITY_INFORMATION; PSID admingrpsid = GetAdminGrpSid(); SECURITY_DESCRIPTOR sd = { 1, 0, SE_DACL_PRESENT, adm...
<vulnerable_code> return QByteArray::fromBase64(decryptResult); } // AES/GCM/NoPadding (128 bit key size) QByteArray FolderMetadata::encryptJsonObject(const QByteArray& obj, const QByteArray pass) const { files.insert(it->encryptedFilename, file); } QJsonObject metaObject = { {"metadata", m...
<vulnerable_code> if (flag == 'w') // just windows { if (buf == curbuf || wp == NULL) // first call for this flag/expansion wp = curwin; while ((wp = (wp->w_next != NULL ? wp->w_next : firstwin)) != curwin && wp->w_buffer->b_scanned) */ typedef struct { char_u *e_cpt; // current entry in 'comp...
<vulnerable_code> void validate_cursor(void) { check_cursor_moved(curwin); if ((curwin->w_valid & (VALID_WCOL|VALID_WROW)) != (VALID_WCOL|VALID_WROW)) curs_columns(TRUE);<commit_title>[PATCH] patch 9.0.0579: using freed memory when 'tagfunc' wipes out<commit_description><fixed_code> void validate_cursor...
<vulnerable_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 578, /**/<commit_title>[PATCH] patch 9.0.0579: using freed memory when 'tagfunc' wipes out<commit_description><fixed_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 57...
<vulnerable_code>package controllers; import java.util.HashMap; import java.util.Map; import models.Secured; import play.data.DynamicForm; String oldPassword = requestData.get("oldPassword"); String newPassword = requestData.get("newPassword"); String repeatedPassword = requestData.get("repeatedPassword"); ...