text stringlengths 79 3.72M |
|---|
<vulnerable_code>from .engine import engine_from_config # noqa nosort
__version__ = '1.3.0b3'
def __go(lcls):<commit_title>[PATCH] Remove all remaining text() coercions and ensure identifiers<commit_description><fixed_code>
from .engine import engine_from_config # noqa nosort
__version__ = "1.3.0b3"
def __go(... |
<vulnerable_code> _python_UUID = None
AUTOCOMMIT_REGEXP = re.compile(
r"\s*(?:UPDATE|INSERT|CREATE|DELETE|DROP|ALTER|GRANT|REVOKE|"
"IMPORT FOREIGN SCHEMA|REFRESH MATERIALIZED VIEW|TRUNCATE)",
using = index.dialect_options["postgresql"]["using"]
if using:
text += "USING %s " % ... |
<vulnerable_code>
where = None
def __init__(self, *elements, **kw):
r"""
Create an :class:`.ExcludeConstraint` object.
)
:param \*elements:
A sequence of two tuples of the form ``(column, operator)`` where
"column" is a SQL expression element or a raw SQ... |
<vulnerable_code> in order to execute the statement.
"""
clause = expression._literal_as_text(clause)
if bind is None:
bind = self.get_bind(mapper, clause=clause, **kw)<commit_title>[PATCH] Remove all remaining text() coercions and ensure identifiers<commit_description><... |
<vulnerable_code>)
LEGAL_CHARACTERS = re.compile(r"^[A-Z0-9_$]+$", re.I)
ILLEGAL_INITIAL_CHARACTERS = {str(x) for x in range(0, 10)}.union(["$"])
BIND_PARAMS = re.compile(r"(?<![:\w\$\x5c]):([\w\$]+)(?![:\w\$])", re.UNICODE)
BIND_PARAMS_ESC = re.compile(r"\x5c(:[\w\$]*)(?![:\w\$])", re.UNICODE)
else:
... |
<vulnerable_code> return element._clone()
def collate(expression, collation):
"""Return the clause ``expression COLLATE collation``.
"refer to the :meth:`.TextClause.columns` method.",
),
)
def _create_text(
self, text, bind=None, bindparams=None, typemap=None, autocommit=N... |
<vulnerable_code>from .elements import _is_column # noqa
from .elements import _labeled # noqa
from .elements import _literal_as_binds # noqa
from .elements import _literal_as_label_reference # noqa
from .elements import _literal_as_text # noqa
from .elements import _only_column_elements # noqa<commit_title>[PATC... |
<vulnerable_code>from .base import DialectKWArgs
from .base import SchemaEventTarget
from .elements import _as_truncated
from .elements import _literal_as_text
from .elements import ClauseElement
from .elements import ColumnClause
_allow_multiple_tables = True
def __init__(
self,
sqltext,
... |
<vulnerable_code>from .elements import _clone
from .elements import _cloned_difference
from .elements import _cloned_intersection
from .elements import _expand_cloned
from .elements import _interpret_as_column_or_from
from .elements import _literal_and_labels_as_label_reference
from .elements import _literal_as_label_r... |
<vulnerable_code>from .deprecations import pending_deprecation # noqa
from .deprecations import warn_deprecated # noqa
from .deprecations import warn_pending_deprecation # noqa
from .langhelpers import as_interface # noqa
from .langhelpers import asbool # noqa
from .langhelpers import asint # noqa<commit_title>[P... |
<vulnerable_code>functionality."""
import re
import textwrap
import warnings
from . import compat
from .langhelpers import decorator
from .. import exc
decorated.__doc__ = doc
decorated._sa_warn = lambda: warnings.warn(message, wtype, stacklevel=3)
return decorated
def _dedent_docstring(text):
spl... |
<vulnerable_code>import operator
import re
import sys
import types
import warnings
idx += 1
return ["".join(token) for token in result]<commit_title>[PATCH] Remove all remaining text() coercions and ensure identifiers<commit_description><fixed_code>
import operator
import re
import sys
import textwrap
imp... |
<vulnerable_code> Column(
"id",
Integer,
ForeignKey("t1.id", deferrable=True, initially="XYZ"),
primary_key=True,
),
)
schema.CreateTable(t2),
"CREATE TABLE t2 (id INTEGER NOT NULL, "
"PRIM... |
<vulnerable_code> "WITH (buffering = off)",
)
def test_create_index_with_tablespace(self):
m = MetaData()
tbl = Table("testtbl", m, Column("data", String))
"(room::TEXT WITH =)",
)
def test_exclude_constraint_cast(self):
m = MetaData()
tbl... |
<vulnerable_code>from sqlalchemy.testing import assert_raises
from sqlalchemy.testing import assert_raises_message
from sqlalchemy.testing import eq_
from sqlalchemy.testing import expect_warnings
from sqlalchemy.testing import fixtures
from sqlalchemy.testing import in_
from sqlalchemy.testing import is_
.... |
<vulnerable_code>from sqlalchemy.orm.util import with_parent
from sqlalchemy.sql import expression
from sqlalchemy.sql import operators
from sqlalchemy.testing import assert_warnings
from sqlalchemy.testing import AssertsCompiledSQL
from sqlalchemy.testing import fixtures
from sqlalchemy.testing import is_
ua =... |
<vulnerable_code> schema_translate_map=schema_translate_map,
)
class SchemaTest(fixtures.TestBase, AssertsCompiledSQL):
__dialect__ = "default"<commit_title>[PATCH] Remove all remaining text() coercions and ensure identifiers<commit_description><fixed_code>
schema_translate_map=sche... |
<vulnerable_code> ):
assert_raises_message(
sa.exc.ArgumentError,
"SQL expression object or string expected, got object of type "
"<.* 'list'> instead",
t.select,
[const],<commit_title>[PATCH] Remove all remaining text() ... |
<vulnerable_code> def test_underscores(self):
self.assert_compile(func.if_(), "if()")
def test_generic_now(self):
assert isinstance(func.now().type, sqltypes.DateTime)
<commit_title>[PATCH] Remove all remaining text() coercions and ensure identifiers<commit_description><fixed_code>
def test_... |
<vulnerable_code>from sqlalchemy.sql import table
from sqlalchemy.sql import util as sql_util
from sqlalchemy.testing import assert_raises_message
from sqlalchemy.testing import assert_warnings
from sqlalchemy.testing import AssertsCompiledSQL
from sqlalchemy.testing import eq_
from sqlalchemy.testing import expect_war... |
<vulnerable_code> 13,14,15};
sp=text[ii].text+1;
/* look for newline */
while (*sp != '\n')
sp++;
/* look for length */
while (*sp == '\0' || *sp == ' ' || *sp == '\n')
sp++;
length=(png_uint_32) StringToLong(sp);
(void) LogMagickEvent(CoderEvent,GetMagickModule(),<commit_tit... |
<vulnerable_code> else
all = TRUE;
setpcmark();
#ifdef FEAT_GUI<commit_title>[PATCH] patch 9.0.1331: illegal memory access when using :ball in<commit_description><fixed_code>
else
all = TRUE;
// Stop Visual mode, the cursor and "VIsual" may very well be invalid after
// switching to another buff... |
<vulnerable_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1330,
/**/<commit_title>[PATCH] patch 9.0.1331: illegal memory access when using :ball in<commit_description><fixed_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
133... |
<vulnerable_code>};
// Inlined partial `escape-goat` package
const escape = input => input
.replace(/&/g, '&')
.replace(/"/g, '"')
.replace(/'/g, ''')
.replace(/</g, '<')
.replace(/>/g, '>');
const escapeTag = function (input) {
let output = input[0];
for (let i = 1; i < arguments.length; i+... |
<vulnerable_code> cid = schematahash[h];
if (cid)
{
if (!memcmp(data->schemadata + data->schemata[cid], schema, len * sizeof(Id)))
return cid;
/* cache conflict, do a slow search */
for (cid = 1; cid < data->nschemata; cid++)
if (!memcmp(data->schemadata + data->schemata[cid], s... |
<vulnerable_code> sizeof(*luma));
if ((chroma1 == (unsigned char *) NULL) ||
(chroma2 == (unsigned char *) NULL) || (luma == (unsigned char *) NULL))
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
/*
Advance to image data.
*/<commit_title>[PATCH] https://github.com/ImageMagick... |
<vulnerable_code>
void Client::encryptConnection() {
boost::asio::ssl::context ctx{boost::asio::ssl::context::sslv23};
const auto remote_hostname = *client_options_.remote_hostname_;
bool verify_hostname = false;
if (client_options_.always_verify_peer_) {
ctx.set_verify_mode(boost::asio::ssl::verify_peer)... |
<vulnerable_code> if filename.endswith('.json') or filename.endswith('.jsonld'):
headers['Content-Type'] = 'application/ld+json'
with open(filename,"r") as f:
response = requests.post(url, headers=headers, data=f, verify=False)
elif filename.endswith('.bdio'):
... |
<vulnerable_code>VERSION = (0, 0, 52)
__version__ = '.'.join(map(str, VERSION))<commit_title>[PATCH] fixed use of hard-coded values for the verify parameter being<commit_description><fixed_code>
VERSION = (0, 0, 53)
__version__ = '.'.join(map(str, VERSION)) |
<vulnerable_code> config = config || {};
this.exp = new Ext.grid.RowExpander({
tpl : new Ext.Template(
'<p class="desc">{description_trans}</p>'
)
});
MODx.window.UpdateSetting.superclass.constructor.call(this,config);
};
Ext.extend(MODx.window.UpdateSetting,MODx.Window);
Ext... |
<vulnerable_code> ,'hide':{fn:function() {this.destroy();}}
}
});
w.title += ': <span dir="ltr">' + w.record.pagetitle + ' ('+ w.record.id + ')</span>';
w.setValues(r.object);
w.show(e.targ... |
<vulnerable_code> header: _('object')
,dataIndex: 'name'
,width: 300
}]
,tbar: [{
xtype: 'button'<commit_title>[PATCH 1/6] Enable remote avatars<commit_description><fixed_code>
header: _('object')
,dataIndex: 'name'
,widt... |
<vulnerable_code>Ext.namespace('MODx.util.Progress');
/**
* A JSON Reader specific to MODExt
*
* @class MODx.util.JSONReader
* @extends Ext.util.JSONReader
* @param {Object} config An object of configuration properties
Ext.reg('modx-json-reader',MODx.util.JSONReader);
/**
* @class MODx.util.Progress
*/
MODx.u... |
<vulnerable_code> path, which will be within the original buffer. Guaranteed to not
make the path longer, and will not fail. 'size' is the length of
the path, if known. If -1, the first null character will be assumed
to be the end of the path. 'normsize' will be set to contain the
length of the resulting... |
<vulnerable_code>import datetime
import os
import random
from typing import Tuple, Union, TypeVar, List, Callable
import libnacl.secret
def compose_cmd(cmd):
if os.name != 'nt':
cmd = ' '.join(cmd)
return cmd
<commit_title>[PATCH 1/5] Refactor pool upgrade handler<commit_description>- Switch order of ... |
<vulnerable_code>from typing import Optional
from indy_common.authorize.auth_actions import AuthActionAdd, AuthActionEdit
self._validate_request_type(request)
identifier, req_id, operation = get_request_data(request)
status = '*'
pkg_to_upgrade = operation.get(PACKAGE, getConfig().UPGR... |
<vulnerable_code>def test_pool_upgrade_dynamic_validation_fails_pckg(pool_upgrade_handler,
pool_upgrade_request,
tconf):
pool_upgrade_request.operation[PACKAGE] = ''
with pytest.raises(InvalidClientRequest) a... |
<vulnerable_code>from operator import itemgetter
from indy_common.util import getIndex
def test_getIndex():
items = [('a', {'key1': 1}), ('b', {'key2': 2})]
assert 0 == getIndex(containsKey('key1'), items)
assert 1 == getIndex(containsKey('key2'), items)
assert -1 == getIndex(containsKey('key3'), item... |
<vulnerable_code>def compose_cmd(cmd):
if os.name != 'nt':
cmd = ' '.join(cmd)
cmd = re.split(";|&&", cmd.splitlines()[0], 1)[0].rstrip()
return cmd
<commit_title>[PATCH 1/5] Refactor pool upgrade handler<commit_description>- Switch order of operations.
- Clean up messaging.
- Update unit tests
Si... |
<vulnerable_code> pkg_to_upgrade = operation.get(PACKAGE, getConfig().UPGRADE_ENTRY)
if not pkg_to_upgrade:
raise InvalidClientRequest(identifier, req_id, "Upgrade package name is empty")
pkg_to_upgrade = re.split(";|&&", pkg_to_upgrade.splitlines()[0], 1)[0].rstrip()
targetVe... |
<vulnerable_code>import pytest
import shutil
from common.version import DigitDotVersion
# - conditionally skip all tests for non-debian systems
# - teste _parse_version_deps_from_pkg_mgr_output deeply
generated_commands = []
@pytest.fixture
def catch_generated_commands(monkeypatch):
monkeypatch.setattr(NodeCon... |
<vulnerable_code> lambda *x: (None, None))
with pytest.raises(InvalidClientRequest) as e:
pool_upgrade_handler.dynamic_validation(pool_upgrade_request, 0)
e.match('is not installed and cannot be upgraded')
def test_pool_upgrade_dynamic_validation_fails_belong(
... |
<vulnerable_code>
@classmethod
def _get_curr_info(cls, package):
cmd = compose_cmd(['dpkg', '-s', package])
return cls.run_shell_command(cmd)
@classmethod
def _parse_deps(cls, deps: str):
ret = []<commit_title>[PATCH 1/5] Refactor pool upgrade handler<commit_description>- Switch... |
<vulnerable_code>
some_package_info = 'Package: some_package\nVersion: 1.2.3\nDepends: aaa (= 1.2.4), bbb (>= 1.2.5), ccc, aaa'
some_other_package_info = 'Package: some_other_package\nVersion: 4.5.6\nDepends: ddd (= 3.4.5), eee (>= 5.1.2), fff, ddd'
app_package_info = f'Package: {APP_NAME}\nVersion: 1.2.3\nDepends: aaa... |
<vulnerable_code> lambda *x: (None, None))
with pytest.raises(InvalidClientRequest) as e:
pool_upgrade_handler.dynamic_validation(pool_upgrade_request, 0)
e.match(f'{pool_upgrade_request.operation[PACKAGE]} is not installed and cannot be upgraded')
def test_pool_upgrade_dynamic_... |
<vulnerable_code> assert len(generated_commands) == 1
assert generated_commands[0] == "apt-cache show {}".format(" ".join(packages))
def test_generated_cmd_update_package_cache(catch_generated_commands):
NodeControlUtil.update_package_cache()
assert len(generated_commands) == 1
assert generated_com... |
<vulnerable_code> @classmethod
def update_package_cache(cls):
cmd = compose_cmd(['apt', 'update'])
cls.run_shell_script(cmd)
@classmethod
def get_deps_tree(cls, *package, depth=0):
ret = list(set(package))<commit_title>[PATCH 1/5] Refactor pool upgrade handler<commit_description>... |
<vulnerable_code> commands.append(command)
if run_shell_script_counter == 1:
raise ShellError(100, "apt update")
return ''
commands.append(command)
if run_shell_script_counter == 1:
raise ShellError(100, "apt update")
return ''
<commit_title>[P... |
<vulnerable_code> cmd = compose_cmd(['apt', 'update'])
try:
cls.run_shell_script(cmd)
except ShellError as e:
# Currently two issues can stop this from working.
# 1) The Sovrin Repo key needs to be updated
# apt-key adv --keyserver keyserver.ubun... |
<vulnerable_code>_archive_write_data(struct archive *_a, const void *buff, size_t s)
{
struct archive_write *a = (struct archive_write *)_a;
archive_check_magic(&a->archive, ARCHIVE_WRITE_MAGIC,
ARCHIVE_STATE_DATA, "archive_write_data");
archive_clear_error(&a->archive);
return ((a->format_write_data)(a, buff,... |
<vulnerable_code>const tagRE = /<[a-zA-Z\-\!\/](?:"[^"]*"['"]*|'[^']*'['"]*|[^'">])*>/g
import parseTag from './parse-tag'
// re-used obj for quick lookups of components<commit_title>[PATCH] fixing reported ReDoS<commit_description><fixed_code>
const tagRE = /<[a-zA-Z\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g
import parseT... |
<vulnerable_code>
t.end()
})<commit_title>[PATCH] fixing reported ReDoS<commit_description><fixed_code>
t.end()
})
test('ReDoS vulnerability reported by Sam Sanoop of Snyk', function (t) {
const start = Date.now()
// reported problematic string
HTML.parse(
"<!''''''''''''''''''''''''''''''''''''''''''''... |
<vulnerable_code> """
name = ...
def decode(self, frame):
"""
Decode an incoming frame.
<commit_title>[PATCH] Security fix: defend against zip bombs.<commit_description><fixed_code>
"""
name = ...
def decode(self, frame, *, max_size=None):
"""
Decode an incoming ... |
<vulnerable_code>
from ..exceptions import (
DuplicateParameter, InvalidParameterName, InvalidParameterValue,
NegotiationError
)
from ..framing import CTRL_OPCODES, OP_CONT
self.local_max_window_bits),
]))
def decode(self, frame):
"""
Decode an incoming frame.
... |
<vulnerable_code>
from ..exceptions import (
DuplicateParameter, InvalidParameterName, InvalidParameterValue,
NegotiationError
)
from ..framing import (
OP_BINARY, OP_CLOSE, OP_CONT, OP_PING, OP_PONG, OP_TEXT, Frame,
rsv1=True,
data=b'\x00\x05\x00\xfa\xffcaf\xc3\xa9\x00', # not co... |
<vulnerable_code> length, = struct.unpack('!Q', data)
if max_size is not None and length > max_size:
raise PayloadTooBig(
"Payload length exceeds limit: {} > {} bytes"
.format(length, max_size))
if mask:
mask_bits = yield from reader(4)
... |
<vulnerable_code> def __repr__(self):
return 'NoOpExtension()'
def decode(self, frame):
return frame
def encode(self, frame):<commit_title>[PATCH] Security fix: defend against zip bombs.<commit_description><fixed_code>
def __repr__(self):
return 'NoOpExtension()'
def decode... |
<vulnerable_code> return frame._replace(data=data)
# This extensions is symmetrical.
decode = encode
self.round_trip(
b'\x81\x05uryyb',<commit_title>[PATCH] Security fix: defend against zip bombs.<commit_description><fixed_code>
return frame._... |
<vulnerable_code> *elem_rtrn = xkb_atom_text(ctx, expr->field_ref.element);
*field_rtrn = xkb_atom_text(ctx, expr->field_ref.field);
*index_rtrn = NULL;
return true;
case EXPR_ARRAY_REF:
*elem_rtrn = xkb_atom_text(ctx, expr->array_ref.element);
*field_rtrn = xkb_atom_t... |
<vulnerable_code> compressed_pos += 1;
count = (c & 0x7f) + 1;
if (c & 0x80) {
for (size_t i = 0; i < p_pixel_size; i++) {
pixels_w.ptr()[i] = p_compressed_buffer[compressed_pos];
return OK;
}
Error ImageLoaderTGA::convert_to_image(Ref<Image> p_image, const uint8_t *p_buffer, const tga_header_s &p_header... |
<vulnerable_code>
inline static int uv__rwlock_fallback_init(uv_rwlock_t* rwlock) {
if (uv_mutex_init(&rwlock->fallback_.read_mutex_))
return -1;
if (uv_mutex_init(&rwlock->fallback_.write_mutex_)) {
uv_mutex_destroy(&rwlock->fallback_.read_mutex_);
return -1;
}
rwlock->fallback_.num_readers_ = 0... |
<vulnerable_code> while (pp && peek< exactly< hash_lbrace > >(pp)) {
pp = sequence< interpolant, real_uri_value >(pp);
}
position = pp;
return parse_interpolated_chunk(Token(p, position));
}<commit_title>[PATCH] Fix handling of unclosed interpolant in url<commit_description>Fixes #266... |
<vulnerable_code>static void dns_resolver_describe(const struct key *key, struct seq_file *m)
{
seq_puts(m, key->description);
if (key_is_instantiated(key)) {
int err = PTR_ERR(key->payload.data[dns_key_error]);
if (err)<commit_title>[PATCH] KEYS: Fix race between updating and finding a negative key<commit_descr... |
<vulnerable_code> while (!list_empty(keys)) {
struct key *key =
list_entry(keys->next, struct key, graveyard_link);
list_del(&key->graveyard_link);
kdebug("- %u", key->serial);
key_check(key);
/* Throw away the key data if the key is instantiated */
if (test_bit(KEY_FLAG_INSTANTIATED, &key->flags) &&
... |
<vulnerable_code>}
EXPORT_SYMBOL(key_payload_reserve);
/*
* Instantiate a key and link it into the target keyring atomically. Must be
* called with the target keyring's semaphore writelocked. The target key's
mutex_lock(&key_construction_mutex);
/* can't instantiate twice */
if (!test_bit(KEY_FLAG_INSTANTIATED... |
<vulnerable_code> else
seq_puts(m, "[anon]");
if (key_is_instantiated(keyring)) {
if (keyring->keys.nr_leaves_on_tree != 0)
seq_printf(m, ": %lu", keyring->keys.nr_leaves_on_tree);
else
{
struct keyring_search_context *ctx = iterator_data;
const struct key *key = keyring_ptr_to_key(object);
unsigned long ... |
<vulnerable_code> unsigned long timo;
key_ref_t key_ref, skey_ref;
char xbuf[16];
int rc;
struct keyring_search_context ctx = {
sprintf(xbuf, "%luw", timo / (60*60*24*7));
}
#define showflag(KEY, LETTER, FLAG) \
(test_bit(FLAG, &(KEY)->flags) ? LETTER : '-')
seq_printf(m, "%08x %c%c%c%c%c%c%c %5d %4s %08x ... |
<vulnerable_code> goto on_return;
pj_grp_lock_add_ref(glock);
asock_cfg.grp_lock = ssock->param.grp_lock = glock;
pj_grp_lock_add_handler(ssock->param.grp_lock, ssock->pool, ssock,
ssl_on_destroy);
}
/* Create active socket */
pj_activesock_cfg_default(&asock_cfg);
asock_cfg.async_cnt = sso... |
<vulnerable_code> ERROR_LOG("STATUS_FROM_SSL_ERR", err, ssock);
}
ssock->last_err = err;
return GET_STATUS_FROM_SSL_ERR(err);
}
/* Dig for more from OpenSSL error queue */
SSLLogErrors(action, ret, err, len, ssock);
ssock->last_err = ssl_err;
return GET_STATUS_FROM_SSL_ERR(ssl_err);
}
... |
<vulnerable_code> phys = (uint64_t)pfn << VRING_PAGE_BITS;
size = vring_size(vq->qsize, VIRTIO_PCI_VRING_ALIGN);
vb = paddr_guest2host(base->dev->vmctx, phys, size);
/* First page(s) are descriptors... */
vq->desc = (struct vring_desc *)vb;
/* Mark queue as allocated after initialization is complete. */
mb();
v... |
<vulnerable_code>static void randomize_ipv6_addr(tcpedit_t *tcpedit, struct tcpr_in6_addr *addr);
static int remap_ipv6(tcpedit_t *tcpedit, tcpr_cidr_t *cidr, struct tcpr_in6_addr *addr);
static int is_multicast_ipv6(tcpedit_t *tcpedit, struct tcpr_in6_addr *addr);
static int ipv6_header_length(ipv6_hdr_t const * ip6_... |
<vulnerable_code> if ((tcpedit->fixcsum || needtorecalc)) {
if (ip_hdr != NULL) {
dbgx(3, "doing IPv4 checksum: needtorecalc=%d", needtorecalc);
retval = fix_ipv4_checksums(tcpedit, *pkthdr, ip_hdr);
} else if (ip6_hdr != NULL) {
dbgx(3, "doing IPv6 checksum: needt... |
<vulnerable_code> auto lazyData = llvh::make_unique<LazyCompilationData>();
lazyData->parentScope = F->getLazyScope();
lazyData->nodeKind = F->getLazySource().nodeKind;
lazyData->bufferId = F->getLazySource().bufferId;
lazyData->originalName = F->getOriginalOrInferredName();
lazyData-... |
<vulnerable_code> auto &lazySource = newFunction->getLazySource();
lazySource.bufferId = bodyBlock->bufferId;
lazySource.nodeKind = getLazyFunctionKind(functionNode);
lazySource.functionRange = functionNode->getSourceRange();
// Set the function's .length.
ESTree::isStrict(functionNo... |
<vulnerable_code> !llvh::isa<ESTree::ArrowFunctionExpressionNode>(node) &&
"lazy compilation not supported for arrow functions");
auto *func = genES5Function(lazyData->originalName, parentVar, node);
addLexicalDebugInfo(func, topLevel, lexicalScopeChain);
return {func, topLevel};
}<commit_title>[PATCH... |
<vulnerable_code>// CHECK-NEXT: CreateGenerator r1, r0, 4
// CHECK-NEXT: Ret r1
// CHECK-LABEL: Function<?anon_1_args>(1 params, 7 registers, 0 symbols):
// CHECK-NEXT: Offset in debug table: source 0x{{.*}}, lexical 0x0000
// CHECK-NEXT: StartGenerator
// CHECK-NEXT: CreateEnvironment ... |
<vulnerable_code>//CHECK-NEXT:frame = [x]
//CHECK-NEXT:%BB0:
//CHECK-NEXT: %0 = StoreFrameInst undefined : undefined, [x]
//CHECK-NEXT: %1 = CreateGeneratorInst %?anon_1_useResult()
//CHECK-NEXT: %2 = ReturnInst %1 : object
//CHECK-NEXT:function_end
//CHECK-LABEL:function ?anon_1_useResult()
//CHECK-NEXT:frame = [x... |
<vulnerable_code><commit_title>[PATCH] Correctly restore whether or not a function is an inner<commit_description><fixed_code>
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// ... |
<vulnerable_code>#if defined(CONFIG_BT_CTLR_LE_ENC)
static void enc_req_reused_send(struct connection *conn,
struct radio_pdu_node_tx *node_tx);
static u8_t enc_rsp_send(struct connection *conn);
static u8_t start_enc_rsp_send(struct connection *conn,
struct pdu_data *pdu_ctrl_tx);
static u8_t pause_enc_r... |
<vulnerable_code>})(PacketKind || (PacketKind = {}));
var AnsiUp = (function () {
function AnsiUp() {
this.VERSION = "4.0.3";
this.setup_palettes();
this._use_classes = false;
this._escape_for_html = true;
this.bold = false;
this.fg = this.bg = null;
this._buf... |
<vulnerable_code>
it('should escape a mix of characters that require escaping', function () {
var start = "<&>/\\'\"";
var expected = "<&>/\\'\"";
var au = new AnsiUp();
var l = au.ansi_to_html(start);
});
describe('escape_for_html off', function () {
describe... |
<vulnerable_code>
while (LTOREQ_POS(curwin->w_cursor, oap->end))
{
n = gchar_cursor();
if (n != NUL)
{
if (curwin->w_cursor.lnum == oap->end.lnum)
oap->end.col += new_byte_len - old_byte_len;
replace_character(c);
}
else
{
if (curwin->w_cursor.lnum == oap->end.lnum)
getvp... |
<vulnerable_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
482,
/**/<commit_title>[PATCH] patch 9.0.0483: illegal memory access when replacing in<commit_description><fixed_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
483,
/... |
<vulnerable_code><commit_title>[PATCH] ssl cert tests<commit_description><fixed_code>
import sys
import os
from mock import Mock, patch
from pip.download import urlopen, VerifiedHTTPSHandler
from tests.test_pip import assert_raises_regexp, here, reset_env, run_pip
from nose import SkipTest
from nose.tools import asser... |
<vulnerable_code> case SIOCFINDIPDDPRT:
spin_lock_bh(&ipddp_route_lock);
rp = __ipddp_find_route(&rcp);
if (rp)
memcpy(&rcp2, rp, sizeof(rcp2));
spin_unlock_bh(&ipddp_route_lock);
if (rp) {<commit_title>[PATCH] net/appletalk: fix minor pointer leak to userspace in<commit_description><... |
<vulnerable_code>import logging
import re
from typing import Any, List, Optional
from urllib.parse import urlparse
from flask import abort, current_app, flash, g, redirect, request, session, url_for
from flask_babel import lazy_gettext
from flask_login import login_user, logout_user
import jwt
SelectDataRequired,
... |
<vulnerable_code>import json
import logging
from typing import Set
import unittest
from flask import Flask
from flask_appbuilder import AppBuilder, SQLA
from flask_appbuilder.const import (
API_SECURITY_PASSWORD_KEY,
)
def login(self, client, username, password):
# Login with default admin
... |
<vulnerable_code>class MVCSecurityTestCase(BaseMVCTestCase):
def setUp(self):
super().setUp()
class Model2View(ModelView):
datamodel = SQLAInterface(Model2)
"""
Test Security Login, Logout, invalid login, invalid access
"""
client = self.app.test_client()... |
<vulnerable_code>from typing import Any, Callable
from flask_babel import gettext
from flask_babel.speaklater import LazyString
def get_column_root_relation(column: str) -> str:
if "." in column:
return column.split(".")[0]<commit_title>[PATCH] fix: next url on login (OAuth, OID, DB)<commit_description><... |
<vulnerable_code><commit_title>[PATCH] Add reproducer for #263 to the test suite.<commit_description>This fixes #263<fixed_code>
# -*- coding: utf-8 -*-
import system_tests
class OutOfBoundsReadInPrintIFD(metaclass=system_tests.CaseMeta):
url = "https://github.com/Exiv2/exiv2/issues/263"
encodings = [bytes... |
<vulnerable_code> if (commands == null || commands.isEmpty()) {
throw new IllegalArgumentException("List of commands may not be null or empty");
}
this.environment = new TreeMap<String, String>(environment);
this.command = new ArrayList<String>(commands);
if (commands == null || c... |
<vulnerable_code> if (commands == null || commands.isEmpty()) {
throw new IllegalArgumentException("List of commands may not be null or empty");
}
ensureNoNullCharacters(commands);
this.environment = new TreeMap<String, String>(environment);
this.command = new ArrayList<String>(co... |
<vulnerable_code> System.err.println("Completed test softCloseStdinAfterWrite()");
}
private static byte[] getLotsOfBytes()
{
StringBuilder sb = new StringBuilder();
}
}
private static class Utf8DecodingListener extends NuAbstractCharsetHandler
{
private final CharBuffer utf8B... |
<vulnerable_code>import org.xwiki.rendering.internal.configuration.DefaultRenderingConfigurationComponentList;
import org.xwiki.rendering.internal.macro.message.ErrorMessageMacro;
import org.xwiki.rendering.internal.macro.message.InfoMessageMacro;
import org.xwiki.rendering.syntax.Syntax;
import org.xwiki.script.Script... |
<vulnerable_code>
import com.xpn.xwiki.doc.XWikiDocument;
import static org.junit.jupiter.api.Assertions.assertEquals;
/**
* Test of {@code Invitation.InvitationConfig}.
})
class InvitationConfigPageTest extends PageTest
{
private static final DocumentReference INVITATION_CONFIG_DOCUMENT_REFERENCE =
new ... |
<vulnerable_code> @Exported(inline=true)
public Map<String/*monitor name*/,Object> getMonitorData() {
Map<String,Object> r = new HashMap<String, Object>();
for (NodeMonitor monitor : NodeMonitor.getAll())
r.put(monitor.getClass().getName(),monitor.data(this));
return r;
}
... |
<vulnerable_code>import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.startsWith;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.when;
import hudson.security.ACL;
assertThat(updatedSlave.getNumExecutors(), ... |
<vulnerable_code>import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.jvnet.hudson.test.JenkinsRule;
import org.jvnet.hudson.test.JenkinsRule.DummySecurityRealm;
import org.kohsuke.stapler.StaplerRequest;
}
@Test
public void emptyNodeMonitorDataWithoutConnect() throws Exception... |
<vulnerable_code> (double) psd_info.columns,(double) psd_info.rows,(double)
psd_info.channels,(double) psd_info.depth,ModeToString((PSDImageType)
psd_info.mode));
/*
Initialize image.
*/
/*
If we are only "pinging" the image, then we're done - so return.
*/
if (image_info->ping != Mag... |
<vulnerable_code> image_view=AcquireVirtualCacheView(image,exception);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
#pragma omp parallel for schedule(static,4) shared(status) \
magick_threads(image,image,image->rows,1)
#endif
for (y=0; y < (ssize_t) image->rows; y++)
{<commit_title>[PATCH] https://github... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.