text stringlengths 79 3.72M |
|---|
<vulnerable_code>
// look up attachments if type binary
if (exports.BINARY_EVENT === p.type || exports.BINARY_ACK === p.type) {
var buf = '';
while (str.charAt(++i) !== '-') {
buf += str.charAt(i);
if (i == str.length) break;
}
if (buf != Number(buf) || str.charAt(i) !== '-') {
thr... |
<vulnerable_code> return readFixedString(length)
} else { // not cacheable, go back and do a standard read
position--
return read().toString()
}
let key = ((length << 5) ^ (length > 1 ? dataView.getUint16(position) : length > 0 ? src[position] : 0)) & 0xfff
let entry = keyCache[key]
return entry.string = rea... |
<vulnerable_code>{
/* first let's check the buffer parameter's */
if (params->buffer.fragment_size == 0 ||
params->buffer.fragments > SIZE_MAX / params->buffer.fragment_size)
return -EINVAL;
/* now codec parameters */<commit_title>[PATCH] ALSA: compress: fix an integer overflow check<commit_description>I previ... |
<vulnerable_code> */
if (GetBlobSize(image) != (size_t) GetBlobSize(image))
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
buffer=(unsigned char *) AcquireQuantumMemory((size_t) GetBlobSize(image),
sizeof(*buffer));
if (buffer == (unsigned char *) NULL)
ThrowReaderException(Resour... |
<vulnerable_code>from simple_history.admin import SimpleHistoryAdmin
from simple_history.models import HistoricalRecords
def diff_objects(old_instance, new_instance, fields):
"""
field_diff = []
old_value = getattr(old_instance, field.attname)
new_value = getattr(new_instance, field.attnam... |
<vulnerable_code>DBusService::DBusService(QObject* parent) : Daemon(parent) {
MZ_COUNT_CTOR(DBusService);
m_wgutils = new WireguardUtilsLinux(this);
if (!removeInterfaceIfExists()) {
// Get the PID of the D-Bus message sender.
QDBusConnectionInterface *iface = QDBusConnection::systemBus().interface();
QDB... |
<vulnerable_code> break;
case '{':
if (CTX > 0) {
// r_egg_printf (egg, " %s:\n", get_frame_label (0));
if (egg->lang.nested_callname[CTX] && strstr (egg->lang.nested_callname[CTX], "if") &&
strstr (egg->lang.elem, "else")) {<commit_title>[PATCH] Fix #14296 - Segfault in ragg2<commit_description>... |
<vulnerable_code>
for (var i = 0; i < refTokens.length - 1; ++i) {
var tok = refTokens[i];
if (tok === "__proto__" || tok === "constructor" || tok === "prototype") {
continue
}<commit_title>[PATCH] Fix prototype pollution when pointer is not a string or<commit_description><fixed_... |
<vulnerable_code> expect(obj2.polluted).to.be.undefined();
});
it('should not set prototype', function () {
var obj = {}, objPointer = pointer(obj);
expect(obj.polluted).to.be.undefined();<commit_title>[PATCH] Fix prototype pollution when pointer is not a string or<commit_description><fi... |
<vulnerable_code>const jsesc = require("jsesc");
/**
* Returns a string that represents the javascript that is required to insert the Google Analytics scripts
* @returns {string}
*/
function getGoogleAnalyticsScript(tagId) {
let escapedTagId = jsesc(tagId, { isScriptContext: true });
if (escapedTagId) {
... |
<vulnerable_code> * limitations under the License.
*/
function loadSessionsTable(sessions) {
$.each(sessions, function(index, session) {
$("#interactive-sessions .sessions-table-body").append(
"<tr>" +
tdWrap(uiLink("session/" + session.id, session.id)) +
tdWrap(appIdLink(session)) +
... |
<vulnerable_code>from .base_protocol import BaseProtocol
from .helpers import NO_EXTENSIONS, BaseTimerContext
from .http_exceptions import (
BadStatusLine,
ContentEncodingError,
ContentLengthError,
# chunking
te = headers.get(hdrs.TRANSFER_ENCODING)
if te and "chunked" in te.lower()... |
<vulnerable_code> assert isinstance(payload, streams.StreamReader)
def test_conn_upgrade(parser) -> None:
text = (
b"GET /test HTTP/1.1\r\n"
b"connection: upgrade\r\n"<commit_title>[PATCH] Raise '400: Content-Length can't be present with<commit_description><fixed_code>
assert isinstance(pay... |
<vulnerable_code> case 12: z2=z = ReadBlobXXXLong(image2); /* 3D matrix RGB*/
Unknown6 = ReadBlobXXXLong(image2);
(void) Unknown6;
if(z!=3) ThrowReaderException(CoderError, "MultidimensionalMatricesAreNotSupported");
break;
case 16: z2=z = ReadBlobXXXLong(image2); /*... |
<vulnerable_code> }
int32_t oldLength = length();
int32_t newLength = oldLength + srcLength;
// Check for append onto ourself
const UChar* oldArray = getArrayStart();<commit_title>[PATCH] ICU-20958 Prevent SEGV_MAPERR in append<commit_description>See #971<fixed_code>
}
int32_t oldLength = length();
in... |
<vulnerable_code> TESTCASE_AUTO(TestWCharPointers);
TESTCASE_AUTO(TestNullPointers);
TESTCASE_AUTO(TestUnicodeStringInsertAppendToSelf);
TESTCASE_AUTO_END;
}
str.insert(2, sub);
assertEquals("", u"abbcdcde", str);
}<commit_title>[PATCH] ICU-20958 Prevent SEGV_MAPERR in append<commit_description>... |
<vulnerable_code> return(SetStreamBuffering(image_info,image));
}
#if defined(MAGICKCORE_HAVE_POPEN) && defined(MAGICKCORE_PIPES_SUPPORT)
if (*filename == '|')
{
char
fileMode[MagickPathExtent],<commit_title>[PATCH] possible RCE vulnerability<commit_description><fixed_code>
return(Set... |
<vulnerable_code>
if (op_byte == 0xaa) {
// handle a table switch condition
if (pos + 8 > len) {
return op->size;
}
int min_val = (ut32)(UINT (data, pos + 4)),
max_val = (ut32)(UINT (data, pos + 8));
ut32 default_loc = (ut32) (UINT (data, pos)), cur_case = 0;
op->switch_op = r_anal_switch_op_new (ad... |
<vulnerable_code>
// slashes and backslashes have lost all meaning for the web protocols (https, http, wss, ws)
string = string.replace(/^(https?|ftp|wss?)?:+[/\\]*/i, '$1://');
// extract protocol
if (string.substring(0, 2) === '//') {<commit_title>[PATCH] fix(parse): handle excessive slashes in schem... |
<vulnerable_code> idn: false,
punycode: false
}
}, {
name: 'scheme-relative URL',
url: '//www.example.org/',
idn: false,
punycode: false
}
}, {
name: 'missing authority',
url: 'food:///test/file.csv',<commit_title>[PATCH] fix(parse): handle excessive slashes in scheme-... |
<vulnerable_code>{
char *old = x->ptr;
int newlen;
newlen = x->length * 6 / 5;
if (newlen == x->length)
newlen += 2;
x->ptr = GC_MALLOC_ATOMIC(newlen);
x->area_size = newlen;<commit_title>[PATCH] Fix potential heap buffer corruption due to Strgrow<commit_description>If Str.length = 5 and area_s... |
<vulnerable_code>#include "dbusservice.h"
#include <sys/capability.h>
#include <QCoreApplication>
#include <QDBusConnection><commit_title>[PATCH] Fix build failures on Ubuntu/focal<commit_description><fixed_code>
#include "dbusservice.h"
#include <sys/capability.h>
#include <unistd.h>
#include <QCoreApplication>
#i... |
<vulnerable_code> }
total_samples = dff_chunk_header.ckDataSize / config->num_channels;
break;
}
else { // just copy unknown chunks to output file<commit_title>[PATCH] issue #110: sanitize DSD file types for invalid lengths<commit_description><fixed_code>
... |
<vulnerable_code>
if (format_chunk.ckSize != sizeof (DSFFormatChunk) || format_chunk.formatVersion != 1 ||
format_chunk.formatID != 0 || format_chunk.blockSize != DSF_BLOCKSIZE || format_chunk.reserved ||
(format_chunk.bitsPerSample != 1 && format_chunk.bitsPerSample != 8) ||
format_chunk.nu... |
<vulnerable_code> # layout:
# 32 bytes | args
# 0x..00<method_id_4bytes> | args
mstore_method_id.append(["mstore", buf, signature.method_id])
buf += 32
<commit_title>[PATCH] add a note about alignment<commit_description><fixed_code>
# layout:
# 32 b... |
<vulnerable_code>import { removeScript, removeEscapes } from './common';
describe('when securityLevel is antiscript, all script must be removed', function () {
it('should remove all script block, script inline.', function () {
expect(result).toEqual('script:');
});
});<commit_title>[PATCH 1/2] Fix for XSS vuln... |
<vulnerable_code>import common from '../common/common';
import { addFunction } from '../../interactionDb';
export const drawRect = function (elem, rectData) {
const rectElem = elem.append('rect');
return rectElem;
};
const sanitizeUrl = function (s) {
return s
.replace(/&/g, '&')
.replace(/</g, '<... |
<vulnerable_code>const svgDraw = require('./svgDraw');
const { MockD3 } = require('d3');
describe('svgDraw', function () {
expect(rect.lower).toHaveBeenCalled();
});
});
});<commit_title>[PATCH 1/2] Fix for XSS vulnerability in url sanitization<commit_description><fixed_code>
const svgDraw = require('./svg... |
<vulnerable_code> *(s+(nlen+1+vlen)) = '\0'
#ifdef USE_ENVIRON_ARRAY
/* VMS' my_setenv() is in vms.c */
#if !defined(WIN32) && !defined(NETWARE)
void
Perl_my_setenv(pTHX_ const char *nam, const char *val)
{
#ifndef PERL_USE_SAFE_PUTENV
if (!PL_use_safe_putenv) {
/* most putenv()s leak, so we manip... |
<vulnerable_code>/*
* Copyright (c) 1997-8 Andrew G. Morgan <morgan@linux.kernel.org>
*
* This is a file to make the capability <-> string mappings for
* libcap.
*/
#include <stdio.h>
#include <stdlib.h>
#include <linux/capability.h>
/*
* #include 'sed' generated array
*/
struct {
int index;
const cha... |
<vulnerable_code>/*
* Copyright (c) 1997-8 Andrew G Morgan <morgan@linux.kernel.org>
*
* See end of file for Log.
*
* This file deals with allocation and deallocation of internal
* capability sets as specified by POSIX.1e (formerlly, POSIX 6).
*/
#include "libcap.h"
/*
* This function duplicates an internal c... |
<vulnerable_code>/*
* Copyright (c) 1997-8 Andrew G Morgan <morgan@linux.kernel.org>
*
* See end of file for Log.
*
* This file deals with exchanging internal and external
* representations of capability sets.
*/
#include "libcap.h"
/*
* External representation for capabilities. (exported as a fixed
* length... |
<vulnerable_code>/*
* Copyright (c) 1997 Andrew G Morgan <morgan@linux.kernel.org>
*
* See end of file for Log.
*
* This file deals with setting capabilities on files.
*/
#include "libcap.h"
/*
* Get the capabilities of an open file, as specified by its file
* descriptor.
*/
cap_t cap_get_fd(int fildes)
{
... |
<vulnerable_code>/*
* Copyright (c) 1997-8 Andrew G. Morgan <morgan@linux.kernel.org>
*
* See end of file for Log.
*
* This file deals with flipping of capabilities on internal
* capability sets as specified by POSIX.1e (formerlly, POSIX 6).
*/
#include "libcap.h"
/*
* Return the state of a specified capabili... |
<vulnerable_code>/*
* Copyright (c) 1997-8 Andrew G Morgan <morgan@linux.kernel.org>
*
* See end of file for Log.
*
* This file deals with setting capabilities on processes.
*/
#include "libcap.h"
cap_t cap_get_proc(void)
{
cap_t result;
/* allocate a new capability set */
result = cap_init();
... |
<vulnerable_code>/*
* Copyright (c) 1997-8 Andrew G Morgan <morgan@linux.kernel.org>
* Copyright (c) 1997 Andrew Main <zefram@dcs.warwick.ac.uk>
*
* See end of file for Log.
*
* This file deals with exchanging internal and textual
* representations of capability sets.
*/
#define LIBCAP_PLEASE_INCLUDE_ARRAY
#in... |
<vulnerable_code>/*
* ProFTPD - FTP server daemon
* Copyright (c) 1997, 1998 Public Flood Software
* Copyright (c) 2003-2017 The ProFTPD Project team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* recommended for s... |
<vulnerable_code>
if (sfsname) {
/* file system ID is ASCII, not numeric, for this server OS */
static char temp[NFSX_V3FHMAX+1];
/* Make sure string is null-terminated */
strncpy(temp, sfsname, NFSX_V3FHMAX);
temp[sizeof(temp) - 1] = '\0';
/* Remove trailing spaces */
spacep = strchr(temp, ' ');
if (... |
<vulnerable_code> x_value = np.random.random_sample(x_shape).astype(np.float64)
f_value = np.random.random_sample(f_shape).astype(np.float64)
nn_ops.conv3d_transpose(
x_value, f_value, y_shape, strides, data_format='NCDHW')
def testConv3DTransposeOutputShapeType(self):
# Test case for GitHub i... |
<vulnerable_code>@RestController
public class MyRestController {
@GetMapping("api/get")
public BeanWithPrivateFields read() {
return new BeanWithPrivateFields();
}
}<commit_title>[PATCH] code format<commit_description><fixed_code>
@RestController
public class MyRestController {
@GetMapping("api/get")
pu... |
<vulnerable_code> );
}
} catch (e) {
mermaid.innerHTML = `<span class="mermaid-error">${e?.str || e}</span>`;
} finally {
mermaid.dataset.processed = true;
mermaid.querySelector(".spinner")?.remove();<commit_title>[PATCH] SECURITY: render errors as plain text<commit_description><f... |
<vulnerable_code> const userName = document.getElementById('add_user_name').value;
const realName = document.getElementById('add_user_realname').value;
const email = document.getElementById('add_user_email').value;
const password = document.getElementById('add_user_password').value;
const p... |
<vulnerable_code> return;
}
static int isofs_read_inode(struct inode *);
static int isofs_statfs (struct dentry *, struct kstatfs *);
static struct kmem_cache *isofs_inode_cachep;
goto out;
}
static int isofs_read_inode(struct inode *inode)
{
struct super_block *sb = inode->i_sb;
struct isofs_sb_info *sbi = ISOFS... |
<vulnerable_code> goto out;
}
static int
parse_rock_ridge_inode_internal(struct iso_directory_record *de,
struct inode *inode, int regard_xa)
{
int symlink_len = 0;
int cnt, sig;
struct inode *reloc;
struct rock_ridge *rr;
int rootflag;
init_rock_state(&rs, inode);
setup_rock_ridge(de, inode, &rs);
if (re... |
<vulnerable_code> },
axes : {
xaxis : {
label : settings.xaxisLabel
},
yaxis : {
label : settings.yaxisLabel<commit_title>[PATCH] bug #4504 [security] Self-XSS in query charts<commit_description>Signed-off-by: Marc Delisle <marc@infomarc... |
<vulnerable_code> );
}
var runSpeed = 2000;
osmStream.runFn(function(err, data) {
case 'way':
var bbox_intersects_old = (f.old && f.old.bounds && bbox.intersects(makeBbox(f.old.bounds)));
var bbox_intersects_new = (f.neu && f.neu.bounds && bbox.intersects(makeBbox(f.neu.... |
<vulnerable_code>
if (isNonCompositePath(internalPath)) {
obj = decouple(obj, options);
obj[options.transformKey(unEscape(internalPath))] = val;
return obj;
var newObj = decouple(obj, options);
var pathParts = split(internalPath);
var pathPart = pathParts.shift();
var transformedPathPart = option... |
<vulnerable_code>
// Path has no dot-notation, set key/value
if (isNonCompositePath(internalPath)) {
obj = decouple(obj, options);
obj[options.transformKey(unEscape(internalPath))] = val;
return obj;
const pathParts = split(internalPath);
const pathPart = pathParts.shift();
const transformedPathPart = optio... |
<vulnerable_code> const keys = Object.getOwnPropertyNames(source);
keys.push(...Object.getOwnPropertySymbols(source));
for (const key of keys) {
if (key === '__proto__')
continue;
if (options.filter && !options.filter(source, key))
continue;<commit_title>[PATCH] Fixed Prototype Pollution vulner... |
<vulnerable_code> );
});
it('should prevent Prototype Pollution vulnerability', function() {
const payload = JSON.parse('{"__proto__":{"polluted":"Yes! Its Polluted"}}');
const obj = {};
merge(obj, payload, {deep: true});
assert.strictEqual(obj.polluted, undefined);
});
});<commit_title>[PATC... |
<vulnerable_code> public void testEmailValidatorWithOkEmail() {
assertTrue(validator.isValid("my.name@email.com"));
}
}<commit_title>[PATCH] Add unit test<commit_description><fixed_code>
public void testEmailValidatorWithOkEmail() {
assertTrue(validator.isValid("my.name@email.com"));
}
... |
<vulnerable_code>
bool MemoryManager::validate_user_read(const Process& process, VirtualAddress vaddr) const
{
auto* region = region_from_vaddr(process, vaddr);
return region && region->is_readable();
}
bool MemoryManager::validate_user_write(const Process& process, VirtualAddress vaddr) const
{
auto* regi... |
<vulnerable_code>package uk.q3c.krail.core.data;
import javax.annotation.Nonnull;
import static com.google.common.base.Preconditions.checkNotNull;
}
}
private StringBuilder buf;
public Select() {
public Select(@Nonnull String selection) {
checkNotNull(selection);
buf = new ... |
<vulnerable_code> public static final OptionKey<String> optionPathToValues = new OptionKey<>("", DefaultClassPatternDao.class, LabelKey.Path, DescriptionKey.Path);
public static final OptionKey<Boolean> optionKeyUseKeyPath = new OptionKey<>(Boolean.TRUE, DefaultClassPatternDao.class, LabelKey.Use_Key_Path,
... |
<vulnerable_code>/*
* Copyright (c) 2015. David Sowerby
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or... |
<vulnerable_code>/*
* Copyright (c) 2015. David Sowerby
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or... |
<vulnerable_code>INTERNAL_PORT = '8080'
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '$(fefwefwef13;LFK{P!)@#*!)kdsjfWF2l+i5e3t(8a1n'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = get_bool_env('DEBUG', True)<commit_title>[PATCH] feat: retrieve SECRET_KEY ... |
<vulnerable_code> if (u != 0)
strcpy(path_env, "PATH=/usr/bin:/bin:"BIN_DIR);
putenv(path_env);
}
execvp(EXECUTABLE, (char **)args);<commit_title>[PATCH] a-a-i-d-t-a-cache: sanitize umask<commit_description>We cannot trust anything when running suided program.
Related: #1216962
Sig... |
<vulnerable_code>def raise_on_import() -> None:
"""Raise on import letting users know that underlying code is deprecated."""
raise ImportError(
"This tool has been moved to langchain experiment. "
"This tool has access to a python REPL. "
"For best practices make sure to sandbox this too... |
<vulnerable_code>from __future__ import annotations
import functools
import logging
import multiprocessing
from typing import TYPE_CHECKING, Dict, Optional
from langchain.pydantic_v1 import BaseModel, Field
if TYPE_CHECKING:
from wasm_exec import WasmExecutor
logger = logging.getLogger(__name__)
@functools.lr... |
<vulnerable_code> return toReturn;
}
void ArrayBuffer::ClearParentsLength(ArrayBufferParent* parent)
{
if (parent == nullptr)
{
switch (JavascriptOperators::GetTypeId(parent))
{
case TypeIds_Int8Array:
case TypeIds_Uint8Array:
case ... |
<vulnerable_code> return FALSE;
}
#ifdef _M_ARM
// Provide template specialization (only) for memory access at unaligned float/double address which causes data alignment exception otherwise.
template<><commit_title>[PATCH] [CVE-2017-0236] Bug with array buffer detach<commit_description>Change the vt... |
<vulnerable_code>
}
Var TypedArrayBase::EntryGetterBuffer(RecyclableObject* function, CallInfo callInfo, ...)
{
PROBE_STACK(function->GetScriptContext(), Js::Constants::MinStackDefault);<commit_title>[PATCH] [CVE-2017-0236] Bug with array buffer detach<commit_description>Change the vtable of virtua... |
<vulnerable_code> return "Authentication required", 401
if key in get_preferences():
return Response(json.dumps({'key': key, 'value': get_preferences()[key]}))
else:
return Response(json.dumps({'key': key, 'error': 'novalue'}))
@app.route("/api/preferences/set/<key>/<value>")
r... |
<vulnerable_code> return 0;
}
static void crypto_skcipher_exit_tfm(struct crypto_tfm *tfm)
{
struct crypto_skcipher *skcipher = __crypto_skcipher_cast(tfm);
tfm->__crt_alg->cra_type == &crypto_givcipher_type)
return crypto_init_skcipher_ops_ablkcipher(tfm);
skcipher->setkey = alg->setkey;
skcipher->encrypt ... |
<vulnerable_code>{
struct dentry *upperdir = ovl_dentry_upper(dentry->d_parent);
struct inode *dir = upperdir->d_inode;
struct dentry *upper = ovl_dentry_upper(dentry);
int err;
inode_lock_nested(dir, I_MUTEX_PARENT);
err = -ESTALE;
if (upper->d_parent == upperdir) {
/* Don't let d_delete() think it can reset... |
<vulnerable_code>#include <linux/pagevec.h>
#include <linux/blkdev.h>
#include <linux/bio.h>
#include <linux/prefetch.h>
#include <linux/uio.h>
#include <linux/cleancache.h>
static enum count_type __read_io_type(struct page *page)
{
struct address_space *mapping = page->mapping;
if (mapping) {
struct inode *inode... |
<vulnerable_code>import { escapeExpression } from "discourse/lib/utilities";
import getURL from "discourse-common/lib/get-url";
import { helperContext } from "discourse-common/lib/helpers";
let _renderer = defaultRenderTag;
href +
" data-tag-name=" +
tag +
(params.description ? ' title="' + params.des... |
<vulnerable_code> if (!ndo->ndo_eflag)
ND_PRINT((ndo, "MLPPP, "));
ND_PRINT((ndo, "seq 0x%03x, Flags [%s], length %u",
(EXTRACT_16BITS(p))&0x0fff, /* only support 12-Bit sequence space for now */
bittok2str(ppp_ml_flag_values, "none", *p & 0xc0),<commit_title>[PATCH] CVE-2017-13038... |
<vulnerable_code> if(count > segment->length)
{
segment->length = count;
}
js_memcpy_s(segment->elements, sizeof(Var) * segment->length, vars->elements, sizeof(Var) * count);
if(count > segment->length)
{
segment->length = count;
}
... |
<vulnerable_code> InitArrayFlags(DynamicObjectFlags::InitialArrayValue);
SetHeadAndLastUsedSegment(DetermineInlineHeadSegmentPointer<JavascriptArray, 0, false>(this));
head->size = size;
Var fill = Js::JavascriptArray::MissingItem;
for (uint i = 0; i < size; i++)
{
{
... |
<vulnerable_code> // if it's not being changed) may cause an AV.
size = min(size, nextLeft - left);
}
Assert(length <= size);
}
// Test if an element value is null/undefined.
_this->Truncate(left + newLen); // Truncate to new length (also clears moved element... |
<vulnerable_code> ex_diffgetput(&ea);
}
/*
* ":diffget"
* ":diffput"
}
}
// Adjust marks. This will change the following entries!
if (added != 0)
{
mark_adjust(lnum, lnum + count - 1, (long)MAXLNUM, (long)added);
if (curwin->w_cursor.lnum >= lnum)
{
#endif
vim_free(dfree);
}
... |
<vulnerable_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
25,
/**/<commit_title>[PATCH] patch 9.0.0026: accessing freed memory with diff put<commit_description>Problem: Accessing freed memory with diff put.
Solution: Bail out when diff pointer is no longer valid.<fix... |
<vulnerable_code> if (!kbuf)
return -ENOMEM;
if (!copy_from_iter_full(kbuf, len, from))
return -EFAULT;
if (mutex_lock_interruptible(&eptdev->ept_lock)) {
ret = -ERESTARTSYS;<commit_title>[PATCH] rpmsg: char: release allocated memory<commit_description>In rpmsg_eptdev_write_iter, if copy_from_iter_full fails ... |
<vulnerable_code> /* Copy from the fragment context info buffer first */
memcpy((uint8_t *)UIP_IP_BUF, (uint8_t *)frag_info[context].first_frag,
frag_info[context].first_frag_len);
for(i = 0; i < SICSLOWPAN_FRAGMENT_BUFFERS; i++) {
/* And also copy all matching fragments */
if(frag_buf[i].len > 0 ... |
<vulnerable_code>from django.utils.decorators import method_decorator
from django.views.decorators.cache import never_cache
from rest_framework import serializers
from rest_framework.authentication import SessionAuthentication
from rest_framework.permissions import IsAuthenticated
from rest_framework.request import Req... |
<vulnerable_code>void CLASS foveon_dp_load_raw()
{
unsigned c, roff[4], row, col, diff;
ushort huff[512], vpred[2][2], hpred[2];
fseek (ifp, 8, SEEK_CUR);
foveon_huff (huff);
void CLASS foveon_load_camf()
{
unsigned type, wide, high, i, j, row, col, diff;
ushort huff[258], vpred[2][2] = {{512,512},{512,512... |
<vulnerable_code> }
if (pDestArray && JavascriptArray::IsDirectAccessArray(aItem) && JavascriptArray::IsDirectAccessArray(pDestArray)
&& BigIndex(idxDest + JavascriptArray::FromVar(aItem)->length).IsSmallIndex()) // Fast path
{
if (JavascriptNativeIntA... |
<vulnerable_code>}
echo("-------concat Small-------------");
test_concat(2147483642);
// Fix for MSRC 33319 changes concat to skip a fast path if the index we're copying into is a BigIndex.
// Disable the large portion of this test since this change makes such a test run for hours.<commit_title>[PATCH] [CVE-2017-0252... |
<vulnerable_code> {
var c = [];
c[0] = 1;
c[4294967293] = 2;
var oNeg = { length : -1, 0 : 3, 1: 4, [Symbol.isConcatSpreadable] : true};
c = c.concat(oNeg);
assert.areEqual(1, c[0], "confirm indices of array concated to did not change")
... |
<vulnerable_code> """
read_bytes = self.read(num_bytes)
if len(read_bytes) < num_bytes:
raise EOFError(read_bytes)
return read_bytes
def read_pascal_bytes(self, string_length_size: int) -> bytes:<commit_title>[PATCH] Changed an exception message to prevent possible disclo... |
<vulnerable_code> nf_conntrack_standalone_init_dccp_sysctl(net, table);
nf_conntrack_standalone_init_gre_sysctl(net, table);
/* Don't allow unprivileged users to alter certain sysctls */
if (net->user_ns != &init_user_ns) {
table[NF_SYSCTL_CT_MAX].mode = 0444;
table[NF_SYSCTL_CT_EXPECT_MAX].mode = 0444;
table... |
<vulnerable_code> }
}
if (ent_name) gf_free(ent_name);
xml_sax_store_text(parser, i);
}
static GF_Err xml_sax_append_string(GF_SAXParser *parser, char *string)
{
u32 size = parser->line_size;
u32 nl_size = (u32) strlen(string);
if (!nl_size) return GF_OK;
<commit_title>[PATCH] fixed #2480<commit_description><f... |
<vulnerable_code>"""Tests for tf.quantize ops."""
import numpy as np
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import errors
from tensorflow.python.framework import test_util
from tensorflow.python.ops import array_ops
from tenso... |
<vulnerable_code>
buf = virtqueue_get_buf(port->in_vq, &len);
if (buf) {
buf->len = len;
buf->offset = 0;
port->stats.bytes_received += len;
}
while ((buf = virtqueue_get_buf(vq, &len))) {
spin_unlock(&portdev->c_ivq_lock);
buf->len = len;
buf->offset = 0;
handle_control_message(vq->vdev, portdev, b... |
<vulnerable_code> if (preloaded)
radix_tree_preload_end();
if (IS_ERR(blkg)) {
blkg_free(new_blkg);
return PTR_ERR(blkg);
}
q->root_blkg = blkg;
q->root_rl.blkg = blkg;<commit_title>[PATCH] blkcg: fix double free of new_blkg in blkcg_init_queue<commit_description>If blkg_create fails, new_blkg passed as an ... |
<vulnerable_code> "192.0.0.0/24",
# Link-local networks.
"169.254.0.0/16",
# Testing networks.
"198.18.0.0/15",
"192.0.2.0/24",
"fe80::/10",
# Unique local addresses.
"fc00::/7",
]
DEFAULT_ROOM_VERSION = "6"<commit_title>[PATCH] Add additional IP ranges.<commit_description><fixed_cod... |
<vulnerable_code>};
module.exports.createReview = (reviewData, callback) => {
const client = new Client({
user: dbconf.role,
host: dbconf.host,
database: 'reviews',
password: dbconf.password,
port: 5432
});
const insertReview = `INSERT INTO reviews
(
restaurant,
diner,
... |
<vulnerable_code>const path = require('path');
const cors = require('cors');
const express = require('express');
const db = require('../database/index.js');
const app = express();
app.use(cors());
app.use(express.static(path.resolve(__dirname, '../public')));
// Gets files from public folder
});
app.post('/:id/revi... |
<vulnerable_code> response = self.client.get(f"{self.proxy_url}?url={url}")
self.assertEqual(response.status_code, 403)
# Legit requests using the local host (SITEURL)
url = f"/\\@%23{urlsplit(settings.SITEURL).hostname}"
<commit_title>[PATCH] Merge pull request from GHSA-pxg5-h34r-7q8p<... |
<vulnerable_code> urlparse,
urlsplit,
urlencode,
parse_qsl,
ParseResult,
)
return url
def extract_ip_or_domain(url):
ip_regex = re.compile("^(?:http://|https://)(\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})")
domain_regex = re.compile("^(?:http://|https://)([a-zA-Z0-9.-]+)")
match = ... |
<vulnerable_code> /* OOB ok, we've got 4 bytes min on entry */
lines = I16(data); data += 2;
for (l = y = 0; l < lines && y < state->ysize; l++, y++) {
UINT8* buf = (UINT8*) im->image[y];
int p, packets;
ERR_IF_DATA_OOB(2)
packets = I16(data); data += 2;
state->errcode = IMAGING_CODEC_OVERR... |
<vulnerable_code> mch_memmove(new_end, sub_firstline + copycol, (size_t)copy_len);
new_end += copy_len;
#ifdef FEAT_EVAL
++textlock;
#endif<commit_title>[PATCH] patch 9.0.1848: [security] buffer-overflow in<commit_description><fixed_code>
mch_memmove(new_end, sub_firstline + copycol, (size_t)copy_len);
new_en... |
<vulnerable_code> // "flags & REGSUB_COPY" != 0.
if (copy)
{
if (eval_result[nested] != NULL)
{
STRCPY(dest, eval_result[nested]);
dst += STRLEN(eval_result[nested]);<commit_title>[PATCH] patch 9.0.1848: [security] buffer-overflow in<commit_description><fixed_code>
// "flags & REGSUB_COPY" != 0.
if (c... |
<vulnerable_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1847,
/**/<commit_title>[PATCH] patch 9.0.1848: [security] buffer-overflow in<commit_description><fixed_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1848,
/**/
... |
<vulnerable_code> j=0;
delta_x=0;
delta_y=0;
while (EOFBlob(image) != EOF)
{
x=ReadBlobByte(image);
y=ReadBlobByte(image);
j++;
blocks[j].offset=(ssize_t) i;
number_blocks=(size_t) j;
/*
Write stitches as SVG file.
*/
(void) FormatLocaleFile(file,"<svg xmlns=\"http://www.w3.org/2000/svg... |
<vulnerable_code>(function () {
var MESSAGE_NAMESPACE = 'cross-domain-local-message';
var allowedOriginsAttr = document.getElementById("post-message-api").getAttribute("accepted-origins");
var allowedOrigins = [];
if (allowedOriginsAttr && allowedOriginsAttr.length && allowedOriginsAttr.length > 0) {
allow... |
<vulnerable_code>
.listen(port, function() {
var port = this.address().port;
console.log('Listening at port', port);
});
function renderForm(req, res) {
function processData(req, res) {
var body = req.body,
exec = childProcess.exec,
cmd = getCmdWithArgs(body),
cbk = onSpeechDone.bind(this, {
res: res... |
<vulnerable_code>/* Generated by Cython 0.29.17 */
/* BEGIN: Cython Metadata
{
"depends": [],
"name": "clickhouse_driver.bufferedreader",
"sources": [
"clickhouse_driver/bufferedreader.pyx"
]
},
"module_name": "clickhouse_driver.bufferedreader"
#elif PY_VERSION_HEX <... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.