text stringlengths 79 3.72M |
|---|
<vulnerable_code> ogs_log_print(OGS_LOG_TRACE, "%s", json);
item = cJSON_Parse(json);
if (!item) {
ogs_error("JSON parse error");
return OGS_ERROR;
}
data = multipart_parser_get_data(parser);
ogs_assert(data);
if (at && length) {
SWITCH(data->header_field)
CA... |
<vulnerable_code> OpenAPI_n2_info_content_t *n2InfoContent = NULL;
OpenAPI_ref_to_binary_data_t *ngapData = NULL;
ogs_assert(stream);
ogs_assert(recvmsg);
ogs_error("No smInfo");
return OGS_ERROR;
}
n2InfoContent = smInfo->n2_info_content;
if (!n2InfoCont... |
<vulnerable_code>
void gf_bt_check_line(GF_BTParser *parser)
{
while (1) {
switch (parser->line_buffer[parser->line_pos]) {
case ' ':
case '\t':
case '\r':
parser->line_pos++;
continue;
default:
break;
}
break;
}
if (parser->line_buffer[parser->line_pos]=='#') {
parser->line_size = parser->... |
<vulnerable_code> tar.extractfile(t).read()
def test_length_zero_header(self):
with self.assertRaisesRegex(tarfile.ReadError, "file could not be opened successfully"):
with tarfile.open(support.findfile('recursion.tar')) as tar:
tar.getmembers()<commit_title>[... |
<vulnerable_code>
import javax.servlet.http.HttpSession;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.codehaus.jackson.map.ObjectMapper;
public String post(PageModel model, @ModelAttribute(value = "appId") @BindParams UserApp userApp,
@RequestPara... |
<vulnerable_code> skip_over_comment,
skip_over_whitespace,
read_block_backwards,
read_previous_line,
)
from PyPDF2.errors import PdfStreamError
<commit_title>[PATCH] flake8<commit_description><fixed_code>
skip_over_comment,
skip_over_whitespace,
read_block_backwards,
)
from PyPDF2.errors impo... |
<vulnerable_code> Pebkac,
UnrecvEOF,
alltrace,
atomic_move,
exclude_dotfiles,
fsenc,
self.reply(b"", 301, headers=h)
return True
static_path = os.path.join(self.E.mod, "web/", self.vpath[5:])
return self.tx_file(static_path)
if "cf... |
<vulnerable_code> ieee80211_tx(sdata, sta, skb, false);
}
bool ieee80211_parse_tx_radiotap(struct sk_buff *skb,
struct net_device *dev)
{
struct ieee80211_radiotap_header *rthdr =
(struct ieee80211_radiotap_header *) skb->data;
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
struct ieee80211_supporte... |
<vulnerable_code> (void) close(unique_file);
(void) RelinquishUniqueFileResource(read_info->filename);
read_info=DestroyImageInfo(read_info);
(void) CloseBlob(pwp_image);
pwp_image=DestroyImage(pwp_image);
if (EOFBlob(image) != MagickFalse)
{
char<commit_title>[PATCH] Prevent memory use after fre... |
<vulnerable_code>void LanLinkProvider::dataReceived()
{
QSslSocket* socket = qobject_cast<QSslSocket*>(sender());
#if QT_VERSION < QT_VERSION_CHECK(5,7,0)
if (!socket->canReadLine())
return;<commit_title>[PATCH] Limit identity packets to 8KiB<commit_description>Healthy identity packages shouldn't be tha... |
<vulnerable_code>import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Locale;
import org.glassfish.grizzly.utils.Charsets;
private StandardContext context = null;
// ------------------------------------------------------------- Properties
if (rv.indexOf("./")... |
<vulnerable_code> String path2 = "/app/./some/./something/./my.jsp";
String path3 = "./my.jsp";
String path4 = "../app/WEB-INF/web.xml";
String result = standardContextValve.normalize(path1);
result = standardContextValve.normalize(path4);
assertEquals("/WEB-INF", resul... |
<vulnerable_code>
private StandardContext context = null;
private static final Pattern PATTERN_META_INF = Pattern.compile("../*/META-INF/*");
private static final Pattern PATTERN_WEB_INF = Pattern.compile("../*/WEB-INF/*");
// ------------------------------------------------------------- Properties
... |
<vulnerable_code> this.maxTokens = maxTokens;
this.maxWhitespaceTokens = maxWhitespaceTokens;
this.whenMaxTokensExceeded = whenMaxTokensExceeded;
// we only have 3 channels - but they are 0,2 and 3 so use 5 for safety - still faster than a map get/put
this.channelCounts = new int[... |
<vulnerable_code> public void logout(ServletRequest request)
{
attemptLogoutRedirect(request);
super.logout(request);
HttpServletRequest httpRequest = (HttpServletRequest)request;
HttpSession session = httpRequest.getSession(false);
}
/**
* This will attempt to redir... |
<vulnerable_code> throw new AuthenticationException("Authorized party claim value should be the client_id");
// Check that the ID token has not expired by checking the exp claim.
long expiry = (Long)claims.get("exp");
long currentTimeSeconds = (long)(System.currentTimeMillis() / 1000... |
<vulnerable_code> {
if (!(user.getUserPrincipal() instanceof OpenIdUserPrincipal))
return false;
return loginService == null || loginService.validate(user);
}
<commit_title>[PATCH] respect idToken expiry for lifetime of login<commit_description>Signed-off-by: Lachlan Roberts <lachlan... |
<vulnerable_code>
import org.eclipse.jetty.client.HttpClient;
import org.eclipse.jetty.client.api.ContentResponse;
import org.eclipse.jetty.http.HttpStatus;
import org.eclipse.jetty.security.AbstractLoginService;
import org.eclipse.jetty.security.ConstraintMapping;
import static org.hamcrest.Matchers.equalTo;
import st... |
<vulnerable_code> private String provider;
private User preAuthedUser;
private final CounterStatistic loggedInUsers = new CounterStatistic();
public static void main(String[] args) throws Exception
{
addBean(server);
}
public void join() throws InterruptedException
{
ser... |
<vulnerable_code>
internals.isFileHidden = function (path) {
return /^\./.test(Path.basename(path));
};
<commit_title>[PATCH] Don't allow files in hidden directories to be served<commit_description><fixed_code>
internals.isFileHidden = function (path) {
return /(^|[\\\/])\.([^\\\/]|[\\\/]?$)/.test(path); ... |
<vulnerable_code> });
});
it('returns the index when found in hidden folder', function (done) {
var server = provisionServer({ files: { relativeTo: __dirname } });
server.route({ method: 'GET', path: '/{path*}', handler: { directoryTest: { path: './directory/.dot' } } });
});
... |
<vulnerable_code> content = nodes[i].allTextContent();
}
itemElement.appendChild(colorBox);
itemElement.appendChild(new Element('span').update(content));
if (nodes[i].startDate)... |
<vulnerable_code> if (data["description"].length)
msg += "\n\n" + data["description"];
window.alert(msg);
showSelectDialog(data["summary"], _('Snooze for '),
{ '5': _('5 minutes'),
'10': _('10 minutes'),
... |
<vulnerable_code>ogBuildingsFootprintSlider.noUiSlider.on("end", update_filter);
function update_filter(msg) {
var num_filtered_clusters = 0;
if (selectedState != "init") {
var [filtered_centroids_keys, total_clusters] = filter_settlements_ids();
set_filtered_centroids_keys(filtered_centroids... |
<vulnerable_code> }
s->diff_start = get_bits(&gb, 8);
s->diff_height = get_bits(&gb, 8);
av_log(avctx, AV_LOG_DEBUG,
"%dx%d diff start %d height %d\n",
i, j, s->diff_start, s->diff_heigh... |
<vulnerable_code><commit_title>[PATCH] ACPI: Split out custom_method functionality into an own<commit_description><fixed_code>
/*
* debugfs.c - ACPI debugfs interface to userspace.
*/
#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/uaccess.h>
#include <linux/debugfs.h>
#in... |
<vulnerable_code> */
#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/uaccess.h>
#include <linux/debugfs.h>
#include <acpi/acpi_drivers.h>
ACPI_MODULE_NAME("debugfs");
struct dentry *acpi_debugfs_dir;
static struct dentry *cm_dentry;
/* /sys/kernel/debug/acpi/custom_method... |
<vulnerable_code>// @Produce application/json
// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
// @Router /autoCode/getDatabase [get]
export const getDB = () => {
return service({
url: '/autoCode/getDB',
method: 'get'
})
}
<commit_title>[PATCH 1/2] auto_code_oracle<commit_descriptio... |
<vulnerable_code> description:
- Path the save the archived container. If the path does not exist
the archive method will attempt to create it.
default: /tmp
archive_compression:
choices:
- gzip
import subprocess
import tempfile
# Ensure that the d... |
<vulnerable_code>package io.dropwizard.validation.selfvalidating;
import javax.validation.ConstraintValidatorContext;
/**
* This class is a simple wrapper around the ConstraintValidatorContext of hibernate validation.
* It collects all the violations of the SelfValidation methods of an object.
*/
public class Viol... |
<vulnerable_code>import static org.assertj.core.api.Assertions.assertThat;
public class SelfValidationTest {
private static final String FAILED = "failed";
@SelfValidating
public static class FailingExample {
@SelfValidation
public void validateFail(ViolationCollector col) {
c... |
<vulnerable_code> return mappingorseq
class BaseCache(object):
"""Baseclass for the cache systems. All the cache systems implement this
API or a superset of it.<commit_title>[PATCH] Pass serializer args to the parent class<commit_description><fixed_code>
return mappingorseq
def extract_serializer_ar... |
<vulnerable_code>import tempfile
from time import time
from flask_caching.backends.base import BaseCache
logger = logging.getLogger(__name__)
mode=0o600,
hash_method=hashlib.md5,
ignore_errors=False,
):
super(FileSystemCache, self).__init__(default_timeout)
self._path = ca... |
<vulnerable_code>"""
from time import time
from flask_caching.backends.base import BaseCache, iteritems_wrapper
_test_memcached_key = re.compile(r"[^\x00-\x21\xff]{1,250}$").match
different prefix.
"""
def __init__(self, servers=None, default_timeout=300, key_prefix=None):
sup... |
<vulnerable_code> :copyright: (c) 2010 by Thadeus Burgess.
:license: BSD, see LICENSE for more details.
"""
from flask_caching.backends.base import BaseCache, iteritems_wrapper
class RedisCache(BaseCache):
key_prefix=None,
**kwargs
):
super().__init__(default_timeout)
if hos... |
<vulnerable_code>import logging
from time import time
from flask_caching.backends.base import BaseCache
logger = logging.getLogger(__name__)
``False``.
"""
def __init__(self, threshold=500, default_timeout=300, ignore_errors=False):
super(SimpleCache, self).__init__(default... |
<vulnerable_code>"""
import platform
from flask_caching.backends.base import BaseCache
class UWSGICache(BaseCache):
you only have to provide the name of the cache.
"""
def __init__(self, default_timeout=300, cache=""):
super(UWSGICache, self).__init__(default_timeout)
if platform.py... |
<vulnerable_code>__cold void io_uring_show_fdinfo(struct seq_file *m, struct file *f)
{
struct io_ring_ctx *ctx = f->private_data;
struct io_sq_data *sq = NULL;
struct io_overflow_cqe *ocqe;
struct io_rings *r = ctx->rings;
unsigned int sq_mask = ctx->sq_entries - 1, cq_mask = ctx->cq_entries - 1;
unsigned int cq... |
<vulnerable_code> return 1;
}
/*
* The exit handlers return 1 if the exit was handled fully and guest execution
* may resume. Otherwise they set the kvm_run parameter to indicate what needs
[EXIT_REASON_MWAIT_INSTRUCTION] = handle_mwait,
[EXIT_REASON_MONITOR_INSTRUCTION] = handle_monitor,
[EXIT_REASON_... |
<vulnerable_code> if (/* Local idle, and Peer request then complete the Peer procedure
* with response.
*/
((conn->llcp_length.req == conn->llcp_length.ack) &&
(pdu_rx->llctrl.opcode == PDU_DATA_LLCTRL_TYPE_LENGTH_REQ)) ||
/* or Local has active... */
((conn->llcp_length.req != conn->ll... |
<vulnerable_code> */
if (param->value) {
priv->tkip_cm_active = 1;
ret = hermes_enable_port(hw, 0);
} else {
priv->tkip_cm_active = 0;
ret = hermes_disable_port(hw, 0);
}
break;
<commit_title>[PATCH] orinoco: fix TKIP countermeasure behaviour<commit_description>Enable the port when disabling count... |
<vulnerable_code> def _parse(self, err):
all_hosts = {}
self.raw = utils.parse_json(self.data)
all = Group('all')
groups = dict(all=all)
group = None<commit_title>[PATCH] When parsing json from untrusted sources, remove templating<commit_description><fixed_code>... |
<vulnerable_code> cmd2 = conn.shell.remove(tmp, recurse=True)
self._low_level_exec_command(conn, cmd2, tmp, sudoable=False)
data = utils.parse_json(res['stdout'])
if 'parsed' in data and data['parsed'] == False:
data['msg'] += res['stderr']
return Retu... |
<vulnerable_code> self.diff = diff
if type(self.result) in [ str, unicode ]:
self.result = utils.parse_json(self.result)
if self.host is None:
raise Exception("host not set")<commit_title>[PATCH] When parsing json from untrusted sources, remove templating<commit_descrip... |
<vulnerable_code>
return json.loads(data)
def parse_json(raw_data):
''' this version for module return data only '''
orig_data = raw_data
data = filter_leading_non_json_lines(raw_data)
try:
return json.loads(data)
except:
# not JSON, but try "Baby JSON" which allows many of ou... |
<vulnerable_code>
FILTER_PLUGINS = None
_LISTRE = re.compile(r"(\w+)\[(\d+)\]")
JINJA2_OVERRIDE='#jinja2:'
def lookup(name, *args, **kwargs):
from ansible import utils
except:
raise errors.AnsibleError("unable to read %s" % realpath)
# Get jinja env overrides from template
if data.startswith(... |
<vulnerable_code>}
END_TEST
/* Test trailing spaces in elements are accepted */
static void XMLCALL
record_element_end_handler(void *userData, const XML_Char *name) {
}
END_TEST
START_TEST(test_bad_doctype_utf16) {
const char text[] =
/* <!DOCTYPE doc [ \x06f2 ]><doc/>
tcase_add_test(tc_basic, test_ext_enti... |
<vulnerable_code> q->exit_rq_fn(q, q->fq->flush_rq);
out_free_flush_queue:
blk_free_flush_queue(q->fq);
return -ENOMEM;
}
EXPORT_SYMBOL(blk_init_allocated_queue);<commit_title>[PATCH] block: blk_init_allocated_queue() set q->fq as NULL in the<commit_description><fixed_code>
q->exit_rq_fn(q, q->fq->flush_rq);
out_f... |
<vulnerable_code> }
if (off == KVM_REG_ARM_CORE_REG(regs.pstate)) {
u32 mode = (*(u32 *)valp) & PSR_AA32_MODE_MASK;
switch (mode) {
case PSR_AA32_MODE_USR:
case PSR_AA32_MODE_FIQ:
case PSR_AA32_MODE_IRQ:
case PSR_AA32_MODE_SVC:
case PSR_AA32_MODE_ABT:
case PSR_AA32_MODE_UND:
case PSR_MODE_EL0t:
ca... |
<vulnerable_code>@Deprecated
public class EmailValidator extends RegexpValidator {
/**
* Creates a validator for checking that a string is a syntactically valid
* e-mail address.
* the message to display in case the value does not validate.
*/
public EmailValidator(String errorMe... |
<vulnerable_code> public void testEmailValidatorWithOkEmail() {
assertTrue(validator.isValid("my.name@email.com"));
}
}<commit_title>[PATCH] fix: Update regexp pattern of legacy EmailValidator (#12241)<commit_description>Fixes: https://github.com/vaadin/framework/issues/12240<fixed_code>
public void ... |
<vulnerable_code> // Chrome version does not necessarily match the desired version
// because of auto updates...
browserIdentifier = getExpectedUserAgentString(
getDesiredCapabilities()) + "87";
} else if (BrowserUtil.isFirefox(getDesiredCapabilities())) {
... |
<vulnerable_code>import asyncio
from contextlib import contextmanager
import time
import json
import traceback
except IndexError:
content_type = ""
if "text/html" in content_type and b"</body>" in accumulated_body:
extra = json.dumps(trace_info, in... |
<vulnerable_code> ) as client:
response = client.get("/?_sort=relationships")
assert response.status == 200<commit_title>[PATCH] Correctly escape output of ?_trace, refs #1360<commit_description><fixed_code>
) as client:
response = client.get("/?_sort=relationships")
assert respon... |
<vulnerable_code>
# Check bidi
RandAL = [stringprep.in_table_d1(x) for x in label]
for c in RandAL:
if c:
# There is a RandAL char in the string. Must perform further
# This is table C.8, which was already checked
# 2) If a string contains any RandALCat character,... |
<vulnerable_code>import io
import locale
import sys
import unittest
import encodings
from unittest import mock
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.ge... |
<vulnerable_code> break;
length=ExportQuantumPixels(image,(const CacheView *) NULL,quantum_info,
quantum_type,pixels,&image->exception);
count=WriteBlob(image,extent,pixels);
if (count != (ssize_t) length)
break;
status=SetImageProgress(image,SaveImageTag,(MagickOffsetType) y,
ima... |
<vulnerable_code> HttpRequestBase httpRequest;
if (message instanceof CustomWebhookMessage) {
CustomWebhookMessage customWebhookMessage = (CustomWebhookMessage) message;
uri = buildUri(customWebhookMessage.getUrl(), customWebhookMessage.getScheme(), customWebhookMessage.getHost(),... |
<vulnerable_code>
package com.amazon.opendistroforelasticsearch.alerting.destination.message;
import org.elasticsearch.common.Strings;
/**
* This class holds the generic parameters required for a
* message.
return url;
}
}<commit_title>[PATCH] Support deny list for destinations<commit_description><fixe... |
<vulnerable_code>import org.apache.http.client.methods.HttpPut;
import org.elasticsearch.common.Strings;
import java.util.Map;
/**
return headerParams;
}
}<commit_title>[PATCH] Support deny list for destinations<commit_description><fixed_code>
import org.apache.http.client.methods.HttpPut;
import org.ela... |
<vulnerable_code> uint64_t l;
int digit;
l = 0;
digit = *p - '0';
while (digit >= 0 && digit < 10 && char_cnt-- > 0) {
{
int64_t l;
int digit;
l = 0;
while (char_cnt-- > 0) {
if (*p >= '0' && *p <= '7')<commit_title>[PATCH] Do something sensible for empty strings to make fuzzers<commit_description>... |
<vulnerable_code>
// Entities should not be translated into "undefined"
expect(i18n.lmd('https://commons.wikimedia.org/wiki/File:HK_WCD_WC_%E7%81%A3%E4%BB%94_Wan_Chai_%E8%BB%92%E5%B0%BC%E8%A9%A9%E9%81%93_Hennessy_Road_tram_body_ads_Tsingtao_Brewery_August_2021_SS2.jpg'))
.toBe('<a href="https://commons.wikimedi... |
<vulnerable_code>import Emojis from '../js/Emojis';
import XRegExp from 'xregexp';
import Reactive from '../js/Reactive';
import {api} from '../js/Api';
import {derived} from 'svelte/store';
import {route} from '../store/Route';
const RE = {};
const STOP = ' ,.:;!"\'';
const XML_ESCAPE = {'&': '&', '<': '<', '>... |
<vulnerable_code> Decodes an AMF0 stream.
"""
def buildContext(self):
return Context()
def getTypeFunc(self, data):
# great for coverage, sucks for readability
Read XML.
"""
data = self.readLongString()
root = xml.fromstring(data)
self.context.ad... |
<vulnerable_code> @type classes: C{list}
"""
def __init__(self):
self.strings = codec.ByteStringReferenceCollection()
self.classes = {}
self.class_ref = {}
self.class_idx = 0
codec.Context.__init__(self)
def clear(self):
"""
codec.Decoder.__ini... |
<vulnerable_code> """
The base context for all AMF [de|en]coding.
@ivar extra: The only public attribute. This is a placeholder for any extra
contextual data that required for different adapters.
@type extra: C{dict}
@ivar _objects: A collection of stored references to objects that have
... |
<vulnerable_code> return get_fault_class(level, **e)(**e)
def decode(stream, strict=False, logger=None, timezone_offset=None):
"""
Decodes the incoming stream as a remoting message.
pyamf.AMF0,
stream,
strict=strict,
timezone_offset=timezone_offset
)
context = decod... |
<vulnerable_code>import pyamf.xml
from pyamf import util
class _BaseTestCase(unittest.TestCase):
"""
self.assertEqual(l >> 1, b.remaining())
self.assertEqual(b.read(), xml)
def fromstring(self, xml):
return self.etree.fromstring(xml)
def tostring(self, element):
return se... |
<vulnerable_code>#: list of supported third party packages that support the C{etree}
#: interface. At least enough for our needs anyway.
ETREE_MODULES = [
'lxml.etree',
'xml.etree.cElementTree',
'cElementTree',
'xml.etree.ElementTree',
'elementtree.ElementTree'
]
#: A tuple of class/type objects th... |
<vulnerable_code> Returns a list of dependencies for PyAMF to function correctly on the
target platform.
"""
install_requires = []
if sys.version_info < (2, 5):
install_requires.extend(["elementtree>=1.2.6", "uuid>=1.30"])<commit_title>[PATCH] Switch to use defusedxml as the default xml load... |
<vulnerable_code>{
static char *message = NULL;
static unsigned short len = 0;
char buff[13], *ret_msg = NULL;
register unsigned char i;
unsigned char blen;<commit_title>[PATCH] Fix double-free/OOB-write while receiving IPC data<commit_description>If a malicious client pretends to be the E17 window manager, it is... |
<vulnerable_code><commit_title>[PATCH] adding patch for found security bug<commit_description><fixed_code>
|
<vulnerable_code> gettimeofday(&tv, NULL);
long time = (tv.tv_sec * 1000) + (tv.tv_usec / 1000);
return time;
}<commit_title>[PATCH] code style update<commit_description><fixed_code>
gettimeofday(&tv, NULL);
long time = (tv.tv_sec * 1000) + (tv.tv_usec / 1000);
return time;
}
|
<vulnerable_code>import sys
import datetime
from functools import wraps
from werkzeug.utils import secure_filename
from werkzeug.security import generate_password_hash, check_password_hash
from flask import Flask, request, jsonify, render_template, flash, redirect, url_for, session, send_file, make_response
from flask_... |
<vulnerable_code>
if (isObject(target) && isObject(source)){
for (const key in source){
if (isObject(source[key])){
if (!target[key]) {
Object.assign(target, {[key]: {}});
}
}
return nestedObjectAssign(target, ...sources);
}<commit_tit... |
<vulnerable_code> expect(JSON.stringify(nestedObjectAssign({}, mockData.default, mockData.first, mockData.second))).to.be.equal(JSON.stringify(expectedData));
});
});
});<commit_title>[PATCH] Security fix for Prototype Pollution<commit_description><fixed_code>
expect(JSON.stringify(ne... |
<vulnerable_code> return array;
}
function prepareComponents(frame) {
var maxH = 0, maxV = 0;
var component, componentId;
for (componentId in frame.components) {
if (frame.components.hasOwnProperty(componentId)) {
var h = data[offset + 1] >> 4;
... |
<vulnerable_code> return fs.readFileSync(path.join(__dirname, 'fixtures', name));
}
const SUPER_LARGE_JPEG_BASE64 =
'/9j/wJ39sP//DlKWvX+7xPlXkJa9f7v8DoDVAAD//zb6QAEAI2cBv3P/r4ADpX8Jf14AAAAAgCPE+VeQlr1/uwCAAAAVALNOjAGP2lIS';
const SUPER_LARGE_JPEG_BUFFER = Buffer.from(SUPER_LARGE_JPEG_BASE64, 'base64');
it('should... |
<vulnerable_code>
// https://github.com/jonschlinkert/assign-deep/commit/90bf1c551d05940898168d04066bbf15060f50cc
var isValidKey = function (key) {
return key !== '__proto__' && key !== 'constructor' && key !== 'prototype';
};
var setPath = function (obj, path, value, delimiter) {<commit_title>[PATCH] fix new protot... |
<vulnerable_code> return {
nested: {
thing: {
foo: 'bar'
},
is: {
cool: true
}
},
dataUndefined: undefined,
dataDate: now,
dataNumber: 42,
dataString: 'foo',
dataNull: null,
dataBoolean: true
};
};
expect(setPath(true, 'a', 42)).toEqual({ a... |
<vulnerable_code> proc->pr_WindowPtr = (APTR)-1L;
# endif
if (first == TRUE)
{
// copy file name into NameBuff, expanding environment variables
int c;
# if defined(FEAT_FIND_ID) && defined(FEAT_EVAL)
char_u *tofree = NULL;
if ((options & FNAME_INCL) && *curbuf->b_p_inex != NUL)
{
tofree ... |
<vulnerable_code> *pp = ml_get_pos(&VIsual);
*lenp = curwin->w_cursor.col - VIsual.col + 1;
}
if (has_mbyte)
// Correct the length to include the whole last character.
*lenp += (*mb_ptr2len)(*pp + (*lenp - 1)) - 1;
}
reset_VIsual_and_resel();<commit_title>[PATCH] patch 8.2.3611: crash when ... |
<vulnerable_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
3610,
/**/<commit_title>[PATCH] patch 8.2.3611: crash when using CTRL-W f without finding a<commit_description><fixed_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
3... |
<vulnerable_code>
})();
/*! @license DOMPurify 2.3.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.3/LICENSE */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==ty... |
<vulnerable_code>!function(u,D){"object"==typeof exports&&"undefined"!=typeof module?module.exports=D():"function"==typeof define&&define.amd?define(D):u.JSON5=D()}(this,function(){"use strict";function u(u,D){return u(D={exports:{}},D.exports),D.exports}var D=u(function(u){var D=u.exports="undefined"!=typeof window&&w... |
<vulnerable_code>
function isArray(val) { return Object.prototype.toString.call(val) == "[object Array]" }
function getModeConf(editor) {
return editor.getModeAt(editor.getCursor()).config || CodeMirror.resolveMode("text/x-sql")
}
function getKeywords(editor) {
return getModeConf(editor).keywords || [... |
<vulnerable_code> lock.setAttribute("tabindex", "0");
var lockWrap = elt("div", [lock], "CodeMirror-merge-scrolllock-wrap");
CodeMirror.on(lock, "click", function() { setScrollLock(dv, !dv.lockScroll); });
CodeMirror.on(lock, "keyup", function(e) { e.key === "Enter" && setScrollLock(dv, !dv.lockScroll); ... |
<vulnerable_code> }
function disableBrowserMagic(field, spellcheck, autocorrect, autocapitalize) {
field.setAttribute("autocorrect", autocorrect ? "" : "off");
field.setAttribute("autocapitalize", autocapitalize ? "" : "off");
field.setAttribute("spellcheck", !!spellcheck);
}
else { te.setAttribu... |
<vulnerable_code> name: "clike",
keywords: words("abstract as async await base break case catch checked class const continue" +
" default delegate do else enum event explicit extern finally fixed for" +
" foreach goto if implicit in interface internal is lock namespace new... |
<vulnerable_code> "def", "del", "elif", "else", "except", "finally",
"for", "from", "global", "if", "import",
"lambda", "pass", "raise", "return",
"try", "while", "with", "yield", "in"];
var commonBuiltins = ["abs", "all", ... |
<vulnerable_code> " [keyword pass]",
" [keyword else]:",
" [variable baz]()")
})();<commit_title>[PATCH] Update vendor libs<commit_description><fixed_code>
" [keyword pass]",
" [keyword else]:",
" [variable baz]()")
MT("dedentCase",
"[keyword match]... |
<vulnerable_code> return "number";
if (stream.match(/^\.+/))
return null
// .table_name (ODBC)
// // ref: https://dev.mysql.com/doc/refman/8.0/en/identifier-qualifiers.html
if (support.ODBCdotTable && stream.match(/^[\w\d_$#]+/))
return "variable-2";
} else if (operato... |
<vulnerable_code>/*! @license DOMPurify 2.3.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.3/LICENSE */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&d... |
<vulnerable_code>/**
* @license
* Lodash lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE
*/
;(function(){function n(n,t,r){switch(r.length){case 0:return n.call(t);case 1:return n.call(t,r[0]);case 2:return n.call(t,r[0],r[1]);case 3:return n.call(t,r[0],r[1],r[2])}return n.apply(t,r)}function t(n,... |
<vulnerable_code> except KeyError:
raise ApiError("must supply 'username' and 'password'", 401)
try:
if '\\' in login:
domain, username = login.split('\\')<commit_title>[PATCH 1/2] Do not allow LDAP login with empty password<commit_description><fixed_code>
except KeyError:
... |
<vulnerable_code> 'updateTime': self.update_time,
'_links': dict(),
'customer': self.customer
}
if self.alert:
note['_links'] = {
'alert': absolute_url('/alert/' + self.alert)<commit_title>[PATCH 1/2] Do not allow LDAP login with empty passw... |
<vulnerable_code> })
}
// If no wifi, then there is no error but cbed get's a null in second param.
exports.get_active_network_interface_name = function(cb) {
var cmd = "netstat -rn | grep UG | awk '{print $NF}'";
exec(cmd, function(err, stdout) {
if (err) return cb(err);
var raw = stdout.toString().trim... |
<vulnerable_code> checker.check_model(self.model_filename)
class TestNotAllowToLoadExternalDataOutsideModelDirectoryOnWindows(TestLoadExternalDataBase):
"""Essential test to check that onnx (validate) C++ code will not allow to load external_data outside the model
directory. """
tensor.data... |
<vulnerable_code> var h = parsed.params.headers[i].toLowerCase();
parsed.params.headers[i] = h;
var value;
if (h !== 'request-line') {
value = request.headers[h];
if (!value)
throw new MissingHeaderError(h + ' was not in the request');
} else {
value =
... |
<vulnerable_code> throw new TypeError('options.headers must be an array of Strings');
var h = options.headers[i].toLowerCase();
request.getHeader(h);
var value = request.getHeader(h);
if (!value) {
if (h === 'request-line') {
value = request.method + ' ' + request.path... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.