text stringlengths 79 3.72M |
|---|
<vulnerable_code> label="Your message",
field_type='multiline',
required=True,
)
FormField.objects.create(
page=form_page,<commit_title>[PATCH] Escape help text in form builder forms by default<commit_description>This can be disabled with the setting WAGTAILFORMS_HELP_TEXT_ALLOW_H... |
<vulnerable_code> ret = copy_user_to_xstate(xsave, ubuf);
} else {
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, xsave, 0, -1);
}
/*<commit_title>[PATCH] x86/fpu: Don't let userspace set bogus xcomp_bv<commit_description>On x86, userspace can use the ptrace() or rt_sigreturn() system calls to
set a task'... |
<vulnerable_code>function isSynthetic(subject) {
return Array.isArray(subject) && subject.length === 2 && typeof subject[1] === "object" && Object.keys(subject[1]).includes("s");
}
var csrf;
function getCsrfToken() {
if (csrf)
return csrf;
if (document.querySelector("[data-csrf]")) {
csrf = document.query... |
<vulnerable_code>(()=>{var Aa=Object.create;var un=Object.defineProperty;var Ca=Object.getOwnPropertyDescriptor;var Ta=Object.getOwnPropertyNames;var ka=Object.getPrototypeOf,Oa=Object.prototype.hasOwnProperty;var La=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Na=(e,t,r,n)=>{if(t&&typeof t=="object"||ty... |
<vulnerable_code>import { triggerSend, waitUntilTheCurrentRequestIsFinished } from "./request"
import { dataGet, dataSet, each, deeplyEqual, isObjecty, deepClone, diff, isObject, getCsrfToken, contentIsFromDump, splitDumpFromContent } from '@/utils'
import { on, trigger } from '@/events'
/**<commit_title>[PATCH] Stop ... |
<vulnerable_code> * Post requests in Laravel require a csrf token to be passed
* along with the payload. Here, we'll try and locate one.
*/
let csrf
export function getCsrfToken() {
if (csrf) return csrf
if (document.querySelector('[data-csrf]')) {
csrf = document.querySelector('[data-csrf]').getAtt... |
<vulnerable_code> """
# If model is a path instead of ModelProto
if isinstance(model, str):
C.check_model_path(model)
if full_check:
onnx.shape_inference.infer_shapes_path(model, check_type=True, strict_mode=True)
else:
protobuf_string = model if isinstance(model, byte... |
<vulnerable_code> graph,
[make_tensor_value_info('y', TensorProto.INT32, (2, 3, 9, 9))])
def test_shape(self) -> None:
graph = self._make_graph(
[('x', TensorProto.FLOAT, (2, 4, 3))],<commit_title>[PATCH 1/4] fix bugs and add .clang-tidy (#4391)<commit_description>* fix b... |
<vulnerable_code> '<xss>': 'safe',
link: 'https://example.com',
xss_link: 'https://example.com with "quotes"',
};
const data = [
{ key: 'span.kind', value: 'client', expected: 'client' },<commit_title>[PATCH] add more test cases<commit_description>Signed-off-by: Yuri Shkuro <ysh@meta.com><fixed_code>... |
<vulnerable_code>#include <QUuid>
#include <QScopeGuard>
#include <QRandomGenerator>
#include <qt5keychain/keychain.h>
#include <common/utility.h>
}
}
if (_metadataKey.isEmpty()) {
qCDebug(lcCse()) << "Could not setup existing metadata with missing metadataKeys!";
return;
}
QB... |
<vulnerable_code>//
// Original version written by Sean Barrett in 2007.
//
// Originally sponsored by RAD Game Tools. Seeking sponsored
// by Phillip Bennefall, Marc Andersen, Aaron Baker, Elias Software,
// Aras Pranckevicius, and Sean Barrett.
//
// LICENSE
//
// manxorist@github saga musix github:infa... |
<vulnerable_code> {"request", JSON_OBJECT, 0}
};
static struct janus_json_parameter querylogger_parameters[] = {
{"handler", JSON_STRING, JANUS_JSON_PARAM_REQUIRED},
{"request", JSON_OBJECT, 0}
};
static struct janus_json_parameter messageplugin_parameters[] = {<commit_title>[PATCH] Fixed typo in querylogger_paramete... |
<vulnerable_code> js_newobject(J);
if (!ref->getter && !ref->setter) {
js_pushvalue(J, ref->value);
js_setproperty(J, -2, "value");
js_pushboolean(J, !(ref->atts & JS_READONLY));
js_setproperty(J, -2, "writable");
} else {
if (ref->getter)
js_pushobject(J, ref->getter);
else
js_pushundefi... |
<vulnerable_code>import utils.AccountType;
import utils.Pair;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.ArrayList;
public class DBManager {
Connection c;
rs.close();
stmt.clo... |
<vulnerable_code> # architecture, and generating one in a bespoke way may cause virus scanners to
# give a false positive. So we use a Bash/Python polyglot for the hook and use
# the Python interpreter itself as the bash.exe impostor. But an interpreter
# from a venv may not run outside o... |
<vulnerable_code>)
# The secret key to use in the Flask app for various cryptographic features
SECRET_KEY = os.environ.get("REDASH_COOKIE_SECRET", "c292a0a3aa32397cdb050e233733900f")
# The secret key to use when encrypting data source options
DATASOURCE_SECRET_KEY = os.environ.get("REDASH_SECRET_KEY", SECRET_KEY)
<com... |
<vulnerable_code> const specificityString = pattern.replace(/\*/g, '');
pattern = pattern
.split('*')
.map(escapeRegExp)
.join('(?:.*)');
<commit_title>[PATCH 1/2] Mitigate Redos<commit_description><fixed_code>
const specificityString = pattern.replace(/\*/g, '');
pattern = pattern
.split(/\*+/... |
<vulnerable_code>
assertNoMatch(pattern, '/Fish.PHP');
});
});
});<commit_title>[PATCH 1/2] Mitigate Redos<commit_description><fixed_code>
assertNoMatch(pattern, '/Fish.PHP');
});
it('should handle a ReDos', function () {
const pattern = patterns.path('/********************************... |
<vulnerable_code> PUNFETCH;
prev = p;
num = scan_unsigned_octal_number(&p, end, 3, enc);
if (num < 0) return ONIGERR_TOO_BIG_NUMBER;
if (p == prev) { /* can't read nothing. */
num = 0; /* but, it's not error */
}
if (IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_OCTAL... |
<vulnerable_code><commit_title>[PATCH] Add a fuzzing test to search for segfaults in encoding.<commit_description><fixed_code>
#!/usr/bin/env python
"""
A brute force fuzzer for detecting memory issues in ujson.dumps(). To use, first
compile ujson in debug mode:
CFLAGS='-DDEBUG' python setup.py -q build_ext --inpl... |
<vulnerable_code> u16 key_gen = msg_key_gen(hdr);
u16 size = msg_data_sz(hdr);
u8 *data = msg_data(hdr);
spin_lock(&rx->lock);
if (unlikely(rx->skey || (key_gen == rx->key_gen && rx->key.keys))) {
pr_err("%s: key existed <%p>, gen %d vs %d\n", rx->name,
rx->skey, key_gen, rx->key_gen);
goto exit;
}
... |
<vulnerable_code> super().__init__(hs)
self.hs = hs
self.is_mine_id = hs.is_mine_id
self.http_client = hs.get_simple_http_client()
self._presence_enabled = hs.config.use_presence
<commit_title>[PATCH] Remove unused HTTP clients.<commit_description><fixed_code>
super().__i... |
<vulnerable_code>
def __init__(self, hs: "HomeServer"):
self.config = hs.config
self.http_client = hs.get_simple_http_client()
self.clock = hs.get_clock()
self._instance_name = hs.get_instance_name()
<commit_title>[PATCH] Remove unused HTTP clients.<commit_description><fixed_code>
... |
<vulnerable_code> *
* This task should be used prior to publishing a change.
**/
gulp.task('check', ['check-license-headers', 'lint', 'test', 'integration-test:prod']);
/**
* Checks the code quality (frontend + backend tests) of Dashboard. In addition lints the code and<commit_title>[PATCH] Fix integration tests<co... |
<vulnerable_code> systemBannerSeverity: gulpUtil.env.systemBannerSeverity !== undefined ?
gulpUtil.env.systemBannerSeverity :
'',
},
/**<commit_title>[PATCH] Fix integration tests<commit_description><fixed_code>
systemBannerSeverity: gulpUtil.env.systemBannerSeverity !== undefined ?
... |
<vulnerable_code> args.push(`--apiserver-host=${conf.backend.envApiServerHost || conf.backend.apiServerHost}`);
}
return args;
}
<commit_title>[PATCH] Fix integration tests<commit_description><fixed_code>
args.push(`--apiserver-host=${conf.backend.envApiServerHost || conf.backend.apiServerHost}`);
}
if... |
<vulnerable_code>import goCommand from './gocommand';
import {browserSyncInstance} from './serve';
/**
* @param {boolean} singleRun
* @param {function(?Error=)} doneFn
* Downloads and updates webdriver. Required to keep it up to date.
*/
gulp.task('webdriver-update', gulpProtractor.webdriver_update);<commit_title... |
<vulnerable_code> type = 0;
if (fread(data, 1, 4, f) == 4) {
if (fread(data, 1, 4, f) == 4) {
type = GF_4CC(data[0], data[1], data[2], data[3]);
}
}
gf_fclose(f);
if (movie->mfra) {
if (!movie->mfra->mfro)
movie->mfra->mfro = (GF_MovieFragmentRandomAccessOffsetBox *)gf_isom_box_new(GF_ISOM_... |
<vulnerable_code> if (simple_check && (ts->buffer[i]==0x47)) return 0;
while (i<ts->buffer_size) {
if (i+188>ts->buffer_size) return ts->buffer_size;
if ((ts->buffer[i]==0x47) && (ts->buffer[i+188]==0x47))
break;
if ((ts->buffer[i]==0x47) && (ts->buffer[i+192]==0x47)) {
ts->prefix_present = 1;
break;<c... |
<vulnerable_code> }
});
afterEach(async function (done) {
const client = await Parse.CoreManager.getLiveQueryController().getDefaultLiveQueryClient();
client.close();<commit_title>[PATCH] fix: protected fields exposed via LiveQuery; this removes<commit_description><fixed_code>
}
});
it('should ... |
<vulnerable_code> aclGroup: any[],
auth: any,
operation: any,
schema: SchemaController.SchemaController,
className: string,
protectedFields: null | Array<any>,
object: any
if (auth && auth.user) userId = auth.user.id;
// replace protectedFields when using pointer-permissions
const perms = schema.get... |
<vulnerable_code> if (request.original) {
message.originalParseObject = request.original._toFullJSON();
}
this.parsePublisher.publish(type, JSON.stringify(message));
}
}<commit_title>[PATCH] fix: protected fields exposed via LiveQuery; this removes<commit_description><fixed_code>
if (request.orig... |
<vulnerable_code>import SchemaController from '../Controllers/SchemaController';
import _ from 'lodash';
import { v4 as uuidv4 } from 'uuid';
import { runLiveQueryEventHandlers, getTrigger, runTrigger, resolveError, toJSONwithObjects } from '../triggers';
import { getAuthForSessionToken, Auth } from '../Auth';
import {... |
<vulnerable_code>import ca.uhn.fhir.interceptor.model.RequestPartitionId;
import ca.uhn.fhir.jpa.api.config.DaoConfig;
import ca.uhn.fhir.jpa.api.dao.IFhirResourceDao;
import ca.uhn.fhir.jpa.dao.BaseHapiFhirDao;
import ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao;
import ca.uhn.fhir.jpa.dao.JpaResourceDao;
import ca.uhn... |
<vulnerable_code>import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInfo;
import org.junit.jupiter.api.extension.RegisterExtension;
import com.fasterxml.jackson.databind.JsonNode;
import com.google.common.base.Strings;
import com.google.common.io.Files;
import com.linecorp.centraldogma.client.Central... |
<vulnerable_code>import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CancellationException;
import java.util.concurrent.CompletableFuture;
import java.util.function.Function;
import javax.annotation.Nullable;
import com.google.common.base.Throwables;
import com.google... |
<vulnerable_code> @VisibleForTesting
static final String PATH_CREDENTIALS = "/credentials.json";
@VisibleForTesting
static final String PATH_MIRRORS = "/mirrors.json";
private static final String PATH_CREDENTIALS_AND_MIRRORS = PATH_CREDENTIALS + ',' + PATH_MIRRORS;
<commit_title>[PATCH] Prohibit mi... |
<vulnerable_code>import java.util.regex.Pattern;
import java.util.stream.Collectors;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
public void parse(final InputSource is) {
try {
final SAXParserFactory factory = SAXParserFactory.newInstance();
final... |
<vulnerable_code> esd = gf_isom_get_esd(file, sceneT, 1);
if (gf_isom_get_sample_count(file, sceneT)==1) {
samp = gf_isom_get_sample(file, sceneT, 1, &descIndex);
if (gf_hinter_can_embbed_data(samp->data, samp->dataLength, GF_STREAM_SCENE)) {
slc.timeScale = slc.timestampResolution = gf_isom_get_media_tim... |
<vulnerable_code> shape.fillColor.alpha = shape.fillOpacity
def svg2rlg(path, **kwargs):
"Convert an SVG file to an RLG Drawing object."
# unzip .svgz file into .svg
path = path[:-1]
unzipped = True
svg_root = load_svg_file(path)
if svg_root is None:
return
re... |
<vulnerable_code> header: _('object')
,dataIndex: 'name'
,width: 300
}]
,tbar: [{
xtype: 'button'<commit_title>[PATCH] Fix #14105<commit_description><fixed_code>
header: _('object')
,dataIndex: 'name'
,width: 300
... |
<vulnerable_code> import json
import os
from html import unescape
import requests
api = f"http://{domain}:7873/bGVhdmVfcmlnaHRfbm93"
with open(image_file, "rb") as f:<commit_title>[PATCH] small fix<commit_description><fixed_code>
import json
import os
from html import unescape
... |
<vulnerable_code>
cp = strchr(ip_as_string, ':');
if (*ip_as_string == '[') {
int len;
if (!(cp = strchr(ip_as_string, ']'))) {
return -1;
}
len = (int) ( cp-(ip_as_string + 1) );
if (len > (int)sizeof(buf)-1) {
return -1;
}
memcpy(buf, ip_as_string+1, len);<commit_title>[PATCH] evutil_parse_socka... |
<vulnerable_code>#include "image.hpp"
#include "image_int.hpp"
#include "error.hpp"
#include "futils.hpp"
#include "safe_op.hpp"
#include "slice.hpp"
// class member definitions
namespace Exiv2 {
Image::Image(int imageType,
uint16_t supportedMetadata,
BasicIo:... |
<vulnerable_code> RETRY_AFTER_STATUS_CODES = frozenset([413, 429, 503])
#: Default headers to be used for ``remove_headers_on_redirect``
DEFAULT_REMOVE_HEADERS_ON_REDIRECT = frozenset(["Authorization"])
#: Maximum backoff time.
DEFAULT_BACKOFF_MAX = 120<commit_title>[PATCH] Backport GHSA-v845-jxx5-... |
<vulnerable_code> def test_retry_default_remove_headers_on_redirect(self):
retry = Retry()
assert list(retry.remove_headers_on_redirect) == ["authorization"]
def test_retry_set_remove_headers_on_redirect(self):
retry = Retry(remove_headers_on_redirect=["X-API-Secret"])
assert l... |
<vulnerable_code> def test_retry_default_remove_headers_on_redirect(self):
retry = Retry()
assert list(retry.remove_headers_on_redirect) == ["authorization"]
def test_retry_set_remove_headers_on_redirect(self):
retry = Retry(remove_headers_on_redirect=["X-API-Secret"])<commit_title>[PAT... |
<vulnerable_code> "GET",
"%s/redirect" % self.base_url,
fields={"target": "%s/headers" % self.base_url_alt},
headers={"Authorization": "foo"},
)
assert r.status == 200
data = json.loads(r.data.decode("utf-8"))
... |
<vulnerable_code> return user_core_fd;
}
static bool dump_fd_info(const char *dest_filename, char *source_filename, int source_base_ofs)
{
FILE *fp = fopen(dest_filename, "w");
if (!fp)
}
fclose(in);
}
fclose(fp);
return true;
}
// Disabled for now: /proc/PID/smaps tends... |
<vulnerable_code> return [line.strip() for line in out.splitlines()]
def remove_logical_volumes(*paths):
"""Remove one or more logical volume."""
if paths:
lvremove = ('lvremove', '-f') + paths
execute(*lvremove, attempts=3, run_as_root=True)<commit_title>[PATCH] Don't leak info from libvir... |
<vulnerable_code>
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import test_util
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import gradient_checker
err_tolerance = 1e-3
self.assertLess(e... |
<vulnerable_code> validateOnly: boolean = false,
validSchemaController: SchemaController.SchemaController
): Promise<any> {
const originalQuery = query;
const originalUpdate = update;
// Make a copy of the object, so we don't mutate the incoming data.
validateOnly: boolean = false,
validSch... |
<vulnerable_code> }
}
this.checkProhibitedKeywords(data);
// When the operation is complete, this.response may have several
// fields.
// response: the actual data to be returned
delete this.data.objectId;
}
}
this.checkProhibitedKeywords(this.data);
});
};
return res... |
<vulnerable_code> include: 'user',
};
const RestQuery = require('./RestQuery');
const query = new RestQuery(config, master(config), '_Session', { sessionToken }, restOptions);
results = (await query.execute()).results;
} else {
results = (
});
};
var getAuthForLegacySessionToken = function... |
<vulnerable_code>// Returns a list of pointers in REST format.
function findPointers(object, path) {
if (object instanceof Array) {
var answer = [];
for (var x of object) {
answer = answer.concat(findPointers(x, path));
}
return answer;
}
if (typeof object !== 'object' || !object) {<commit_... |
<vulnerable_code> op->cycles = 2;
op->failcycles = 3;
op->type = R_ANAL_OP_TYPE_CJMP;
if (data[1] <= 127)
op->jump = addr + data[1] + op->size;
else op->jump = addr - (256 - data[1]) + op->size;
op->fail = addr + op->size;
// FIXME: add a type of conditional
// op->cond = R_ANAL_COND_LE;<commit_title>... |
<vulnerable_code>
def valid_args(self, rdtype, domain):
if not is_valid_rdtype(rdtype):
abort(400, message="%s type is not supported" % rdtype)
if not is_valid_hostname(domain):
abort(400, message="%s is not a valid domain name" % domain)
class ReverseLookup(Resource):
... |
<vulnerable_code>
const char *ptr = compressed + 20;
if ( ptr + (nBits+7 )/8 > compressed+nCompressed)
{
notEnoughData();
return;<commit_title>[PATCH] prevent overflow in hufUncompress if nBits is large<commit_description>Signed-off-by: Peter Hillman <peterh@wetafx.co.nz><fixed_code>
c... |
<vulnerable_code> if ( is_block_cipher ( cipher ) ) {
pad_len = tls_verify_padding ( tls, last );
if ( pad_len < 0 ) {
rc = pad_len;
return rc;
}
iob_unput ( last, pad_len );
len -= pad_len;<commit_title>[PATCH] [tls] Treat invalid block padding as zero length padding<commit_description>Harden against p... |
<vulnerable_code>module.exports = minimatch
minimatch.Minimatch = Minimatch
var path = { sep: '/' }
try {
path = require('path')
} catch (er) {}
var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}
var expand = require('brace-expansion')
var plTypes = {
'!': { open: '(?:(?!(?:', close: '))[^/]*?)'},
'?'... |
<vulnerable_code> // options.debug = true
var m = new mm.Minimatch(pattern, options)
var r = m.makeRe()
var expectRe = regexps[re++]
expectRe = '/' + expectRe.slice(1, -1).replace(new RegExp('([^\\\\])/', 'g'), '$1\\\/') + '/'
tapOpts.re = String(r) || JSON.stringify(r)
tapOpts.re = '/' + tap... |
<vulnerable_code> patterns.forEach(function (tc) {
var p = tc[0],
expect = tc[1]
t.equivalent(minimatch.braceExpand(p), expect, p)
})
t.end()
})<commit_title>[PATCH] Improve redos protection, add many tests<commit_description>100% line coverage, not quite 100% total though.<fixed_code>
patterns.for... |
<vulnerable_code> var actual = mm.match(f, pattern, options)
actual.sort(alpha)
t.equivalent(
actual,
expect,
JSON.stringify(pattern) + ' ' + JSON.stringify(expect),
var globalAfter = Object.keys(global).filter(function (k) {
return (k !== '__coverage__')
})
t.equivalent(globalAf... |
<vulnerable_code><commit_title>[PATCH] Improve redos protection, add many tests<commit_description>100% line coverage, not quite 100% total though.<fixed_code>
const t = require('tap')
const mm = t.mock('../', { path: null })
t.equal(mm.sep, '/') |
<vulnerable_code> 'https://github.com/isaacs/minimatch/issues/59',
['[z-a]', []],
['a/[2015-03-10T00:23:08.647Z]/z', []],
['[a-0][a-\u0100]', []]
]
module.exports.regexps = [
'/^(?:(?=.)a[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/][^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?)$/',
'/^(?:\\[\\])... |
<vulnerable_code><commit_title>[PATCH] Improve redos protection, add many tests<commit_description>100% line coverage, not quite 100% total though.<fixed_code>
const t = require('tap')
const mm = t.mock('../', { path: { sep: '\\' }})
t.equal(mm('x\\y\\z', 'x/y/*/z'), false)
t.equal(mm('x\\y\\w\\z', 'x/y/*/z'), true) |
<vulnerable_code> ecma_string_t *search_key_p, /**< key */
ecma_string_t **out_private_key_p) /**< [out] private key */
{
ecma_string_t *internal_string_p = ecma_get_internal_string (LIT_INTERNAL_MAGIC_STRING_CLASS_PRIVATE_ELEMENTS);
ecma_property_t *prop_p = ecma_fi... |
<vulnerable_code><commit_title>[PATCH] Fix fast array objects cannot hold private properties (#4952)<commit_description>This patch fixes #4934.
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 un... |
<vulnerable_code>import io.undertow.servlet.api.ThreadSetupHandler;
import io.undertow.servlet.api.WebResourceCollection;
import io.undertow.servlet.handlers.CrawlerSessionManagerHandler;
import io.undertow.servlet.handlers.ServletDispatchingHandler;
import io.undertow.servlet.handlers.ServletHandler;
import io.underto... |
<vulnerable_code><commit_title>[PATCH] [UNDERTOW-1578] 401 Unauthorized should be returned when<commit_description><fixed_code>
/*
* JBoss, Home of Professional Open Source.
* Copyright 2019 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* Licensed under the Apache License, Versio... |
<vulnerable_code>import io.undertow.servlet.spec.HttpServletResponseImpl;
import io.undertow.servlet.spec.RequestDispatcherImpl;
import io.undertow.servlet.spec.ServletContextImpl;
import io.undertow.util.Headers;
import io.undertow.util.HttpString;
import io.undertow.util.Methods;
import io.undertow.util.Protocols;
im... |
<vulnerable_code><commit_title>[PATCH] [UNDERTOW-1578] 401 Unauthorized should be returned when<commit_description><fixed_code>
/*
* JBoss, Home of Professional Open Source.
* Copyright 2019 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* Licensed under the Apache License, Versio... |
<vulnerable_code>{
unsigned inx;
df_elt_t *col = pred->_.bin.right->_.call.args[0];
collation_t * coll = DFE_COLUMN == col->dfe_type ? col->_.col.col->col_sqt.sqt_collation : NULL;
for (inx = 1; inx < BOX_ELEMENTS (pred->_.bin.right->_.call.args); inx++)
{
if (cmp_to_find == cmp_boxes ((caddr_t) pred-... |
<vulnerable_code> int htileno;
int vtileno;
jpc_dec_cmpt_t *cmpt;
dec->xstart = siz->xoff;
dec->ystart = siz->yoff;
dec->numhtiles = JPC_CEILDIV(dec->xend - dec->tilexoff, dec->tilewidth);
dec->numvtiles = JPC_CEILDIV(dec->yend - dec->tileyoff, dec->tileheight);
dec->numtiles = dec->numhtiles * dec->numvtiles;... |
<vulnerable_code> import, typically used to move data from staging to
production and issue cleanup commands. (templated)
:param bulk_load: flag to use bulk_load option. This loads mysql directly
from a tab-delimited text file using the LOAD DATA LOCAL INFILE command.
This option requ... |
<vulnerable_code> in extras.
extras example: ``{"iam":true, "aws_conn_id":"my_aws_conn"}``
:param schema: The MySQL database schema to connect to.
:param connection: The :ref:`MySQL connection id <howto/connection:mysql>` used for MySQL credentials.
"""
conn_name_attr = "mysql_conn_id"
... |
<vulnerable_code>
mock_hive_hook.assert_called_once_with(hiveserver2_conn_id=self.kwargs["hiveserver2_conn_id"])
mock_hive_hook.return_value.get_records.assert_called_once_with("sql", parameters={})
mock_mysql_hook.assert_called_once_with(mysql_conn_id=self.kwargs["mysql_conn_id"])
mock_... |
<vulnerable_code>
@mock.patch("MySQLdb.connect")
def test_get_conn_local_infile(self, mock_connect):
self.connection.extra = json.dumps({"local_infile": True})
self.db_hook.get_conn()
assert mock_connect.call_count == 1
args, kwargs = mock_connect.call_args
@mock.patch("mysql... |
<vulnerable_code>/* eslint-disable max-len */
import { Controller } from '@hotwired/stimulus'
import { castBoolean } from '../../helpers/cast_boolean'
let index = 0
this.fieldValue.forEach((row) => {
const [key, value] = row
result += this.interpolatedRow(key, value, index)
index++
})
... |
<vulnerable_code> { 0, NULL }
};
static int dccp_print_option(netdissect_options *ndo, const u_char *option, u_int hlen)
{
uint8_t optlen, i;
}
break;
case 41:
if (optlen == 4)
ND_PRINT((ndo, " %u", EXTRACT_32BITS(option + 2)));
else
ND_PRINT((ndo, " optlen != 4"));
break;
case 42:
if (... |
<vulnerable_code> return -ENOMEM;
err = mlx5_crdump_collect(dev, cr_data);
if (err)
return err;
if (priv_ctx) {
struct mlx5_fw_reporter_ctx *fw_reporter_ctx = priv_ctx;<commit_title>[PATCH] net/mlx5: fix memory leak in mlx5_fw_fatal_reporter_dump<commit_description>In mlx5_fw_fatal_reporter_dump if mlx5_crdump... |
<vulnerable_code>#endif
}
static bool sig_enforce = IS_ENABLED(CONFIG_MODULE_SIG_FORCE);
module_param(sig_enforce, bool_enable_only, 0644);
/*
* Export sig_enforce kernel cmdline parameter to allow other subsystems rely
* on that instead of directly to CONFIG_MODULE_SIG_FORCE config.
}
EXPORT_SYMBOL(is_module_sig_e... |
<vulnerable_code>
text = self.clean_input(text)
# Make sure it's not a URL
if URL_RE.search(text):
return False, None
watchlist_patterns = self._get_filterlist_items('filter_token', allowed=False)
for pattern in watchlist_patterns:
match = re.search(patt... |
<vulnerable_code><commit_title>[PATCH] Merge pull request from GHSA-j8c3-8x46-8pp6<commit_description>* Don't Exit Token Filtering Early On URLs
The token filtering function would exit early if it detected a URL
within the message, but it made no extra checks to ensure there weren't
other tokens within that message th... |
<vulnerable_code><commit_title>[PATCH] Share logic for opening external links<commit_description><fixed_code>
const { shell } = require('electron');
const url = require('url');
const protocolRegex = /^https?:/i;
/**
* Opens the given link in an external browser.
*
* @param {string} link - The link (URL) that shou... |
<vulnerable_code>const createElectronStorage = require('redux-persist-electron-storage');
const { ipcRenderer, shell, remote } = require('electron');
const os = require('os');
const url = require('url');
const jitsiMeetElectronUtils = require('jitsi-meet-electron-utils');
const protocolRegex = /^https?:/i;
/**
* Op... |
<vulnerable_code> BrowserWindow,
Menu,
app,
ipcMain,
shell
} = require('electron');
const contextMenu = require('electron-context-menu');
const debug = require('electron-debug');
const path = require('path');
const URL = require('url');
const config = require('./app/features/config');
const showDevT... |
<vulnerable_code> 'creationDate',
'modificationDate'
],
proxy: {
type: 'ajax',
reader: {
type: 'json',
writeAllFields: true,
rootProperty: 'data',
encode: 'true'
},
api:... |
<vulnerable_code> tooltip: t('delete'),
handler: function (grid, rowIndex) {
let data = grid.getStore().getAt(rowIndex);
pimcore.helpers.deleteConfirm(t('glossary'), data.data.name, function () {
grid.getS... |
<vulnerable_code> icon: "/bundles/pimcoreadmin/img/flat-color-icons/delete.svg",
handler: function (grid, rowIndex) {
let data = grid.getStore().getAt(rowIndex);
pimcore.helpers.deleteConfirm(t('redirect'), data.data.id, function () ... |
<vulnerable_code> listeners: {
"keydown" : function (field, key) {
if (key.getKey() == key.ENTER) {
var input = filterField;
var val = input.getValue();
this.store.getProxy().extraParams.filter = val ?... |
<vulnerable_code> url: this.getSearchUrl(address),
method: "GET",
success: function (response, opts) {
var data = Ext.decode(response.responseText);
this.latitude.setValue(data[0].lat);
this.longitude.setValue(data[0].lon);
... |
<vulnerable_code> xtype: "tbspacer",
width: 20
});
let predefinedMetadataGroups = Ext.Array.map (this.asset.data.predefinedMetaDataGroups, function(predefinedMetadataGroup){
return {text: t(predefinedMetadataGroup), handler: func... |
<vulnerable_code>import java.util.Set;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.xwiki.bridge.event.DocumentCreatedEvent;
import org.xwiki.bridge.event.WikiDeletedEvent;
import org.xwiki.model.EntityType;
import org.xwiki.model.reference.DocumentRe... |
<vulnerable_code> */
public void use(String resource, XWikiContext context)
{
useResource(resource, context);
// In case a previous call added some parameters, remove them, since the last call for a resource always
// discards previous ones.
getParametersMap(context).remove(... |
<vulnerable_code>import java.net.MalformedURLException;
import java.net.URL;
import java.util.Arrays;
import java.util.Locale;
import javax.inject.Named;
import javax.inject.Provider;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.xwiki.model.reference.DocumentReference;
import... |
<vulnerable_code><commit_title>[PATCH] XWIKI-9119: Refactoring of SkinExtensionPlugin<commit_description>* Provide some tests<fixed_code>
/*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify i... |
<vulnerable_code> // inherited from Object.prototype. For example, if obj has a custom
// toString() method, don't overwrite it with the toString() method
// that props inherited from Object.prototype
if((tobj[x] === undefined || tobj[x] != props[x]) && props[x] !== undefined && obj != props[x]){
if(doj... |
<vulnerable_code>{
if (!value)
return;
fprintf(fp, "%s=%s\n", key, value);
}
<commit_title>[PATCH] credential: avoid writing values with newlines<commit_description>The credential protocol that we use to speak to helpers can't represent
values with newlines in them. This was an intentional design choice to
keep the... |
<vulnerable_code>{
JERRY_ASSERT (ecma_get_object_type (func_obj_p) == ECMA_OBJECT_TYPE_FUNCTION);
vm_frame_ctx_shared_args_t shared_args;
shared_args.header.status_flags = VM_FRAME_CTX_SHARED_HAS_ARG_LIST;
shared_args.header.function_object_p = func_obj_p;<commit_title>[PATCH] Add stack-overflow check for 'ecm... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.