text stringlengths 79 3.72M |
|---|
<vulnerable_code>from test.lib import TestBase, fixture_path, with_rw_directory
@ddt.ddt
class TestGit(TestBase):
@classmethod
self.assertRegex(self.git.execute(["git", "version"]), r"^git version [\d\.]{2}.*$")
@ddt.data(
(False, False, ["git", "version"]),
(False, True, "git version... |
<vulnerable_code>import org.xwiki.component.wiki.internal.bridge.DefaultContentParser;
import org.xwiki.icon.IconManagerScriptService;
import org.xwiki.icon.internal.DefaultIconManagerComponentList;
import org.xwiki.model.reference.AttachmentReference;
import org.xwiki.model.reference.DocumentReference;
import org.xwik... |
<vulnerable_code> The directory entry contains an offset.
*/
offset=(ssize_t) ReadProfileLong(endian,q+8);
if ((ssize_t) (offset+number_bytes) < offset)
continue; /* prevent overflow */
if ((size_t) (offset+number_bytes) > length)
continue;
... |
<vulnerable_code>"""
import base64
import json
import os
import re
if system_comment:
for idx, value in enumerate(elements[1:]):
system_comment = system_comment.replace(
'{' + str(idx) + '}', value)
message = system_comment
return message
def c... |
<vulnerable_code>Report commenting tests.
"""
import logging
import os
import unittest
self.assertEqual(num_comment, 0)
# Try to add a new comment for the first bug
comment1 = CommentData(author='anybody', message='First msg')
success = self._cc_client.addComment(bug.reportId, comment... |
<vulnerable_code>Report exporting and importing tests
"""
import os
import unittest
import logging
comments = self._cc_client.getComments(bug.reportId)
self.assertEqual(len(comments), 0)
comment1 = CommentData(author='anybody', message='First msg')
success = self._cc_client.addComment... |
<vulnerable_code>store tests.
"""
import json
import os
import shlex
'-d', 'core.DivideZero', '-e', 'deadcode.DeadStores']
codechecker.analyze(cfg, self._divide_zero_workspace)
cfg['reportdir'] = report_dir2
cfg['checkers'] = [
'-e', 'core.DivideZero', '-d', 'deadcode.... |
<vulnerable_code> * - The text after the match.
*/
sublen = vim_regsub(®match, sub, expr, tail, 0, REGSUB_MAGIC);
if (ga_grow(&ga, (int)((end - tail) + sublen -
(regmatch.endp[0] - regmatch.startp[0]))) == FAIL)
{<commit_title>[PATCH] patch 9.0.1145: invalid memory access with recurs... |
<vulnerable_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1144,
/**/<commit_title>[PATCH] patch 9.0.1145: invalid memory access with recursive<commit_description><fixed_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1145,
/*... |
<vulnerable_code> (jp2_image->comps[0].dy != jp2_image->comps[i].dy) ||
(jp2_image->comps[0].prec != jp2_image->comps[i].prec) ||
(jp2_image->comps[0].sgnd != jp2_image->comps[i].sgnd) ||
(jp2_image->comps[i].data == NULL))
{
opj_destroy_codec(jp2_codec);
opj_image_d... |
<vulnerable_code>from ceph_volume.util import encryption
class TestStatus(object):
class TestDmcryptKey(object):
def test_dmcrypt_with_default_size(self, conf_ceph_stub):
conf_ceph_stub('[global]\nfsid=asdf-lkjh')
result = encryption.create_dmcrypt_key()
assert len(result) == 172
d... |
<vulnerable_code>
logger = logging.getLogger(__name__)
def create_dmcrypt_key():
"""
Create the secret dm-crypt key used to decrypt a device.
"""
# get the customizable dmcrypt key size (in bits) from ceph.conf fallback
# to the default of 1024
dmcrypt_key_size = conf.ceph.get_safe(
'o... |
<vulnerable_code>const deepmerge = require('deepmerge');
const parseSrcset = require('parse-srcset');
const { parse: postcssParse } = require('postcss');
const url = require('url');
// Tags that can conceivably represent stand-alone media.
const mediaTags = [
'img', 'audio', 'video', 'picture', 'svg',
if ... |
<vulnerable_code> '<div><div><div><div><div><div>nested text</div></div></div></div></div></div>'
);
});
});<commit_title>[PATCH] stop IDNA iframe attacks<commit_description><fixed_code>
'<div><div><div><div><div><div>nested text</div></div></div></div></div></div>'
);
});
it('should not allow ... |
<vulnerable_code> PendingProperties *converted = rm_malloc(sizeof(PendingProperties));
converted->values = rm_malloc(sizeof(SIValue) * map->property_count);
for(int i = 0; i < map->property_count; i++) {
SIValue val = AR_EXP_Evaluate(map->values[i], r);
if(!(SI_TYPE(val) & SI_VALID_PROPERTY_VALUE)) {
// This v... |
<vulnerable_code>
SIValue *GraphEntity_GetProperty(const GraphEntity *e, Attribute_ID attr_id) {
if(attr_id == ATTRIBUTE_NOTFOUND) return PROPERTY_NOTFOUND;
for(int i = 0; i < e->entity->prop_count; i++) {
if(attr_id == e->entity->properties[i].id) {<commit_title>[PATCH] Don't attempt to access non-existent proper... |
<vulnerable_code>import os
import sys
from RLTest import Env
from redisgraph import Graph, Node, Edge
result = redis_graph.query(query)
self.env.assertEquals(result.nodes_created, 2)
self.env.assertEquals(result.properties_set, 1)<commit_title>[PATCH] Don't attempt to access non-existent proper... |
<vulnerable_code> self.env.assertEquals(result.properties_set, 0)
def test27_merge_create_invalid_entity(self):
redis_con = self.env.getConnection()
graph = Graph("N", redis_con) # Instantiate a new graph.
query = """MATCH (a) RETURN a"""
result = graph.query(query)
... |
<vulnerable_code> assert("Unexpected clause following RETURN" in e.message)
pass
<commit_title>[PATCH] Don't attempt to access non-existent properties (#1495)<commit_description>* Don't attempt to access non-existent properties
* Address PR comments
* Add additional tests
* Add documen... |
<vulnerable_code> --p; /* for ';' */
count = Z_LVAL_P(pcount);
while (count-- > 0) {
spl_SplObjectStorageElement *pelement;
zend_string *hash;
if (!php_var_unserialize(&entry, &p, s + buf_len, &var_hash)) {
goto outexcept;
}
if (Z_TYPE(entry) != IS_OBJECT) {
zval_ptr_dtor(&entry);
goto outexcept;
... |
<vulnerable_code>
Mockito.verify(errors).rejectValue("name", "appointmentscheduling.AppointmentType.longName.errorMessage");
}
@Test
public void mustRejectAppointmentTypeDescriptionWithMoreThan1024Characters() throws Exception {
String longDescription = StringUtils.repeat("*", 1025);<commit_title>[PATCH] RA-... |
<vulnerable_code><commit_title>[PATCH] lock stdio streams<commit_description><fixed_code>
const file = Deno.openSync("./clearscreen.txt");
file.readable.pipeTo(Deno.stdout.writable);
// console.clear();
console.log("Are you sure you want to continu?"); |
<vulnerable_code> return FALSE;
def_mess = scanned_member->field->default_value;
subm = protobuf_c_message_unpack(scanned_member->field->descriptor,
allocator,
len - pref_len,
data + pref_len);
if (maybe_clear &&
*pmessage != NULL &&<commit_title>[PATCH 1/2] Fix issue #499: unsigned... |
<vulnerable_code> return FALSE;
def_mess = scanned_member->field->default_value;
if (len > pref_len)
subm = protobuf_c_message_unpack(scanned_member->field->descriptor,
allocator,
len - pref_len,<commit_title>[PATCH 1/2] Fix issue #499: unsigned integer overflow<commit_description>Signed-off-b... |
<vulnerable_code> ipmpt->num_alternate = gf_bs_read_int(bs, 8);
nbBytes += 1;
for (i=0; i<ipmpt->num_alternate; i++) {
gf_bs_read_data(bs, (char*)ipmpt->specificToolID[i], 16);
nbBytes += 16;
if (nbBytes>DescSize) break;
}
}
if (nbBytes>DescSize) return GF_ODF_INVALID_DESCRIPTOR;<commit_title>[PATCH] ... |
<vulnerable_code> var npm = require('../lib/npm.js')
var npmconf = require('../lib/config/core.js')
var errorHandler = require('../lib/utils/error-handler.js')
var configDefs = npmconf.defs
var shorthands = configDefs.shorthands
process.argv.splice(1, 1, 'npm', '-g')
}
log.verbose('cli', process.argv... |
<vulnerable_code>const deprCheck = require('./utils/depr-check')
const path = require('path')
const log = require('npmlog')
const readPackageTree = require('read-package-tree')
const rimraf = require('rimraf')
const validate = require('aproba')
let npmConfig
const npmlog = require('npmlog')
const limit = require('call-... |
<vulnerable_code>var rollbacks = npm.rollbacks
var chain = require('slide').chain
var errorMessage = require('./error-message.js')
var stopMetrics = require('./metrics.js').stop
const cacheFile = require('./cache-file.js')
].forEach(function (k) {
var v = er[k]
if (!v) return
log.verbose(k, v)
})
lo... |
<vulnerable_code>var util = require('util')
var nameValidator = require('validate-npm-package-name')
var npmlog = require('npmlog')
module.exports = errorMessage
function errorMessage (er) {
var short = []
var detail = []
switch (er.code) {
case 'ENOAUDIT':
short.push(['audit', er.message])<commit_tit... |
<vulnerable_code><commit_title>[PATCH] chore: remove auth info from logs<commit_description><fixed_code>
const URL = require('url')
// replaces auth info in an array
// of arguments or in a strings
function replaceInfo (arg) {
const isArray = Array.isArray(arg)
const isString = typeof arg === 'string'
if (!isA... |
<vulnerable_code> */
package org.xwiki.velocity.introspection;
import java.util.HashSet;
import java.util.Set;
import org.apache.velocity.util.introspection.SecureIntrospectorImpl;
*/
public class SecureIntrospector extends SecureIntrospectorImpl
{
private final Set<String> secureClassMethods = new HashSet<>();
... |
<vulnerable_code><commit_title>[PATCH] XWIKI-5168: Don't allow some methods in velocity introspector<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
* ... |
<vulnerable_code>
source = self.request.form.get('source')
if source:
# Is it valid XML?
try:
root = etree.fromstring(source)
except etree.XMLSyntaxError, e:
return dumps({
'success': False,<commit_title>[PATCH] For ... |
<vulnerable_code>}
function fastifyMultipart (fastify, options, done) {
const attachFieldsToBody = options.attachFieldsToBody
if (options.addToBody === true) {
if (typeof options.sharedSchemaId === 'string') {
.on('finish', onEnd)
bb.on('partsLimit', function () {
onError(new PartsLimitError()... |
<vulnerable_code>
t.teardown(fastify.close.bind(fastify))
fastify.register(multipart)
fastify.post('/', async function (req, reply) {
t.ok(req.isMultipart())<commit_title>[PATCH] Merge pull request from GHSA-hpp2-2cr5-pf6g<commit_description>* lib: implement default values for parts and fileSize
* fixup! l... |
<vulnerable_code>const http = require('http')
const path = require('path')
const fs = require('fs')
const filePath = path.join(__dirname, '../README.md')
form.pipe(req)
})
})<commit_title>[PATCH] Merge pull request from GHSA-hpp2-2cr5-pf6g<commit_description>* lib: implement default values for parts and fileSiz... |
<vulnerable_code> preempt_disable();
count_vm_tlb_event(NR_TLB_LOCAL_FLUSH_ALL);
local_flush_tlb();
trace_tlb_flush(TLB_LOCAL_SHOOTDOWN, TLB_FLUSH_ALL);
if (cpumask_any_but(mm_cpumask(mm), smp_processor_id()) < nr_cpu_ids)
flush_tlb_others(mm_cpumask(mm), mm, 0UL, TLB_FLUSH_ALL);
unsigned long base_pages_to_flu... |
<vulnerable_code><commit_title>[PATCH] Fix token present in referrer header (#2413)<commit_description><fixed_code>
export * from './ConfirmationPage'; |
<vulnerable_code>export * from './InvitationPage';<commit_title>[PATCH] Fix token present in referrer header (#2413)<commit_description><fixed_code>
|
<vulnerable_code>
static u32 swf_get_32(SWFReader *read)
{
u32 val, res;
val = swf_read_int(read, 32);
res = (val&0xFF);
res <<=8;
res |= ((val>>8)&0xFF);
res<<=8;
res |= ((val>>16)&0xFF);
res<<=8;
res|= ((val>>24)&0xFF);
return res;
}
static u16 swf_get_16(SWFReader *read)
{
u16 val, res;
val = swf_read_i... |
<vulnerable_code>{
struct common_audit_data sa;
struct apparmor_audit_data aad = {0,};
char *command, *args = value;
size_t arg_size;
int error;
if (size == 0)
return -EINVAL;
/* args points to a PAGE_SIZE buffer, AppArmor requires that
* the buffer must be null terminated or have size <= PAGE_SIZE -1
* s... |
<vulnerable_code> }
}
static int sanitize_ptr_alu(struct bpf_verifier_env *env,
struct bpf_insn *insn,
const struct bpf_reg_state *ptr_reg,
struct bpf_reg_state tmp;
bool ret;
if (env->allow_ptr_leaks || BPF_SRC(insn->code) == BPF_K)
return 0;
/* We already marked aux for masking from non-specula... |
<vulnerable_code>from tensorflow.python.framework import test_util
from tensorflow.python.ops import composite_tensor_ops
from tensorflow.python.ops import gen_composite_tensor_ops
from tensorflow.python.ops import gradients_impl
from tensorflow.python.ops import math_ops
from tensorflow.python.ops import parsing_ops
... |
<vulnerable_code> /* maximum number of coofs */
kmax = (int) ceil(support) * 2 + 1;
/* coefficient buffer */
kk = malloc(xsize * kmax * sizeof(float));
if ( ! kk)
return (Imaging) ImagingError_MemoryError();
xbounds = malloc(xsize * 2 * sizeof(int));
if ( ! xbounds) {
free(k... |
<vulnerable_code>
int pure_strcmp(const char * const s1, const char * const s2)
{
return pure_memcmp(s1, s2, strlen(s1) + 1U);
}<commit_title>[PATCH] pure_strcmp(): len(s2) can be > len(s1)<commit_description>Reported by Antonio Morales from GitHub Security Labs, thanks!<fixed_code>
int pure_strcmp(const char * co... |
<vulnerable_code> bmp_info.file_size+=extra_size;
bmp_info.offset_bits+=extra_size;
}
bmp_info.width=(ssize_t) image->columns;
bmp_info.height=(ssize_t) image->rows;
bmp_info.planes=1;
bmp_info.image_size=(unsigned int) (bytes_per_line*image->rows);
bmp_info.file_size+=bmp... |
<vulnerable_code> item->_etag = serverEntry.etag;
item->_directDownloadUrl = serverEntry.directDownloadUrl;
item->_directDownloadCookies = serverEntry.directDownloadCookies;
item->_isEncrypted = serverEntry.isE2eEncrypted() ? SyncFileItem::EncryptionStatus::EncryptedMigratedV1_2 : SyncFileItem::Encryptio... |
<vulnerable_code>/* $OpenBSD: wsemul_sun.c,v 1.36 2023/03/06 20:34:35 miod Exp $ */
/* $NetBSD: wsemul_sun.c,v 1.11 2000/01/05 11:19:36 drochner Exp $ */
/*
break;
case ';': /* argument terminator */
edp->nargs++;
break;
default: /* end of escape sequence */
oargs = edp->nargs++;
if (edp->nargs > SUN_E... |
<vulnerable_code>/* $OpenBSD: wsemul_vt100.c,v 1.45 2023/03/06 20:34:35 miod Exp $ */
/* $NetBSD: wsemul_vt100.c,v 1.13 2000/04/28 21:56:16 mycroft Exp $ */
/*
(instate->inchar - '0');
break;
case ';': /* argument terminator */
edp->nargs++;
break;
default:
edp->nargs++;
if (edp->nargs > VT100_EMUL_N... |
<vulnerable_code>from pipenv.patched import crayons
from pipenv.utils import (
cmd_list_to_shell, convert_deps_to_pip, create_spinner, download_file,
find_python, get_canonical_names, get_source_list, is_pinned,
is_python_command, is_required_version, is_star, is_valid_url,
parse_indexes, pep423_name, p... |
<vulnerable_code> return urllib3_util.parse_url(url).host
def get_canonical_names(packages):
"""Canonicalize a list of packages and return a set of canonical names"""
from .vendor.packaging.utils import canonicalize_name<commit_title>[PATCH] fix TLS validation for requirements.txt<commit_description>Previo... |
<vulnerable_code> ("--extra-index-url=https://example.com/simple/", (None, "https://example.com/simple/", None, [])),
("--trusted-host=example.com", (None, None, "example.com", [])),
("# -i https://example.com/simple/", (None, None, None, [])),
("requests", (None, None, None, ["requests"]))
])
@pytest.ma... |
<vulnerable_code>
#undef MATCH
if (IS_NON_WS(s[n]))
/* Unknown method */
code = sip_method_unknown;<commit_title>[PATCH] Fix Out-of-bound read in sip_method_d<commit_description><fixed_code>
#undef MATCH
if (strlen(s) < n) {
return sip_method_invalid;
}
if (IS_NON_WS(s[n]))
/* Unknown method... |
<vulnerable_code> return *static_cast<ConcurrentTableSharedStore*>(vpStore);
}
}
//////////////////////////////////////////////////////////////////////
return Variant(false);
}
Variant v = iter.second();
apc_store().set(key.toString(), v, ttl);
}
return Variant(ArrayData::Create())... |
<vulnerable_code> // Helpers.
$('.delete-button').click(showDeletePopup);
$('.add-all-button').click(showAddAllPopup);
$('.delete-branch-button').click(showDeletePopup);
return false;
}
function initVueComponents() {
const vueDelimeters = ['${', '}'];
<commit_title>[PATCH] Change action GETs to POST<commi... |
<vulnerable_code> /**
* A graphql hacking vector is to send nonsensical queries that have lots of grammar rule depth to them which
* can cause stack overflow exceptions during the query parsing. To prevent this for most users, graphql-java
* sets this value to 1000.
* <p>
* If you want to a... |
<vulnerable_code> offset += 3;
length -= 3;
memcpy(tim.bitmap, p + (tim.length - 3),
(tim.length - 3));
offset += tim.length - 3;
length -= tim.length - 3;
/*<commit_title>[PATCH] CVE-2017-12987/IEEE 802.11: Fix processing of TIM IE.<commit_description>The arguments to memcpy() were completely ... |
<vulnerable_code>/************************************************************************
**
** Copyright (C) 2009, 2010, 2011 Strahinja Markovic <strahinja.markovic@gmail.com>
**
** This file is part of Sigil.
// If there is no file name then we can't do anything with it.
if (!qfile_name.... |
<vulnerable_code>LPSTR tr_esc_str(LPCSTR arg, bool format)
{
LPSTR tmp = NULL;
size_t cs = 0, x, ds, len;
size_t s;
ds = s + 1;
if (s)
tmp = (LPSTR)realloc(tmp, ds * sizeof(CHAR));
if (NULL == tmp)
{
case '<':
len = format ? 13 : 4;
ds += len - 1;
tmp = (LPSTR)realloc(tmp, ds * sizeof(CHAR));... |
<vulnerable_code>
if (finalNbRects != nbRects)
{
int allocSize = sizeof(REGION16_DATA) + (finalNbRects * sizeof(RECTANGLE_16));
region->data = realloc(region->data, allocSize);
if (!region->data)
{
BOOL region16_union_rect(REGION16* dst, const REGION16* src, const RECTANGLE_16* rect)
{
const RECTANGLE_16* ... |
<vulnerable_code>static unsigned HuffmanTree_makeFromFrequencies(HuffmanTree* tree, const unsigned* frequencies,
size_t mincodes, size_t numcodes, unsigned maxbitlen)
{
unsigned error = 0;
while(!frequencies[numcodes - 1] && numcodes > mincodes) numcodes--; /*trim zer... |
<vulnerable_code>import array
import io
import zlib
from psd_tools.constants import Compression
from psd_tools.utils import (
be_array_from_bytes, be_array_to_bytes, read_be_array, write_be_array
)
try:
from . import _rle as rle
except ImportError:
from . import rle
def compress(data, compression, width,... |
<vulnerable_code>def decode(data, size):
"""
Decodes a PackBit encoded data.
"""
data = bytearray(data) # <- python 2/3 compatibility fix
result = bytearray(size)
src += 1
if 0 <= header <= 127:
result[dst:dst + header + 1] = data[src:src + header + 1]
src +... |
<vulnerable_code><commit_title>[PATCH] add guard for malicious rle data (fix #195)<commit_description><fixed_code>
|
<vulnerable_code> (bytes(bytearray(range(256))), 128, 2, 8, 2),
]
)
def test_packbits(fixture, width, height, depth, version):
encoded = encode_rle(fixture, width, height, depth, version)
decoded = decode_rle(encoded, width, height, depth, version)
assert fixture == decoded<commit_title>[PATCH] a... |
<vulnerable_code><commit_title>[PATCH] add guard for malicious rle data (fix #195)<commit_description><fixed_code>
import pytest
import logging
import psd_tools.compression.rle as rle
import psd_tools.compression._rle as _rle
from .test_compression import RAW_IMAGE_3x3_8bit
def test_identical():
size = len(RAW_IM... |
<vulnerable_code>
import numpy as np
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import sparse_tensor as sparse_tensor_lib
from tensorflow.python.framework import test_util
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import sparse_ops
from tensorflow.pytho... |
<vulnerable_code> }
else
{
hs->hs_ref_slots[nth]->ssl_sqt.sqt_col_dtp = ssl->ssl_sqt.sqt_col_dtp; /* hash filler col must have this set */
if (!tb_dfe->_.table.ot->ot_is_outer)
ssl_alias (ssl, hs->hs_ref_slots[nth]);
else<commit_title>[PATCH] Fixed do not change col_dtp if already set before (... |
<vulnerable_code> exception);
if (status != MagickFalse)
{
if (cache_info->reference_count == 1)
cache_info->nexus_info=(NexusInfo **) NULL;
destroy=MagickTrue;
image->cache=clone_image.cache;
... |
<vulnerable_code> Initialize persistent pixel cache.
*/
status=PersistPixelCache(image,cache_filename,MagickFalse,&offset,
exception);
if (status == MagickFalse)
ThrowWriterException(CacheError,"UnableToPersistPixelCache");
if (GetNextImageInList(image) == (Image *) NULL)<commit_title>... |
<vulnerable_code> if (!die) {
return -1;
}
die->attr_values = calloc(sizeof(RzBinDwarfAttrValue), attr_count);
if (!die->attr_values) {
return -1;
}
die->abbrev_code = abbr_code;
die->capacity = attr_count;
size_t i;
const char *comp_dir = NULL;
ut64 line_info_offset = UT64_MAX;
for (i = 0; i < abbrev->co... |
<vulnerable_code> int available = bits.available();
// try to repair count data if count data is invalid
if (count * 8 > available) {
count = (available + 7 / 8);
}
size_t nBytes = count;
<commit_title>[PATCH] fix(wechat_qrcode): Incorrect count data repair<commit_description><fixed_code>
... |
<vulnerable_code>
@property
def args(self):
args = ["register", "--force"]
if self.server_url:
[self.cmd] + self.args, expect_script=(("[Pp]assword: ", self.password + "\n"),), print_cmd=False
)
else:
# Warning: Currently activation_key can only b... |
<vulnerable_code> int lim = a+b*2+1;
hash = regs[a];
mrb_assert(mrb_hash_p(hash));
for (i=a+1; i<lim; i+=2) {
mrb_hash_set(mrb, hash, regs[i], regs[i+1]);
}<commit_title>[PATCH] vm.c: should check type before hash access.<commit_description>Since the operand of double splat (`**`) ... |
<vulnerable_code>import tempfile
import getpass
from pip.backwardcompat import get_python_lib
def running_under_virtualenv():
path = os.path.join(tempfile.gettempdir(), 'pip-build-%s' % \
getpass.getuser())
if sys.platform == 'win32':
return path
try:
os.mkdir(path)
except ... |
<vulnerable_code> Strcat(tmp, getLinkNumberStr(0));
Strcat_char(tmp, '(');
}
Strcat(tmp, Sprintf("<input_alt hseq=\"%d\" fid=\"%d\" type=%s "
"name=\"%s\" width=%d maxlength=%d value=\"%s\"",
cur_hseq++, cur_form_id, p, html_quote(r), size, i, qq));
if (x)
Strcat_charp(tmp, " checked");
if (... |
<vulnerable_code> ++q;
}
memcpy(szBuffer, p, q - p);
szBuffer[q-p] = 0;
szResult = szBuffer;
break;
memcpy(szBuffer, szCopy, sizeof(szCopy));
}
}
printf(szBuffer);
}
list_free(&substPtr);<commit_title>[PATCH] Fix [bad6cc213d]: A format string vulnerability in Tcl<commit_description>... |
<vulnerable_code> list_append(gexps, e);
} else {
const char *ername = exp_relname(e), *nername = exp_relname(ne), *ename = exp_name(e), *nename = exp_name(ne);
if ((ername && !nername) || (!ername && nername) ||
(ername && nername && strcmp(ername,nername) != 0) || strcmp(ename,nename) != 0)
l... |
<vulnerable_code> return &clk_src->base;
}
BREAK_TO_DEBUGGER();
return NULL;
}<commit_title>[PATCH] drm/amd/display: memory leak<commit_description>In dcn*_clock_source_create when dcn20_clk_src_construct fails allocated
clk_src needs release.
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-... |
<vulnerable_code> idata->status = IMAP_FATAL;
return;
}
mailbox = idata->buf;
s = mailbox + litlen;
*s = '\0';<commit_title>[PATCH] Ensure litlen isn't larger than our mailbox<commit_description><fixed_code>
idata->status = IMAP_FATAL;
return;
}
if (strlen(idata->buf) < l... |
<vulnerable_code>import os
import pathlib
import pickle
import re
import sys
import traceback
import warnings
Iterable,
Iterator,
List,
Sequence,
Union,
cast,
import jinja2
import pendulum
from dateutil.relativedelta import relativedelta
from pendulum.tz.timezone import Timezone
from sqlalchemy... |
<vulnerable_code>import java.io.Serializable;
import java.lang.reflect.Constructor;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
.isXsrfProtectionEnabled()) {
String uiToken = ui.getCsrfToken();
if (uiToken == null |... |
<vulnerable_code> op->output_layer_set_idx = gf_bs_read_u16(bs);
op->max_temporal_id = gf_bs_read_u8(bs);
op->layer_count = gf_bs_read_u8(bs);
for (j = 0; j < op->layer_count; j++) {
op->layers_info[j].ptl_idx = gf_bs_read_u8(bs);
op->layers_info[j].layer_id = gf_bs_read_int(bs, 6);<commit_title>[PATCH] fi... |
<vulnerable_code> sps->offset_for_non_ref_pic = bs_get_se(bs);
sps->offset_for_top_to_bottom_field = bs_get_se(bs);
sps->poc_cycle_length = bs_get_ue(bs);
for(i=0; i<sps->poc_cycle_length; i++) sps->offset_for_ref_frame[i] = bs_get_se(bs);
}
if (sps->poc_type > 2) {<commit_title>[PATCH] fix some exploitable ov... |
<vulnerable_code>
static int uv__rwlock_fallback_init(uv_rwlock_t* rwlock) {
int err;
err = uv_mutex_init(&rwlock->fallback_.read_mutex_);
if (err)
return err;
err = uv_mutex_init(&rwlock->fallback_.write_mutex_);
if (err) {
uv_mutex_destroy(&rwlock->fallback_.read_mutex_);
return err;
}
r... |
<vulnerable_code>if not logging.getLogger().hasHandlers():
logging.basicConfig(level=logging.DEBUG, format='%(message)s')
from label_studio.core.utils.io import get_data_dir
from label_studio.core.utils.params import get_bool_env, get_env, get_env_list_int
logger = logging.getLogger(__name__)
INTERNAL_PORT = '808... |
<vulnerable_code>"""This file and its contents are licensed under the Apache License 2.0. Please see the included NOTICE for copyright information and LICENSE for a copy of the license.
"""
import os
import socket
from tempfile import mkstemp, mkdtemp
from django.conf import settings
from appdirs import user_config_di... |
<vulnerable_code>import os
from rest_framework.exceptions import ValidationError
def cast_bool_from_str(value):
if isinstance(value, str):
if value.lower() in ['true', 'yes', 'on', '1']:<commit_title>[PATCH] fix: LSDV-5071: Ensure secret key is securely set persisting<commit_description><fixed_code>
impor... |
<vulnerable_code> return bus->close_on_exit;
}
_public_ int sd_bus_enqeue_for_read(sd_bus *bus, sd_bus_message *m) {
int r;
assert_return(bus, -EINVAL);
if (!BUS_IS_OPEN(bus->state))
return -ENOTCONN;
/* Re-enqeue a message for reading. This is primarily useful ... |
<vulnerable_code> if (r < 0)
goto fail;
r = sd_bus_enqeue_for_read(sd_bus_message_get_bus(q->request), q->request);
if (r < 0)
goto fail;
<commit_title>[PATCH] Fix typo in function name<commit_description><fixed_code>
if (r < 0)
goto fail;
... |
<vulnerable_code> * {@linkplain #validateHeaders() headers}.
* @return {@code true} if the header values should be validated as a result of the decode operation.
*/
protected final boolean validateHeaderValues() {
return validateHeaderValues;
}
<commit_title>[PATCH] Fix backwards compatibi... |
<vulnerable_code>
XML_Parser XMLCALL
XML_ParserCreateNS(const XML_Char *encodingName, XML_Char nsSep) {
XML_Char tmp[2];
*tmp = nsSep;
return XML_ParserCreate_MM(encodingName, NULL, tmp);
}
would be otherwise.
*/
if (parser->m_ns) {
XML_Char tmp[2];
*tmp = parser->m_namespaceSeparator;
parse... |
<vulnerable_code> """
from mlflow.utils.file_utils import local_file_uri_to_path
exc = MlflowException(f"Invalid path: {path}", error_code=INVALID_PARAMETER_VALUE)
if any((s in path) for s in ("#", "%23")):
raise exc
<commit_title>[PATCH] Prevent path traversal with encoded URL (#10650)<commit_d... |
<vulnerable_code> UpdateRegisteredModel,
)
from mlflow.protos.service_pb2 import CreateExperiment, SearchRuns
from mlflow.server import BACKEND_STORE_URI_ENV_VAR, app
from mlflow.server.handlers import (
_create_experiment,
_create_model_version,
_create_registered_model,
_delete_model_version,
_... |
<vulnerable_code> http_artifact_repo.list_artifacts()
@pytest.mark.parametrize("path", ["/tmp/path", "../../path"])
def test_list_artifacts_malicious_path(http_artifact_repo, path):
with mock.patch(
"mlflow.store.artifact.http_artifact_repo.http_request",
200,
),
):
... |
<vulnerable_code>)
from mlflow.exceptions import MlflowException
from mlflow.models import Model
from mlflow.server.handlers import validate_path_is_safe
from mlflow.store.tracking.sqlalchemy_store import SqlAlchemyStore
from mlflow.utils import mlflow_tags
from mlflow.utils.file_utils import TempDir, path_to_local_fil... |
<vulnerable_code> is_valid_dbfs_uri,
remove_databricks_profile_info_from_artifact_uri,
resolve_uri_if_local,
)
)
def test_negative_detection(uri):
assert not is_fuse_or_uc_volumes_uri(uri)<commit_title>[PATCH] Prevent path traversal with encoded URL (#10650)<commit_description>Signed-off-by: B-Step62 <... |
<vulnerable_code>/**
* Create an event loop context
* @param ctx Pointer to an uev_ctx_t context to be initialized
* @param maxevents Maximum number of events in event cache
*
* This function is the same as uev_init() except for the @p maxevents
* argument, which controls the number of events in the event c... |
<vulnerable_code># Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
#
from snowflake.connector.url_util import is_valid_url, url_encode_str
def test_url_validator():<commit_title>[PATCH] fix unit test import issue<commit_description><fixed_code>
# Copyright (c) 2012-2023 Snowflake Computing Inc.... |
<vulnerable_code> unsigned long nr_segs, loff_t *poffset)
{
unsigned long nr_pages, i;
size_t copied, len, cur_len;
ssize_t total_written = 0;
loff_t offset;
struct iov_iter it;
save_len = cur_len;
for (i = 0; i < nr_pages; i++) {
copied = min_t(const size_t, cur_len, PAGE_SIZE);
copied = iov_iter_cop... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.