text stringlengths 79 3.72M |
|---|
<vulnerable_code> return_true,
regexp_source_fix,
has_annotation,
} from "../utils/index.js";
import { first_in_statement } from "../utils/first_in_statement.js";
import { equivalent_to } from "../equivalent-to.js";
params.push(value);
return arg !== value;
... |
<vulnerable_code> return (escaped ? "" : "\\") + lineTerminatorEscape[match];
});
}
const all_flags = "gimuy";
function sort_regexp_flags(flags) {
const existing_flags = new Set(flags.split(""));
let out = "";<commit_title>[PATCH] fix potential regexp DDOS<commit_description><fixed_code>
retu... |
<vulnerable_code> unsafe: true,
}
input: {
console.log(JSON.stringify("COMPASS? Overpass.".match(new RegExp("([Sap]+)", "ig"))));
}
expect: {
console.log(JSON.stringify("COMPASS? Overpass.".match(/([Sap]+)/gi)));
}
expect_stdout: '["PASS","pass"]'
}
unsafe: true
... |
<vulnerable_code> {
// All PdfParser instances have a pointer to a PdfEncrypt object.
// So we have to take ownership of it (command the parser to give it).
m_Encrypt = parser.TakeEncrypt();
}
Init();<commit_title>[PATCH] PdfParserObject: Store the PdfEncrypt instance as a<commit_des... |
<vulnerable_code> unique_ptr<PdfParserObject> obj(new PdfParserObject(m_Objects->GetDocument(), reference, device, (ssize_t)entry.Offset));
try
{
obj->SetEncrypt(m_Encrypt.get());
if (m_Encrypt... |
<vulnerable_code> InputStreamDevice& device, ssize_t offset) :
PdfObject(PdfVariant(), indirectReference, true),
m_device(&device),
m_Encrypt(nullptr),
m_IsTrailer(false),
m_Offset(offset < 0 ? device.GetPosition() : offset),
m_HasStream(false),
m_StreamOffset(0)
{
// Parsed objects b... |
<vulnerable_code>
const passport = require('passport');
const LocalStrategy = require('passport-local').Strategy;
const csrf = require('lusca').csrf();
const secret = process.env.SECRET_KEY || 'change-me';
<commit_title>[PATCH] protects db endpoints with auth data, but will require ui<commit_description><fixed_code>
c... |
<vulnerable_code>
const passport = require('passport');
router.get('/csrf', (req, res) => {
return res.json({csrfToken: res.locals._csrf});
})
csrfToken: res.locals._csrf
}
if (req.user) {
session.user = req.user
}
return res.json(session)<commit_title>[PATCH] protects db endpoints with auth data, b... |
<vulnerable_code>
const router = express.Router();
router.use('/auth', auth);
router.use('/db', db);
module.exports = router;<commit_title>[PATCH] protects db endpoints with auth data, but will require ui<commit_description><fixed_code>
const router = express.Router();
const secret = process.env.JWT_SECRET_KEY || '... |
<vulnerable_code> * things around needlessly
*/
static const char * fileActionString(rpmFileAction a);
static int fsmOpenat(int dirfd, const char *path, int flags);
/** \ingroup payload
* Build path to file from file info, optionally ornamented with suffix.
static int cap_set_fileat(int dirfd, const char *path, ca... |
<vulnerable_code> * You cannot use wc_psk_client_cs_callback type callback on client.
* WOLFSSL_CHECK_ALERT_ON_ERR
* Check for alerts during the handshake in the event of an error.
*/
#ifdef HAVE_CONFIG_H
#if !defined(NO_CERTS) && !defined(WOLFSSL_NO_CLIENT_AUTH)
/* verify the client sent certificate if ... |
<vulnerable_code>
if (qcom->acpi_pdata->is_urs) {
qcom->urs_usb = dwc3_qcom_create_urs_usb_platdev(dev);
if (!qcom->urs_usb) {
dev_err(dev, "failed to create URS USB platdev\n");
return -ENODEV;
}
}
}<commit_title>[PATCH] usb: dwc3: qcom: Fix NULL vs IS_ERR checking in<commit_description><fixed_co... |
<vulnerable_code> // set the account to admin if using the setup form. Eg: First user account
let urlParts = url.parse(req.header('Referer'));
let isAdmin = false;
if(urlParts.path === '/admin/setup'){
isAdmin = true;
}
let doc = {
usersName: req.body.usersName,
userEmai... |
<vulnerable_code>import org.openmrs.util.OpenmrsConstants;
import org.springframework.mock.web.MockHttpSession;
import org.w3c.dom.Document;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
Assert.assertTrue(false);
}
}
@Test
@Verifies(value="shouldSetTheValueComplexOfObsIfConceptIs... |
<vulnerable_code> user = user = authenticate(username=username, password=password)
if user and user.is_active:
login(request, user)
if 'next' in request.POST:
return HttpResponseRedirect(request.POST.get('next'))
else:
... |
<vulnerable_code>var Lexer = parse.Lexer;
var Parser = parse.Parser;
var parserOptions = {
csp: false, // noUnsafeEval,
expensiveChecks: true,
literals: { // defined at: function $ParseProvider() {
true: true,
false: false,
null: null,
/*eslint no-undefined: 0*/
undef... |
<vulnerable_code>/*eslint no-multiple-empty-lines: 0*/
/*eslint no-new: 0*/
/*eslint no-unused-vars: 0*/
'use strict';
var window = {document: {}};
'use strict';
/* We need to tell ESLint what variables are being exported */
/* exported
* <div doc-module-components="ng"></div>
*/
var REGEX_STRING_REGEXP = /^\/(.+... |
<vulnerable_code>
// These tests make no claim to be complete. We only test the most important parts of angular expressions.
// I hope they have their own tests ;)
describe("expressions", function () {
describe(".Lexer", function () {
it("should be a function", function () {
expect(expressions... |
<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>% %
% %
% %
% G e t I m a g e P i x e l C a c h e P i x e l s ... |
<vulnerable_code> *property,
*value;
MagickBooleanType
status;
MagickOffsetType
offset,
scene;
register ssize_t
i;
size_t
depth;
/*
Open persistent cache.
*/
(void) CopyMagickString(cache_filename,image->filename,MagickPathExtent);
AppendImageFormat("cache",cache_file... |
<vulnerable_code> {
int s = bd->textlen + bd->endspaces;
while (VIM_ISWHITE(*(bd->textstart + s - 1)) && s > 0)
{
s = s - (*mb_head_off)(bd->textstart, bd->textstart + s - 1) - 1;
pnew--;<commit_title>[PATCH] patch 8.2.4219: reading before the start of the line<commit_description>Problem: Reading be... |
<vulnerable_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
4218,
/**/<commit_title>[PATCH] patch 8.2.4219: reading before the start of the line<commit_description>Problem: Reading before the start of the line.
Solution: Check boundary before trying to read the charact... |
<vulnerable_code> viewname = lookup.get_route_for_model(self.model, "list", api=True)
return reverse(viewname)
def assert_no_verboten_content(self, response):
"""Check an API response for content that should not be exposed in the API."""
response_raw_content = response.content.decode... |
<vulnerable_code> if (!(t1 & 0x80)) {
/* get offset from mincode, maxcode tables */
while (code < huffcdic->mincode_table[code_length]) {
code_length++;
}
maxcode = huffcdic->maxcode_table[code_length];
}<commit_title>[PATCH] Fix potential o... |
<vulnerable_code> /* read 32 mincode-maxcode pairs from data2 big-endian */
huffcdic->mincode_table[0] = 0;
huffcdic->maxcode_table[0] = 0xFFFFFFFF;
for (int i = 1; i < 33; i++) {
const uint32_t mincode = mobi_buffer_get32(buf);
const uint32_t maxcode = mobi_buffer_get32(buf);
huf... |
<vulnerable_code>{
void *buf;
buf = g_malloc( size );
if( object ) {
g_signal_connect( object, "postclose",
*/
size += 16;
if( !(buf = g_try_malloc( size )) ) {
#ifdef DEBUG
g_assert_not_reached();
#endif /*DEBUG*/<commit_title>[PATCH] zero memory on malloc<commit_description>to prevent wri... |
<vulnerable_code>
if (unlikely(file->f_flags & __O_TMPFILE)) {
error = do_tmpfile(dfd, pathname, nd, flags, op, file, &opened);
goto out;
}
error = path_init(dfd, pathname, flags, nd);
}
out:
path_cleanup(nd);
if (!(opened & FILE_OPENED)) {
BUG_ON(!error);
put_filp(file);<commit_title>[PATCH] path_openat... |
<vulnerable_code> port = args->args[0];
idx = args->args[1];
for (i = 0; i <= SERDES_MAX; i++) {
struct serdes_macro *macro = phy_get_drvdata(ctrl->phys[i]);
if (idx != macro->idx)
if (IS_ERR(ctrl->regs))
return PTR_ERR(ctrl->regs);
for (i = 0; i <= SERDES_MAX; i++) {
ret = serdes_phy_create(ctrl, i, &ct... |
<vulnerable_code>from server import db
from flask import current_app
from enum import Enum
@staticmethod
def get_all_contributors(project_id: int):
""" Get all contributors to a project """
query = '''SELECT mapped_by as contributors from tasks where project_id = {0} and mapped_by is not null
... |
<vulnerable_code>import geojson
from flask import current_app
from geoalchemy2 import Geometry
from shapely.geometry import shape
from sqlalchemy.dialects.postgresql import ARRAY
from sqlalchemy.orm.session import make_transient
stats_dto.total_time_spent = 0
query = """SELECT SUM(TO_TIMESTAMP(action_t... |
<vulnerable_code>import json
from enum import Enum
from flask import current_app
from sqlalchemy.orm.exc import NoResultFound, MultipleResultsFound
from sqlalchemy.orm.session import make_transient
from geoalchemy2 import Geometry
AND t.task_status IN (1,3)
AND th.action IN ( 'LOCKED_FOR_VALIDAT... |
<vulnerable_code>import datetime
import dateutil.parser
from server import db
from sqlalchemy import desc
from server.models.dtos.user_dto import UserDTO, UserMappedProjectsDTO, MappedProject, UserFilterDTO, Pagination, \
UserSearchQuery, UserSearchDTO, ProjectParticipantUser, ListedUser
from server.models.postgis.... |
<vulnerable_code> from tasks t,
users u
where t.mapped_by = u.id
and t.project_id = {0}
and t.mapped_by is not null
... |
<vulnerable_code>import dateutil.parser
import datetime
from server import db
from server.models.dtos.user_dto import UserDTO, UserOSMDTO, UserFilterDTO, UserSearchQuery, UserSearchDTO, \
UserStatsDTO
sql = """SELECT SUM(TO_TIMESTAMP(action_text, 'HH24:MI:SS')::TIME) FROM task_history
WHER... |
<vulnerable_code> };
presenter.getWordsTextVoices = function($element) {
var $clone = $element.clone();
$clone.find('.selectable').each(function(){
var $this = $(this);
if ($this.hasClass('selected')) {
}
});
var textArray = presenter.getText... |
<vulnerable_code> CHECK_PROP(GF_PROP_PID_CODECID, ds->codec_id, GF_NOT_SUPPORTED)
CHECK_PROP(GF_PROP_PID_TIMESCALE, ds->timescale, GF_NOT_SUPPORTED)
if (ds->stream_type==GF_STREAM_VISUAL) {
CHECK_PROP(GF_PROP_PID_WIDTH, ds->width, GF_EOS)
CHECK_PROP(GF_PROP_PID_HEIGHT, ds->height, GF_EOS)<commit_title>[PATC... |
<vulnerable_code> if (ctx->use_file_fps) {
Double fps = AVI_frame_rate(ctx->avi);
gf_media_get_video_timing(fps, &ctx->fps.num, &ctx->fps.den);
}
dur.den = ctx->fps.num;<commit_title>[PATCH] fixed #2576<commit_description><fixed_code>
if (ctx->use_file_fps) {
Double fps = AVI_frame_rate(ctx->avi);
gf_media_... |
<vulnerable_code> numSpeakers = (s32) gf_mpegh_escaped_value(ctx->bs, 5, 8, 16) + 1;
//TODO ...
}
mhas_dmx_check_pid(filter, ctx, pl, sr, frame_len, CICPspeakerLayoutIdx, numSpeakers, start + pay_start, (u32) mhas_size);
has_cfg = GF_TRUE;
}
//audio truncation
else if (mhas_type==17) {<commit_ti... |
<vulnerable_code> ft->glyphs = gf_list_new();
ft->fontID = swf_get_16(read);
e = GF_OK;
if (revision==0) {
start = swf_get_file_pos(read);
}
}
}
gf_list_add(read->fonts, ft);
return GF_OK;
}
read->frame_rate = swf_get_16(read)>>8;
read->frame_count = swf_get_16(read);
GF_LOG(GF_LOG_INFO, GF_LOG_PARS... |
<vulnerable_code>import re
import sys
import collections
import unicodedata
import warnings
__all__ = ["urlparse", "urlunparse", "urljoin", "urldefrag",
return
# looking for characters like \u2100 that expand to 'a/c'
# IDNA uses NFKC equivalence, so normalize for this check
netloc2 = unicodedata.n... |
<vulnerable_code>import os
import tempfile
import textwrap
from tests.test_pip import reset_env, run_pip, clear_environ, write_file
def test_options_from_env_vars():
result = run_pip('install', '-vvv', 'INITools', expect_error=True)
assert "Analyzing links from page http://pypi.pinaxproject.com" in result.std... |
<vulnerable_code> * stop trying to log in with a given user name and move on
* to another user name.
*/
HANDLE Token;
if (LogonUser(username, ".", password, LOGON32_LOGON_NETWORK, LOGON32_PROVIDER_DEFAULT, &Token) == 0)
{
pcap_fmt_errmsg_for_win32_err(errbuf, PCAP_ERRBUF_SIZE,
GetLastError(), "LogonUser... |
<vulnerable_code> Q_strncpyz( filename, Cmd_Argv( 1 ), sizeof( filename ) );
COM_DefaultExtension( filename, sizeof( filename ), ".txt" );
f = FS_FOpenFileWrite( filename );
if (!f)
{<commit_title>[PATCH] Merge some file writing extension checks from OpenJK.<commit_description>Thanks Ensiform.
https://github.com/J... |
<vulnerable_code> return;
}
Q_strncpyz( filename, Cmd_Argv(1), sizeof( filename ) );
COM_DefaultExtension( filename, sizeof( filename ), ".cfg" );
Com_Printf( "Writing %s.\n", filename );<commit_title>[PATCH] Merge some file writing extension checks from OpenJK.<commit_description>Thanks Ensiform.
https://github.... |
<vulnerable_code> if(mosq->sock == INVALID_SOCKET) return MOSQ_ERR_NO_CONN;
#ifdef WITH_BROKER
mux__add_out(mosq);
#endif
pthread_mutex_lock(&mosq->current_out_packet_mutex);<commit_title>[PATCH] Unconditionally adding an event to the epoll causes 100% CPU<commit_description><fixed_code>
if(mosq->sock == INVALID_S... |
<vulnerable_code>{
const char *ptr=str+1,*end_ptr=str+1;char *ptr2;char *out;int len=0;unsigned uc,uc2;
if (*str!='\"') {*ep=str;return 0;} /* not a string! */
while (*end_ptr!='\"' && *end_ptr && ++len) if (*end_ptr++ == '\\') end_ptr++; /* Skip escaped quotes. */
out=(char*)cJSON_malloc(len+1); /* This is how... |
<vulnerable_code> if (DEBUG_PRES)
printf("PRES: pcd list\n");
bufPos = parsePresentationContextDefinitionList(self, buffer, len, bufPos);
break;
case 0xa5: /* context-definition-result-list */<commit_title>[PATCH] - fixed - Bug in presentation layer parser can... |
<vulnerable_code># -*- test-case-name: twisted.web.test.test_web -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Implementation of the lowest-level Resource class.
"""
from zope.interface import Attribute, Interface, implementer
from twisted.python.compat import nativeString
from tw... |
<vulnerable_code>from twisted.web.resource import (
FORBIDDEN,
NOT_FOUND,
ErrorPage,
ForbiddenResource,
NoResource,
Resource,
getChildForRequest,
)
from twisted.web.test.requesthelper import DummyRequest
class ErrorPageTests(TestCase):
"""
Tests for L{ErrorPage}, L{NoResource}, and ... |
<vulnerable_code> """
A factory for L{Tag} objects; the implementation of the L{tags} object.
This allows for the syntactic convenience of C{from twisted.web.html import
tags; tags.a(href="linked-page.html")}, where 'a' can be basically any HTML
tag.
The class is not exposed publicly because yo... |
<vulnerable_code><commit_title>[PATCH 01/12] Deprecate twisted.web.resource.ErrorPage and spawn<commit_description><fixed_code>
# -*- test-case-name: twisted.web.test.test_pages -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Utility implementations of L{IResource}.
"""
__all__ = (
... |
<vulnerable_code> Parameters and return value have the same meaning and requirements as
those defined by L{IResource.getChildWithDefault}.
"""
return NoResource("No such child resource.")
def getChildWithDefault(self, path, request):
"""
returns the HTTP response code I{N... |
<vulnerable_code><commit_title>[PATCH 01/12] Deprecate twisted.web.resource.ErrorPage and spawn<commit_description><fixed_code>
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test L{twisted.web.pages}
"""
from twisted.trial.unittest import SynchronousTestCase
from twisted.web.http_headers... |
<vulnerable_code>
[warning] = self.flushWarnings()
self.assertEqual(warning["category"], DeprecationWarning)
self.assertIn("twisted.pages.NotFoundPage", warning["message"])
def test_deprecatedForbiddenResource(self):
"""
[warning] = self.flushWarnings()
self.assertE... |
<vulnerable_code>from twisted.logger import Logger
from twisted.python.components import proxyForInterface
from twisted.web import util
from twisted.web.resource import ErrorPage, IResource
@implementer(IResource)
return b" ".join([scheme, b", ".join(lst)])
def quoteString(s):
return ... |
<vulnerable_code> # XXX: Argh. FIXME.
failure = str(failure)
self.request.write(
resource.ErrorPage(
http.INTERNAL_SERVER_ERROR,
"Server Connection Lost",
"Connection to distributed server lost:" + util._PRE(failure),
).rende... |
<vulnerable_code> self.doCache = 1
noRsrc = resource.ErrorPage(500, "Whoops! Internal Error", rpyNoResource)
def ResourceScript(path, registry):
glob = {
"__file__": _coerceToFilesystemEncoding("", path),
"resource": resource.ErrorPage(500, "Whoops! Internal Error", rpyNoResource),
... |
<vulnerable_code> "allowed": ", ".join([nativeString(x) for x in allowedMethods]),
}
)
epage = resource.ErrorPage(http.NOT_ALLOWED, "Method Not Allowed", s)
body = epage.render(self)
else:
epage = reso... |
<vulnerable_code>from twisted.web import http, resource, server
from twisted.web.util import redirectTo
dangerousPathError = resource.NoResource("Invalid request URL.")
def isDangerous(path):
"""
self.ignoredExts.append(ext)
childNotFound = resource.NoResource("File not found.")
forbidden = ... |
<vulnerable_code>Test L{twisted.web.pages}
"""
from twisted.trial.unittest import SynchronousTestCase
from twisted.web.http_headers import Headers
from twisted.web.pages import ErrorPage, forbidden, notFound
from twisted.web.test.requesthelper import DummyRequest
@returns: The request that the resource handled,
... |
<vulnerable_code> "forbidden",
)
from twisted.web import http
from twisted.web.iweb import IRequest
from twisted.web.resource import Resource
from twisted.web.template import renderElement, tags
self._brief: str = brief
self._detail: str = detail
def render(self, request: IRequest) -> None:
... |
<vulnerable_code> """
virtualHostResource = NameVirtualHost()
virtualHostResource.default = Data(b"correct result", "")
request = DummyRequest([""])
self.assertEqual(virtualHostResource.render(request), b"correct result")
def test_renderWithoutHostNoDefault(self):
hea... |
<vulnerable_code>
# Twisted Imports
from twisted.python import roots
from twisted.web import resource
class VirtualHostCollection(roots.Homogenous):
def _getResourceForRequest(self, request):
"""(Internal) Get the appropriate resource for the given host."""
hostHeader = request.getHeader(b"host")
... |
<vulnerable_code> descriptive text. This is useful for rendering simple error pages.
Deprecated in Twisted NEXT because it permits HTML injection; use
L{twisted.pages.ErrorPage} instead.
@ivar template: A native string which will have a dictionary interpolated
into it to generate the response ... |
<vulnerable_code>
[warning] = self.flushWarnings()
self.assertEqual(warning["category"], DeprecationWarning)
self.assertIn("twisted.pages.ErrorPage", warning["message"])
def test_deprecatedNoResource(self):
"""
[warning] = self.flushWarnings()
self.assertEqual(warni... |
<vulnerable_code> """
def __init__(self, message="Sorry. No luck finding that resource."):
ErrorPage.__init__(self, NOT_FOUND, "No Such Resource", message)
class _UnsafeForbiddenResource(_UnsafeErrorPage):
"""
def __init__(self, message="Sorry, resource is forbidden."):
ErrorPage.__in... |
<vulnerable_code>"""
__all__ = (
"ErrorPage",
"notFound",
"forbidden",
)
from twisted.web import http
from twisted.web.iweb import IRenderable, IRequest
from twisted.web.resource import Resource
from twisted.web.template import renderElement, tags
class ErrorPage(Resource):
"""
L{ErrorPage} is a... |
<vulnerable_code> descriptive text. This is useful for rendering simple error pages.
Deprecated in Twisted NEXT because it permits HTML injection; use
L{twisted.web.pages.ErrorPage} instead.
@ivar template: A native string which will have a dictionary interpolated
into it to generate the respo... |
<vulnerable_code>from twisted.trial.unittest import SynchronousTestCase
from twisted.web.http_headers import Headers
from twisted.web.iweb import IRequest
from twisted.web.pages import ErrorPage, forbidden, notFound
from twisted.web.test.requesthelper import DummyRequest
def _render(resource: ErrorPage) -> DummyReque... |
<vulnerable_code>
[warning] = self.flushWarnings()
self.assertEqual(warning["category"], DeprecationWarning)
self.assertIn("twisted.web.pages.ErrorPage", warning["message"])
def test_deprecatedNoResource(self):
"""<commit_title>[PATCH 01/12] Deprecate twisted.web.resource.ErrorPage ... |
<vulnerable_code>
Z_SYSCALL_HANDLER(gpio_enable_callback, port, access_op, pin)
{
return z_impl_gpio_enable_callback((struct device *)port, access_op,
pin);
}
Z_SYSCALL_HANDLER(gpio_disable_callback, port, access_op, pin)
{
return z_impl_gpio_disable_callback((struct device *)port, access_op,
pin);
}
... |
<vulnerable_code> // One goal is to minimize the use of regular expressions...
var MAX_FLOAT = Math.pow(2, 53);
var MIN_FLOAT = -MAX_FLOAT;
var FLOAT = /^\s*-?(\d*\.?\d+|\d+\.?\d*)(e[-+]?\d+)?\s*$/i;
var ISO_DATE = /(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\... |
<vulnerable_code> while (line_end && *line_end && *line_end != '\n') {
if (*line_end == '\n') break;
if (*line_end == '\r') break;
utf8::unchecked::next(line_end);
}
if (line_end && *line_end != 0) ++ line_end;
size_t line_len = line_end - line_beg;<commit_ti... |
<vulnerable_code>from flask import Flask, json, request
from scripts.watch.process_single import process_single
from scripts.watch.filetypes import ACCEPTED_MIMES
@api.route('/process', methods=['POST'])
def process_file():
content = request.json
target_filename = content.get('filename')
print(f"Processing {targe... |
<vulnerable_code> return to_native_string(location, 'utf8')
return None
def resolve_redirects(self, resp, req, stream=False, timeout=None,
verify=True, cert=None, proxies=None, yield_requests=False, **adapter_kwargs):
"""Receives a Response. Returns a generator ... |
<vulnerable_code> preq = req.prepare()
assert test_url == preq.url
@pytest.mark.xfail(raises=ConnectionError)
def test_auth_is_stripped_on_redirect_off_host(self, httpbin):
r = requests.get(
httpbin('redirect-to'),
params={'url': 'http://www.google.co.uk'}... |
<vulnerable_code>/***/ }),
/***/ 16:
/***/ (function(module) {
module.exports = require("tls");
/***/ }),
const EventEmitter = __webpack_require__(614);
const urlLib = __webpack_require__(835);
const normalizeUrl = __webpack_require__(53);
const getStream = __webpack_require__(997);
const CachePolicy = __webpack_re... |
<vulnerable_code> const { value, request, cachedResponse } = result;
if (cachedResponse) {
core.debug('ℹ using cached response');
}
command.issue('add-mask', value);
if (exportEnv) {
core.exportVariable(request.envVarName, `${value}`);
}<com... |
<vulnerable_code>jest.mock('@actions/core');
jest.mock('@actions/core/lib/command');
const core = require('@actions/core');
const got = require('got');
const {
expect(core.exportVariable).toBeCalledWith('KEY', '1');
expect(core.setOutput).toBeCalledWith('key', '1');
});
});<commit_title>[PATCH] Mas... |
<vulnerable_code> const BYTE** ppDstData, UINT32* pDstSize, UINT32 flags)
{
UINT32 index;
UINT32 bits;
INT32 nbits;
const BYTE* SrcPtr;
const BYTE* SrcEnd;
UINT16 Mask;
BYTE Literal;
UINT32 IndexLEC;
UINT32 BitLength;
UINT32 MaskedBits;
UINT32 CopyOffset;
UINT32 CopyLength;
UINT32 OldC... |
<vulnerable_code>from plone.app.testing import TEST_USER_ID
from plone.rest.service import Service
from plone.rest.testing import PLONE_REST_INTEGRATION_TESTING
from zope.event import notify
from zope.interface import alsoProvides
from zope.publisher.interfaces.browser import IBrowserView
obj = self.traverse(pa... |
<vulnerable_code>from plone.rest.interfaces import IAPIRequest
from plone.rest.interfaces import IService
from plone.rest.events import mark_as_api_request
from zope.component import adapter
from zope.component import queryMultiAdapter
from zope.interface import implementer
self.request = request
def trave... |
<vulnerable_code> return true; // Continue monitoring this source
}
bool
XmlRpcClient::readResponse()
{<commit_title>[PATCH] Trap for memory allocation error in tests<commit_description>Signed-off-by: Sid Faber <sid.faber@canonical.com><fixed_code>
return true; // Continue monitoring this source
}
bool
XmlR... |
<vulnerable_code>#include <stdlib.h>
#include <string>
#include "xmlrpcpp/XmlRpcException.h"
#include "xmlrpcpp/XmlRpcUtil.h"
#include "xmlrpcpp/XmlRpcValue.h"
#include <gtest/gtest.h>
//Test decoding of a well-formed but overly large XML input
TEST(XmlRpc, testOversizeString) {
std::string xml = "<tag><nexttag>"... |
<vulnerable_code> "<methodCall><methodName>DoEmpty</methodName>\r\n"
"</methodCall>\r\n",
a._request);
// create a request where content fits but the message will overflow and gets truncated
XmlRpcValue toolarge(std::string(__INT_MAX__ - 10, 'a'));
EXPECT_FALS... |
<vulnerable_code> const cert_headers = await new Promise((resolve, reject) =>
https.get(headOptions, res => resolve(res.headers)).on('error', reject)
);
if (
cert_headers['content-type'] !== 'application/pkix-cert' ||
cert_headers['content-length'] == null ||
cert_headers['content-length'] > 10000
... |
<vulnerable_code> return NULL;
}
object = r_asn1_create_object (buffer, length);
if (!object || object->list.length != 2 || !object->list.objects[0] || object->list.objects[1]->list.length != 1) {
r_asn1_free_object (object);
free (container);
return NULL;<commit_title>[PATCH] Fix #7152 - Null deref in cms<co... |
<vulnerable_code>inflect.underscore = function (camel_cased_word) {
var self;
self = util.string.gsub(camel_cased_word, /\./, '/');
self = util.string.gsub(self, /([A-Z]+)([A-Z][a-z])/, '$1_$2');
self = util.string.gsub(self, /([a-z\d])([A-Z])/, '$1_$2');
self = util.string.gsub(self, /-/, '_');
return self... |
<vulnerable_code> (void) WriteBlobString(image,"<CiscoIPPhoneImage>\n");
value=GetImageProperty(image,"label",exception);
if (value != (const char *) NULL)
(void) FormatLocaleString(buffer,MagickPathExtent,"<Title>%s</Title>\n",value);
else
{
char
}
if ((image->columns % 4) != 0)
{
... |
<vulnerable_code> s.add("org.jdom.transform.XSLTransformer");
s.add("org.jdom2.transform.XSLTransformer");
DEFAULT_NO_DESER_CLASS_NAMES = Collections.unmodifiableSet(s);
}
<commit_title>[PATCH] Backport #2387, #2389 fixes<commit_description><fixed_code>
s.add("org.jdom.transform.XSLT... |
<vulnerable_code> this.cert = opts.cert || null;
this.ca = opts.ca || null;
this.ciphers = opts.ciphers || null;
this.rejectUnauthorized = opts.rejectUnauthorized === undefined ? null : opts.rejectUnauthorized;
// other options for Node.js client
var freeGlobal = typeof global === 'object' && global;<commit... |
<vulnerable_code> n_textarea = -1;
break;
case HTML_N_TEXTAREA_INT:
if (n_textarea >= 0) {
FormItemList *item =
(FormItemList *)a_textarea[n_textarea]->url;
item->init_value = item->value =<commit_title>[PATCH] Prevent null pointer dereference in HTMLlineproc2body for<commit_description><fi... |
<vulnerable_code>// YR_ARENA* arena - Pointer to the arena.
//
// Returns:
// A pointer to the arena's data. NULL if the no data has been written to
// the arena yet.
//
<commit_title>[PATCH] Fix issue #658<commit_description><fixed_code>
// YR_ARENA* arena - Pointer to the arena.
//
// Returns:
// A p... |
<vulnerable_code>#include <time.h>
#include <math.h>
#include <yara/endian.h>
#include <yara/exec.h>
#include <yara/limits.h>
YR_RULE* rule;
YR_MATCH* match;
YR_OBJECT_FUNCTION* function;
char* identifier;
char* args_fmt;
if (stack == NULL)
return ERROR_INSUFFICIENT_MEMORY;
while(!stop)
{
swi... |
<vulnerable_code>}
begin_declarations;
begin_struct("constants");
declare_function("fsum", "fff", "f", fsum_3);
declare_function("length", "s", "i", length);
declare_function("empty", "", "s", empty);
end_declarations;
<commit_title>[PATCH] Fix issue #658<commit_description><fixed_code>
}
define_function(... |
<vulnerable_code> switch(object->type)
{
case OBJECT_TYPE_INTEGER:
((YR_OBJECT_INTEGER*) copy)->value = UNDEFINED;
break;
case OBJECT_TYPE_STRING:
((YR_OBJECT_STRING*) copy)->value = NULL;
break;
case OBJECT_TYPE_FUNCTION:<commit_title>[PATCH] Fix issue #658<commit_description><... |
<vulnerable_code>SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <yara/sizedstr.h>
else
return 1;
}<commit_title>[PATCH] Fix issue #658<commit_description><fixed_code>
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <string.h>
#include <yara/mem.h>
#include <y... |
<vulnerable_code> }",
NULL);
assert_true_rule(
"import \"tests\" \
rule test { \<commit_title>[PATCH] Fix issue #658<commit_description><fixed_code>
}",
NULL);
assert_true_rule(
"import \"tests\" \
rule test { \
condition: tests.foobar(1) == tests.foobar(1)... |
<vulnerable_code>
hw_init(LOW_FREQUENCY);
if (! tsc_sensor_exists())
{
_NFC_status = nfc_init();
device_migrate();
#if BOOT_TO_DFU
flash_option_bytes_init(1);
#else
flash_option_bytes_init(0);
#endif
}
<commit_title>[PATCH] patches to improve resistance to fault injection<commit_des... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.