text stringlengths 79 3.72M |
|---|
<vulnerable_code>"""
import base64
import json
import random
import re
import socket
import ssl
import string
"""
Create a random and strongish challenge.
"""
challenge = "".join(random.choice(string.ascii_uppercase) for x in range(6)) # noqa
challenge += "".join(random.choice("~!@#$%^&*()_+") for ... |
<vulnerable_code>
import base64
import os
import random
import string
_basedir = os.path.abspath(os.path.dirname(__file__))
# generate random secrets for unittest
def get_random_secret(length):
secret_key = ''.join(random.choice(string.ascii_uppercase) for x in range(round(length / 4)))
secret_key = secret_ke... |
<vulnerable_code> (u8 *)&settings->beacon.head[ie_offset],
settings->beacon.head_len - ie_offset,
WLAN_EID_SSID);
if (!ssid_ie)
return -EINVAL;
memcpy(ssid_le.SSID, ssid_ie->data, ssid_ie->len);<commit_title>[PATCH] brcmfmac: avoid potential stack overflow in<commit_description><fixed_code>
(u8 *... |
<vulnerable_code> }, options);
function defaults(c, b) {
for (var a in b) {
b.hasOwnProperty(a) && (c[a] && typeof b[a] === "object" ? defaults(c[a], b[a]) : c[a] = b[a]);
}
return c;
}
function repeatStr(width, str) {
str = str || " ";
var result = ... |
<vulnerable_code> )
def default(self, path=b"", action=None, **kwargs):
repo_obj = self.app.store.get_repo(path)
if kwargs.get('keepdays'):
return self._remove_older(repo_obj, **kwargs)
elif kwargs.get('new_encoding'):
return self._set_encoding(repo_obj, **kwargs)
... |
<vulnerable_code> repo_obj = self.app.store.get_user('admin').get_repo(self.REPO)
self.assertEqual(4, repo_obj.maxage)
def test_does_not_exists(self):
# Given an invalid repo
repo = 'invalid'<commit_title>[PATCH] Mitigate CSRF on repository settings #217<commit_description><fixed_cod... |
<vulnerable_code> # Browse admin's repos
self._remove_older('anotheruser', 'testcases', '2')
self.assertStatus('403 Forbidden')<commit_title>[PATCH] Mitigate CSRF on repository settings #217<commit_description><fixed_code>
# Browse admin's repos
self._remove_older('anotheruser', '... |
<vulnerable_code> # Browse admin's repos
self._set_encoding('anotheruser', 'testcases', 'utf-8')
self.assertStatus('403 Forbidden')<commit_title>[PATCH] Mitigate CSRF on repository settings #217<commit_description><fixed_code>
# Browse admin's repos
self._set_encoding('anotheruser... |
<vulnerable_code> for (size_t i = 0; i < _data->lineBuffers.size(); i++)
{
_data->lineBuffers[i]->buffer = (char *) EXRAllocAligned(_data->lineBufferSize*sizeof(char),16);
}
}
_data->nextLineBufferMinY = _data->minY - 1;<commit_title>[PATCH 4/4] reduce ... |
<vulnerable_code> s[ 0] = (b[0] << 8) | b[1];
unsigned short shift = (b[ 2] >> 2);
unsigned short bias = (0x20 << shift);
s[ 4] = s[ 0] + ((((b[ 2] << 4) | (b[ 3] >> 4)) & 0x3f) << shift) - bias;
s[ 8] = s[ 4] + ((((b[ 3] << 2) | (b[ 4] >> 6)) & 0x3f) << shift) - bias;
s[12] = s[ 8] + ((b[ 4]... |
<vulnerable_code> int gChan = _cscSets[csc].idx[1];
int bChan = _cscSets[csc].idx[2];
LossyDctDecoderCsc decoder
(rowPtrs[rChan],<commit_title>[PATCH 4/4] reduce B44 _tmpBufferSize (was allocating two bytes per<commit_description><fixed_code>
int gChan = _cscSets[csc... |
<vulnerable_code> //
_tmpBuffer = new unsigned short
[checkArraySize (uiMult (maxScanLineSize, numScanLines),
sizeof (unsigned short))];
const ChannelList &channels = header().channels();<commit_title>[PATCH 4/4] reduce B44 _tmpBufferSize (was allocating two bytes per<commi... |
<vulnerable_code> }
protected int indexOf(char c, int pos) {
for (int i = pos; pos < len; i++)
if (in[i] == (byte) c)
return i;
return -1;<commit_title>[PATCH] Fix indexOf<commit_description><fixed_code>
}
protected int indexOf(char c, int pos) {
for (int i = pos; i < len; i++)
if (in[i] == (byte) ... |
<vulnerable_code> query += `q=${encodeURIComponent(searchData.term)}`;
if (contextEnabled && ctx) {
if (
this.currentUser &&
ctx.id.toString().toLowerCase() ===
this.currentUser.get("username_lower") &&
type === "private_messages"
) {
query... |
<vulnerable_code>
exports.randomDigits = function (size) {
const buffer = exports.randomBits(size * 8);
const digits = [];
for (let i = 0; i < buffer.length; ++i) {
digits.push(Math.floor(buffer[i] / 25.6));
}
return digits.join('');
}
const bytes = Math.ceil(bits / 8);
try {
... |
<vulnerable_code>
expect(() => Cryptiles.randomDigits(99999999999999999999)).to.throw(/Failed generating random bits/);
});
});
describe('randomBits()', () => {<commit_title>[PATCH] Fix less than ideal random digits generator. Closes #34<commit_description><fixed_code>
expect(() => Cryptiles.rando... |
<vulnerable_code> if (oid_list_todo_num == 0) {
/* The request is still empty - so we are finished */
DEBUG("snmp plugin: all variables have left their subtree");
status = 0;
break;
}
res = NULL;
status = snmp_sess_synch_response(host->sess_handle, req, &res);
if ((status != ... |
<vulnerable_code> }
(void)r_buf_read_at (bf->buf, sec->paddr, buf, sec->size);
if (bits == 32) {
for (i = 0; i < sec->size; i += 4) {
ut32 addr32 = r_read_le32 (buf + i);
if (addr32) {
RBinAddr *ba = newEntry (sec->paddr + i, (ut64)addr32, type, bits);
}
}
} else {
for (i = 0... |
<vulnerable_code> r_cons_printf ("[Entrypoints]\n");
}
}
r_list_foreach (entries, iter, entry) {
ut64 paddr = entry->paddr;<commit_title>[PATCH] Fix #9904 - crash in r2_hoobr_r_read_le32 (over 9000<commit_description><fixed_code>
r_cons_printf ("[Entrypoints]\n");
}
}
if (r_list_length (entries) > 1024)... |
<vulnerable_code> }
/* Not so likely to happen. */
if (vallen >= len + sizeof (rhostname)) {
dbglog("EAP: trimming really long peer name down");
BCOPY(inp + vallen, rhostname, sizeof (rhostname) - 1);
rhostname[sizeof (rhostname) - 1] = '\0';
}
/* Not so likely to happen. */
if (vallen >= len + si... |
<vulnerable_code> if (wmf_error != wmf_E_None)
{
wmf_api_destroy(API);
if (image->debug != MagickFalse)
{
(void) LogMagickEvent(CoderEvent,GetMagickModule(),<commit_title>[PATCH] https://github.com/ImageMagick/ImageMagick/issues/544<commit_description><fixed_code>
if (wmf_error != w... |
<vulnerable_code> npy_intp idx =
PyArray_NDIM(input) > 0 ? 2 * PyArray_NDIM(input) * ii : ii;
if (regions[idx] >= 0) {
PyObject *tuple = PyTuple_New(PyArray_NDIM(input));
if (!tuple) {
PyErr_NoMemory();
goto exit;
... |
<vulnerable_code> ret_check_path, conf = check_path(item, conf, strict=strict)
returncode += ret_check_path
# ignore quoted text
line = re.sub(r'\"(.+?)\"', '', line)
line = re.sub(r'\'(.+?)\'', '', line)
if re.findall('[:cntrl:].*\n', line):
ret, conf = warn_count('synt... |
<vulnerable_code>
self.assertEqual(expected, result)
def test_28_catch_lnext_terminal_ctrl(self):
""" F25 | test ctrl-v ctrl-j then command, forbidden/security """
self.child = pexpect.spawn('%s/bin/lshell '
'--config %s/etc/lshell.conf '
... |
<vulnerable_code> userconf = CheckConfig(args).returnconf()
shell = ShellCmd(userconf, args)
def test_01_checksecure_doublequote(self):
""" U01 | quoted text should not be forbidden """
INPUT = 'ls -E "1|2" tmp/test'
return self.assertEqual(sec.check_secure(INPUT, self.userconf)[0], ... |
<vulnerable_code> try:
cl = int(headers.get("CONTENT_LENGTH", 0))
except ValueError:
cl = 0
self.content_length = cl
if cl > 0:
buf = OverflowableBuffer(self.adj.inbuf_overflow)<commit_title>[PATCH] Upon receiving invalid Con... |
<vulnerable_code> self.assertTrue(False)
def test_parse_header_bad_content_length(self):
data = b"GET /foobar HTTP/8.4\r\ncontent-length: abc\r\n"
self.parser.parse_header(data)
self.assertEqual(self.parser.body_rcv, None)
def test_parse_header_11_te_chunked(self):
#... |
<vulnerable_code> addGoogleAnalytics: false,
upgradeInsecureRequests: 'auto',
reportURI: undefined,
allowFraming: true
},
cookiePolicy: 'lax',
protocolUseSSL: false,<commit_title>[PATCH] Add config option to disallow embedding PDFs<commit_description>Signed-off-by: David Mehren <git@herrmehren.de><... |
<vulnerable_code> reportURI: process.env.CMD_CSP_REPORTURI,
addDisqus: toBooleanConfig(process.env.CMD_CSP_ADD_DISQUS),
addGoogleAnalytics: toBooleanConfig(process.env.CMD_CSP_ADD_GOOGLE_ANALYTICS),
allowFraming: toBooleanConfig(process.env.CMD_CSP_ALLOW_FRAMING)
},
cookiePolicy: process.env.CMD_COOK... |
<vulnerable_code> frameAncestors: ['\'self\'']
}
CspStrategy.computeDirectives = function () {
const directives = {}
mergeDirectives(directives, config.csp.directives)
mergeDirectivesIf(config.csp.addGoogleAnalytics, directives, googleAnalyticsDirectives)
mergeDirectivesIf(config.dropbox.appKey, directives, d... |
<vulnerable_code> struct iov_iter i;
int ret;
if (map_data)
copy = true;
else if (iov_iter_alignment(iter) & align)
unmap_rq:
__blk_rq_unmap_user(bio);
rq->bio = NULL;
return -EINVAL;
}<commit_title>[PATCH] Don't feed anything but regular iovec's to<commit_description><fixed_code>
struct iov_iter i;
int ret... |
<vulnerable_code>import RestModel from "discourse/models/rest";
import discourseComputed from "discourse-common/utils/decorators";
export default RestModel.extend({
@discourseComputed("count", "pm_count")
totalCount(count, pmCount) {
return count + pmCount;
},
@discourseComputed("count", "pm_count")
pmO... |
<vulnerable_code> return response({
tags: [
{ id: "eviltrout", count: 1 },
{ id: "planned", text: "planned", count: 7, pm_count: 0 },
{ id: "private", text: "private", count: 0, pm_count: 7 },
],
extras: {
tag_groups: [
id: 2,
name: "Ford Cars... |
<vulnerable_code> pretender.get("/tags/filter/search", (params) => {
if (params.queryParams.q === "dav") {
return response({
results: [{ id: "David", name: "David", count: 2, pm_count: 0 }],
});
}
});<commit_title>[PATCH] SECURITY: Hide PM count for tags by default (#20061)<... |
<vulnerable_code><commit_title>[PATCH] SECURITY: Hide PM count for tags by default (#20061)<commit_description>Currently `Topic#pm_topic_count` is a count of all personal messages tagged for a given tag. As a result, any user with access to PM tags can poll a sensitive tag to determine if a new personal message has bee... |
<vulnerable_code> break;
case DLT_JUNIPER_ETHER:
if (datalen >= 5) {
l2_len = -1;
break;
}<commit_title>[PATCH] fix heap-buffer-overflow when DLT_JUNIPER_ETHER<commit_description>The test logic on datalen was inverted.
Processing truncated packats should now raise a ... |
<vulnerable_code>{
struct archive_write_disk *a = (struct archive_write_disk *)_a;
struct fixup_entry *next, *p;
int fd, ret;
archive_check_magic(&a->archive, ARCHIVE_WRITE_DISK_MAGIC,
(TODO_TIMES | TODO_MODE_BASE | TODO_ACLS | TODO_FFLAGS)) {
fd = open(p->name,
O_WRONLY | O_BINARY | O_NOFOLLOW | O... |
<vulnerable_code><commit_title>[PATCH] Do not follow symlinks when processing fixup list<commit_description>Use lchmod() instead of chmod() and tell the remaining functions that the
real file to be modified is a symbolic link.
Fixes #1566<fixed_code>
/*-
* Copyright (c) 2021 Martin Matuska
* All rights reserved.
*
... |
<vulnerable_code> baseUri: ['\'self\''],
connectSrc: ['\'self\''],
fontSrc: ['\'self\''],
frameSrc: ['\'self\'', 'https://player.vimeo.com', 'https://www.slideshare.net/slideshow/embed_code/key/', 'https://www.youtube.com'],
imgSrc: ['*'], // we allow using arbitrary images
scriptSrc: [<commit_title>[PATCH] ... |
<vulnerable_code><commit_title>[PATCH] Merge pull request from GHSA-v5vr-h3xq-8v6w<commit_description>* fix: add pr commit author check
* chore: update prettier settings
* chore: update prettier settings
* feat: add verify commit signatures
* chore: revert prettier
* test: add action test
* refactor: remove commi... |
<vulnerable_code> getModuleVersionChanges,
checkModuleVersionChanges,
} = __nccwpck_require__(9488)
const {
GITHUB_TOKEN,
const pr = pull_request || (await client.getPullRequest(PR_NUMBER))
const isDependabotPR = pr.user.login === 'dependabot[bot]'
if (!isDependabotPR) {
return logWarning('Not... |
<vulnerable_code><commit_title>[PATCH] Merge pull request from GHSA-v5vr-h3xq-8v6w<commit_description>* fix: add pr commit author check
* chore: update prettier settings
* chore: update prettier settings
* feat: add verify commit signatures
* chore: revert prettier
* test: add action test
* refactor: remove commi... |
<vulnerable_code>const actionLog = require('../src/log')
const actionUtil = require('../src/util')
const actionGithubClient = require('../src/github-client')
const GITHUB_TOKEN = 'the-token'
const BOT_NAME = 'dependabot[bot]'
const prStub = sinon.stub()
const prDiffStub = sinon.stub()
const approveStub = sinon.... |
<vulnerable_code><commit_title>[PATCH] Merge pull request from GHSA-v5vr-h3xq-8v6w<commit_description>* fix: add pr commit author check
* chore: update prettier settings
* chore: update prettier settings
* feat: add verify commit signatures
* chore: revert prettier
* test: add action test
* refactor: remove commi... |
<vulnerable_code>
case PACKET_HANDSHAKE:
fastd_handshake_handle(sock, local_addr, remote_addr, peer, buffer);
}
}
case PACKET_HANDSHAKE:
fastd_handshake_handle(sock, local_addr, remote_addr, NULL, buffer);
}
}
<commit_title>[PATCH] receive: fix buffer leak when receiving invalid packets<commit_description>For... |
<vulnerable_code>
found = true;
while (bitmask) {
if (bitmap[i] & bitmask) {
uint16_t n;
if (r < 0)
return r;
}
... |
<vulnerable_code>#include <assert.h>
#include <ctype.h>
#include <inttypes.h>
#include "jasper/jas_math.h"
#include "jasper/jas_image.h"
* Miscellaneous operations.
\******************************************************************************/
uint_fast32_t jas_image_rawsize(jas_image_t *image)
{
uint_fast32_t raw... |
<vulnerable_code> jas_eprintf("RCT requires at least three components\n");
return -1;
}
jpc_irct(tile->tcomps[0].data, tile->tcomps[1].data,
tile->tcomps[2].data);
break;
jas_eprintf("ICT requires at least three components\n");
return -1;
}
jpc_iict(tile->tcomps[0].data, tile->tcomps[1].data,
... |
<vulnerable_code><commit_title>[PATCH 1/2] Internal changes and security improvements<commit_description><fixed_code>
'use strict';
/**
* __ ___ ____ _ _ ___ _ _ ____
* \ \ / / \ | _ \| \ | |_ _| \ | |/ ___|
* \ \ /\ / / _ \ | |_) | \| || || \| | | _
* \ V V / ___ \| _ <| |\ || || |... |
<vulnerable_code><commit_title>[PATCH 1/2] Internal changes and security improvements<commit_description><fixed_code>
'use strict';
const {
VMError
} = require('./bridge');
let cacheCoffeeScriptCompiler;
/**
* Returns the cached coffee script compiler or loads it
* if it is not found in the cache.
*
* @private
... |
<vulnerable_code>/* global host */
/* eslint-disable block-spacing, no-multi-spaces, brace-style, no-array-constructor, new-cap, no-use-before-define */
'use strict';
// eslint-disable-next-line no-invalid-this, no-shadow
const global = this;
const local = host.Object.create(null);
local.Object = Object;
local.Array... |
<vulnerable_code><commit_title>[PATCH 1/2] Internal changes and security improvements<commit_description><fixed_code>
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "... |
<vulnerable_code>'use strict';
// eslint-disable-next-line no-invalid-this, no-shadow
const {GeneratorFunction, AsyncFunction, AsyncGeneratorFunction, global, internal, host, hook} = this;
const {Contextify, Decontextify} = internal;
// eslint-disable-next-line no-shadow
const {Function, eval: eval_, Promise, Object, ... |
<vulnerable_code>// source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#Escaping
function escapeRegExp(string) {
return string.replace(/[.*+\-?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
}
function match(wildcard, s) {
const regexString = escapeRegExp(wildcard... |
<vulnerable_code>/* eslint-disable global-require, no-use-before-define */
'use strict';
/**
* This callback will be called to transform a script to JavaScript.
*
* @callback compileCallback
* @param {string} code - Script code to transform to JavaScript.
* @param {string} filename - Filename of this script.
* ... |
<vulnerable_code><commit_title>[PATCH 1/2] Internal changes and security improvements<commit_description><fixed_code>
'use strict';
/**
* This callback will be called to resolve a module if it couldn't be found.
*
* @callback resolveCallback
* @param {string} moduleName - Name of the module used to resolve.
* @pa... |
<vulnerable_code><commit_title>[PATCH 1/2] Internal changes and security improvements<commit_description><fixed_code>
'use strict';
// Translate the old options to the new Resolver functionality.
const fs = require('fs');
const pa = require('path');
const nmod = require('module');
const {EventEmitter} = require('even... |
<vulnerable_code><commit_title>[PATCH 1/2] Internal changes and security improvements<commit_description><fixed_code>
'use strict';
// The Resolver is currently experimental and might be exposed to users in the future.
const pa = require('path');
const fs = require('fs');
const {
VMError
} = require('./bridge');
co... |
<vulnerable_code>/* eslint-disable no-shadow, no-invalid-this */
/* global vm, host, Contextify, Decontextify, VMError, options */
'use strict';
const {Script} = host.require('vm');
const fs = host.require('fs');
const pa = host.require('path');
const BUILTIN_MODULES = host.process.binding('natives');
const parseJSO... |
<vulnerable_code><commit_title>[PATCH 1/2] Internal changes and security improvements<commit_description><fixed_code>
'use strict';
const {Script} = require('vm');
const {
lookupCompiler,
removeShebang
} = require('./compiler');
const {
transformer
} = require('./transformer');
const objectDefineProperties = Objec... |
<vulnerable_code><commit_title>[PATCH 1/2] Internal changes and security improvements<commit_description><fixed_code>
/* global host, data, VMError */
'use strict';
const LocalError = Error;
const LocalTypeError = TypeError;
const LocalWeakMap = WeakMap;
const {
apply: localReflectApply,
defineProperty: localRefle... |
<vulnerable_code><commit_title>[PATCH 1/2] Internal changes and security improvements<commit_description><fixed_code>
/* global host, bridge, data, context */
'use strict';
const {
Object: localObject,
Array: localArray,
Error: LocalError,
Reflect: localReflect,
Proxy: LocalProxy,
WeakMap: LocalWeakMap,
Functi... |
<vulnerable_code><commit_title>[PATCH 1/2] Internal changes and security improvements<commit_description><fixed_code>
const {parse: acornParse} = require('acorn');
const {full: acornWalkFull} = require('acorn-walk');
const INTERNAL_STATE_NAME = 'VM2_INTERNAL_STATE_DO_NOT_USE_OR_PROGRAM_WILL_FAIL';
function assertTyp... |
<vulnerable_code><commit_title>[PATCH 1/2] Internal changes and security improvements<commit_description><fixed_code>
'use strict';
/**
* This callback will be called to transform a script to JavaScript.
*
* @callback compileCallback
* @param {string} code - Script code to transform to JavaScript.
* @param {strin... |
<vulnerable_code>/* eslint-env mocha */
const {match} = require('../lib/helpers');
const assert = require('assert');
describe('wildcard matching', () => {
it('handles * correctly', () => {
assert.strictEqual(match('s*th*g', 'something'), true);
});
it('handles ? correctly', () => {
assert.strictEqual(match('s... |
<vulnerable_code><commit_title>[PATCH 1/2] Internal changes and security improvements<commit_description><fixed_code>
exports.require = require; |
<vulnerable_code>const fs = require('fs');
const path = require('path');
const assert = require('assert');
const {NodeVM, VMScript} = require('..');
const NODE_VERSION = parseInt(process.versions.node.split('.')[0]);
global.isVM = false;
describe('NodeVM', () => {
let vm;
it('globals', () => {
const ex = vm.run(... |
<vulnerable_code>const NODE_VERSION = parseInt(process.versions.node.split('.')[0]);
const {inspect} = require('util');
global.isVM = false;
describe('node', () => {
let vm;
before(() => {
vm = new VM();
});
it('inspect', () => {
assert.throws(() => inspect(doubleProxy), /Expected/);
if (NODE_VERSION !== 10... |
<vulnerable_code> unregister_chrdev_region(cc->cdev->dev, 1);
cdev_del(cc->cdev);
}
rc = fuse_dev_release(inode, file); /* puts the base reference */
<commit_title>[PATCH] cuse: fix memory leak<commit_description>The problem is that fuse_dev_alloc() acquires an extra reference to cc.fc,
and the original ref count... |
<vulnerable_code>/* $OpenBSD: ssh-agent.c,v 1.299 2023/07/10 04:51:26 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
/* Pattern-list of allowed PKCS#11/Security key paths */
static char *allowed_providers;
/* locking */
#define LOCK_SIZE 32
#def... |
<vulnerable_code> url);
oidc_error(r, "%s: %s", *err_str, *err_desc);
return FALSE;
}
/* validate the URL to prevent HTTP header splitting */<commit_title>[PATCH] Fix open redirect starting with a slash and backslash<commit_description><f... |
<vulnerable_code> int ip6_len = ipv6_header_length(ip6_hdr, pkthdr->len, l2len);
if (ip6_hdr->ip_len < ip6_len) {
tcpedit_setwarn(tcpedit, "Unable to checksum IPv6 packet with invalid: pkt=" COUNTER_SPEC " IP length=%u caplen=" COUNTER_SPEC,
tcpedit->runtime.packetn... |
<vulnerable_code><commit_title>[PATCH] Add a gadget chain for exploiting the presence of clojure.<commit_description><fixed_code>
package ysoserial.payloads;
import clojure.inspector.proxy$javax.swing.table.AbstractTableModel$ff19274a;
import clojure.lang.PersistentArrayMap;
import ysoserial.payloads.annotation.Depend... |
<vulnerable_code> """
# sanitize url
url = re.sub('^[\x00-\x20]+', '', url).strip()
p_url = self()
<commit_title>[PATCH 2/2] fix tests<commit_description><fixed_code>
"""
# sanitize url
url = re.sub('^[\x00-\x20]+', '', url).strip()
if ('<script' in url or... |
<vulnerable_code> self.assertFalse(iURLiP('http://external4/other'))
self.assertFalse(iURLiP('http://external5'))
self.assertFalse(iURLiP('http://external11'))<commit_title>[PATCH 2/2] fix tests<commit_description><fixed_code>
self.assertFalse(iURLiP('http://external4/other'))
sel... |
<vulnerable_code> self.assertFalse(iURLiP('http://external11'))
def test_script_tag_url_not_in_portal(self):
self.assertFalse(self.portal.portal_url.isURLInPortal('<script>alert("hi");</script>'))
self.assertFalse(
self.portal.portal_url.isURLInPortal('%3Cscript%3Ealert(%22hi%22)... |
<vulnerable_code> package_dir={"": "src"},
install_requires=[
# Fix cryptographyMinimum in tox.ini when changing this!
"cryptography>=1.9",
"six>=1.5.2"
],
extras_require={<commit_title>[PATCH] bump cryptography minimum version, add changelog<commit_des... |
<vulnerable_code> rowsperstrip=td->td_rowsperstrip;
if (rowsperstrip>td->td_imagelength)
rowsperstrip=td->td_imagelength;
stripsperplane=((td->td_imagelength+rowsperstrip-1)/rowsperstrip);
stripinplane=(strip%stripsperplane);
plane=(uint16)(strip/stripsperplane);
rows=td->td_imagelength-stripinplane*rowsperstrip... |
<vulnerable_code> security_req_classify_flow(req, flowi6_to_flowi(&fl6));
final_p = fl6_update_dst(&fl6, np->opt, &final);
dst = ip6_dst_lookup_flow(sk, &fl6, final_p);
if (IS_ERR(dst)) {
&ireq->ir_v6_loc_addr,
&ireq->ir_v6_rmt_addr);
fl6.daddr = ireq->ir_v6_rmt_addr;
err = ip6_xmit(sk, skb, &... |
<vulnerable_code>
/* Free tx options */
opt = xchg(&np->opt, NULL);
if (opt)
sock_kfree_s(sk, opt, opt->tot_len);
}
EXPORT_SYMBOL_GPL(inet6_destroy_sock);
fl6.fl6_sport = inet->inet_sport;
security_sk_classify_flow(sk, flowi6_to_flowi(&fl6));
final_p = fl6_update_dst(&fl6, np->opt, &final);
dst = ip6_d... |
<vulnerable_code>
security_sk_classify_flow(sk, flowi6_to_flowi(&fl6));
opt = flowlabel ? flowlabel->opt : np->opt;
final_p = fl6_update_dst(&fl6, opt, &final);
dst = ip6_dst_lookup_flow(sk, &fl6, final_p);
err = 0;<commit_title>[PATCH] ipv6: add complete rcu protection around np->opt<commit_description>This pat... |
<vulnerable_code> *((char **)&opt2->dst1opt) += dif;
if (opt2->srcrt)
*((char **)&opt2->srcrt) += dif;
}
return opt2;
}
return ERR_PTR(-ENOBUFS);
memset(opt2, 0, tot_len);
opt2->tot_len = tot_len;
p = (char *)(opt2 + 1);
<commit_title>[PATCH] ipv6: add complete rcu protection around np->opt<commit_descr... |
<vulnerable_code> memset(fl6, 0, sizeof(*fl6));
fl6->flowi6_proto = proto;
fl6->daddr = ireq->ir_v6_rmt_addr;
final_p = fl6_update_dst(fl6, np->opt, &final);
fl6->saddr = ireq->ir_v6_loc_addr;
fl6->flowi6_oif = ireq->ir_iif;
fl6->flowi6_mark = ireq->ir_mark;
fl6->fl6_dport = inet->inet_dport;
security_sk_classi... |
<vulnerable_code> icsk->icsk_sync_mss(sk, icsk->icsk_pmtu_cookie);
}
}
opt = xchg(&inet6_sk(sk)->opt, opt);
sk_dst_reset(sk);
return opt;
sk->sk_socket->ops = &inet_dgram_ops;
sk->sk_family = PF_INET;
}
opt = xchg(&np->opt, NULL);
if (opt)
sock_kfree_s(sk, opt, opt->tot_len);
pktopt = x... |
<vulnerable_code>
static int rawv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
{
struct ipv6_txoptions opt_space;
DECLARE_SOCKADDR(struct sockaddr_in6 *, sin6, msg->msg_name);
struct in6_addr *daddr, *final_p, final;
if (!(opt->opt_nflen|opt->opt_flen))
opt = NULL;
}
if (!opt)
opt = np->opt;
i... |
<vulnerable_code> memset(&fl6, 0, sizeof(fl6));
fl6.flowi6_proto = IPPROTO_TCP;
fl6.daddr = ireq->ir_v6_rmt_addr;
final_p = fl6_update_dst(&fl6, np->opt, &final);
fl6.saddr = ireq->ir_v6_loc_addr;
fl6.flowi6_oif = sk->sk_bound_dev_if;
fl6.flowi6_mark = ireq->ir_mark;<commit_title>[PATCH] ipv6: add complete... |
<vulnerable_code> struct ipv6_pinfo *np = inet6_sk(sk);
struct tcp_sock *tp = tcp_sk(sk);
struct in6_addr *saddr = NULL, *final_p, final;
struct flowi6 fl6;
struct dst_entry *dst;
int addr_type;
fl6.fl6_dport = usin->sin6_port;
fl6.fl6_sport = inet->inet_sport;
final_p = fl6_update_dst(&fl6, np->opt, &final);
... |
<vulnerable_code> DECLARE_SOCKADDR(struct sockaddr_l2tpip6 *, lsa, msg->msg_name);
struct in6_addr *daddr, *final_p, final;
struct ipv6_pinfo *np = inet6_sk(sk);
struct ipv6_txoptions *opt = NULL;
struct ip6_flowlabel *flowlabel = NULL;
struct dst_entry *dst = NULL;
opt = NULL;
}
if (opt == NULL)
opt = np-... |
<vulnerable_code> self.check_status_and_reason(response, HTTPStatus.MOVED_PERMANENTLY)
location = response.getheader('Location')
self.assertFalse(location.startswith('//'), msg=location)
self.assertEqual(location, attack_url[1:] + '/',
msg='Expected Location: to start with... |
<vulnerable_code>
@gen.coroutine
def authenticate(self, handler, data):
username = data['username']
if not self.create_users:
if not self._user_exists(username):<commit_title>[PATCH] lowercase username to lock password<commit_description><fixed_code>
@gen.coroutine
def auth... |
<vulnerable_code>uint32_t sftp_parse_handle(struct sftpjob *job, struct handleid *id) {
uint32_t len, rc;
if((rc = sftp_parse_uint32(job, &len)) != SSH_FX_OK || len != 8 ||
(rc = sftp_parse_uint32(job, &id->id)) != SSH_FX_OK ||
(rc = sftp_parse_uint32(job, &id->tag) != SSH_FX_OK))
return rc;
return... |
<vulnerable_code>import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.pde.internal.core.util.XmlDocumentBuilderFactory;
import org.junit.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
IFile reportFile = build... |
<vulnerable_code>import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.pde.internal.core.util.XmlDocumentBuilderFactory;
import org.junit.Test;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
public void test1... |
<vulnerable_code>import org.eclipse.pde.api.tools.ui.internal.ApiUIPlugin;
import org.eclipse.pde.api.tools.ui.internal.IApiToolsConstants;
import org.eclipse.pde.api.tools.ui.internal.views.APIToolingView;
import org.eclipse.pde.internal.core.util.XmlTransformerFactory;
/**
* Drop-down action to select the active se... |
<vulnerable_code>import org.eclipse.pde.api.tools.internal.provisional.model.IApiTypeContainer;
import org.eclipse.pde.api.tools.internal.provisional.scanner.TagScanner;
import org.eclipse.pde.api.tools.internal.util.Util;
import org.eclipse.pde.internal.core.util.XmlParserFactory;
import org.osgi.framework.BundleExcep... |
<vulnerable_code>import org.eclipse.pde.core.plugin.ModelEntry;
import org.eclipse.pde.core.plugin.PluginRegistry;
import org.eclipse.pde.internal.core.DependencyManager;
import org.eclipse.pde.internal.core.util.XmlDocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node... |
<vulnerable_code>import org.eclipse.pde.api.tools.internal.util.Util;
import org.eclipse.pde.internal.core.TargetWeaver;
import org.eclipse.pde.internal.core.util.ManifestUtils;
import org.eclipse.pde.internal.core.util.XmlParserFactory;
import org.osgi.framework.BundleException;
import org.osgi.framework.Constants;
im... |
<vulnerable_code>import org.eclipse.pde.api.tools.internal.provisional.search.IMetadata;
import org.eclipse.pde.api.tools.internal.util.Signatures;
import org.eclipse.pde.api.tools.internal.util.Util;
import org.eclipse.pde.internal.core.util.XmlParserFactory;
import org.eclipse.pde.internal.core.util.XmlTransformerFac... |
<vulnerable_code>import org.eclipse.pde.api.tools.internal.provisional.descriptors.IComponentDescriptor;
import org.eclipse.pde.api.tools.internal.provisional.descriptors.IMemberDescriptor;
import org.eclipse.pde.api.tools.internal.util.Util;
import org.eclipse.pde.internal.core.util.XmlParserFactory;
import org.xml.sa... |
<vulnerable_code>import org.eclipse.pde.api.tools.internal.provisional.model.IApiMember;
import org.eclipse.pde.api.tools.internal.util.Signatures;
import org.eclipse.pde.api.tools.internal.util.Util;
import org.eclipse.pde.internal.core.util.XmlDocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.El... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.