text stringlengths 79 3.72M |
|---|
<vulnerable_code> *green++=ScaleQuantumToChar(GetPixelGreen(p));
*blue++=ScaleQuantumToChar(GetPixelBlue(p));
if (image->matte != MagickFalse)
*opacity++=ScaleQuantumToChar((Quantum)
(GetPixelAlpha(p)));
p++;
}
count+=Encod... |
<vulnerable_code> if ((number_pixels*number_planes_filled) != (size_t) (number_pixels*
number_planes_filled))
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
pixel_info_length=image->columns*image->rows*number_planes_filled;
pixel_info=AcquireVirtualMemory(pixel_info_length,... |
<vulnerable_code> ThrowReaderException(ResourceLimitError,"ImproperImageHeader");
bytes_per_line>>=4;
sun_pixels=(unsigned char *) AcquireQuantumMemory(height,
bytes_per_line*sizeof(*sun_pixels));
if (sun_pixels == (unsigned char *) NULL)
ThrowReaderException(ResourceLimitError,"MemoryAlloc... |
<vulnerable_code> image->colors=viff_info.map_columns;
if (AcquireImageColormap(image,image->colors) == MagickFalse)
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
viff_colormap=(unsigned char *) AcquireQuantumMemory(image->colors,
viff_info.map_rows*bytes_... |
<vulnerable_code>% o quantum: the number of bytes in each quantum.
%
*/
MagickExport void *AcquireAlignedMemory(const size_t count,const size_t quantum)
{
#define AlignedExtent(size,alignment) \
void
*memory;
size=count*quantum;
if ((count == 0) || (quantum != (size/count)))
{
errno=ENOMEM;
... |
<vulnerable_code> bytes += this.salt;
bytes += String.fromCharCode(this.c);
break;
}
return bytes;
isp = isp.substr(0, count);
return crypto.hash.digest(algorithm, prefix + isp);
}
}
<commit_title>[PATCH] Throw exception on unsupported S2K type.<commit_description><fixed_c... |
<vulnerable_code><commit_title>[PATCH] 1.3.1.2<commit_description><fixed_code>
|
<vulnerable_code>from io import BytesIO
from plone.memoize import ram
from plone.namedfile.file import FILECHUNK_CLASSES
from plone.namedfile.interfaces import IAvailableSizes
from plone.namedfile.interfaces import IStableImageScale
from plone.namedfile.picture import get_picture_variants
__allow_access_to_unprotec... |
<vulnerable_code>from plone.app.testing import SITE_OWNER_PASSWORD
from plone.namedfile import field
from plone.namedfile import file
from plone.namedfile.interfaces import IImageScaleTraversable
from plone.namedfile.testing import PLONE_NAMEDFILE_FUNCTIONAL_TESTING
from plone.namedfile.tests import getFile
from plone.... |
<vulnerable_code> threshold_image=CloneImage(image,0,0,MagickTrue,exception);
if (threshold_image == (Image *) NULL)
return((Image *) NULL);
if (SetImageStorageClass(threshold_image,DirectClass) == MagickFalse)
{
InheritException(exception,&threshold_image->exception);<commit_title>[PATCH] https://gi... |
<vulnerable_code> res = document.URL;
}
}
return res;
}
// -------------- finish setup player url according to the socialShareURL flashvar ------- //
<commit_title>[PATCH] fix(FEC-11791): share url has cross-site scripting<commit_description><fixed_code>
res = document.URL;
}
}
return k... |
<vulnerable_code> bad.should.throw(/cdf data must be an array of finite numbers, got:/);
});
} else {
it('f('+x+') should throw TypeError', function(){
var f = cdf(data);
function bad(){ var p = f(x); }
bad.should.throw(/cdf... |
<vulnerable_code>#include <errno.h>
#include <fcntl.h>
#include <grp.h>
#include <sched.h>
#include <setjmp.h>
#include <signal.h>
SYNC_RECVPID_ACK = 0x43, /* PID was correctly received by parent. */
SYNC_GRANDCHILD = 0x44, /* The grandchild is ready to run. */
SYNC_CHILD_FINISH = 0x45, /* The child or grandchild ha... |
<vulnerable_code>}
static int
validate_event(struct pmu_hw_events *hw_events,
struct perf_event *event)
{
struct arm_pmu *armpmu = to_arm_pmu(event->pmu);
struct hw_perf_event fake_event = event->hw;
struct pmu *leader_pmu = event->group_leader->pmu;
if (is_software_event(event))
return 1;
if (event->... |
<vulnerable_code> if (acl_len > buflen)
goto out_free;
_copy_from_pages(buf, pages, res.acl_data_offset,
res.acl_len);
}
ret = acl_len;
out_free:<commit_title>[PATCH] Fix length of buffer copied in __nfs4_get_acl_uncached<commit_description>_copy_from_pages() used to copy data from the temporary buffer to t... |
<vulnerable_code>
key = key_ref_to_ptr(key_ref);
/* see if we can read it directly */
ret = key_permission(key_ref, KEY_NEED_READ);
if (ret == 0)<commit_title>[PATCH] KEYS: prevent KEYCTL_READ on negative key<commit_description>Because keyctl_read_key() looks up the key with no permissions
requested, it may find a... |
<vulnerable_code>void DecodedBitStreamParser::append(std::string& result, const char* bufIn, size_t nIn,
ErrorHandler& err_handler) {
if (err_handler.ErrCode()) return;
#ifndef NO_ICONV_INSIDE
if (nIn == 0) {
return;
}
iconv_t cd;
// cout<<src<<endl;
c... |
<vulnerable_code>#include "file.h"
#ifndef lint
FILE_RCSID("@(#)$File: cdf.c,v 1.61 2014/06/04 17:23:19 christos Exp $")
#endif
#include <assert.h>
if (cdf_check_stream_offset(sst, h, e, 0, __LINE__) == -1)
goto out;
for (i = 0; i < sh.sh_properties; i++) {
size_t ofs = CDF_GETUINT32(p, (i << 1) + 1);
q = (co... |
<vulnerable_code>#-----------------------------------------------------------------------------
try:
from urllib.parse import urlparse
except ImportError:
from urlparse import urlparse
try:
from http.cookies import SimpleCookie # Py 3<commit_title>[PATCH] Indicate Py3 vs. Py2 codepath.<commit_description... |
<vulnerable_code>
f.readDwords(&instr[y].size,1);
if (instr[y].size < 29)
{
mp_ubyte buffer[29];
memset(buffer, 0, sizeof(buffer));<commit_title>[PATCH] Fix possible stack corruption with XM instrument headers<commit_description><fixed_code>
f.readDwords(&instr[y].size,1);
if (instr[... |
<vulnerable_code>const BaseRegistrar = artifacts.require(
'./registrar/BaseRegistrarImplementation',
)
const namehash = require('eth-ens-namehash')
const sha3 = require('web3-utils').sha3
let ens
let registrar
before(async () => {
ens = await ENS.new()
registrar = await BaseRegistrar.new(ens.address... |
<vulnerable_code>const { ZERO_ADDRESS } = require('@openzeppelin/test-helpers/src/constants')
const { deploy } = require('../test-utils/contracts')
const { EMPTY_BYTES32, EMPTY_ADDRESS } = require('../test-utils/constants')
const abiCoder = new ethers.utils.AbiCoder()
use(solidity)
let NameWrapper2
let NameWrappe... |
<vulnerable_code> // still expired
expect(expiryAfter).to.be.at.most(block1.timestamp + GRACE_PERIOD)
})
})
describe('isWrapped(bytes32 node)', () => {<commit_title>[PATCH 1/8] Initial version of mitigation contracts<commit_description><fixed_code>
// still expired
expect(expiryAfter).to... |
<vulnerable_code> NameWrapperAdmin.connect(signers[2]).setUpgradeContract(account2),
).to.be.revertedWith('Ownable: caller is not the owner')
})
it('Will setApprovalForAll for the upgradeContract addresses in the registrar and registry to true', async () => {
expect(
await BaseRegistr... |
<vulnerable_code> int v)
{
unsigned int n;
if (!xdr_krb5_principal(xdrs, &objp->principal)) {
return (FALSE);
if (!xdr_krb5_int16(xdrs, &objp->n_key_data)) {
return (FALSE);
}
if (!xdr_krb5_int16(xdrs, &objp->n_tl_data)) {
return (FALSE);
}
return FALSE;
}
n = objp->n_key_data;
if (!xdr_array(x... |
<vulnerable_code>
/*
** Similar to 'luaD_call', but does not allow yields during the call.
** If there is a stack overflow, freeing all CI structures will
** force the subsequent call to invoke 'luaE_extendCI', which then
** will raise any errors.
*/
void luaD_callnoyield (lua_State *L, StkId func, int nResults) {
in... |
<vulnerable_code><commit_title>[PATCH] Add tests for BaseSecurityManager.update_user_auth_stat<commit_description><fixed_code>
import datetime
import unittest
from unittest.mock import MagicMock, patch
from flask_appbuilder.security.manager import BaseSecurityManager
@patch.object(BaseSecurityManager, "update_user")... |
<vulnerable_code> enum AVDiscard skip_thresh;
VP8Frame *av_uninit(curframe), *prev_frame;
if (is_vp7)
ret = vp7_decode_frame_header(s, avpkt->data, avpkt->size);
else<commit_title>[PATCH] avcodec/webp: Always set pix_fmt<commit_description>Fixes: out of array access
Fixes: 1434/clusterfuzz-testc... |
<vulnerable_code> if (!s->initialized) {
ff_vp8_decode_init(avctx);
s->initialized = 1;
if (s->has_alpha)
avctx->pix_fmt = AV_PIX_FMT_YUVA420P;
}
s->lossless = 0;
if (data_size > INT_MAX) {<commit_title>[PATCH] avcodec/webp: Always set pix_fmt<commit_description>Fixes... |
<vulnerable_code> !ASS_REALLOC_ARRAY(shaper->emblevels, new_size) ||
!ASS_REALLOC_ARRAY(shaper->cmap, new_size))
return false;
}
return true;
}<commit_title>[PATCH] shaper: fix reallocation<commit_description>Update the variable that tracks the allocated size. This potentially... |
<vulnerable_code> }
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
if (!(flags & TTM_PAGE_FLAG_DMA32)) {
for (j = 0; j < HPAGE_PMD_NR; ++j)
if (p++ != pages[i + j])
break;
unsigned max_size, n2free;
spin_lock_irqsave(&huge->lock, irq_flags);
while (i < npages) {
struct page *p = pages[i];
unsig... |
<vulnerable_code>import shutil
import subprocess
import tempfile
from typing import Callable, List, Optional, Tuple
from ..document import Document
from ..util import get_resource_path, get_subprocess_startupinfo, get_tmp_dir
from .base import IsolationProvider
# Define startupinfo for subprocesses
return in... |
<vulnerable_code><commit_title>[PATCH] container: Improve parsing of progress reports<commit_description>Improve the `parse_progress()` method of the container isolation
provider in the following ways:
1. Make sure that the fields of the progress report have the expected
type.
2. In case of a JSON parsing error, sa... |
<vulnerable_code><commit_title>[PATCH] container: Improve parsing of progress reports<commit_description>Improve the `parse_progress()` method of the container isolation
provider in the following ways:
1. Make sure that the fields of the progress report have the expected
type.
2. In case of a JSON parsing error, sa... |
<vulnerable_code>
# Validate user-data adheres to schema definition
if os.path.exists(init.paths.get_ipath_cur("userdata_raw")):
validate_cloudconfig_schema(config=init.cfg, strict=False)
else:
LOG.debug("Skipping user-data validation. No user-data found.")
<commit_title>[PATCH] Remove schem... |
<vulnerable_code> schema: dict = None,
strict: bool = False,
strict_metaschema: bool = False,
):
"""Validate provided config meets the schema definition.
logging warnings.
@param strict_metaschema: Boolean, when True validates schema using strict
metaschema definition at runtime (curre... |
<vulnerable_code> - echo 'hi' > /var/tmp/test
"""
INVALID_USER_DATA_SCHEMA = """\
#cloud-config
updates:
notnetwork: -1
apt_pipelining: bogus
"""
assert result.ok
log = client.read_from_file("/var/log/cloud-init.log")
warning = (
"[WARNING]: Invalid cloud-config provided:\napt_pipelining: 'bogu... |
<vulnerable_code> assert "cloudinit.config.schema" == module
assert logging.WARNING == log_level
assert (
"Invalid cloud-config provided:\np1: -1 is not of type 'string'"
== log_msg
)
@skipUnlessJsonSchema()
def test_validateconfig_schema_emits_warning_on_... |
<vulnerable_code> viewManager.setDropdownSelected(String.valueOf(imageToShow));
}
// Reset LOGID (the LOGID setter is called later by PrettyFaces, so if a value is passed, it will still be set)
setLogid("");
logger.trace("imageToShow: {}", this.imageToShow)... |
<vulnerable_code>
import org.xwiki.component.annotation.Component;
import org.xwiki.context.Execution;
import org.xwiki.script.service.ScriptService;
/**
@Inject
private Execution execution;
/**
* Display an icon with wiki code from the current {@link org.xwiki.icon.IconSet}.
*
*/
publi... |
<vulnerable_code> np.reshape(initializing_values, (num_rows, num_cols)),
self.evaluate(remapped_matrix))
@test_util.run_deprecated_v1
def test_load_and_remap_invalid_remapping(self):
"""Tests that errors are raised when an ID maps to multiple new IDs.<commit_title>[PATCH] Fix tf.raw_ops.Load... |
<vulnerable_code>
fix_current_dir();
if (flags & WEE_TRIGGER_NEW_AUTOCMDS) {
apply_autocmds(EVENT_WINNEW, NULL, NULL, false, curbuf);
}
}
// set window width to desired minimal value
if (curwin->w_width < p_wiw && !curwin->w_p_wfw && !wp->w_floating) {
win_setwidth((int)p_wiw);
}
<commit_title>[... |
<vulnerable_code>from setroubleshoot.util import *
from setroubleshoot.Plugin import Plugin
import commands
import sys
def is_execstack(path):
if path[0] != "/":
return False
x = commands.getoutput("execstack -q %s" % path).split()
return ( x[0] == "X" )
def find_execstack(exe, pid):
execst... |
<vulnerable_code> suffix=self._fs_transaction_suffix, dir=self._path
)
with os.fdopen(fd, "wb") as f:
pickle.dump(timeout, f, 1)
pickle.dump(value, f, pickle.HIGHEST_PROTOCOL)
os.replace(tmp, filename)
os.chmod(filename, self... |
<vulnerable_code> # I didn't found a good way to avoid pickling/unpickling if
# key is smaller than chunksize, because in case or <werkzeug.requests>
# getting the length consume the data iterator.
serialized = pickle.dumps(value, 2)
values = {}
len_ser = len(serialized)
... |
<vulnerable_code> def set(self, key, value, timeout=None):
expires = self._normalize_timeout(timeout)
self._prune()
item = (expires, pickle.dumps(value, pickle.HIGHEST_PROTOCOL))
self._cache[key] = item
logger.debug("set key %r", key)
return True
def add(self, key,... |
<vulnerable_code> bool waitable) /**< waitable argument */
{
/* 2. */
if (!ecma_is_value_object (typedarray))
{
return ecma_raise_type_error (ECMA_ERR_ARGUMENT_THIS_NOT_OBJECT);
}
/* 3-4. */<commit_title>[PATCH] Fix typedarray validation in Atomics read_modify_writ... |
<vulnerable_code><commit_title>[PATCH] Fix typedarray validation in Atomics read_modify_write<commit_description>This patch fixes #4875.
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik robert.fancsik@h-lab.eu<fixed_code>
// Copyright JS Foundation and other contributors, http://js.foundation
//
// Licensed under the... |
<vulnerable_code>import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.dspace.authorize.AuthorizeException;
import org.dspace.core.Context;
*/
public class ControlledVocabularyServlet extends DSpaceServlet
{
// private static Logger log =
// Logger.getLogger(... |
<vulnerable_code>static uint64_t unpack_timestamp(const struct efi_time *timestamp)
{
uint64_t val = 0;
uint16_t year = le32_to_cpu(timestamp->year);
/* pad1, nanosecond, timezone, daylight and pad2 are meant to be zero */
val |= ((uint64_t) timestamp->pad1 & 0xFF) << 0;<commit_title>[PATCH] secvar: fix endian con... |
<vulnerable_code> return true; // Continue monitoring this source
}
bool
XmlRpcClient::readResponse()
{<commit_title>[PATCH] Revert earlier change<commit_description>Signed-off-by: Sid Faber <sid.faber@canonical.com><fixed_code>
return true; // Continue monitoring this source
}
bool
XmlRpcClient::readR... |
<vulnerable_code> ND_TCHECK2(opt[i+2], cap_len);
switch (cap_type) {
case BGP_CAPCODE_MP:
ND_PRINT((ndo, "\n\t\tAFI %s (%u), SAFI %s (%u)",
tok2str(af_values, "Unknown",
EXTRACT_16BITS(opt... |
<vulnerable_code> with suppress(InvalidGitRepositoryError):
if (
Path(repository_record.filesystem_path).exists()
and Repo(repository_record.filesystem_path).head == head
):
return False
<commit_title>[PATCH] fixes early return conditional i... |
<vulnerable_code> if salt.utils.data.is_true(allow_passwordless) and \
salt.utils.data.is_true(unix_socket):
if host == 'localhost':
if salt.utils.versions.version_cmp(server_version, '8.0.11') >= 0:
qry = "ALTER USER %(user)s@%(host)s IDENTIFIED BY %(password)s;"
... |
<vulnerable_code> if (end && Jsi_GetNumberFromValue(interp,end, &nend) == JSI_OK) {
iend = (int) nend;
if (iend >= n)
iend = n;
if (iend < 0)
iend = (n+iend);
if (iend<0)
if (end && Jsi_GetNumberFromValue(interp,end, &nend) == JSI_OK) {
iend = (int)... |
<vulnerable_code> client->hid = safe_strdup(hash);
free(hash);
// Reset custom and client_type
client->custom = safe_calloc(MID_BUF);
client->client_type = safe_calloc(STATUS_BUF);
//Reset cid and remove cidfile using rmcid
if (client->cid) {
free(msg);
free(cidinfo);
}
client->cid = safe_calloc(SMA... |
<vulnerable_code> if (strcmp(url, "/login") == 0) {
client->cpi_query = safe_strdup(originurl);
debug(LOG_DEBUG, "RFC8910 request: %s", client->cpi_query);
} else {
client->cpi_query = "none";
}
debug(LOG_DEBUG, "originurl_raw: %s", originurl_raw);<commit_title>[PATCH] Fix - memory leak when deleting client f... |
<vulnerable_code> /* split. */
GC_ASSERT((sz & (GRANULE_BYTES - 1)) == 0);
blocks = OBJ_SZ_TO_BLOCKS(sz);
if ((signed_word)(blocks * HBLKSIZE) < 0) {
return 0;
}
signed_word size_needed; /* number of bytes in requested objects */... |
<vulnerable_code>/* Returns FALSE on failure. */
GC_INNER GC_bool GC_expand_hp_inner(word n)
{
word bytes;
struct hblk * space;
word expansion_slop; /* Number of bytes by which we expect the */
/* heap to expand soon. ... |
<vulnerable_code> /* Note that according to malloc() specification, if size is 0 then */
/* malloc() returns either NULL, or a unique pointer value that can */
/* later be successfully passed to free(). We always do the latter. */
result = GC_malloc(lb + DEBUG_BYTES);
# ifdef GC_ADD_CALLER
if (s ... |
<vulnerable_code> word lg;
DCL_LOCK_STATE;
lb += sizeof(word);
GC_ASSERT(done_init);
if (SMALL_OBJ(lb)) {
GC_DBG_COLLECT_AT_MALLOC(lb);<commit_title>[PATCH] Fix malloc routines to prevent size value wrap-around<commit_description><fixed_code>
word lg;
DCL_LOCK_STATE;
lb = SIZET_... |
<vulnerable_code> /* confuse the backtrace. */
LOCK();
maybe_finalize();
result = GC_generic_malloc_inner(lb + DEBUG_BYTES, GC_gcj_debug_kind);
if (result == 0) {
GC_oom_func oom_fn = GC_oom_fn;
UNLOCK();<commit_title>[PATCH] Fix malloc routines to pr... |
<vulnerable_code>{
register ptr_t result = scratch_free_ptr;
bytes += GRANULE_BYTES-1;
bytes &= ~(GRANULE_BYTES-1);
scratch_free_ptr += bytes;
if ((word)scratch_free_ptr <= (word)GC_scratch_end_ptr) {
return(result);<commit_title>[PATCH] Fix malloc routines to prevent size value wrap-around... |
<vulnerable_code> ptr_t result;
GC_bool retry = FALSE;
/* Round up to a multiple of a granule. */
lb = (lb + GRANULE_BYTES - 1) & ~(GRANULE_BYTES - 1);
n_blocks = OBJ_SZ_TO_BLOCKS(lb);
if (!EXPECT(GC_is_initialized, TRUE)) GC_init();
/* Do our share of marking work */
if (GC_increm... |
<vulnerable_code> return(GC_generic_malloc((word)lb, k));
lg = ROUNDED_UP_GRANULES(lb);
lb_rounded = GRANULES_TO_BYTES(lg);
if (lb_rounded < lb)
return((*GC_get_oom_fn())(lb));
n_blocks = OBJ_SZ_TO_BLOCKS(lb_rounded);
init = GC_obj_kinds[k].ok_init;
if (EXPECT(GC_have_errors, FALS... |
<vulnerable_code>/* quantization algorithm (but we precompute it). */
STATIC void GC_init_size_map(void)
{
int i;
/* Map size 0 to something bigger. */
/* This avoids problems at lower levels. */
GC_size_map[0] = 1;
for (i = 1; i <= GRANULES_TO_BY... |
<vulnerable_code># endif /* OS/2 */
/* Find the page size */
GC_INNER word GC_page_size = 0;
#if defined(MSWIN32) || defined(MSWINCE) || defined(CYGWIN32)
# ifndef VER_PLATFORM_WIN32_CE
GC_INNER void GC_setpagesize(void)
{
GetSystemInfo(&GC_sysinfo);
GC_page_size = GC_sysinfo.dwPageSize;
# if defined(MS... |
<vulnerable_code> DCL_LOCK_STATE;
GC_ASSERT(GC_explicit_typing_initialized);
lb += TYPD_EXTRA_BYTES;
if (SMALL_OBJ(lb)) {
GC_DBG_COLLECT_AT_MALLOC(lb);
lg = GC_size_map[lb];
DCL_LOCK_STATE;
GC_ASSERT(GC_explicit_typing_initialized);
lb += TYPD_EXTRA_BYTES;
if( SMALL_OBJ(... |
<vulnerable_code> bns = bns_restore_core(ann_filename, amb_filename, pac_filename);
if (bns == 0) return 0;
if ((fp = fopen(strcat(strcpy(alt_filename, prefix), ".alt"), "r")) != 0) { // read .alt file if present
char str[1024];
khash_t(str) *h;
int c, i, absent;
khint_t k;
}
while (c != '\n' && c != ... |
<vulnerable_code> {SCMP_SYS (clone), &SCMP_A0 (SCMP_CMP_MASKED_EQ, CLONE_NEWUSER, CLONE_NEWUSER)},
/* Don't allow faking input to the controlling tty (CVE-2017-5226) */
{SCMP_SYS (ioctl), &SCMP_A1 (SCMP_CMP_EQ, (int) TIOCSTI)},
};
struct<commit_title>[PATCH] run: Only compare the lowest 32 ioctl arg bi... |
<vulnerable_code>VERSION = (0, 9, '3a3')
__version__ = '.'.join(map(str, VERSION))
<commit_title>[PATCH] to b1<commit_description><fixed_code>
VERSION = (0, 9, '3b1')
__version__ = '.'.join(map(str, VERSION))
|
<vulnerable_code>from pathlib import Path
from urllib.parse import unquote
import base64
configuration = json.dumps(data.get('configuration'), ensure_ascii=False)
project.update(**{'configuration': configuration})
# execute generate cmd
cmd = ' '.join(['gerapy', 'generate', proj... |
<vulnerable_code>public class DelegatingSerializationFilter {
private static final Logger LOG = Logger.getLogger(DelegatingSerializationFilter.class.getName());
private static final SerializationFilterAdapter serializationFilterAdapter = isJava6To8() ? new OnJava6To8() : new OnJavaAfter8();
private static... |
<vulnerable_code> pfk->registered |= (1<<hdr->sadb_msg_satype);
}
xfrm_probe_algs();
supp_skb = compose_sadb_supported(hdr, GFP_KERNEL | __GFP_ZERO);
if (!supp_skb) {
if (hdr->sadb_msg_satype != SADB_SATYPE_UNSPEC)
pfk->registered &= ~(1<<hdr->sadb_msg_satype);<commit_title>[PATCH] af_key: Do not call xfrm_... |
<vulnerable_code> goto out;
}
n2size = json_integer_value(json_array_get(res_val, 2));
if (!n2size) {
applog(LOG_INFO, "Failed to get n2size in initiate_stratum");
free(sessionid);
free(nonce1);<commit_title>[PATCH] Bugfix: initiate_stratum: Ensure extranonce2 size is not<commit_description><fixed_code>
got... |
<vulnerable_code>{
struct usb_device *usb_dev = atusb->usb_dev;
int ret;
uint8_t value;
dev_dbg(&usb_dev->dev, "atusb: reg = 0x%x\n", reg);
ret = atusb_control_msg(atusb, usb_rcvctrlpipe(usb_dev, 0),
ATUSB_REG_READ, ATUSB_REQ_FROM_DEV,
0, reg, &value, 1, 1000);
return ret >= 0 ? value : ret;
}
static in... |
<vulnerable_code> ("v,verbose", "Enable verbose logging",
cxxopts::value<int>()->default_value("0")) //
("k,keepalive", "Client keepalive duration in seconds",
cxxopts::value<int>()) //
("logtostdout", "Write log to stdout") //
... |
<vulnerable_code> // Not used by etterminal but easylogging uses this flag under the hood
("v,verbose", "Enable verbose logging",
cxxopts::value<int>()->default_value("0")) //
("logtostdout", "Write log to stdout") //
("serverfifo",
"If set, connects to the etserv... |
<vulnerable_code> ("daemon", "Daemonize the server") //
("cfgfile", "Location of the config file",
cxxopts::value<std::string>()->default_value("")) //
("logtostdout", "log to stdout") //
("pidfile", "Location of the pid file",
cxxopts::va... |
<vulnerable_code>}
EXPORT_SYMBOL(ip4_datagram_connect);
void ip4_datagram_release_cb(struct sock *sk)
{
const struct inet_sock *inet = inet_sk(sk);
const struct ip_options_rcu *inet_opt;
__be32 daddr = inet->inet_daddr;
struct flowi4 fl4;
struct rtable *rt;
if (! __sk_dst_get(sk) || __sk_dst_check(sk, 0))
ret... |
<vulnerable_code>import java.lang.reflect.Constructor;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
.isXsrfProtectionEnabled()) {
String sessionToken = session.getCsr... |
<vulnerable_code>/*!
Web Build: https://mootools.net/more/builder/a3048f4bfdf603b22a69c141dbd0fca9
*/
MooTools.More={version:"1.6.0",build:"45b71db70f879781a7e0b0d3fb3bb1307c2521eb"},function(){var e={wait:function(e){return this.chain(function(){return this.callChain.delay(null==e?500:e,this),this}.bind(this))}};Chain... |
<vulnerable_code>
// [databind#2688]: apache/drill
s.add("oadd.org.apache.xalan.lib.sql.JNDIConnectionPool");
// [databind#2698]: weblogic w/ oracle/aq-jms
// (note: dependency not available via Maven Central, but as part of<commit_title>[PATCH] MNSTR-5023 backport security fix from jac... |
<vulnerable_code> BufferedInputStream inputStream = new BufferedInputStream(entity.getContent());
FileType fileType = FileTypeDetector.detectFileType(inputStream);
String suffix = fileType.getCommonExtension();
if (CommonUtil... |
<vulnerable_code> * @returns {string}
*/
_format(value) {
if (typeof value === 'string') {
if (value.includes('\'')) {
throw Error('Argument must not contain single quote "\'"');
} else if (['$', ' ', '#', '\\', ';'].some(c => value.includes(c))) {
return `'${value}'`;
}
... |
<vulnerable_code> if (this.scanimage.supportsOutputFlag) {
cmdBuilder.arg('-o', outputFile);
} else {
cmdBuilder.arg('>', outputFile);
}
}
return cmdBuilder.build();<commit_title>[PATCH] SECURITY: CommandBuilder fixes<commit_description>Closes #599
This was an issue privately r... |
<vulnerable_code> 'echo');
});
it('command-arg', async () => {
assert.strictEqual(
new CommandBuilder('echo').arg('hello world').build(),
'echo \'hello world\'');
});
it('command-arg-hash', async () => {
assert.strictEqual(
new CommandBuilder('echo').arg('-n', 'hello#world').bui... |
<vulnerable_code> result = await Process.execute(new CmdBuilder('echo').arg('-n', '`ls -al`').build());
assert.strictEqual(result, '`ls -al`');
result = await Process.execute(new CmdBuilder('echo').arg('-n', '$(date)').build());
assert.strictEqual(result, '$(date)');
});
it('echo "1\\n2\\n3" | wc -... |
<vulnerable_code>describe('ScanimageCommand', () => {
it('scanimageVersion:1.0.27:scan', () => {
const command = commandFor('1.0.27', requestScan);
assert.ok(command.match(/.*scanimage.* > data\/temp\/~tmp-scan-0-ined.tif/));
});
it('scanimageVersion:1.0.27:preview', () => {
const command = commandFo... |
<vulnerable_code> *p = '\0';
im_strncpy( mode, p + 1, FILENAME_MAX );
}
strcpy( buf, mode );
p = &buf[0];<commit_title>[PATCH] fix a used-before-set error in im_vips2dz<commit_description>we were reading an uninited string in a vips7 compatibility wrapper, thanks
yifengchen-cc
see https://github.com/libvips/l... |
<vulnerable_code>
return Promise.all(files.map(x => {
const dest = path.join(output, x.path);
if (dest.match(/\.\.\//)) {
throw (new Error('File path contains "..":', dest));
}
const mode = x.mode & ~process.umask();
const now = new Date();
.then(() => x);
}
return makeDir(path.dirname(dest))
... |
<vulnerable_code>test('throw when a location outside the root is given', async t => {
await t.throwsAsync(async () => {
await m(path.join(__dirname, 'fixtures', 'slipping.tar.gz'), 'dist');
}, {message: /File path contains "\.\."/});
});
test('allows filenames to be written with dots in them', async t => {
const ... |
<vulnerable_code> clock_source_private_data *clock_private_info,
uint64_t reception_time) {
if (recv_len != -1) {
buf[recv_len - 1] = 0; // make sure there's a null in it!
debug(2, "New control port message: \"%s\".", buf);
// we need to g... |
<vulnerable_code>(function(global) {
global.confirmPrompt = function confirmPrompt(message, title) {
var dfd = $.Deferred();
message = $('<div>', {width: 400, html: message});
new ConfirmPopup(title || $T('Please confirm'), message, function(confirmed) {
if (confirmed) {
dfd.resolve();<commi... |
<vulnerable_code> id = fields.Integer(required=True, validate=Range(min=1))
class _PasswordValidationSchema(Schema):
""" Schema that contains password validation function """
def _validate_password(self, password: str):
self._validate_password(password)
class CollaborationInputSchema(Schema):
... |
<vulnerable_code> client.maybeUpgrade(transport);
}
} else {
// transport error handling takes over
socket.removeListener("error", onUpgradeError);
this.handshake(req._query.transport, req);
}
<commit_title>[PATCH] fix: properly handle invalid data sent by a malicious<commit_desc... |
<vulnerable_code> }
);
});
});
describe("handshake", () => {<commit_title>[PATCH] fix: properly handle invalid data sent by a malicious<commit_description><fixed_code>
}
);
});
it("should not throw when the client sends invalid data during the handshake (ws only)", done => {... |
<vulnerable_code>
#include "PubSubReader.hpp"
#include "PubSubWriter.hpp"
#include <gtest/gtest.h>
using namespace eprosima::fastrtps;
using namespace eprosima::fastrtps::rtps;
#include "DatagramIntectionTransport.hpp"
enum communication_type
{
TRANSPORT
}
void deliver_datagram_from_file(
const std::set<ep... |
<vulnerable_code><commit_title>[PATCH] Refs #16784. Small refactor.<commit_description>Signed-off-by: Miguel Company <MiguelCompany@eprosima.com><fixed_code>
// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use th... |
<vulnerable_code>
package com.pugh.sockso;
import com.pugh.sockso.inject.SocksoModule;
import com.google.inject.Guice;
import com.google.inject.Injector;<commit_title>[PATCH 3/3] extracted majority of caching implementation to<commit_description><fixed_code>
package com.pugh.sockso;
import com.pugh.sockso.cache.Obje... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.