text stringlengths 79 3.72M |
|---|
<vulnerable_code> } catch (InvalidNameException e) {
throw new RuntimeException(e);
}
String userSearchFilter = StringUtils.replace(getUserSearchFilter(), "{0}", token.getUsername());
userSearchFilter = StringUtils.replace(userSearchFilter, "\\", "\\\\");
logger.debug("Evaluated user searc... |
<vulnerable_code> PyPDF2._utils.deprecate_no_replacement("foo")
error_msg = "foo is deprecated and will be removed in PyPDF2 3.0.0."
assert exc.value.args[0] == error_msg
@pytest.mark.parametrize(
("dat", "pos", "expected", "expected_pos"),<commit_title>[PATCH] flake8<commit_description><fixed_... |
<vulnerable_code>static void decode_mode(struct Flex * flex, unsigned int sync_code) {
if (flex==NULL) return;
struct {
int sync;
unsigned int baud;
flex->GroupHandler.GroupFrame[groupbit] = -1;
flex->GroupHandler.GroupCycle[groupbit] = -1;
}
pt_offset += sp... |
<vulnerable_code> return add_item_to_array(array, newitem);
}
if (after_inserted != array->child && newitem->prev == NULL) {
/* return false if after_inserted is a corrupted array item */
return false;
}<commit_title>[PATCH] fix null checks problems<commit_description>Fixes #802 and ... |
<vulnerable_code> colors: ['#009688', '#455A64', '#e4e4e4'],
height: 230,
data: {
labels: templateInstance.topTasks.get().map((task) => task._id),
datasets: [{
values: templateInstance.topTasks.get().map((task) => task.count),
... |
<vulnerable_code> numberWithUserPrecision,
getUserSetting,
getUserTimeUnitVerbose,
} from '../../utils/frontend_helpers'
import { i18nReady, t } from '../../utils/i18n.js'
import { dailyTimecardMapper } from '../../utils/server_method_helpers'
width: 1,
compareValue: (cell, keyword) => [dayjs(c... |
<vulnerable_code> const project = Projects.findOne({ _id: entry.projectId })
const mapping = [project ? project.name : '',
dayjs.utc(entry.date).format(getGlobalSetting('dateformat')),
entry.task,
projectUsers.findOne() ? projectUsers.findOne().users.find((elem) => elem._id === entry.userId)?.profile?.na... |
<vulnerable_code> numberWithUserPrecision,
getUserSetting,
getUserTimeUnitVerbose,
} from '../../utils/frontend_helpers.js'
import { totalHoursForPeriodMapper } from '../../utils/server_method_helpers.js'
.map((key) => key[1]))
}
const columns = [
{ name: t('globals.project'), edit... |
<vulnerable_code>import './projectAccessRights.html'
import { t, i18nReady } from '../../utils/i18n.js'
import {
validateEmail, getGlobalSetting, showToast,
} from '../../utils/frontend_helpers'
import Projects from '../../api/projects/projects.js'
name: t('globals.name'),
editable: false,
... |
<vulnerable_code> colors: [Projects.findOne({ _id: templateInstance.data.projectId }).color || '#009688', '#66c0b8', '#e4e4e4'],
height: 230,
data: {
labels: templateInstance.topTasks.get().map((task) => task._id),
datasets: [{
... |
<vulnerable_code> getGlobalSetting,
timeInUserUnit,
getUserTimeUnitVerbose,
} from '../../utils/frontend_helpers'
import './dashboard.html'
import Timecards from '../../api/timecards/timecards'
const precision = getUserSetting('precision')
for (const timecard of Timecards.find({}, { sort: { dat... |
<vulnerable_code>
function addToolTipToTableCell(value) {
if (value) {
return `<span class="js-tooltip" data-bs-toggle="tooltip" data-bs-placement="left" title="${value}">${value}</span>`
}
return ''
}<commit_title>[PATCH] =?UTF-8?q?=F0=9F=94=92=20fixes=20three=20critical=20store?=<commit_description><fixed_c... |
<vulnerable_code> }
return {
projectId: Projects.findOne({ _id: entry._id.projectId }).name,
userId: projectUsers.findOne().users.find((elem) => elem._id === entry._id.userId)?.profile?.name,
totalHours,
}
}<commit_title>[PATCH] =?UTF-8?q?=F0=9F=94=92=20fixes=20three=20critical=20store?=<commit_descrip... |
<vulnerable_code>import subprocess
import binwalk.core.common
from binwalk.core.compat import *
from binwalk.core.module import Module, Option, Kwarg
from binwalk.core.common import file_size, file_md5, unique_file_name, BlockFile
UNIQUE_PATH_DELIMITER = '%%'
# Unprivileged user account to execute external ex... |
<vulnerable_code> * Section Header Block.
*/
#define BT_SHB 0x0A0D0D0A
#define BT_SHB_INSANE_MAX 1024*1024*1 /* 1MB should be enough */
struct section_header_block {
bpf_u_int32 byte_order_magic;
u_short major_version;
if (total_length < sizeof(*bhdrp) + sizeof(*shbp) + sizeof(struct block_trailer) ||
... |
<vulnerable_code>} );
QUnit.test( "of", function( assert ) {
assert.expect( 9 + ( scrollTopSupport() ? 1 : 0 ) );
var event;
top: 600,
left: 400
}, "event - left top, right bottom" );
} );
QUnit.test( "offsets", function( assert ) {
assert.deepEqual( position, expectedPosition, "correct position for call ... |
<vulnerable_code> options = $.extend( {}, options );
var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions,
target = $( options.of ),
within = $.position.getWithinInfo( options.within ),
scrollInfo = $.position.getScrollInfo( within ),
collision = ( options.collision || "flip" ).spli... |
<vulnerable_code> int error;
if (type == ACL_TYPE_ACCESS) {
error = posix_acl_equiv_mode(acl, &inode->i_mode);
if (error < 0)
return 0;
if (error == 0)
acl = NULL;
}
inode->i_ctime = current_time(inode);<commit_title>[PATCH] tmpfs: clear S_ISGID when setting posix ACLs<commit_description>This change wa... |
<vulnerable_code>import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.nio.file.Files;
import java.nio.file.StandardCopyOption;
import org.glassfish.jersey.logging.LoggingFeature;
import java.util.logging.Level;<commit_title>[PATCH] add missing import<commit_description><fixed_co... |
<vulnerable_code> */
#include <stdio.h>
#include <string.h>
#include "yajl/yajl_tree.h"
static unsigned char fileData[65536];
int
main(void)
yajl_val node;
char errbuf[1024];
/* NUL plug the buffers */
fileData[0] = '\0';
errbuf[0] = '\0';
/* read the entire config file */
rd = fread((... |
<vulnerable_code>yajl_do_finish(yajl_handle hand)
{
yajl_status stat;
stat = yajl_do_parse(hand,(const unsigned char *) " ",(size_t) 1);
if (stat != yajl_status_ok) return stat;
switch(yajl_bs_current(hand->stateStack))
{
case yajl_state_parse_error:
case yajl_state_lexical_error:
... |
<vulnerable_code>#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <assert.h>
#define STATUS_CONTINUE 1
#define STATUS_ABORT 0
struct stack_elem_s;
typedef struct stack_elem_s stack_elem_t;
struct stack_elem_s
{
yajl_val v;
v = malloc (sizeof (*v));
... |
<vulnerable_code>from colorama import Fore, Style
from ..document import Document
log = logging.getLogger(__name__)
) -> bool:
pass
def print_progress(
self, document: Document, error: bool, text: str, percentage: float
) -> None:
s = Style.BRIGHT + Fore.YELLOW + f"[doc {document... |
<vulnerable_code><commit_title>[PATCH] Sanitize progress reports in a provider-agnostic way<commit_description>Update the common `print_progress()` method in the base
`IsolationProvider` class, with two extra features:
1. Always sanitize the provided text argument.
2. Mark the sanitized text argument as untrusted.
Th... |
<vulnerable_code>sage: q = next_prime(randrange(2^97))
sage: n = p * q
sage: qsieve(n) # long time (8s on sage.math, 2011)
([6340271405786663791648052309,
46102313108592180286398757159], '')
sage: legendre_symbol(2,3)
-1
sage: legendre_symbol(1,3)<commit_title>[PATCH] src/sage/tests/book_stein_ent.py: update qsieve(... |
<vulnerable_code> with self.assertRaises(ValueError):
self.stitch_op(indices, data)
class DynamicStitchTest(DynamicStitchTestBase, test.TestCase):
<commit_title>[PATCH] Add out of bounds array check to dynamic_stitch_op.<commit_description>PiperOrigin-RevId: 506418249<fixed_code>
with self.assertRaises(V... |
<vulnerable_code> }
}
return TRUE;
}
/* Handles a message received from client over socket. */<commit_title>[PATCH] daemon, dbus: allow only root to create CCpp, Koops, vmcore<commit_description><fixed_code>
}
}
return allowed_new_user_problem_entry(client_uid, key, value);
}
/* Handl... |
<vulnerable_code>
static char *handle_new_problem(GVariant *problem_info, uid_t caller_uid, char **error)
{
problem_data_t *pd = problem_data_new();
GVariantIter *iter;
gchar *key, *value;
while (g_variant_iter_loop(iter, "{ss}", &key, &value))
{
problem_data_add_text_editable(pd, key, valu... |
<vulnerable_code> }
return true;
}<commit_title>[PATCH] daemon, dbus: allow only root to create CCpp, Koops, vmcore<commit_description><fixed_code>
}
return true;
}
bool allowed_new_user_problem_entry(uid_t uid, const char *name, const char *value)
{
/* Allow root to create everything */
if (uid... |
<vulnerable_code> struct ext4_inode *raw_inode;
int error;
if (EXT4_I(inode)->i_extra_isize == 0)
return 0;
raw_inode = ext4_raw_inode(&is->iloc);
header = IHDR(inode, raw_inode);
is->s.base = is->s.first = IFIRST(header);
struct ext4_xattr_search *s = &is->s;
int error;
if (EXT4_I(inode)->i_extra_isize == ... |
<vulnerable_code># -*- coding: utf-8 -*-
def test(grains):
return {'custom_grain_test': 'itworked' if 'os' in grains else 'itdidntwork'}<commit_title>[PATCH] Remove custom grains module from 2018.3 branch<commit_description>Support for passing the grains data to custom grains modules wasn't
added until the 2019.2... |
<vulnerable_code>from pathutils import full_path
XML_RESPONSE_XSW = full_path("saml2_response_xsw.xml")
class TestAuthnResponse:
def setup_class(self):
self.conf = config_factory("sp", dotname("server_conf"))
self.ar = authn_response(self.conf, "http://lingon.catalogix.se:8087/")
@patch('sa... |
<vulnerable_code> SamlBase.__setattr__(self, key, value)
def verify(self):
if not self.text:
if not self.extension_attributes:
raise Exception(
"Attribute value base should not have extension attributes"
self._convert_element_tree_to_me... |
<vulnerable_code><commit_title>[PATCH 1/4] Strengthen XSW tests<commit_description>Signed-off-by: Ivan Kanakarakis <ivan.kanak@gmail.com><fixed_code>
|
<vulnerable_code>from saml2.xmlenc import CipherData
from saml2.xmlenc import CipherValue
from saml2.xmlenc import EncryptedData
logger = logging.getLogger(__name__)
if not certs:
raise MissingKey(_issuer)
# saml-core section "5.4 XML Signature Profile" defines constrains on the
#... |
<vulnerable_code><commit_title>[PATCH 1/4] Strengthen XSW tests<commit_description>Signed-off-by: Ivan Kanakarakis <ivan.kanak@gmail.com><fixed_code>
from importlib_resources import path as _resource_path
from xmlschema import XMLSchema as _XMLSchema
from xmlschema.exceptions import XMLSchemaException as XMLSchemaErro... |
<vulnerable_code>SIGNED_XSW_ASSERTION_EXTENSIONS = full_path("xsw/signed-xsw-assertion-extensions.xml")
SIGNED_XSW_ASSERTION_ASSERTION = full_path("xsw/signed-xsw-assertion-assertion.xml")
class TestXSW:
assert self.ar.ava is None
assert self.ar.name_id is None<commit_title>[PATCH 1/4] Strengthen XS... |
<vulnerable_code> entry=SetMagickInfo("CACHE");
entry->description=ConstantString("Magick Persistent Cache image format");
entry->module=ConstantString("MPC");
entry->seekable_stream=MagickTrue;
entry->stealth=MagickTrue;
(void) RegisterMagickInfo(entry);
entry=SetMagickInfo("MPC");<commit_title>[PATCH] ..... |
<vulnerable_code>
token = token.substr(index + 1)
index = token.indexOf('-')
}
var salt = token.substr(0, index)<commit_title>[PATCH] add missing epoch protection<commit_description><fixed_code>
token = token.substr(index + 1)
index = token.indexOf('-')
if (index === -1) {
return false
... |
<vulnerable_code> Date.now = fn
assert.ok(valid)
})
})
})<commit_title>[PATCH] add missing epoch protection<commit_description><fixed_code>
Date.now = fn
assert.ok(valid)
})
it('should return `false` for tokens with no date', function () {
var token = this.tokens.create(this.... |
<vulnerable_code> p=PushLongPixel(MSBEndian,p,&count);
if (id == 0x0000040f)
{
(void) CopyMagickMemory(q,q+PSDQuantum(count)+12,length-
(PSDQuantum(count)+12)-(q-datum));
SetStringInfoLength(bim_profile,length-(PSDQuantum(count)+12));
break;
}
p+=count;<commit_ti... |
<vulnerable_code>var header = require('./tool/httpHeader').contentType;
var route = require('./router').response;
var conf = require('./config');
function responseTemp(response, head, file) {
response.writeHead(200, head);
}
}
var nowTemp = (host.frondend + (request.url.replace('/', '') || host.baseTe... |
<vulnerable_code> var nowTemp = (host.frondend + (request.url.replace('/', '') || host.baseTemp));
// Sanitize *nowTemp* variable to avoid *Path Traversal* attacks
var nowTemp = path.normalize(nowTemp).replace(/^(\.\.(\/|\\|$))+/, '');
var httpHead = header(nowTemp);
conf.app = conf.getApp(host.backe... |
<vulnerable_code>var header = require('./tool/httpHeader').contentType;
var route = require('./router').response;
var conf = require('./config');
var path = require('path');
function responseTemp(response, head, file) {
response.writeHead(200, head);
}
}
var nowTemp = (host.frondend + (request.url.rep... |
<vulnerable_code> }
// Sanitize *nowTemp* variable to avoid *Path Traversal* attacks
var nowTemp = (host.frondend + (request.url.replace('/', '') || host.baseTemp)).replace(/(\.\.(\/|\\|$))/g, '');
var httpHead = header(nowTemp);
conf.app = conf.getApp(host.backend);
if(!host) {<commit_title>[P... |
<vulnerable_code> unsigned char digest[64];
PHP_SHA512_CTX context;
PHP_SHA512Init(&context);
read_len = end_of_phar;
unsigned char digest[32];
PHP_SHA256_CTX context;
PHP_SHA256Init(&context);
read_len = end_of_phar;
unsigned char digest[20];
PHP_SHA1_CTX context;
PHP_SHA1Init(&co... |
<vulnerable_code> php_stream_seek(fp, sizeof(phar_zip_file_header) + entry.header_offset + entry.filename_len + PHAR_GET_16(zipentry.extra_len), SEEK_SET);
sig = (char *) emalloc(entry.uncompressed_filesize);
read = php_stream_read(fp, sig, entry.uncompressed_filesize);
if (read != entry.uncompressed_filesiz... |
<vulnerable_code>}
/**
* Methods that can be overwritten by subclasses:
* - onStart
* - execute
* - prepareResult
* - onEnd
*/
class Job {
this.currentInnerJobIndex = -1
this.eventListener = null
}
/**
* extend the "process" method instead.
*/
async start (client = db) {
Log.debug('JOB ... |
<vulnerable_code>
if (job.ended) {
const thread = userJobThreads.getThread(userId)
thread.terminate()
userJobThreads.removeThread(userId)
}
}
<commit_title>[PATCH] improve job workflow<commit_description><fixed_code>
if (job.ended) {
const thread = userJobThreads.getThread(userId)
setTimeout(... |
<vulnerable_code>
const isInfoEnabled = () => logger.isInfoEnabled()
const isErrorEnabled = () => logger.isErrorEnabled()
module.exports = {
isDebugEnabled,
isInfoEnabled,
isErrorEnabled,
debug: msg => isDebugEnabled() && logger.debug(msg),
info: msg => isInfoEnabled() && logger.info(msg),
error: msg => ... |
<vulnerable_code> ])
}
async prepareResult() {
const { surveyId } = this.context
this.setResult({<commit_title>[PATCH] improve job workflow<commit_description><fixed_code>
])
}
async beforeSuccess() {
const { surveyId } = this.context
this.setResult({ |
<vulnerable_code> }
}
async onEnd () {
await super.onEnd()
await this.batchPersister.flush(this.tx)
await RecordManager.enableTriggers(this.getSurveyId(), this.tx)
}
<commit_title>[PATCH] improve job workflow<commit_description><fixed_code>
}
}
async beforeSuccess () {
await this.ba... |
<vulnerable_code>import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Objects;
import java.util.Optional;
import java.util.WeakHashMap;
import java.util.concurrent.atomic.AtomicLong;
impor... |
<vulnerable_code> var data = this._loadShares(path);
var dropDownEl;
var self = this;
var html = '<div id="dropdown" class="drop shareDropDown" data-item-type="' + itemType +
'" data-item-source="' + path + '">';
if (data !== false && data[0] && !_.isUndefined(data[0].uid_file_owner) &&
data[0].ui... |
<vulnerable_code> _createClass(_class, [{
key: 'getConn',
value: function () {
var _ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee() {
var conn;
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
... |
<vulnerable_code>Object.defineProperty(exports, "__esModule", {
value: true
});
/**
* sql 构造
*/
var getInsertSql = exports.getInsertSql = function getInsertSql(tableName, data) {
var columns = [],
params = [],
holders = [],
sql = '';
for (var key in data) {
columns.push(ke... |
<vulnerable_code> _createClass(NodeBatis, [{
key: 'execute',
value: function () {
var _ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee(key, data, transationConn) {
var sqlObj, result;
return regeneratorRuntime.wrap(function _callee$(_contex... |
<vulnerable_code> * sql 构造
*/
export const getInsertSql = (tableName, data) => {
let columns = [], params = [], holders = [], sql = ''
for (let key in data) {
columns.push(key)
holders.push('?')
params.push(data[key])
}
export const getUpdateSql = (tableName, data, idKey = 'id') =... |
<vulnerable_code>});
var queryTest = function () {
var _ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee(name, age) {
var ret;
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
}();
var insertTest = function () {
var _ref2 = _asyncToGenerator(regeneratorRuntime.mark(fun... |
<vulnerable_code>});
var transationTest = function () {
var _ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee() {
var tdao, result3, result1, result2;
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
return function transationTest() {
... |
<vulnerable_code> console.log(ret)
}
queryTest()<commit_title>[PATCH] fix bug of sql injection in sqlBuilder<commit_description><fixed_code>
console.log(ret)
}
insertTest()
updateTest()
deleteTest()
queryTest() |
<vulnerable_code>'use strict';
const Boom = require('@hapi/boom');
const internals = {};
};
// Extract host and port from request
// $1 $2
internals.hostHeaderRegex = /^(?:(?:\r\n)?\s)*((?:[^:]+)|(?:\[[^\]]+\]))(?::(\d+))?(?:(?:\r\n)?\s)*$/; ... |
<vulnerable_code> await expect(Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() })).to.reject('Invalid Host header');
});
it('errors on an bad host header (pad port)', async () => {
const req = {<commit_title>[PATCH] Parse UR... |
<vulnerable_code> method: 'POST',
url: '/resource/4?filter=a',
headers: {
host: '[123:123:123]',
'content-type': 'text/plain;x=y'
},
connection: {
method: 'POST',
url: '... |
<vulnerable_code> struct mm_struct *mm = file->private_data;
unsigned long env_start, env_end;
if (!mm)
return 0;
page = (char *)__get_free_page(GFP_TEMPORARY);<commit_title>[PATCH] proc: prevent accessing /proc/<PID>/environ until it's ready<commit_description>If /proc/<PID>/environ gets read before the envp[] ... |
<vulnerable_code><commit_title>[PATCH] Tests for jp2 overflow<commit_description><fixed_code>
#!/usr/bin/env python
# Reproductions/tests for OOB read errors in FliDecode.c
# When run in python, all of these images should fail for
# one reason or another, either as a buffer overrun,
# unrecognized datastream, or trun... |
<vulnerable_code> );
instance._eventHandlers.push(
instance.pagination.after('pageChange', A.bind('_afterPaginationPageChange', instance)),
instance.pagination.on('changeRequest', A.bind('_onPaginationChangeRequest', instance))
);
}
}
},
_onPaginationChangeRequest: function(ev... |
<vulnerable_code> .replace(/(\(|\)|\<|\>)/g, "\\$1")
.replace(/("|'|`)/g, "\\$1")
.replace(/\{(?=(.*?(?:\,|\.).*?)\})/g, "\\{")
.replace(/(?<=\=(?:[^:]*:)?)(~)(?=\:|\=|\-|\+|\/|0|\s|$)/g, "\\$1");
} else if (quoted) {
result = result.replace(/'/g, `'\\''`);
}<commit_title>[PATCH] Correct ... |
<vulnerable_code> return true;
}
private void calculateHistoryCount() {
MemoryCacheService.HistoryCountKey key;
if (mySearchEntity.getResourceId() != null) {<commit_title>[PATCH] Add docs<commit_description><fixed_code>
return true;
}
/**
* Note that this method is called outside a DB transaction, and us... |
<vulnerable_code>import logging
from synapse.api.errors import Codes, SynapseError
from synapse.types import GroupID, RoomID, UserID, get_domain_from_id
from synapse.util.async_helpers import concurrently_execute
# TODO: Flairs
class GroupsServerWorkerHandler:
def __init__(self, hs):
self.hs = hs
... |
<vulnerable_code> requester_user_id = requester.user.to_string()
content = parse_json_object_from_request(request)
await self.groups_handler.update_group_profile(
group_id, requester_user_id, content
)<commit_title>[PATCH] Improve some validation of profile data.<commit_descr... |
<vulnerable_code>// Please note that in auth relay mode = none, password is NULL
User *zmLoadUser( const char *username, const char *password ) {
char sql[ZM_SQL_MED_BUFSIZ] = "";
char safer_username[65]; // current db username size is 32
// According to docs, size of safer_whatever must be 2*length+1 due to uni... |
<vulnerable_code>
if (options.csrf_check_origin) {
const forbidden =
request.method === 'POST' &&
request.headers.get('origin') !== url.origin &&
is_form_content_type(request);
if (forbidden) {
const csrf_error = error(403, `Cross-site ${request.method} form submissions are forbidden`);<commit_title>[... |
<vulnerable_code> * @param {Request} request
*/
export function is_form_content_type(request) {
return is_content_type(request, 'application/x-www-form-urlencoded', 'multipart/form-data');
}<commit_title>[PATCH] Merge pull request from GHSA-5p75-vc5g-8rv2<commit_description>* fix: address security advisory CVE-2023-2... |
<vulnerable_code>
test.describe('CSRF', () => {
test('Blocks requests with incorrect origin', async ({ baseURL }) => {
const res = await fetch(`${baseURL}/csrf`, {
method: 'POST',
headers: {
'content-type': 'application/x-www-form-urlencoded'
}
});
expect(res.status).toBe(403);
expect(await res.t... |
<vulnerable_code> fribidi_boolean status = false;
if UNLIKELY
(len == 0)
{
status = true;
goto out;<commit_title>[PATCH] Fix SEGV issue in fribidi_remove_bidi_marks<commit_description>Escape from fribidi_remove_bidi_marks() immediately if str is null.
This fixes https://github.com/fribidi/fribi... |
<vulnerable_code> dmaaddr = meta->dmaaddr;
goto drop_recycle_buffer;
}
if (unlikely(len > ring->rx_buffersize)) {
/* The data did not fit into one descriptor buffer
* and is split over multiple buffers.
* This should never happen, as we try to allocate buffers<commit_title>[PATCH] b43: allocate receive buf... |
<vulnerable_code>#if USE_MAGIC_HEADERS
size_t _alignment=alignment;
size_t *_ret=0;
size+=alignment+3*sizeof(size_t);
_alignment=0;
#endif
#if USE_ALLOCATOR==0<commit_title>[PATCH] Avoid overflowing allocation size in CallMalloc()<commit_description>The wraparound could happen if USE_MAGIC_HEADERS is enabled.<fixed... |
<vulnerable_code> return bdev;
fail:
ext3_msg(sb, "error: failed to open journal device %s: %ld",
__bdevname(dev, b), PTR_ERR(bdev));
return NULL;
/*todo: use simple_strtoll with >32bit ext3 */
sb_block = simple_strtoul(options, &options, 0);
if (*options && *options != ',') {
ext3_msg(sb, "error: invalid sb... |
<vulnerable_code>define([
"require",
"dojo/_base/declare", // declare
"dojo/dom-attr", // domAttr.get
"dojo/keys", // keys.ENTER
"../_Plugin",
"../../form/DropDownButton",
"../range"
], function(require, declare, domAttr, keys, lang, on, has, query, string,
_Plugin, DropDownButton, rangeapi){
// module:
//
... |
<vulnerable_code> }
if (parser->x3d_root) gf_free(parser->x3d_root);
gf_list_del(parser->nodes);
gf_list_del(parser->descriptors);
gf_list_del(parser->def_nodes);
gf_list_del(parser->peeked_nodes);<commit_title>[PATCH] fixed #2285<commit_description><fixed_code>
}
if (parser->x3d_root) gf_free(parser->x3d_root);... |
<vulnerable_code> },
trim = function (str, len) {
if (typeof(str) === STR_TYPE) {
str = str.replace(/^\s\s*/, EMPTY).replace(/\s\s*$/, EMPTY);
return typeof(len) === UNDEF_TYPE ? str : str.substring(0, UA_MAX_LENGTH);
}
};<commit_title>[PATCH] R... |
<vulnerable_code>#endif
#ifdef MBED_HEAP_STATS_ENABLED
malloc_stats_mutex->lock();
alloc_info_t *alloc_info = (alloc_info_t *)__real__malloc_r(r, size + sizeof(alloc_info_t));
if (alloc_info != NULL) {
alloc_info->size = size;
alloc_info->signature = MBED_HEAP_STATS_SIGNATURE;
#endif
#ifdef ... |
<vulnerable_code> elif filepath.is_file():
return FileResponse(filepath, chunk_size=self._chunk_size)
else:
raise HTTPNotFound
def _directory_as_html(self, filepath: Path) -> str:<commit_title>[PATCH] add another test<commit_description><fixed_code>
elif filepath.is_f... |
<vulnerable_code> await writer.wait_closed()
await client.close()
@pytest.mark.parametrize(
"dir_name,filename,data",<commit_title>[PATCH] add another test<commit_description><fixed_code>
await writer.wait_closed()
await client.close()
async def test_follow_symlink_directory_transversal_after_norm... |
<vulnerable_code> this.model = options.model;
this.refreshTokenLifetime = options.refreshTokenLifetime;
this.alwaysIssueNewRefreshToken = options.alwaysIssueNewRefreshToken;
}
/**<commit_title>[PATCH] PKCE - implementation<commit_description><fixed_code>
this.model = options.model;
this.refreshTokenLifetime =... |
<vulnerable_code>var InvalidGrantError = require('../errors/invalid-grant-error');
var InvalidRequestError = require('../errors/invalid-request-error');
var Promise = require('bluebird');
var promisify = require('promisify-any').use(Promise);
var ServerError = require('../errors/server-error');
var is = require('../val... |
<vulnerable_code> this.allowEmptyState = options.allowEmptyState;
this.authenticateHandler = options.authenticateHandler || new AuthenticateHandler(options);
this.authorizationCodeLifetime = options.authorizationCodeLifetime;
this.model = options.model;
}
var scope;
var state;
var ResponseType... |
<vulnerable_code> this.allowExtendedTokenAttributes = options.allowExtendedTokenAttributes;
this.requireClientAuthentication = options.requireClientAuthentication || {};
this.alwaysIssueNewRefreshToken = options.alwaysIssueNewRefreshToken !== false;
}
/**
}
return promisify(this.model.getClient, 2).call(this... |
<vulnerable_code>OAuth2Server.prototype.authorize = function(request, response, options, callback) {
options = _.assign({
allowEmptyState: false,
authorizationCodeLifetime: 5 * 60 // 5 minutes.
}, this.options, options);
return new AuthorizeHandler(options)
accessTokenLifetime: 60 * 60, ... |
<vulnerable_code><commit_title>[PATCH] PKCE - implementation<commit_description><fixed_code>
'use strict';
/**
* Export `StringUtil`.
*/
module.exports = {
base64URLEncode: function(str) {
return str.toString('base64')
.replace(/\+/g, '-')
.replace(/\//g, '_')
.replace(/=/g, '');
}
}; |
<vulnerable_code>var InvalidGrantError = require('../../../lib/errors/invalid-grant-error');
var InvalidRequestError = require('../../../lib/errors/invalid-request-error');
var Promise = require('bluebird');
var Request = require('../../../lib/request');
var ServerError = require('../../../lib/errors/server-error');
va... |
<vulnerable_code> e.message.should.equal('Invalid client: `redirect_uri` does not match client value');
});
});
it('should support promises', function() {
var model = {
});
});
describe('getState()', function() {
it('should throw an error if `allowEmptyState` is false and `s... |
<vulnerable_code> handler.alwaysIssueNewRefreshToken.should.equal(true);
});
it('should set the `extendedGrantTypes`', function() {
var extendedGrantTypes = { foo: 'bar' };
var model = {
requireClientAuthentication: {
password: false
}
});
var request =... |
<vulnerable_code> };
var handler = new AuthorizeHandler({ authorizationCodeLifetime: 120, model: model });
return handler.saveAuthorizationCode('foo', 'bar', 'qux', 'biz', 'baz', 'boz')
.then(function() {
model.saveAuthorizationCode.callCount.should.equal(1);
model.saveAuth... |
<vulnerable_code> packet_size=4;
offset=SeekBlob(image,start_position+14+bmp_info.size,SEEK_SET);
if (offset < 0)
ThrowReaderException(CorruptImageError,"ImproperImageHeader");
count=ReadBlob(image,packet_size*image->colors,bmp_colormap);
if (count != (ssize_t) (packet... |
<vulnerable_code>
name.encodingLength = function (n) {
if (n === '.') return 1
return Buffer.byteLength(n) + 2
}
const string = {}<commit_title>[PATCH] do trim on encodingLength as well<commit_description><fixed_code>
name.encodingLength = function (n) {
if (n === '.') return 1
return Buffer.byteLength(n.repl... |
<vulnerable_code> if (!WOLFSSL_NAMED_GROUP_IS_PQC(group))
#endif
ret = TLSX_KeyShare_Use(ssl, group, 0, NULL, NULL, &ssl->extensions);
}
else {
/* Not a message type that is allowed to have this extension. */<commit_title>[PATCH] add tls extension sanity check<commit_description><fixe... |
<vulnerable_code> }
#endif
ssl->keys.encryptionOn = 1;
ssl->options.serverState = SERVER_HELLO_COMPLETE;
}
else {
ssl->options.tls1_3 = 1;<commit_title>[PATCH] add tls extension sanity check<commit_description><fixed_code>
}
#endif
/* sanity check on PSK / KSE */... |
<vulnerable_code> isGitHubShorthand(giturl) ? 'github:' + giturl : giturl
)
var parsed = parseGitUrl(url)
var shortcutMatch = url.match(new RegExp('^([^:]+):(?:(?:[^@:]+(?:[^@]+)?@)?([^/]*))[/](.+?)(?:[.]git)?($|#)'))
var matches = Object.keys(gitHosts).map(function (gitHostName) {
try {
var gitHos... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.