text stringlengths 79 3.72M |
|---|
<vulnerable_code> int haveGlobalColormap;
gdImagePtr im = 0;
/*1.4//imageNumber = 1; */
if (! ReadOK(fd,buf,6)) {
return 0;<commit_title>[PATCH 01/43] Fix bug #73807<commit_description><fixed_code>
int haveGlobalColormap;
gdImagePtr im = 0;
memset(ColorMap, 0, 3 * MAXCOLORMAPSIZE);
memset(localColorMap, 0, 3... |
<vulnerable_code>/* Generated by re2c 0.16 */
#line 1 "ext/standard/var_unserializer.re"
/*
+----------------------------------------------------------------------+
static inline int finish_nested_data(UNSERIALIZE_PARAMETER)
{
if (*((*p)++) == '}')
return 1;
#if SOMETHING_NEW_MIGHT_LEAD_TO_CRASH_ENABLE_IF_YOU_AR... |
<vulnerable_code> } else if (!strcmp(name, EL_BOOLEAN)) {
int i;
if (atts) for (i = 0; atts[i]; i++) {
if (!strcmp(atts[i], EL_VALUE) && atts[i+1] && atts[i+1][0]) {
ent.type = ST_BOOLEAN;
SET_STACK_VARNAME;
ALLOC_ZVAL(ent.data);
INIT_PZVAL(ent.data);
Z_TYPE_P(ent.data) = IS_BOOL;
wddx_... |
<vulnerable_code>/* Generated by re2c 0.15.3 on Fri Sep 30 20:18:29 2016 */
#line 1 "ext/date/lib/parse_date.re"
/*
* The MIT License (MIT)
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
if ((YYLIMIT - YYCURSOR) < 31) YYFILL(31);
yych = *YYCURSOR;
switch (yych) {
case 0x0... |
<vulnerable_code>
if (*matchingpath == OP_FAIL)
stacksize = 0;
if (*matchingpath == OP_RREF)
{
stacksize = GET2(matchingpath, 1);
if (common->currententry == NULL)<commit_title>[PATCH 01/43] Fix bug #73807<commit_description><fixed_code>
if (*matchingpath == OP_FAIL)
stacksize... |
<vulnerable_code> buf = emalloc(data_len + EVP_CIPHER_CTX_block_size(ctx));
EVP_CIPHER_CTX_cleanup(ctx);
if (!EVP_SealInit(ctx, cipher, eks, eksl, &iv_buf[0], pkeys, nkeys) ||
!EVP_SealUpdate(ctx, buf, &len1, (unsigned char *)data, (int)data_len) ||
!EVP_SealFinal(ctx, buf + len1, &len2)) {
RETVAL_FALSE;<com... |
<vulnerable_code>/* Generated by re2c 0.16 */
#line 1 "ext/standard/var_unserializer.re"
/*
+----------------------------------------------------------------------+
static inline int finish_nested_data(UNSERIALIZE_PARAMETER)
{
if (*((*p)++) == '}')
return 1;
#if SOMETHING_NEW_MIGHT_LEAD_TO_CRASH_ENABLE_IF_YOU_AR... |
<vulnerable_code> } else if (!strcmp((char *)name, EL_BOOLEAN)) {
int i;
ALLOC_ZVAL(ent.data);
INIT_PZVAL(ent.data);
Z_TYPE_P(ent.data) = IS_BOOL;
ent.type = ST_BOOLEAN;
SET_STACK_VARNAME;
if (atts) for (i = 0; atts[i]; i++) {
break;
}
} else {
ZVAL_FALSE(ent.data);
wddx_stack_push((wddx_s... |
<vulnerable_code> } else if (!strcmp(name, EL_BOOLEAN)) {
int i;
ALLOC_ZVAL(ent.data);
INIT_PZVAL(ent.data);
Z_TYPE_P(ent.data) = IS_BOOL;
ent.type = ST_BOOLEAN;
SET_STACK_VARNAME;
if (atts) for (i = 0; atts[i]; i++) {
if (!strcmp(atts[i], EL_VALUE) && atts[i+1] && atts[i+1][0]) {
wddx_stack_push(... |
<vulnerable_code> break;
case OP_EXACT1: MOP_IN(OP_EXACT1);
#if 0
DATA_ENSURE(1);
if (*p != *s) goto fail;
p++; s++;
#endif
if (*p != *s++) goto fail;
DATA_ENSURE(0);
p++;
MOP_OUT;
break;
<commit_title>[PATCH 01/43] Fix bug #73807<commit_description><fixed_code... |
<vulnerable_code> }
else {
UChar *q = p + reg->dmin;
while (p < q) p += enclen(reg->enc, p);
}
}<commit_title>[PATCH 01/43] Fix bug #73807<commit_description><fixed_code>
}
else {
UChar *q = p + reg->dmin;
if (q >= end) return 0; /* fail */
while (p < q) p += enclen(r... |
<vulnerable_code> }
}
*state = CCS_VALUE;
*type = CCV_CLASS;
return 0;
}<commit_title>[PATCH 01/43] Fix bug #73807<commit_description><fixed_code>
}
}
if (*state != CCS_START)
*state = CCS_VALUE;
*type = CCV_CLASS;
return 0;
} |
<vulnerable_code>PHP_FUNCTION(ldap_get_option)
{
zval *link, *retval;
ldap_linkdata *ld;
zend_long option;
ZVAL_STRING(retval, val);
ldap_memfree(val);
} break;
/* options not implemented
case LDAP_OPT_SERVER_CONTROLS:
case LDAP_OPT_CLIENT_CONTROLS:
case LDAP_OPT_API_INFO:
case LDAP_OPT_API_FEATURE_INFO... |
<vulnerable_code> REGISTER_STRING_CONSTANT("LDAP_EXOP_TURN", LDAP_EXOP_TURN, CONST_PERSISTENT | CONST_CS);
#endif
le_link = zend_register_list_destructors_ex(_close_ldap_link, NULL, "ldap link", module_number);
le_result = zend_register_list_destructors_ex(_free_ldap_result, NULL, "ldap result", module_number);
le_... |
<vulnerable_code> /* Build CFG, Step 4, Mark Reachable Basic Blocks */
zend_mark_reachable_blocks(op_array, cfg, 0);
if (func_flags) {
*func_flags |= flags;
}<commit_title>[PATCH 01/43] Fix bug #73807<commit_description><fixed_code>
/* Build CFG, Step 4, Mark Reachable Basic Blocks */
zend_mark_reachable_blocks... |
<vulnerable_code> /* Narrowing integer initialization to doubles */
zend_type_narrowing(op_array, script, ssa);
for (j = 0; j < op_array->last_var; j++) {
/* $php_errormsg and $http_response_header may be updated indirectly */
if (zend_string_equals_literal(op_array->vars[j], "php_errormsg")) {
int i;
for ... |
<vulnerable_code> }
}
return SUCCESS;
}
/* }}} */<commit_title>[PATCH 01/43] Fix bug #73807<commit_description><fixed_code>
}
}
/* Mark indirectly accessed variables */
for (i = 0; i < op_array->last_var; i++) {
if (ssa->cfg.dynamic) {
ssa_vars[i].alias = SYMTABLE_ALIAS;
} else if (zend_string_equals_l... |
<vulnerable_code> });
});
});
});<commit_title>[PATCH] bug: fix segfault of invalid toString() object (#1450)<commit_description>* bug: verify toString() returns valid data
* test: faulty toString test<fixed_code>
});
});
});
it('should ignore faulty toString', functi... |
<vulnerable_code> assert (255, 255) == ImageColor.getcolor("white", "LA")
assert (163, 33) == ImageColor.getcolor("rgba(0, 255, 115, 33)", "LA")
Image.new("LA", (1, 1), "white")<commit_title>[PATCH] Raise ValueError if color specifier is too long<commit_description><fixed_code>
assert (255, 255) == Image... |
<vulnerable_code> :param color: A color string
:return: ``(red, green, blue[, alpha])``
"""
color = color.lower()
rgb = colormap.get(color, None)<commit_title>[PATCH] Raise ValueError if color specifier is too long<commit_description><fixed_code>
:param color: A color string
:return: ``(red,... |
<vulnerable_code> {
size_t blend_source=ReadBlobLong(image);
size_t blend_dest=ReadBlobLong(image);
if (image->debug != MagickFalse)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" source(%x), des... |
<vulnerable_code> }
],
'macro': {
pattern: /\b[a-z\d][a-z\d-]*::?(?:(?:\S+)??\[(?:[^\]\\"]|(["'])(?:(?!\1)[^\\]|\\.)*\1|\\.)*\])/,
inside: {
'function': /^[a-z\d-]+(?=:)/,
'punctuation': /^::?/,<commit_title>[PATCH] Fixed last cases of exponential backtracking<commit_description><fixed_code>
}
... |
<vulnerable_code>!function(t){var n={pattern:/(^[ \t]*)\[(?!\[)(?:(["'$`])(?:(?!\2)[^\\]|\\.)*\2|\[(?:[^\[\]\\]|\\.)*\]|[^\[\]\\"'$`]|\\.)*\]/m,lookbehind:!0,inside:{quoted:{pattern:/([$`])(?:(?!\1)[^\\]|\\.)*\1/,inside:{punctuation:/^[$`]|[$`]$/}},interpreted:{pattern:/'(?:[^'\\]|\\.)*'/,inside:{punctuation:/^'|'$/}},... |
<vulnerable_code> /\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/,
/\b(?:null)\b/i,
];
var number = /\b0b[01]+\b|\b0x[\da-f]+\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)*|\B\.\d+)(?:e[+-]?\d+)?/i;
var operator = /<?=>|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/;
var punctuation = /[{}\[\](),:;]/... |
<vulnerable_code>!function(a){var e=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,t=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/,/\b(?:null)\b/i],i=/\b0b[01]+\b|\b0x[\da-f]+\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)*|\B\.\d+)(?:e[+-]?\d+)?/i,n=/<?=>|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&... |
<vulnerable_code> def __init__(self, hs):
super().__init__(hs)
self.http_client = SimpleHttpClient(hs)
# We create a blacklisting instance of SimpleHttpClient for contacting identity
# servers specified by clients
self.blacklisting_http_client = SimpleHttpClient(
... |
<vulnerable_code> const footnoteRefs = elem.querySelectorAll("sup.footnote-ref");
footnoteRefs.forEach((footnoteRef) => {
const expandableFootnote = document.createElement("a");
expandableFootnote.classList.add("expand-footnote");
expandableFootnote.innerHTML = iconHTML("ellipsis-h");
expandableFoot... |
<vulnerable_code> tokens = []
);
token = state.push('footnote_ref', '', 0);
token.meta = { id: footnoteId };
<commit_title>[PATCH] SECURITY: Fix malicious footnote causing clientside errors<commit_description><fixed_code>
tokens = []
);
// Having a rendered footnote i... |
<vulnerable_code> /* parse header fields */
coap_pkt->version = (COAP_HEADER_VERSION_MASK & coap_pkt->buffer[0])>>COAP_HEADER_VERSION_POSITION;
coap_pkt->type = (coap_message_type_t) ((COAP_HEADER_TYPE_MASK & coap_pkt->buffer[0])>>COAP_HEADER_TYPE_POSITION);
coap_pkt->token_len = MIN(COAP_TOKEN_LEN, (COAP_HEADER... |
<vulnerable_code> if (new_length > length)
SetStringInfoLength(profile,new_length);
datum=(char *) GetStringInfoDatum(profile);
memmove(datum+start+value_length,datum+end,length-end);
memcpy(datum+start,value,value_length);
if (new_length < length)
{
SetStringInfoLength(profile,new_length);
... |
<vulnerable_code> /*
* ### Read CLUT Data ###
*/
clut_data=(unsigned char *) AcquireQuantumMemory(1,header->clut_size);
if (clut_data == (unsigned char *) NULL)
ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",
image_info->filename);
count=ReadBlob(image,header->... |
<vulnerable_code>var expresss = require('express')
, qs = require('querystring')
, request = require('supertest')
, fetcher = require('../');
describe('It can ', function() {
var app;
beforeEach(function (done) {
app = expresss();
//additional custom option
// key : your key name within http req... |
<vulnerable_code>var expresss = require('express')
, request = require('supertest')
, fetcher = require('../');
var app;
beforeEach(function (done) {
app = expresss();
app.use(fetcher());
done();
});
it('receive error code.', function(done) {
var options;
app.get('/path/:id', function... |
<vulnerable_code>var expresss = require('express')
, qs = require('querystring')
, request = require('supertest')
, fetcher = require('../');
var app;
beforeEach(function(done) {
app = expresss();
app.use(fetcher());
done();
});
it('fetch optional parameters', function(done) {
var opt
... |
<vulnerable_code>var express = require('express')
, qs = require('querystring')
, bodyparser = require('body-parser')
, request = require('supertest')
, fetcher = require('../');
});
it('fetch required Parameters', function(done) {
var options
, queryString = 'id=1&type=int';
app.use(functio... |
<vulnerable_code>"use strict";
var expresss = require('express')
, _ = require('lodash/core')
, request = require('supertest')
, imsiList = require('../dat/mcc_mnc.json')
, jsonDiff = require('json-diff').diff
, fetcher = require('../');
describe('It can ', function() {
, expectedList;
beforeEach(fun... |
<vulnerable_code>import com.auth0.jwt.exceptions.JWTVerificationException;
import com.auth0.jwt.interfaces.JWTVerifier;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import java.time.Instant;
private static final String ISSUER = "Databasir";
private static final String SE... |
<vulnerable_code> cur_seg->page_size = ps;
cur_seg->page_count = ((bin->segs[seg_idx].vmsize + (ps - 1)) & ~(ps - 1)) / ps;
if (cur_seg->page_count > 0) {
cur_seg->page_start = malloc(sizeof(ut16) * cur_seg->page_count);
if (!cur_seg->page_start) {
break;
}
}
if (cu... |
<vulnerable_code>#ifdef USE_IMAGE
i = 0;
if (parsedtag_get_value(tag, ATTR_TOP_MARGIN, &i)) {
if (i > obuf->top_margin)
obuf->top_margin = i;
}
i = 0;
if (parsedtag_get_value(tag, ATTR_BOTTOM_MARGIN, &i)) {
if (i > obuf->bottom_margin)
obuf->bottom_margin = i;
}
#endif
return 0;
case HTML_INPUT... |
<vulnerable_code>from collections.abc import MutableMapping
from jinja2 import sandbox
# pylint: disable=no-member,unsupported-assignment-operation
class TemplatedDictionary(MutableMapping):
'''
self.__dict__.update(*args, **kwargs)
self.sandbox = sandbox.SandboxedEnvironment(keep_trailing_ne... |
<vulnerable_code> }
}
/*
* This must be done under the ctx->lock, such as to serialize against
* context_equiv(), therefore we cannot call put_ctx() since that might end up
* is the current context on this CPU and preemption is disabled,
* hence we can't get into perf_event_task_sched_out for this context.
*/
voi... |
<vulnerable_code>
this.store = pimcore.helpers.grid.buildDefaultStore(
url,
['id',
{name: 'name', allowBlank: false},'description',
{name: 'key', allowBlank: false},
{name: 'type', allowBlank: false}, 'data', 'config',
var proper... |
<vulnerable_code> urllib.parse.urlsplit('http://\u30d5\u309a\ufe1380')
for scheme in ["http", "https", "ftp"]:
for c in denorm_chars:
url = "{}://netloc{}false.netloc/path".format(scheme, c)
with self.subTest(url=url, char='{:04X}'.format(ord(c))):
... |
<vulnerable_code> # looking for characters like \u2100 that expand to 'a/c'
# IDNA uses NFKC equivalence, so normalize for this check
import unicodedata
n = netloc.rpartition('@')[2] # ignore anything to the left of '@'
n = n.replace(':', '') # ignore characters already included
n = n.repl... |
<vulnerable_code> if (llc->cmsg_flags & LLC_CMSG_PKTINFO) {
struct llc_pktinfo info;
info.lpi_ifindex = llc_sk(skb->sk)->dev->ifindex;
llc_pdu_decode_dsap(skb, &info.lpi_sap);
llc_pdu_decode_da(skb, info.lpi_mac);<commit_title>[PATCH] net: fix infoleak in llc<commit_description><fixed_code>
if (llc->cmsg_flag... |
<vulnerable_code>
printk("%s: No ATAPI disk detected\n", name);
for (pf = units, unit = 0; unit < PF_UNITS; pf++, unit++) {
blk_cleanup_queue(pf->disk->queue);
pf->disk->queue = NULL;
blk_mq_free_tag_set(&pf->tag_set);
pf_busy = 0;
if (register_blkdev(major, name)) {
for (pf = units, unit = 0; unit < PF_UN... |
<vulnerable_code>//
//= require jquery
//= require jquery_ujs
//= require jquery-ui
//
//= require jquery-cookie
//= require jquery-leanModal<commit_title>[PATCH] CodeClimate-recommended security fixes<commit_description><fixed_code>
//
//= require jquery
//= require jquery_ujs
//
//= require jquery-cookie
//= require ... |
<vulnerable_code> }
@Override
public InputStream getResourceAsStream(String path) {
return classLoader.getResourceAsStream(resourceRoot + path);
}
@Override<commit_title>[PATCH] [KEYCLOAK-19422] ClassLoaderTheme and<commit_description><fixed_code>
}
@Override
public InputStream... |
<vulnerable_code>
@Override
public InputStream getResourceAsStream(String path) throws IOException {
return classLoader.getResourceAsStream(THEME_RESOURCES_RESOURCES + path);
}
@Override<commit_title>[PATCH] [KEYCLOAK-19422] ClassLoaderTheme and<commit_description><fixed_code>
@Override
... |
<vulnerable_code> });
}
@Test
public void gzipEncoding() throws IOException {
final String resourcesVersion = testingClient.server().fetch(session -> Version.RESOURCES_VERSION, String.class);<commit_title>[PATCH] [KEYCLOAK-19422] ClassLoaderTheme and<commit_description><fixed_code>
}... |
<vulnerable_code> crossOrigin: true,
type: 'json'
}, function(resp) {
document.getElementById('reverse-location').innerHTML =
'' + resp.display_name + '';
});
}
function showComment(id) {
fetchChangesetData(id, function(err, changeset_data) {
document.getElementBy... |
<vulnerable_code> case TELS_URI_T:
/* fix tel uris, move the number in uri and empty the host */
uri->user=uri->host;
uri->host.s="";
uri->host.len=0;
break;
case SIP_URI_T:
case URN_NENA_SERVICE_URI_T:
uri->user.s=0;
uri->user.len=0;
uri->host.s="";
uri->host.len=0;
break;
case ERR... |
<vulnerable_code>from .default_data import DEFAULT_DATA
from .utils import (
Constants, DummyTranslationService, FeedbackMessage,
FeedbackMessages, ItemStats, StateMigration, remove_html, sanitize_html, _
)
# Globals ###########################################################
"display_zone_borders"... |
<vulnerable_code>import copy
import re
from collections import namedtuple
import bleach
def _(text):
return text_plural
def sanitize_html(html_code):
"""
Sanitize html_code for safe embed
"""
tags = bleach.ALLOWED_TAGS + [
'br', 'dd', 'del', 'dl', 'dt', 'h1', 'h2', 'h3', 'h4', 'hr', ... |
<vulnerable_code>from drag_and_drop_v2.default_data import (BOTTOM_ZONE_ID, DEFAULT_DATA, FINISH_FEEDBACK,
MIDDLE_ZONE_ID, START_FEEDBACK,
TOP_ZONE_ID, TOP_ZONE_TITLE)
from drag_and_drop_v2.utils import Constants, FeedbackMessages, sa... |
<vulnerable_code><commit_title>[PATCH] Create SORT BY clause server side<commit_description><fixed_code>
const R = require('ramda')
const serialize = sortCriteria =>
R.pipe(
R.map(c => `${c.variable} ${c.order}`),
R.join(',')
)(sortCriteria)
const getHttpParam = sortCriteria =>
R.map(
R.pick(['varia... |
<vulnerable_code>
app.post('/surveyRdb/:surveyId/:tableName/query', requireRecordListViewPermission, async (req, res) => {
try {
const { surveyId, nodeDefUuidTable, tableName, offset, limit, sort = '', editMode = false } = Request.getParams(req)
const cols = Request.getJsonParam(req, 'cols', [])
... |
<vulnerable_code>
const Expression = require('../../../../../common/exprParser/expression.js')
const DataCol = require('../schemaRdb/dataCol')
const NodeRepository = require('../../../record/persistence/nodeRepository')
const runSelect = async (surveyId, tableName, cols, offset, limit, filterExpr, sort = '', client)... |
<vulnerable_code>const Survey = require('../../../../common/survey/survey')
const NodeDef = require('../../../../common/survey/nodeDef')
const { toUuidIndexedObj } = require('../../../../common/survey/surveyUtils')
const Expression = require('../../../../common/exprParser/expression')
const DataTable = require('../per... |
<vulnerable_code>import * as DataQueryState from './dataQueryState'
import NodeDefTable from '../../../../../../common/surveyRdb/nodeDefTable'
import * as DataSort from './components/sort/dataSort'
export const dataQueryTableNodeDefUuidUpdate = 'dataQuery/table/nodeDefUuid/update'
export const dataQueryTableNodeDefUu... |
<vulnerable_code>import * as R from 'ramda'
export const serialize = sortCriteria =>
R.pipe(
R.map(c => `${c.variable} ${c.order}`),
R.join(',')
)(sortCriteria)
export const getVariable = (variables, value) =>
R.find(v => v.value === value)(variables)
export const getViewExpr = (sortCriteria) =>
R.pi... |
<vulnerable_code>import { connect } from 'react-redux'
import Expression from '../../../../../../../../common/exprParser/expression'
import Popup from '../../../../../../../commonComponents/popup'
import * as ExpressionVariables from '../../../../../../../commonComponents/expression/expressionVariables'
import * as ... |
<vulnerable_code>import React from 'react'
import { connect } from 'react-redux'
import * as R from 'ramda'
import ExpressionEditorPopup from '../../../../../../commonComponents/expression/expressionEditorPopup'
import TablePaginator from '../../../../../../commonComponents/table/tablePaginator'
import Tooltip from '.... |
<vulnerable_code> {
if (enc_utf8 && c > 0x80)
{
if (utf_fold(utf_ptr2char(p)) == cc)
return p;
}
else if (*p == c || *p == cc)<commit_title>[PATCH] patch 9.0.0105: illegal memory access when pattern starts<commit_description><fixed_code>
{
if (enc_utf8 && c > 0x80)
{
int uc = ut... |
<vulnerable_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
104,
/**/<commit_title>[PATCH] patch 9.0.0105: illegal memory access when pattern starts<commit_description><fixed_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
105,... |
<vulnerable_code> syslog(LOG_ERR, "cannot allocate memory");
goto error;
}
if(containsForbiddenChars(p, l)) {
syslog(LOG_ERR, "bad request (st contains forbidden chars)");
goto error;<commit_title>[PATCH] minissdpd.c: Initialize pointers to NULL (fix)<commit_description><fixed_code>
syslog(LOG_ERR, "c... |
<vulnerable_code>const { types } = require('./helpers/types')
const operators = require('./helpers/operators')
const { getWherePerparedStatement } = require('./helpers/sqlUtils')
const modes = {
json: 'json',
// operators
operators,
// Sql utils
getWherePerparedStatement,
}<commit_title>[PATCH] sqlUtils a... |
<vulnerable_code>const { types } = require('./types')
const js2sqlOperators = {
'&&': 'AND',<commit_title>[PATCH] sqlUtils and dataFilter refactoring and code cleanup<commit_description><fixed_code>
const { types } = require('../exprParser/helpers/types')
const js2sqlOperators = {
'&&': 'AND', |
<vulnerable_code> },
}
const serialize = sortCriteria =>
R.pipe(
R.map(c => `${c.variable} ${c.order}`),
R.join(',')
)(sortCriteria)
const getHttpParam = sortCriteria =>
R.map(
R.pick(['variable', 'order'])
)(sortCriteria)
const getSortPreparedStatement = (sortCriteria, prefix = 'sort') => {
r... |
<vulnerable_code>const NodeDefTable = require('../../../../../common/surveyRdb/nodeDefTable')
const Expression = require('../../../../../common/exprParser/expression.js')
const DataSort = require('../../../../../common/dataSort')
const DataCol = require('../schemaRdb/dataCol')
const colParamNames = Object.keys(c... |
<vulnerable_code>import * as DataQueryState from './dataQueryState'
import NodeDefTable from '../../../../../../common/surveyRdb/nodeDefTable'
import * as DataSort from '../../../../../../common/dataSort'
export const dataQueryTableNodeDefUuidUpdate = 'dataQuery/table/nodeDefUuid/update'
export const dataQueryTableNo... |
<vulnerable_code>import { connect } from 'react-redux'
import Expression from '../../../../../../../../common/exprParser/expression'
import * as DataSort from '../../../../../../../../common/dataSort'
import Popup from '../../../../../../../commonComponents/popup'
import * as ExpressionVariables from '../../../../../... |
<vulnerable_code>import Tooltip from '../../../../../../commonComponents/tooltip'
import Expression from '../../../../../../../common/exprParser/expression'
import * as DataSort from '../../../../../../../common/dataSort'
import { updateTableFilter, resetTableFilter, updateTableOffset, updateTableSort, updateTableEdi... |
<vulnerable_code> }
if (t->req->kdc_options & (KDC_OPT_VALIDATE | KDC_OPT_RENEW)) {
/* Copy the whole header ticket except for authorization data. */
ticket_reply = *t->header_tkt;
enc_tkt_reply = *t->header_tkt->enc_part2;
enc_tkt_reply.authorization_data = NULL;
} else {<co... |
<vulnerable_code><commit_title>[PATCH] Add missing toObject conversion for PrivateSet opearation<commit_description>This patch fixes #4936.
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik robert.fancsik@h-lab.eu<fixed_code>
// Copyright JS Foundation and other contributors, http://js.foundation
//
// Licensed under ... |
<vulnerable_code> xmlGenericError(xmlGenericErrorContext,
"Pushing input %d : %.30s\n", ctxt->inputNr+1, input->cur);
}
ret = inputPush(ctxt, input);
if (ctxt->instate == XML_PARSER_EOF)
return(-1);
return;
input = xmlNewEntityInputStream(ctxt, entity);
if (xmlPushInput(ctxt, input) <... |
<vulnerable_code> }
}
return dir;
corrupted:<commit_title>[PATCH] Unsquashfs: additional write outside destination directory<commit_description><fixed_code>
}
}
/* check directory for duplicate names. Need to sort directory first */
sort_directory(dir);
if(check_directory(dir) == FALSE) {
ERROR("File sys... |
<vulnerable_code><commit_title>[PATCH] Unsquashfs: additional write outside destination directory<commit_description><fixed_code>
/*
* Unsquash a squashfs filesystem. This is a highly compressed read only
* filesystem.
*
* Copyright (c) 2021
* Phillip Lougher <phillip@squashfs.org.uk>
*
* This program is free s... |
<vulnerable_code>
free(dir);
}<commit_title>[PATCH] Unsquashfs: additional write outside destination directory<commit_description><fixed_code>
free(dir);
}
/*
* Check directory for duplicate names. As the directory should be sorted,
* duplicates will be consecutive. Obviously we also need to check if the
* di... |
<vulnerable_code>static squashfs_fragment_entry_2 *fragment_table;
static unsigned int *uid_table, *guid_table;
static squashfs_operations ops;
static void read_block_list(unsigned int *block_list, long long start,
}
}
return dir;
corrupted:
* 2.x filesystems use gzip compression.
*/
comp = lookup_compress... |
<vulnerable_code> }
}
return dir;
corrupted:<commit_title>[PATCH] Unsquashfs: additional write outside destination directory<commit_description><fixed_code>
}
}
/* check directory for duplicate names and sorting */
if(check_directory(dir) == FALSE) {
ERROR("File system corrupted: directory has duplicate na... |
<vulnerable_code> return 0;
}
static bool parseUrlAddrFromRtspUrlString(const char* rtspUrlString, char* destination) {
char* rtspUrlScratchBuffer;
char* portSeparator;
char* v6EscapeEndChar;
*urlPathSeparator = 0;
}
strcpy(destination, rtspUrlScratchBuffer + prefixLen);
free(rtspU... |
<vulnerable_code> flash(
Markup(
f"At least one field in trigger form uses custom HTML form definition. This is not allowed per "
"configuration for security. Change <code>allow_html_in_dag_docs</code> to enable HTML. "
"Using plain ... |
<vulnerable_code>@pytest.mark.parametrize("allow_html", [False, True])
def test_trigger_dag_html_allow(admin_client, dag_maker, session, app, monkeypatch, allow_html):
"""
Test that HTML is masked per default in description.
"""
from markupsafe import escape
<commit_title>[PATCH] Review feedback<commit_... |
<vulnerable_code> conn->procedure_expire = 0U;
}
#endif /* CONFIG_BT_CTLR_CONN_PARAM_REQ */
/* Reset ticker_id_prepare as role is not continued further
* due to conn update at this event.
*/
_radio.ticker_id_prepare = 0U;
/* reset mutex */
if (_radio.conn_upd == conn) {
switch (conn->llcp_type) {
... |
<vulnerable_code> if(exception->severity != UndefinedException) goto FINISH_UNL;
if(magic_info->name == (char *) NULL) goto FINISH_UNL;
(void) CopyMagickMemory(clone_info->magick,magic_info->name,MaxTextExtent);
/* Read nested image */
/*FormatString(clone_info->filename,"%s:%s",magic_info->name,postscript... |
<vulnerable_code> struct ufs_mtk_host *host = ufshcd_get_variant(hba);
host->reg_va09 = regulator_get(hba->dev, "va09");
if (!host->reg_va09)
dev_info(hba->dev, "failed to get va09");
else
host->caps |= UFS_MTK_CAP_VA09_PWR_CTRL;<commit_title>[PATCH] scsi: ufs: ufs-mediatek: Fix error checking in<commit_descrip... |
<vulnerable_code> current_element = object->child;
if (case_sensitive)
{
while ((current_element != NULL) && (strcmp(name, current_element->string) != 0))
{
current_element = current_element->next;
}
}
}
return current_element;
}
<commit_title>[PATCH] Fix ... |
<vulnerable_code> cJSON_Delete(item);
}
static void typecheck_functions_should_check_type(void)
{
cJSON invalid[1];
RUN_TEST(cjson_array_foreach_should_not_dereference_null_pointer);
RUN_TEST(cjson_get_object_item_should_get_object_items);
RUN_TEST(cjson_get_object_item_case_sensitive_should_get_obj... |
<vulnerable_code> XMLInputFactory factory = XMLInputFactory.newInstance();
factory.setProperty(XMLInputFactory.IS_COALESCING, true);
factory.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, true);
return factory.createXMLStreamReader(wrapPrefixRemovingInputStream(input... |
<vulnerable_code> Assert.assertNotNull(row.getCell(1));
Assert.assertEquals(row.getCell(1).value, "Author 1, The");
}
@Test
public void canParseSampleWithDuplicateNestedElements(){
return sb.toString();
}
public static ObjectNode getOptions(ImportingJob job, TreeImportin... |
<vulnerable_code>'use strict';
var execSync = require('child_process').execSync;
var sizeOf = require('image-size');
var mkdirp = require('mkdirp-promise');
var rimraf = require('rimraf-then');
.replace(/\.[^.]+$/, '');
var patternedFilenameWithoutTheFilename = '';
if (pattern.indexOf(path.sep) > 0) {
... |
<vulnerable_code>/*global jasmine*/
var fs = require('fs');
var execSync = require('child_process').execSync;
var rimraf = require('rimraf');
var expectImagesToBeTheSame = require('./expectImagesToBeTheSame.helper.js').expectImagesToBeTheSame;
});
describe('When used on an image smaller than the tile size', fu... |
<vulnerable_code> if sql_validation.allow_non_select_statements is False:
statements = get_json_segment(parse_result, "statement")
for statement in statements:
if list(statement.keys())[0] != "select_statement":
raise ValueError(
f"Found disallowed non ... |
<vulnerable_code>"""Test SQL Database Chain."""
from sqlalchemy import Column, Integer, MetaData, String, Table, create_engine, insert
from langchain.chains.sql_database.base import (
SQLDatabaseChain,
SQLDatabaseSequentialChain,
SQLValidation
)
from langchain.llms.openai import OpenAI
from langchain.sql_d... |
<vulnerable_code>
_SQLITE_IN_MEMORY_DB_URI = "sqlite://"
# Arrange
@pytest.fixture
def in_memory_db() -> SQLDatabase:
return database
@pytest.mark.requires("sqlfluff")
def test_simple_question(in_memory_db: SQLDatabase) -> None:
question = "What is the price of an iphone?"
output = fake_llm_db_chain.run(... |
<vulnerable_code>CKEDITOR.plugins.add("wordcount",
{
lang: "ar,bg,ca,cs,da,de,el,en,es,eu,fa,fi,fr,he,hr,hu,it,ka,ko,ja,nl,no,pl,pt,pt-br,ru,sk,sv,tr,uk,zh-cn,zh,ro", // %REMOVE_LINE_CORE%
version: "1.17.10",
requires: "htmlwriter,notification,undo",
bbcodePluginLoaded: false,
... |
<vulnerable_code> .replace(/([$&;|])/gu, "\\$1")
.replace(/([()<>])/gu, "\\$1")
.replace(/(["'`])/gu, "\\$1")
.replace(/\{(?=([^,.]*(?:,|\.)[^]*?)\})/gu, "\\{")
.replace(/(?<==(?:[^]*?:)?)(~)(?=[\s+\-/0:=]|$)/gu, "\\$1");
} else if (quoted) {
result = result.replace(/'/gu, `'\\''`);
... |
<vulnerable_code>
#include <map>
#include <string>
#include <cstdio>
#include <QIODevice>
#include <QUuid>
#include <QScopeGuard>
#include <qt5keychain/keychain.h>
#include "common/utility.h"
job->start();
}
void ClientSideEncryption::publicKeyFetched(Job *incoming)
{
auto *readJob = static_cast<ReadPasswor... |
<vulnerable_code> ++*arg;
ret = eval1(arg, rettv, evalarg);
*arg = skipwhite_and_linebreak(*arg, evalarg);
if (**arg != ')')
{
emsg(_(e_missing_closing_paren));
ret = FAIL;
}
++*arg;
}
if (ret != OK)
return FAIL;<commit_title>[PATCH] patch 8.2.3847: illegal memory access when using a lambda<com... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.