text stringlengths 79 3.72M |
|---|
<vulnerable_code>
void Keccak::Update(const byte *input, size_t length)
{
assert((input && length) || !(input || length));
if (!length)
return;
<commit_title>[PATCH] Add CRYPTOPP_ASSERT (Issue 277, CVE-2016-7420) trap.h and<commit_description><fixed_code>
void Keccak::Update(const byte *input, size_t length)
{
CR... |
<vulnerable_code> {
if (m_skipBytes)
{
assert(length >= m_skipBytes);
inString += m_skipBytes;
length -= m_skipBytes;
}
if (m_buffer.CurrentSize() > targetSize)
{
assert(!blocking);
m_wasBlocked = true;
m_skipBytes += length;
size_t blockedBytes = UnsignedMin(length, m_buffer.CurrentSize... |
<vulnerable_code>
void OAEP_Base::Pad(RandomNumberGenerator &rng, const byte *input, size_t inputLength, byte *oaepBlock, size_t oaepBlockLen, const NameValuePairs ¶meters) const
{
assert (inputLength <= MaxUnpaddedLength(oaepBlockLen));
// convert from bit length to byte length
if (oaepBlockLen % 8 != 0)<commi... |
<vulnerable_code>{
CRYPTOPP_UNUSED(rng), CRYPTOPP_UNUSED(recoverableMessage), CRYPTOPP_UNUSED(recoverableMessageLength);
CRYPTOPP_UNUSED(messageEmpty), CRYPTOPP_UNUSED(hashIdentifier);
assert(representativeBitLength >= MinRepresentativeBitLength(hashIdentifier.second, hash.DigestSize()));
const size_t u = hashIden... |
<vulnerable_code> i -= current->CurrentSize();
}
assert(i < m_lazyLength);
return m_lazyString[i];
}
<commit_title>[PATCH] Add CRYPTOPP_ASSERT (Issue 277, CVE-2016-7420) trap.h and<commit_description><fixed_code>
i -= current->CurrentSize();
}
CRYPTOPP_ASSERT(i < m_lazyLength);
return m_lazyString[i];
}
|
<vulnerable_code>
if (flags & BlockTransformation::BT_ReverseDirection)
{
assert(length % blockSize == 0);
inBlocks += length - blockSize;
xorBlocks += length - blockSize;
outBlocks += length - blockSize;
size_t increment = BLOCKSIZE;
if (flags & BT_ReverseDirection)
{
assert(length % BLOCKSIZE == 0)... |
<vulnerable_code>
// Signature
Integer s = modn.Multiply(modn.Square(Y), rInv);
assert((e * f * s.Squared()) % m_n == x);
// IEEE P1363, Section 8.2.8 IFSP-RW, p.44
s = STDMIN(s, m_n - s);<commit_title>[PATCH] Add CRYPTOPP_ASSERT (Issue 277, CVE-2016-7420) trap.h and<commit_description><fixed_code>
// Signature... |
<vulnerable_code>
void SHA512::Transform(word64 *state, const word64 *data)
{
assert(IsAlignedOn(state, GetAlignmentOf<word64>()));
assert(IsAlignedOn(data, GetAlignmentOf<word64>()));
#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE && (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32)
if (HasSSE2())<commit_title>[PATCH] Add CRYPTOPP_A... |
<vulnerable_code>
void SHA3::Update(const byte *input, size_t length)
{
assert((input && length) || !(input || length));
if (!length)
return;
<commit_title>[PATCH] Add CRYPTOPP_ASSERT (Issue 277, CVE-2016-7420) trap.h and<commit_description><fixed_code>
void SHA3::Update(const byte *input, size_t length)
{
CRYPTO... |
<vulnerable_code>void SosemanukPolicy::CipherResynchronize(byte *keystreamBuffer, const byte *iv, size_t length)
{
CRYPTOPP_UNUSED(keystreamBuffer), CRYPTOPP_UNUSED(iv), CRYPTOPP_UNUSED(length);
assert(length==16);
word32 a, b, c, d, e;
<commit_title>[PATCH] Add CRYPTOPP_ASSERT (Issue 277, CVE-2016-7420) trap.h and... |
<vulnerable_code>void BTEA::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const
{
CRYPTOPP_UNUSED(xorBlock);
assert(IsAlignedOn(inBlock,GetAlignmentOf<word32>()));
assert(IsAlignedOn(outBlock,GetAlignmentOf<word32>()));
unsigned int n = m_blockSize / 4;
word32 *v = (word32*)(v... |
<vulnerable_code> DSA::Verifier pub(priv);
FileSource fs2(CRYPTOPP_DATA_DIR "TestData/dsa1024b.dat", true, new HexDecoder());
DSA::Verifier pub1(fs2);
assert(pub.GetKey() == pub1.GetKey());
pass = SignatureValidate(priv, pub, thorough) && pass;
pass = RunTestDataFile(CRYPTOPP_DATA_DIR "TestVectors/dsa.txt", g_null... |
<vulnerable_code> }
catch (const Exception&)
{
assert(0);
}
}
}
bool WindowsPipeReceiver::Receive(byte* buf, size_t bufLen)
{
assert(!m_resultPending && !m_eofReceived);
const HANDLE h = GetHandle();
// don't queue too much at once, or we might use up non-paged memory<commit_title>[PATCH] Add CRYPTOPP_A... |
<vulnerable_code> data = malloc(size * sizeof(krb5_data));
if (!data) { retval = ENOMEM; }
if (!retval) {
r = strdup(realm);
if (!r) { retval = ENOMEM; }
}
while (!retval && (component = va_arg(ap, char *))) {
if (count == size) {<commit_title>[PATCH] Fix build_principal mem... |
<vulnerable_code> Janus.debug("Got a list of participants:", list);
for(var f in list) {
var id = list[f]["id"];
var display = list[f]["display"];
var setup = list[f]["setup"];
var muted = list[f]["muted"];
var spatial = list[f]["sp... |
<vulnerable_code> Janus.debug("Got a list of available recordings:", list);
for(var mp in list) {
Janus.debug(" >> [" + list[mp]["id"] + "] " + list[mp]["name"] + " (" + list[mp]["date"] + ")");
$('#recslist').append("<li><a href='#' id='" + list[mp]["id"] + "'>" + list[mp]["name"] + " [" + list[mp]["date... |
<vulnerable_code> if(event === "joined") {
myid = msg["id"];
$('#session').html(room);
$('#title').html(msg["description"]);
Janus.log("Successfully joined room " + msg["room"] + " with ID " + myid);
if(role === "publisher") {
// This is our se... |
<vulnerable_code> Janus.debug(list);
for(var mp in list) {
Janus.debug(" >> [" + list[mp]["id"] + "] " + list[mp]["description"] + " (" + list[mp]["type"] + ")");
$('#streamslist').append("<li><a href='#' id='" + list[mp]["id"] + "'>" + list[mp]["description"] + " (" + list[mp]["type"] + ")" + "</a></li>"... |
<vulnerable_code> var what = json["textroom"];
if(what === "message") {
// Incoming message: public or private?
var msg = json["text"];
msg = msg.replace(new RegExp('<', 'g'), '<');
msg = msg.replace(new RegExp('>', 'g'), '>');
var from = json["from... |
<vulnerable_code> } else if(result["event"]) {
var event = result["event"];
if(event === 'registered') {
myusername = result["username"];
Janus.log("Successfully registered as " + myusername + "!");
$('#youok').removeClass('hide').show().html("Registere... |
<vulnerable_code> ptype: "publisher",
display: username
};
myusername = username;
sfutest.send({ message: register });
}
}
}
}
remoteFeed.rfid = msg["id"];
remoteFeed.rfdisplay = msg["display"];
if(!remoteFeed.spinner) {
var target = document.getElementById('videoremote... |
<vulnerable_code> ptype: "publisher",
display: username
};
myusername = username;
sfutest.send({ message: register });
}
}
}
}
remoteFeed.rfid = msg["id"];
remoteFeed.rfdisplay = msg["display"];
if(!remoteFeed.spinner) {
var target = document.getElementById('videoremote... |
<vulnerable_code> return this;
}
StringBuffer condition = new StringBuffer();
int i = 0, j, k = 0;
String _keyword;
while (i < keywords.length) {
_keyword = keywords[i];
if (_keyword.trim().length() > 0) {
if (condition.length()... |
<vulnerable_code> memcpy (&l, iter->raw + iter->d1, sizeof (l));
l = BSON_UINT32_FROM_LE (l);
if (l >= (len - o)) {
iter->err_off = o;
goto mark_invalid;
}<commit_title>[PATCH] Fix for CVE-2018-16790 -- Verify bounds before binary length<commit_description><fixed_code>
me... |
<vulnerable_code> 12,
BSON_VALIDATE_NONE,
"corrupt BSON");
/* DBRef validation */
b = BCON_NEW ("my_dbref",<commit_title>[PATCH] Fix for CVE-2018-16790 -- Verify bounds before binary length<commit_description><fixed_code>
12,
... |
<vulnerable_code>/*******************************************************************************
* Copyright (c) 1998, 2020 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
if (NULL != constantPoolOop... |
<vulnerable_code>/*******************************************************************************
* Copyright (c) 1991, 2020 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
stringRef = vmStruct->javaV... |
<vulnerable_code> caplen = pcap_ph.caplen;
}
/* check to make sure timestamps don't go backwards */
if (last_sec > 0 && last_usec > 0) {
if ((pcap_ph.ts.tv_sec == last_sec) ?
}
close(fd);
continue;
... |
<vulnerable_code> appendDynamic(dctx->dp, &b, 1);
}
static int dynamicGetbuf(gdIOCtxPtr ctx, void *buf, int len)
{
int rlen, remain;
dctx = (dpIOCtxPtr) ctx;
dp = dctx->dp;
remain = dp->logicalSize - dp->pos;
if(remain >= len) {
rlen = len;
} else {
if(remain <= 0) {
/* 2.0.34: EOF is incorrect. We use 0... |
<vulnerable_code> int height = im->sy;
uint32 *buffer;
uint32 rgba;
/* switch off colour merging on target gd image just while we write out
* content - we want to preserve the alpha data until the user chooses
return GD_FAILURE;
}
TIFFReadRGBAImage(tif, width, height, buffer, 0);
for(y = 0; y < height; y++... |
<vulnerable_code><commit_title>[PATCH] Fix invalid read in gdImageCreateFromTiffPtr()<commit_description>tiff_invalid_read.tiff is corrupt, and causes an invalid read in
gdImageCreateFromTiffPtr(), but not in gdImageCreateFromTiff(). The culprit
is dynamicGetbuf(), which doesn't check for out-of-bound reads. In this ca... |
<vulnerable_code>}
void APar_ExtractDetails(FILE *isofile, uint8_t optional_output) {
char uint32_buffer[5];
Trackage track = {0};
AtomicInfo *mvhdAtom = APar_FindAtom("moov.mvhd", false, VERSIONED_ATOM, 0);<commit_title>[PATCH] Avoid stack overflow<commit_description>refs: https://github.com/wez/atomicparsley/... |
<vulnerable_code>module.exports = {
extends: [require.resolve('@backstage/cli/config/eslint.backend')],
ignorePatterns: ['sample-templates/'],
rules: {
'no-console': 0, // Permitted in console programs
'new-cap': ['error', { capIsNew: false }], // Because Express constructs things e.g. like 'const r = exp... |
<vulnerable_code>__version__ = '0.7.1'<commit_title>[PATCH] Issue #183 Potential Heap-based Buffer Overflow<commit_description><fixed_code>
__version__ = '0.7.2' |
<vulnerable_code> // full length must be multiple of body length
if (bodyLength == 0 || nFullLength % bodyLength != 0) {
Tracer::Error("Wrong data length in Explicit. Needed=%d and there is %d bytes.", bodyLength, nFullLength);
}
std::string tmpStr = "";<commit_title>[PATCH] Issue #183 Potential... |
<vulnerable_code>{
struct NntpServer *nserv = data;
struct NntpData *nntp_data = NULL;
char group[LONG_STRING];
char desc[HUGE_STRING] = "";
char mod;
anum_t first, last;
if (!nserv || !line)
return 0;
if (sscanf(line, "%s " ANUM " " ANUM " %c %[^\n]", group, &last, &first, &mod, desc) < 4)
ret... |
<vulnerable_code> constants: {},
};
const REGEXP_IGNORE_KEYS = /__proto__/;
class Parser {
constructor(options = {}) {<commit_title>[PATCH] Fixed 2nd issue with prototype pollution<commit_description><fixed_code>
constants: {},
};
const REGEXP_IGNORE_KEYS = /__proto__|constructor|prototype/;
class Parser... |
<vulnerable_code>
R_API RBinJavaAttrInfo *r_bin_java_enclosing_methods_attr_new(RBinJavaObj *bin, ut8 *buffer, ut64 sz, ut64 buf_offset) {
ut64 offset = 6;
RBinJavaAttrInfo *attr = r_bin_java_default_attr_new (bin, buffer, sz, buf_offset);
if (!attr || sz < 10) {
free (attr);
R_API RBinJavaAttrInfo *r_bin_java_in... |
<vulnerable_code> * if it's meant to be encrypted, then crypt_key will be set */
if (crypt_key) {
value = note_encrypt(value,crypt_key);
r = asprintf(&sql, "UPDATE nodau set text='%s' , encrypted='true' WHERE name='%s'", value, name);
free(value);
if (r < 0)
return 1;
}else{
if (asprintf(&sql, "UPDATE n... |
<vulnerable_code> if (l) {
/* save the note */
l += 6;
if (db_update(name,l))
return 1;
/* let the user know */<commit_title>[PATCH] Use parametetrized SQL statement<commit_description>Move to parametetrized SQL statement allows using chars like "'" in
notes and also avoid sql injection<fi... |
<vulnerable_code>import org.xwiki.model.reference.EntityReference;
import org.xwiki.rendering.async.internal.AsyncRendererConfiguration;
import org.xwiki.rendering.block.Block;
import org.xwiki.rendering.syntax.Syntax;
import org.xwiki.rendering.transformation.TransformationContext;
private Block block;
priv... |
<vulnerable_code> block = PARSERUTILS.convertToInline(block, true);
}
// Create a XDOM instance for the transformation context
XDOM xdom;
if (block instanceof XDOM) {
xdom = (XDOM) block;
} else {
Block rootBlock... |
<vulnerable_code><commit_title>[PATCH] XWIKI-19856: Macro execution as any user without programming<commit_description><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 it
* u... |
<vulnerable_code>import javax.inject.Named;
import javax.inject.Singleton;
import org.xwiki.bridge.DocumentAccessBridge;
import org.xwiki.component.annotation.Component;
import org.xwiki.model.reference.DocumentReference;
import org.xwiki.model.reference.DocumentReferenceResolver;
import org.xwiki.rendering.async.Asyn... |
<vulnerable_code>package org.xwiki.rendering.internal.macro.context;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.inject.Named;
import javax.inject.Singleton;
import org.xwiki.bridge.DocumentAccessBridge;
import org.xwiki.bridge.DocumentModelBridge;
impo... |
<vulnerable_code>import java.util.Arrays;
import java.util.Collections;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.xwiki.bridge.DocumentAccessBridge;
import org.xwiki.bridge.DocumentModelBridge;
import org.xwiki.model.reference.DocumentReference;
import o... |
<vulnerable_code>
import java.io.StringReader;
import org.junit.runner.RunWith;
import org.xwiki.bridge.DocumentAccessBridge;
import org.xwiki.bridge.DocumentModelBridge;
import org.xwiki.component.util.DefaultParameterizedType;
import org.xwiki.model.reference.DocumentReference;
import org.xwiki.model.reference.Docum... |
<vulnerable_code>int main(void) {
int res;
char pushmeback = '#';
res = ioctl64(0, TIOCSTI, &pushmeback);
printf("normal TIOCSTI: %d (%m)\n", res);
res = ioctl64(0, TIOCSTI | (1UL<<32), &pushmeback);
printf("high-bit-set TIOCSTI: %d (%m)\n", res);
return res;
}<commit_title>[PATCH] tests: fix snap-seccomp... |
<vulnerable_code> return ($.cookie("compact-display") == "true");
}
function anonymizeInstanceId(instanceId) {
var tokens = instanceId.split("__");
return "instance-" + md5(tokens[1]).substring(0, 4) + ":" + tokens[2];
$("[data-nav-page=user-id]").css('display', 'inline-block');
$("[data-nav-page=user-id]... |
<vulnerable_code> return err;
}
static int sco_send_frame(struct sock *sk, struct msghdr *msg, int len)
{
struct sco_conn *conn = sco_pi(sk)->conn;
struct sk_buff *skb;
BT_DBG("sk %p len %d", sk, len);
skb = bt_skb_send_alloc(sk, len, msg->msg_flags & MSG_DONTWAIT, &err);
if (!skb)
return err;
if (memcpy_fr... |
<vulnerable_code> if (tga->bits == TGA_BPP_24) {
*tpix = gdTrueColor(tga->bitmap[bitmap_caret + 2], tga->bitmap[bitmap_caret + 1], tga->bitmap[bitmap_caret]);
bitmap_caret += 3;
} else if (tga->bits == TGA_BPP_32 || tga->alphabits) {
register int a = tga->bitmap[bitmap_caret + 3];
*tpix = gdTrueCo... |
<vulnerable_code><commit_title>[PATCH] Unsupported TGA bpp/alphabit combinations should error<commit_description><fixed_code>
/*
We test that a 8bpp TGA file will be gracefully rejected by
gdImageCreateFromTga().
*/
#include <stdio.h>
#include "gd.h"
#include "gdtest.h"
int main(int argc, char **argv)
{
gdImageP... |
<vulnerable_code> }
for (var key in source) {
if (!Object.prototype.hasOwnProperty.call(source, key)) {
continue;
}
continue;
}
if (isObjectOrArrayOrFunction(targetVal) && isObjectOrArrayOrFunction(sourceVal)) {
target[key] = _merge(targetVal, sourceVal);
} else {
targe... |
<vulnerable_code> );
expect(Object.keys(actual)).toEqual(['facet1', 'facet2']);
});<commit_title>[PATCH] fix(SearchParameters): ignore invalid parameters (#880)<commit_description>* fix(SearchParameters): ignore invalid parameters
These parameters could be used maliciously, so are explicilty not allowed in merge
*... |
<vulnerable_code> '2'
]);
});
<commit_title>[PATCH] fix(SearchParameters): ignore invalid parameters (#880)<commit_description>* fix(SearchParameters): ignore invalid parameters
These parameters could be used maliciously, so are explicilty not allowed in merge
* clearer test<fixed_code>
'2'
]);
}); |
<vulnerable_code>
expect(actual).toStrictEqual({a: ['x', 'y', 'z']});
});<commit_title>[PATCH] fix(SearchParameters): ignore invalid parameters (#880)<commit_description>* fix(SearchParameters): ignore invalid parameters
These parameters could be used maliciously, so are explicilty not allowed in merge
* clearer te... |
<vulnerable_code> l2cap_add_conf_opt(&ptr, L2CAP_CONF_RFC,
sizeof(rfc), (unsigned long) &rfc, endptr - ptr);
if (test_bit(FLAG_EFS_ENABLE, &chan->flags)) {
chan->remote_id = efs.id;
chan->remote_stype = efs.stype;
chan->remote_msdu = le16_to_cpu(efs.msdu);<commit_title>[PATCH] Bluetooth: L2CAP... |
<vulnerable_code>import mimetypes
import urllib
import collections
import pkg_resources
from PyQt5.QtCore import QUrlQuery, QUrl
import qutebrowser
from qutebrowser.config import config, configdata, configexc, configdiff
pyeval_output = ":pyeval was never called"
spawn_output = ":spawn was never called"
_HANDLERS ... |
<vulnerable_code>
"""A request interceptor taking care of adblocking and custom headers."""
from PyQt5.QtWebEngineCore import (QWebEngineUrlRequestInterceptor,
QWebEngineUrlRequestInfo)
resource_type, navigation_type))
url = info.requestUrl... |
<vulnerable_code> job.fail(QWebEngineUrlRequestJob.UrlInvalid)
return
assert job.requestMethod() == b'GET'
assert url.scheme() == 'qute'
log.misc.debug("Got request for {}".format(url.toDisplayString()))
try:
mimetype, data = qutescheme.data_for_url(ur... |
<vulnerable_code> return html.encode('UTF-8', errors='xmlcharrefreplace')
def handler(request):
"""Handler for a file:// URL.
Args:
request: QNetworkRequest to answer to.
Return:
A QNetworkReply for directories, None for files.<commit_title>[PATCH] CVE-2018-10895: Fix CSRF issues with... |
<vulnerable_code> req, proxy_error, QNetworkReply.UnknownProxyError,
self)
scheme = req.url().scheme()
if scheme in self._scheme_handlers:
result = self._scheme_handlers[scheme](req)
if result is not None:
result.setParent(s... |
<vulnerable_code>
import mimetypes
from PyQt5.QtNetwork import QNetworkReply
from qutebrowser.browser import pdfjs, qutescheme
from qutebrowser.browser.webkit.network import networkreply
from qutebrowser.utils import log, usertypes, qtutils
def handler(request):
"""Scheme handler for qute:// URLs.
Args:
... |
<vulnerable_code> """Make sure settings from qute://settings are persistent."""
args = _base_args(request.config) + ['--basedir', str(short_tmpdir)]
quteproc_new.start(args)
quteproc_new.open_path(
'qute://settings/set?option=search.ignore_case&value=always')
assert quteproc_new.get_setting('... |
<vulnerable_code> def test_dir(self, tmpdir):
url = QUrl.fromLocalFile(str(tmpdir))
req = QNetworkRequest(url)
reply = filescheme.handler(req)
# The URL will always use /, even on Windows - so we force this here
# too.
tmpdir_path = str(tmpdir).replace(os.sep, '/')
... |
<vulnerable_code>
function write (client, packet, done) {
if (client.conn.writable && (client.connecting || client.connected)) {
const result = mqtt.writeToStream(packet, client.conn)
if (!result && !client.errored && done) {
client.conn.once('drain', done)
return
}
if (done) {
setIm... |
<vulnerable_code>// Hanime
router.get('/hanime/video', require('./routes/hanime/video'));
// 篝火营地
router.get('/gouhuo/news/:category', require('./routes/gouhuo'));
router.get('/gouhuo/strategy', require('./routes/gouhuo/strategy'));
// Soul
router.get('/soul/:id', require('./routes/soul'));
router.get('/soul/posts/ho... |
<vulnerable_code>const got = require('@/utils/got');
const cheerio = require('cheerio');
module.exports = async (ctx) => {
const response = await got.get(`https://front-end-rss.now.sh/`);
const $ = cheerio.load(response.data);
const fn = Function($($('script')[1]).html() + 'return Array.isArray(LINKS_DATA)... |
<vulnerable_code>const got = require('@/utils/got');
const cheerio = require('cheerio');
const self = {
_getProfile: async (ctx) => {
const key = 'gouhuo-profile';
let profile = await ctx.cache.get(key);
if (!profile) {
const response = await got({
method: 'get',... |
<vulnerable_code>const got = require('@/utils/got');
const cache = require('./cache');
module.exports = async (ctx) => {
const category = ctx.params.category;
const tabIdMapping = {
choiceness: '1_110',
overseas: '1_108',
orignal: '1_109',
ps4: '2_5',
xboxone: '2_13',
... |
<vulnerable_code>const got = require('@/utils/got');
const cheerio = require('cheerio');
module.exports = async (ctx) => {
const baseUrl = 'https://gouhuo.qq.com';
const url = `${baseUrl}/guide`;
const response = await got({
method: 'get',
url: url,
headers: {
Referer: `... |
<vulnerable_code>const got = require('@/utils/got');
module.exports = async (ctx) => {
const id = ctx.params.id;
const response = await got.get(`https://www.heibaizhibo.com/anchorLive/${id}`);
const liveInfo = Function('const window={};' + response.data.match(/window\.__NUXT__=.*;/gm)[0] + 'return window.... |
<vulnerable_code>
const $ = cheerio.load(response.data);
const __INITIAL_STATE__ = Function(
'let window={};' +
$('*')
.html()
.match(/window\.__INITIAL_STATE__.*};/gm)[0] +
... |
<vulnerable_code>const got = require('@/utils/got');
const cheerio = require('cheerio');
const iconv = require('iconv-lite');
module.exports = async (ctx) => {
const response = await got({
url: 'https://data.163.com',
method: 'get',
responseType: 'buffer',
});
const $ = cheerio.load... |
<vulnerable_code>const got = require('@/utils/got');
const date = require('@/utils/date');
module.exports = async (ctx) => {
const url = 'https://lemon.qq.com/lab/js/source.js';
let data = (await got.get(url)).data.match(/(?<=(const list = ))(.*)(\])/gs)[0];
// eslint-disable-next-line no-eval
data =... |
<vulnerable_code> if (!MP_SETTINGS.get_as<bool>(mp::mounts_key))
{
return status_promise->set_value(
grpc::Status(grpc::StatusCode::INVALID_ARGUMENT,
"Mounts are disabled on this installation of Multipass.\n\n"
"See https://multipass.run/docs/... |
<vulnerable_code> if (op->operands[1].scale[0] == 0) {
return -1;
}
data[l++] = SEG_REG_PREFIXES[op->operands[1].regs[0]];
data[l++] = 0x8b;
data[l++] = op->operands[0].reg << 3 | 0x5;
data[l++] = offset;
data[l++] = offset >> 8;
data[l++] = offset >> 16;<commit_title>[PATCH] Fix #12242 - Cra... |
<vulnerable_code> i = 0;
if (info->attrs[NL80211_ATTR_SCAN_SSIDS]) {
nla_for_each_nested(attr, info->attrs[NL80211_ATTR_SCAN_SSIDS], tmp) {
if (request->ssids[i].ssid_len > IEEE80211_MAX_SSID_LEN) {
err = -EINVAL;
goto out_free;
}
memcpy(request->ssids[i].ssid, nla_data(attr), nla_len(attr));
req... |
<vulnerable_code>#include "expr-bison.h"
#include "expr-flex.h"
#include "smt.h"
#include <linux/kernel.h>
#include <linux/zalloc.h>
#include <ctype.h>
return NULL;
ctx->ids = hashmap__new(key_hash, key_equal, NULL);
ctx->runtime = 0;
return ctx;<commit_title>[PATCH] perf expr: Fix missing check for return value... |
<vulnerable_code> char *buf = NULL;
size_t sz = 0;
if (BATatoms[res->vtype].atomNull &&
BATatoms[res->vtype].atomCmp(VALget(res), BATatoms[res->vtype].atomNull) == 0)
return GDKstrdup("\"nil\"");
bool use_external = true;<commit_title>[PATCH] fixes and tests for bugs #7380 and #7384 sql.claim has schema<commit... |
<vulnerable_code> q= updated[j];
if(q && getModuleId(q) == sqlRef && isUpdateInstruction(q)){
int c = getFunctionId(q) == claimRef; /* claim has 2 results */
if ( strcmp(getVarConstant(mb,getArg(q,2+c)).val.sval, sch) == 0 &&
strcmp(getVarConstant(mb,getArg(q,3+c)).val.sval, tbl) == 0 ){
... |
<vulnerable_code> if (size < 4)
throw Error(kerCorruptedMetadata);
uint32_t o = getULong(pData + size - 4, byteOrder);
if ( o+2 > size )
throw Error(kerCorruptedMetadata);
uint16_t count = getUShort(pData + o, byteOrder);
#ifdef DEBUG
<<", " << co... |
<vulnerable_code><commit_title>[PATCH] Avoid integer overflow.<commit_description><fixed_code>
# -*- coding: utf-8 -*-
from system_tests import CaseMeta, path
class IntegerOverflowInCiffDirectoryReadDirectory(metaclass=CaseMeta):
"""
Regression test for the bug described in:
https://github.com/Exiv2/exiv... |
<vulnerable_code> bufsize_t cell_matched = 1, pipe_matched = 1, offset;
int expect_more_cells = 1;
int row_end_offset = 0;
row = (table_row *)parser->mem->calloc(1, sizeof(table_row));
row->n_columns = 0;
++cell->internal_offset;
}
row->n_columns += 1;
row->cells = cmark_llist_appen... |
<vulnerable_code> return 0;
}
/*
* Later we can get more picky about what "in core" means precisely.
* For now, simply check to see if the page is in the page cache,
* and is up to date; i.e. that no page-in operation would be required
* at this time if an application were to map and access this page.
*/
static u... |
<vulnerable_code> });
}
function flexibleAddSighting(clicked, type, attribute_id, event_id, value, page, placement) {
var $clicked = $(clicked);
var hoverbroken = false;
$clicked.off('mouseleave.temp').on('mouseleave.temp', function() {<commit_title>[PATCH] fix: [security] Fixed presistent xss in the si... |
<vulnerable_code> self.assertEqual("pyth\xf6n.org".encode("idna"), b"xn--pythn-mua.org")
self.assertEqual("pyth\xf6n.org.".encode("idna"), b"xn--pythn-mua.org.")
def test_stream(self):
r = codecs.getreader("idna")(io.BytesIO(b"abc"))
r.read(3)<commit_title>[PATCH] [3.7] gh-98433: Fix... |
<vulnerable_code> if (ret == 0)
break;
}
if (preferred_mech_type == GSS_C_NO_OID) {
HEIMDAL_MUTEX_unlock(&ctx->ctx_id_mutex);
free_NegotiationToken(&nt);
return ret;
}
ctx->preferred_mech_type = preferred_mech_type;
}
/*<commit_title>[PATCH] spnego: CVE-2021-44758 send_reject when no ... |
<vulnerable_code> m_eKeyLength = static_cast<PdfKeyLength>(length);
m_keyLength = length / 8;
m_EncryptMetadata = encryptMetadata;
std::memcpy(m_oValue, oValue.GetRawData().data(), 32);
std::memcpy(m_uValue, uValue.GetRawData().data(), 32);
// Init buffers
std::memset(m_rc4key, 0, 16);<commi... |
<vulnerable_code> geometry_info;
flags=ParseGeometry(image_info->density,&geometry_info);
image->resolution.x=geometry_info.rho;
image->resolution.y=geometry_info.sigma;
if ((flags & SigmaValue) == 0)
image->resolution.y=image->resolution.x;
}
if (image_info->page != (char ... |
<vulnerable_code> int rid = 0;
if(sync_reply) {
CRM_LOG_ASSERT(client_obj->request_id);
rid = client_obj->request_id;
client_obj->request_id = 0;
crm_trace("Sending response %d to %s %s",
rid, client_obj->name, from_peer?"(originato... |
<vulnerable_code> CRM_CHECK(client != NULL, return TRUE);
CRM_CHECK(update_msg != NULL, return TRUE);
if (client->ipc == NULL) {
crm_warn("Skipping client with NULL channel");
return FALSE;
}<commit_title>[PATCH] High: core: Internal tls api improvements for reuse with<commit_description... |
<vulnerable_code># endif
#endif
#ifdef HAVE_DECL_NANOSLEEP
# include <time.h>
#endif
extern int remote_tls_fd;
extern gboolean cib_shutdown_flag;
#ifdef HAVE_GNUTLS_GNUTLS_H
# define DH_BITS 1024
gnutls_dh_params dh_params;
extern gnutls_anon_server_credentials anon_cred_s;
static void
debug_log(int level, const ... |
<vulnerable_code>#ifdef HAVE_GNUTLS_GNUTLS_H
# undef KEYFILE
# include <gnutls/gnutls.h>
extern gnutls_anon_client_credentials anon_cred_c;
extern gnutls_session *create_tls_session(int csock, int type);
const int kx_prio[] = {
GNUTLS_KX_ANON_DH,
0
};
#else
typedef void gnutls_session;
#endif
gnutls_ses... |
<vulnerable_code> source->trigger = FALSE;
if (source->id > 0) {
g_source_remove(source->id);
}
return TRUE;
}<commit_title>[PATCH] High: core: Internal tls api improvements for reuse with<commit_description><fixed_code>
source->trigger = FALSE;
if (source->id > 0) {
g_source_remo... |
<vulnerable_code>#include <sys/stat.h>
#include <unistd.h>
#include <sys/socket.h>
#include <netinet/ip.h>
#include <stdlib.h>
#include <errno.h>
#endif
#ifdef HAVE_GNUTLS_GNUTLS_H
const int tls_kx_order[] = {
GNUTLS_KX_ANON_DH,
GNUTLS_KX_DHE_RSA,
GNUTLS_KX_DHE_DSS,
0
};
gnutls_anon_client_credentia... |
<vulnerable_code> if (rc == pcmk_ok) {
rc = cib->cmds->set_connection_dnotify(cib, mon_cib_connection_destroy);
if (rc == -EPROTONOSUPPORT) {
print_as("Notification setup failed, won't be able to reconnect after failure");
if (as_console... |
<vulnerable_code> int depth = -1;
int want = 0;
int base = fdt_off_dt_struct(fdt);
end = path;
*end = '\0';
tag = fdt_next_tag(fdt, offset, &nextoffset);
stop_at = nextoffset;
switch (tag) {
case FDT_PROP:
include = want >= 2;
if (depth == FDT_MAX_DEPTH)
return -FDT_ERR_BADSTRUCTURE;
name = f... |
<vulnerable_code>//fgnass.github.com/spin.js#v2.0.0
!function(a,b){"object"==typeof exports?module.exports=b():"function"==typeof define&&define.amd?define(b):a.Spinner=b()}(this,function(){"use strict";function a(a,b){var c,d=document.createElement(a||"div");for(c in b)d[c]=b[c];return d}function b(a){for(var b=1,c=ar... |
<vulnerable_code>mxscript(drawDevUrl + 'js/deflate/pako.min.js');
mxscript(drawDevUrl + 'js/deflate/base64.js');
mxscript(drawDevUrl + 'js/jscolor/jscolor.js');
mxscript(drawDevUrl + 'js/sanitizer/sanitizer.min.js');
mxscript(drawDevUrl + 'js/rough/rough.min.js');
mxscript(drawDevUrl + 'js/freehand/perfect-freehand.js'... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.