text stringlengths 79 3.72M |
|---|
<vulnerable_code> d = php_math_round(d, dec);
// departure from PHP: we got rid of dependencies on spprintf() here.
String tmpstr(63, ReserveString);
tmpbuf = tmpstr.mutableData();
tmplen = snprintf(tmpbuf, 64, "%.*F", dec, d);
if (tmplen < 0) return empty_string();
if (tmpbuf == nullptr || !isdigit((int)... |
<vulnerable_code>
if self.enabled is True:
if self.runas_user is None:
if os.getuid() == 0:
raise ModuleException("Binwalk extraction uses many third party utilities, which may not be secure.\nIf you wish to have extraction utilities executed as the current user, ... |
<vulnerable_code> else
{
// Mark a buffer scanned when it has been scanned completely
if (type == 0 || type == CTRL_X_PATH_PATTERNS)
st.ins_buf->b_scanned = TRUE;
compl_started = FALSE;<commit_title>[PATCH] patch 9.0.1858: [security] heap use after free in<commit_description><fixed_code>
else
{
... |
<vulnerable_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1857,
/**/<commit_title>[PATCH] patch 9.0.1858: [security] heap use after free in<commit_description><fixed_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1858,
/**/
... |
<vulnerable_code> connection,
selectVariant,
[{'COLA': {a: 1, b: [1, 2, 3, -Infinity, undefined], c: {a: 1}}}],
callback
);
}],
done
connection,
selectArray,
[{'COLA': ['a', 1]}],
... |
<vulnerable_code> assert.ok(!err, JSON.stringify(err));
};
module.exports.executeQueryAndVerify = function (connection, sql, expected, callback, bindArray, normalize)
{
// Sometimes we may not want to normalize the row first
normalize = (typeof normalize !== "undefined" && normalize != null) ? normalize : true;
... |
<vulnerable_code> function (row)
{
// variant
assert.deepStrictEqual(row.getColumnValue('C1'), {a: 1});
assert.strictEqual(
row.getColumnValueAsString('C1'), JSON.stringify({a: 1}));
// object<commit_title>[PATCH] Use assert without strict for comparin... |
<vulnerable_code> return false;
}
link_shdr = &bin->shdr[shdr->sh_link];
if (shdr->sh_size < 1) {
return false;
}
Elf_(Verdef) *defs = calloc (shdr->sh_size, sizeof (char));
if (shdr->sh_link > bin->ehdr.e_shnum) {
return NULL;
}
if (shdr->sh_size < 1) {
return NULL;
}
sdb = sdb_new0 ();<commit_title>[... |
<vulnerable_code> (void) CloseBlob(image);
return(image);
}
for ( ; offset < (MagickOffsetType) cin.file.image_offset; offset++)
{
int<commit_title>[PATCH] https://github.com/ImageMagick/ImageMagick/issues/1472<commit_description><fixed_code>
(void) CloseBlob(image);
return(image);
... |
<vulnerable_code>import requests
from mindsdb.utilities import log
from mindsdb.api.http.utils import http_error
from mindsdb.api.http.namespaces.configs.files import ns_conf
from mindsdb.utilities.config import Config
from mindsdb.utilities.context import context as ctx
f.extractall(temp_dir_path)... |
<vulnerable_code>import json
from flask import Response
'Content-Type': 'application/problem+json'
}
)<commit_title>[PATCH] Use safe extract to prevent CVE-2007-4559 bug<commit_description><fixed_code>
import json
import os
from flask import Response
'Content-Type': 'application/... |
<vulnerable_code>#include <stdlib.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include "linenoise.h"
int j;
if (fp == NULL) return -1;
for (j = 0; j < history_len; j++)
fprintf(fp,"%s\n",history[j]);
fclose(fp);
char buf[LINENOISE_MAX_LINE];
if (fp == ... |
<vulnerable_code> tnum_strn(tn_buf, sizeof(tn_buf), regs[regno].var_off);
verbose(env, "invalid variable stack read R%d var_off=%s\n",
regno, tn_buf);
}
off = regs[regno].off + regs[regno].var_off.value;
if (off >= 0 || off < -MAX_BPF_STACK || off + access_size > 0 ||<commit_title>[PATCH] bpf: fix missing erro... |
<vulnerable_code>{
unsigned int u = 0;
LineContribType *res;
int overflow_error = 0;
res = (LineContribType *) gdMalloc(sizeof(LineContribType));
if (!res) {
return NULL;
return NULL;
}
for (u = 0 ; u < line_length ; u++) {
if (overflow2(windows_size, sizeof(double))) {
overflow_error = 1;
} else {
... |
<vulnerable_code>int
zfs_fastaccesschk_execute(znode_t *zdp, cred_t *cr)
{
boolean_t owner = B_FALSE;
boolean_t groupmbr = B_FALSE;
boolean_t is_attr;
uid_t uid = crgetuid(cr);
if (zdp->z_pflags & ZFS_AV_QUARANTINED)
return (1);
if (zdp->z_pflags & ZFS_NO_EXECS_DENIED)
return (0);
mutex_enter(&zdp->z_acl_l... |
<vulnerable_code>/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or htt... |
<vulnerable_code> cr, ZFS_GROUP);
}
uid_t
zfs_fuid_map_id(zfsvfs_t *zfsvfs, uint64_t fuid,
cred_t *cr, zfs_fuid_type_t type)
{
#ifdef HAVE_KSID
uint32_t index = FUID_INDEX(fuid);
const char *domain;
uid_t id;
FUID_RID(fuid), &id);
}
return (id);
#else
/*
* The Linux port only supports POSIX IDs, ... |
<vulnerable_code>#include <string.h>
#include "allheaders.h"
static const l_int32 L_BUF_SIZE = 512;
static const char *version = "1.5";
{
char *filein, *str, *tempfile, *prestring, *outprotos, *protostr;
const char *spacestr = " ";
char buf[L_BUF_SIZE];
l_uint8 *allheaders;
l_int32 i, maxin... |
<vulnerable_code> * l_int32 gplotWrite()
*
*
* Utility for programmatic plotting using gnuplot 7.3.2 or later
* Enabled:
* ~ output to png (color), ps (mono), x11 (color), latex (mono)
* ~ optional title for graph
* ~ optional x and y axis labels
* ~ multiple... |
<vulnerable_code>PTA *
ptaReadStream(FILE *fp)
{
char typestr[128];
l_int32 i, n, ix, iy, type, version;
l_float32 x, y;
PTA *pta;
return (PTA *)ERROR_PTR("not a pta file", procName, NULL);
if (version != PTA_VERSION_NUMBER)
return (PTA *)ERROR_PTR("invalid pta version", procName, N... |
<vulnerable_code>#include <string.h>
#include "allheaders.h"
static const l_int32 L_BUF_SIZE = 256;
static const l_int32 INITIAL_PTR_ARRAYSIZE = 50; /* n'import quoi */
static const l_int32 MANY_SELS = 1000;
l_int32 direction)
{
char *selname;
char combname[L_BUF_SIZE];
l_int32 i, nsels, ... |
<vulnerable_code>import org.apache.cocoon.ResourceNotFoundException;
import org.apache.cocoon.environment.ObjectModelHelper;
import org.apache.cocoon.environment.Request;
import org.apache.cocoon.generation.AbstractGenerator;
import org.dspace.app.xmlui.objectmanager.AbstractAdapter;
import org.dspace.app.xmlui.objectm... |
<vulnerable_code>
}
/**
*
* <commit_title>[PATCH] DSpaceMETSGenerator: Check permissions<commit_description>Ensure that the metadata of objects are not accessible via the mets file, if
the current user doesn't have sufficient permissions.<fixed_code>
}
@Override
public ... |
<vulnerable_code>#include "config.h"
#include <errno.h>
#include <fwupd.h>
#include <glib/gstdio.h>
#include <gmodule.h>
return g_key_file_save_to_file(keyfile, conf_path, error);
}
/**
* fu_plugin_set_secure_config_value:
* @self: a #FuPlugin
GError **error)
{
g_autofree gchar *conf_path = fu_plugin_get_co... |
<vulnerable_code> fu_test_loop_quit();
}
static void
fu_plugin_devices_func(void)
{
g_test_add_func("/fwupd/progress{finish}", fu_progress_finish_func);
g_test_add_func("/fwupd/bios-attrs{load}", fu_bios_settings_load_func);
g_test_add_func("/fwupd/security-attrs{hsi}", fu_security_attrs_hsi_func);
g_test_add_func... |
<vulnerable_code>
var f = cdf(data);
it('f(NaN) === NaN', function(){
assert(Number.isNan(f(NaN)));
});
test_x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, Infinity, -Infinity];<commit_title>[PATCH] fix test: is NaN<c... |
<vulnerable_code>// It has the same sandbox as a Chrome extension.
const { remote, ipcRenderer } = require('electron');
const init = () => {
window.checkClipboard = () => {
return remote.clipboard.readText();
};
window.openExternalUrl = (url) => {
remote.shell.openExternal(url);
};
window.clearClip... |
<vulnerable_code># See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
from tensorflow.python.framework import errors
from tensorflow.python.framework import dtypes
from tensorflow.python.fr... |
<vulnerable_code>#include "ecma-objects.h"
#include "ecma-string-object.h"
#include "jrt.h"
#include "lit-char-helpers.h"
ecma_value_t mapped_value, /**< mapped value */
ecma_value_t thisArg) /**< this arg */
{
/* 7. */
ecma_length_t t... |
<vulnerable_code> if (dis_umaxd == 0)
disiui_();
switch (c = (*dis_getc)(stream))
{
<commit_title>[PATCH] Merge pull request #171 into 2.5-fixes.<commit_description><fixed_code>
if (dis_umaxd == 0)
disiui_();
if (count >= dis_umaxd)
{
if (count > dis_umaxd)
goto overflow;
if (mem... |
<vulnerable_code> async_source_p = source_p;
}
}
else if (depth == total_depth - 1)
{
if (lexer_check_arrow (context_p))
{
arrow_type = SCANNER_SCAN_BRACKET_ARROW_WITH_ONE_ARG;
break;
}
if (context_p->stack_top_uint8 == SCAN_STACK_U... |
<vulnerable_code><commit_title>[PATCH] Fix scanning bracketed expressions<commit_description>Scan 'async' literal with different depth of brackets
This patch fixes #4924.
JerryScript-DCO-1.0-Signed-off-by: Martin Negyokru negyokru@inf.u-szeged.hu<fixed_code>
// Copyright JS Foundation and other contributors, http://js... |
<vulnerable_code>//Copyright (c) 2016 Crystalline Technologies
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'),
// to deal in the Software without restriction, including without limitation the rights to use, copy, ... |
<vulnerable_code><commit_title>[PATCH] Added Text Attribute<commit_description>To help combat XSS attackes the text attribute will add text only to elements rather than html<fixed_code>
|
<vulnerable_code><commit_title>[PATCH] Added Text Attribute<commit_description>To help combat XSS attackes the text attribute will add text only to elements rather than html<fixed_code>
(function() {
//Test the handling of quoted strings
var test_data = [
{"text":"<script>alert(0);</script> no alert"},
... |
<vulnerable_code>// Copyright 2018 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
*
* @param options The CLI options to start Parity with
*/
public Parity(String[] options) {
long config = configFromCli(options);
inner = build(... |
<vulnerable_code>void callback(void* user_data, const char* response, size_t _len) {
Callback* cb = static_cast<Callback*>(user_data);
if (cb->type == CALLBACK_RPC) {
printf("rpc response: %s\r\n", response);
cb->counter -= 1;
} else if (cb->type == CALLBACK_WS) {
printf("websocket response: %s\r\n", response)... |
<vulnerable_code>// Copyright 2018 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
};
public static void runParity(String[] config) {
Parity parity = new Parity(config);
Callback rpcCallback = new Callback(1);
Callback webSocketC... |
<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] Fix issue #499: unsigned int... |
<vulnerable_code> exception_->description) != 0))
{
if (nestedException == (Exception *) NULL)
nestedException=createException(p);
else
{
q=createException(p);
nestedException->nested(q);
nestedExcep... |
<vulnerable_code>
openCL_library->clGetPlatformInfo(platforms[i],CL_PLATFORM_NAME,0,NULL,
&length);
device->platform_name=AcquireQuantumMemory(length,
sizeof(*device->platform_name));
openCL_library->clGetPlatformInfo(platforms[i],CL_PLATFORM_NAME,length,
device->platform_name,... |
<vulnerable_code> response.vary = vary
_seps = {'/', os.sep}
def _contains_slash(item):
for sep in _seps:
if sep in item:
return True
# unless someone screws up the traversal_path code
# (request.subpath is computed via traversal_path too)
return None
if any(... |
<vulnerable_code>
self.assertRaises(HTTPNotFound, inst, context, request)
def test_resource_doesnt_exist(self):
inst = self._makeOne('tests:fixtures/static')
request = self._makeRequest({'PATH_INFO': '/notthere'})<commit_title>[PATCH] fix: reject NUL character as path element<commit_descrip... |
<vulnerable_code>#endif /* !WOLFSSL_NO_TLS12 */
#ifdef HAVE_SESSION_TICKET
/* Make a work from the front of random hash */
static WC_INLINE word32 MakeWordFromHash(const byte* hashID)
{
return ((word32)hashID[0] << 24) | ((word32)hashID[1] << 16) |
((word32)hashID[2] << 8) | (word3... |
<vulnerable_code>}
#endif /* !leanpsk */
#if !defined(NO_CERTS) || !defined(NO_SESSION_CACHE)
/* Make a work from the front of random hash */
static WC_INLINE word32 MakeWordFromHash(const byte* hashID)
{
return ((word32)hashID[0] << 24) | ((word32)hashID[1] << 16) |
((word32)hashID[2] << 8) | (word... |
<vulnerable_code>#endif /* WORD64_AVAILABLE && !WOLFSSL_W64_WRAPPER_TEST */
#endif /* WOLFSSL_W64_WRAPPER */
#undef WC_STATIC
#endif /* !WOLFSSL_MISC_INCLUDED && !NO_INLINE */<commit_title>[PATCH] Refactor and code review<commit_description>- Refactor object hashing into one function
- Allow multiple WOLFSSL_ASSERT_S... |
<vulnerable_code> uint32_t size,
ByteOrder byteOrder)
{
uint32_t o = getULong(pData + size - 4, byteOrder);
if (size < 2 || o > size-2) throw Error(kerNotACrwImage);
uint16_t count = getUShort(pData + o, byteOrde... |
<vulnerable_code>void usageerror (void);
bool copyaudiodata (AFfilehandle infile, AFfilehandle outfile, int trackid);
int main (int argc, char **argv)
{
if (argc == 2)
{
int frameSize = afGetVirtualFrameSize(infile, trackid, 1);
const int kBufferFrameCount = 65536;
void *buffer = malloc(kBufferFrameCount * frameS... |
<vulnerable_code> const RList *syms = r_bin_get_symbols (core->bin);
ut64 baddr = r_config_get_i (core->config, "bin.baddr");
r_list_foreach (syms, iter, sym) {
if ((sym->paddr + baddr) == fcn->addr && !strcmp (sym->type, R_BIN_TYPE_FUNC_STR)) {
free (new_name);
new_name = r_str_newf (... |
<vulnerable_code>
function finish () {
if (!that.disconnected && that.will) {
that.broker.publish(that.will, that, function (err) {
if (!err) {
that.broker.persistence.delWill({
id: that.id,
brokerId: that.broker.id
}, nop)
}
})
that.wi... |
<vulnerable_code>
// When '/' or '?' follows another address, start from
// there.
if (lnum != MAXLNUM)
curwin->w_cursor.lnum = lnum;
// Start a forward search at the end of the line (unless
// before the first line).<commit_title>[PATCH] patch 8.2.3489: ml_get error after search with ... |
<vulnerable_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
3488,
/**/<commit_title>[PATCH] patch 8.2.3489: ml_get error after search with range<commit_description>Problem: ml_get error after search with range.
Solution: Limit the line number to the buffer line count.<... |
<vulnerable_code> if (color)
color -= plen;
#endif
plen = *(--plens);
str += 2;
}
}
if (color)
color -= plen;
#endif
plen = *(--plens);
str++;
}
#else<commit_title>[PATCH] Fix OOB access due to multiple backspaces<commit_description>Commit 419ca82d57 (Fix m17... |
<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>
GC_ASSERT(I_HOLD_LOCK());
lb = ROUNDUP_GRANULE_SIZE(lb);
n_blocks = OBJ_SZ_TO_BLOCKS(lb);
if (!EXPECT(GC_is_initialized, TRUE)) {
DCL_LOCK_STATE;
UNLOCK(); /* just to unset GC_lock_holder */
STATIC ptr_t GC_alloc_large_and_clear(size_t lb, int k, unsigned flags)
{
ptr_t... |
<vulnerable_code> GC_ASSERT(k < MAXOBJKINDS);
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, FALSE))
{
void *... |
<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> size_t lg;
GC_ASSERT(GC_explicit_typing_initialized);
lb += TYPD_EXTRA_BYTES;
op = GC_malloc_kind(lb, GC_explicit_kind);
if (EXPECT(NULL == op, FALSE))
return NULL;
DCL_LOCK_STATE;
GC_ASSERT(GC_explicit_typing_initialized);
lb += TYPD_EXTRA_BYTES;
if (SMALL... |
<vulnerable_code> }
);
xit(
'should return string values for multiple selectField',
function(done) {
selectField = createSelectField(
selectField.set('value', '19');
assert.equal(selectField.getValueSelected().label, 'b');
done();
}
assert.isFalse(divSelect.... |
<vulnerable_code>
var container = selectField.get('container');
var beforeSearchList = container.one('.drop-chosen ul').getHTML();
var inputElement = container.one('input');
window.setTimeout(
function() {
var afterSearchList = container.one('.drop-chosen ul').getHTML();
... |
<vulnerable_code> *
* Returns the address length.
*/
static uint get_alen(char *arg, int default_len)
{
int j;
int alen;
alen = default_len;
for (j = 0; j < 8; j++) {
{
uint chip;
uint devaddr, length;
int alen;
u_char *memaddr;
int ret;
#if CONFIG_IS_ENABLED(DM_I2C)
{
uint chip;
uint devaddr, length;
i... |
<vulnerable_code>var fxp;(()=>{var t={807:t=>{const e=/^[-+]?0x[a-fA-F0-9]+$/,r=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const i={hex:!0,... |
<vulnerable_code>var XMLParser;(()=>{var t={807:t=>{const e=/^[-+]?0x[a-fA-F0-9]+$/,r=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const i={h... |
<vulnerable_code> if (this.options.transformAttributeName) {
aName = this.options.transformAttributeName(aName);
}
if (oldVal !== undefined) {
if (this.options.trimValues) {
oldVal = oldVal.trim();<commit_title>[PATCH] Update package detail<commit_description><fixe... |
<vulnerable_code> }
add(key,val){
// this.child.push( {name : key, val: val, isCdata: isCdata });
this.child.push( {[key]: val });
}
addChild(node) {
if(node[":@"] && Object.keys(node[":@"]).length > 0){
this.child.push( { [node.tagname]: node.child, [":@"]: node[":@"] });
}else{<commit_tit... |
<vulnerable_code> if (!err) {
map_bh(bh, inode->i_sb, map.m_pblk);
bh->b_state = (bh->b_state & ~F2FS_MAP_FLAGS) | map.m_flags;
bh->b_size = map.m_len << inode->i_blkbits;
}
return err;
}<commit_title>[PATCH] f2fs: fix a dead loop in f2fs_fiemap()<commit_description>A dead loop can be triggered in f2fs_fiemap()... |
<vulnerable_code> // [databind#2682]: commons-jelly
s.add("org.apache.commons.jelly.impl.Embedded");
DEFAULT_NO_DESER_CLASS_NAMES = Collections.unmodifiableSet(s);
}
<commit_title>[PATCH] Fix #2688<commit_description><fixed_code>
// [databind#2682]: commons-jelly
s.add("org.a... |
<vulnerable_code>const epoch = () => (Date.now() / 1000) | 0;
const MAX_COOKIE_SIZE = 4096;
function attachSessionObject(req, sessionName, value) {
Object.defineProperty(req, sessionName, {
enumerable: true,
return value;
},
set(arg) {
if (arg === null || arg === undefined) {
value = ... |
<vulnerable_code>const TransientCookieHandler = require('../lib/transientHandler');
const { RequestContext, ResponseContext } = require('../lib/context');
const appSession = require('../lib/appSession');
const { decodeState } = require('../lib/hooks/getLoginState');
const enforceLeadingSlash = (path) => {
try ... |
<vulnerable_code>const clientID = '__test_client_id__';
const expectedDefaultState = encodeState({ returnTo: 'https://example.org' });
const nock = require('nock');
const baseUrl = 'http://localhost:3000';
const defaultConfig = {
};
});
const response = await request.post('/callback', {
baseUrl,
j... |
<vulnerable_code> assert.equal(
store.store.length,
2,
'There should only be two sessions in the store'
);
});
});<commit_title>[PATCH 2/6] Update assert message<commit_description><fixed_code>
assert.equal(
store.store.length,
2,
'There should be two sessions in the sto... |
<vulnerable_code> });
}
function regenerateSession(req, session, config) {
session[REASSIGN] = true;
req[config.session.name] = session;
if (config.session.store) {
req[REGENERATED_SESSION_ID] = config.session.genid(req);
}
}
module.exports = (config) => {
let current;
};
};
module.exports.regenera... |
<vulnerable_code>const TransientCookieHandler = require('../lib/transientHandler');
const { RequestContext, ResponseContext } = require('../lib/context');
const appSession = require('../lib/appSession');
const { regenerateSession } = appSession;
const { decodeState } = require('../lib/hooks/getLoginState');
const enfo... |
<vulnerable_code> });
});
it('should preserve session when a new user is logging in over an anonymous session', async () => {
const store = new MemoryStore({
checkPeriod: 24 * 60 * 1000,
});
assert.equal(currentSession.shoppingCartId, 'bar');
assert.equal(
store.store.length,
1... |
<vulnerable_code> assert.equal(
store.store.length,
2,
'There should only be one session in the store'
);
});
<commit_title>[PATCH 2/6] Update assert message<commit_description><fixed_code>
assert.equal(
store.store.length,
2,
'There should be two sessions in the store'
... |
<vulnerable_code> };
}
setCookie(id, req, res, iat) {
setCookie(req, res, iat);
}
}
res,
{ uat = epoch(), iat = uat, exp = calculateExp(iat, uat) }
) {
if (!req[sessionName] || !Object.keys(req[sessionName]).length) {
if (req[COOKIES][sessionName]) {
awa... |
<vulnerable_code> const store = new RedisStore({ client: redisClient, prefix: '' });
redisClient.asyncSet = promisify(redisClient.set).bind(redisClient);
redisClient.asyncGet = promisify(redisClient.get).bind(redisClient);
const conf = getConfig({
...defaultConfig,
});
});
it('should get ... |
<vulnerable_code> };
});
if (params.existingSession) {
await request.post('/session', {
baseUrl,
jar,
json: params.existingSession,
});
}
const response = await request.post('/callback', {
tokenReqHeader,
tokenReqBody,
tokens,
};
};
const store = new MemoryS... |
<vulnerable_code> await new Promise((resolve) => server.close(resolve));
}
if (redisClient) {
await new Promise((resolve) => redisClient.quit(resolve));
}
});<commit_title>[PATCH 2/6] Update assert message<commit_description><fixed_code>
await new Promise((resolve) => server.close(resolve... |
<vulnerable_code> });
});
it('should preserve session but regenerate session id when a new user is logging in over an anonymous session', async () => {
const store = new MemoryStore({
checkPeriod: 24 * 60 * 1000,<commit_title>[PATCH 2/6] Update assert message<commit_description><fixed_code>
});
... |
<vulnerable_code> nlh = nlmsg_hdr(skb);
err = 0;
if (nlmsg_len(nlh) < sizeof(struct nfgenmsg) ||
skb->len < nlh->nlmsg_len) {
err = -EINVAL;
goto ack;
}
/* Only requests are handled by the kernel */<commit_title>[PATCH] netfilter: nfnetlink: correctly validate length of batch<commit_description><... |
<vulnerable_code> */
module.exports = async function(destination, { hard = true } = {}) {
if (destination && typeof destination === 'string') {
return await exec(`git reset ${destination} ${hard ? '--hard' : ''}`);
}
if (destination && typeof destination === 'number') {<commit_title>[PATCH] Sanitise user input<co... |
<vulnerable_code>
it('Should hard reset to a given sha', async() => {
reset('shaid');
expect(exec.getCall(0).args[0]).to.equal('git reset shaid --hard');
});
it('Should hard reset to n commits back', async() => {
it('Should reset w/o hard argument', async() => {
reset('shaid', { hard: false });
expect(exe... |
<vulnerable_code> exec(`git config user.name "${await author}"`),
exec(`git config user.email "${await email}"`),
]);
await exec(`git tag -a ${tag} -m "${await message}"`);
await exec(`git push origin refs/tags/${tag}`);
};<commit_title>[PATCH] Sanitise user input<commit_description><fixed_code>
exec(`git confi... |
<vulnerable_code> dummy.stub = command => lines.push(command);
await gitTag('1.1.1');
expect(lines).to.include('git tag -a 1.1.1 -m "this is a message"');
expect(lines).to.include('git push origin refs/tags/1.1.1');
});
});<commit_title>[PATCH] Sanitise user input<commit_description><fixed_code>
dummy.stub =... |
<vulnerable_code>import io.onedev.server.web.avatar.AvatarManager;
import io.onedev.server.web.avatar.DefaultAvatarManager;
import io.onedev.server.web.component.diff.DiffRenderer;
import io.onedev.server.web.component.markdown.AttachmentUploadServlet;
import io.onedev.server.web.component.markdown.SourcePositionTrackE... |
<vulnerable_code>import io.onedev.server.web.page.project.setting.build.ActionAuthorizationsPage;
import io.onedev.server.web.page.project.setting.build.BuildPreservationsPage;
import io.onedev.server.web.page.project.setting.build.JobSecretsPage;
import io.onedev.server.web.page.project.setting.tagprotection.TagProtec... |
<vulnerable_code>package io.onedev.server.web.component.markdown;
import java.io.IOException;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import javax.inject.Singleton;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.serv... |
<vulnerable_code>
import static org.apache.wicket.ajax.attributes.CallbackParameter.explicit;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.HashMap;
import javax.annotation.Nu... |
<vulnerable_code> $input[0].dispatchEvent(evt);
}
},
onDomReady: function(containerId, callback, atWhoLimit, attachmentSupport,
attachmentMaxSize, canMentionUser, canReferenceEntity,
projectNamePattern, autosaveKey) {
var $container = $("#" + containerId);
});
}
if (attachment... |
<vulnerable_code>import io.onedev.server.util.jetty.FileAssetServlet;
import io.onedev.server.util.jetty.ServletConfigurator;
import io.onedev.server.web.asset.icon.IconScope;
import io.onedev.server.web.component.markdown.AttachmentUploadServlet;
import io.onedev.server.web.img.ImageScope;
import io.onedev.server.web.... |
<vulnerable_code> (void) TransformImageColorspace(image,sRGBColorspace);
count=GetNumberColors(image,NULL,exception);
for (bits_per_pixel=1; (one << bits_per_pixel) < count; bits_per_pixel*=2) ;
if (image_info->depth > 100)
bits_per_pixel=image_info->depth-100;
if (bits_per_pixel < 16)
(... |
<vulnerable_code> }
}
*norm_size = p2 - path + 1;
#undef SEP_OR_END
#undef IS_SEP
#undef IS_END<commit_title>[PATCH] handle edge cases<commit_description><fixed_code>
}
}
*norm_size = p2 - path + 1;
if (path == p2 && *norm_size < size && path[0] == L'\0') {
*norm_size = 0;
... |
<vulnerable_code>from django.apps import AppConfig
class AnymailBaseConfig(AppConfig):
verbose_name = "Anymail"
def ready(self):
pass<commit_title>[PATCH] Security: rename WEBHOOK_AUTHORIZATION --> WEBHOOK_SECRET<commit_description>This fixes a low severity security issue affecting Anymail v0.2--v1.3... |
<vulnerable_code><commit_title>[PATCH] Security: rename WEBHOOK_AUTHORIZATION --> WEBHOOK_SECRET<commit_description>This fixes a low severity security issue affecting Anymail v0.2--v1.3.
Django error reporting includes the value of your Anymail
WEBHOOK_AUTHORIZATION setting. In a properly-configured deployment,
this s... |
<vulnerable_code> basic_auth = None # (Declaring class attr allows override by kwargs in View.as_view.)
def __init__(self, **kwargs):
self.basic_auth = get_anymail_setting('webhook_authorization', default=[],
kwargs=kwargs) # no esp_name -- auth is shared ... |
<vulnerable_code> pass
@override_settings(ANYMAIL={'WEBHOOK_AUTHORIZATION': 'username:password'})
class WebhookTestCase(AnymailTestMixin, SimpleTestCase):
"""Base for testing webhooks
response = self.call_webhook()
self.assertEqual(response.status_code, 400)
@override_settings(ANYMAIL={'W... |
<vulnerable_code> *
* @type {import('unified').Plugin<[Options?]|void[], Root, string>}
*/
export default function remarkHtml(options = {}) {
const handlers = options.handlers || {}
const schema =
options.sanitize && typeof options.sanitize === 'object'
? options.sanitize
: undefined
Object.ass... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.