text stringlengths 79 3.72M |
|---|
<vulnerable_code> case json_array: {
uint32_t count = r->u.array.length;
gravity_list_t *list = gravity_list_new(NULL, count);
for (uint32_t k=0; k<count; ++k) {
json_value *jsonv = r->u.array.values[k];
gravity_value_t v;
marray_push(gravity_value_t, list->array, v);
}
... |
<vulnerable_code>from decimal import Decimal
import pytest
from vyper.compiler import compile_code
from vyper.exceptions import ArgumentException, CallViolation
c = get_contract_with_gas_estimation(contract)
assert c.bar() == "hello"<commit_title>[PATCH] Merge pull request from GHSA-ph9x-4vc9-m39g<commit_des... |
<vulnerable_code> # _check(all(l.typ == r.typ for (l, r) in zip(args_ir, sig.args))
num_provided_kwargs = len(args_ir) - len(sig.base_args)
num_kwargs = len(sig.default_args)
kwargs_needed = num_kwargs - num_provided_kwargs
kw_vals = list(sig.default_values.values())[:kwargs_nee... |
<vulnerable_code> element=$(element);
var item=element.val();
var id='ms'+multiSelectId+'-option-'+item;
var input=$('<input id="'+id+'" type="checkbox"/>');
var label=$('<label for="'+id+'">'+item+'</label>');
if(settings.checked.indexOf(item)!=-1 || checked){
input.attr('checked',true);
... |
<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> off += 2;
ut8 segnum = *(bin->entry_table + off);
off++;
ut16 segoff = *(ut16 *)(bin->entry_table + off);
if (segnum > 0) {
entry->paddr = (ut64)bin->segment_entries[segnum - 1].offset * bin->alignment + segoff;
}
} else { // Fixed
if (bundle_type < bin->ne_header->S... |
<vulnerable_code>
/* skip all queries that are part of the reply */
for (unsigned n = 0; n < ntohs(hdr->qdcount); n++) {
bufpos += _skip_hostname(bufpos);
bufpos += 4; /* skip type and class of query */
}
bufpos += 4; /* skip ttl */
unsigned addrlen = ntohs(_get_short(buf... |
<vulnerable_code> setEditor: function(html, strip)
{
if (strip !== false)
{
html = this.cleanSavePreCode(html);
}
html = html.replace(/&#36;/g, '$');
html = this.cleanEmpty(html);
html = this.sanitizeHTML(html);
this.$editor.html(html);
},
sanitizeHTML: function(htmlStr)
... |
<vulnerable_code>!function($){var uuid=0;"use strict";var Range=function(t){return this[0]=t.startOffset,this[1]=t.endOffset,this.range=t,this};Range.prototype.equals=function(){return this[0]===this[1]};var reUrlYoutube=/https?:\/\/(?:[0-9A-Z-]+\.)?(?:youtu\.be\/|youtube\.com\S*[^\w\-\s])([\w\-]{11})(?=[^\w\-]|$)(?![?... |
<vulnerable_code> s[i] === '\\' ||
s[i] === '\t' ||
s[i] === '\n' ||
s[i] === '"')) {
result = result + s[i];
}<commit_title>[PATCH] inetLatency() command injection vulnaribility fix<commit_description><fixed_code>
s[i] === '\\' ||
s[i] === '\t' ||
s[i] === '\n' ||
... |
<vulnerable_code> */
htp_status_t htp_connp_RES_HEADERS(htp_connp_t *connp) {
for (;;) {
OUT_COPY_BYTE_OR_RETURN(connp);
// Have we reached the end of the line?<commit_title>[PATCH] response: finalize when closing during headers<commit_description>Fixes #2969<fixed_code>
*/
htp_status_t htp_connp_... |
<vulnerable_code> * pError = ErrorTLSNotAvailable;
goto close;
}
break;
case ConnectionTypeTLS:<commit_title>[PATCH] [Core] Check Start/TLS cert<commit_description><fixed_code>
* pError = ErrorTLSNotAvailable;
goto close;
}
... |
<vulnerable_code> parser_raise_error (context_p, PARSER_ERR_LITERAL_LIMIT_REACHED);
}
literal_p = (lexer_literal_t *) parser_list_append (context_p, &context_p->literal_pool);
literal_p->prop.length = (uint16_t) length;
literal_p->type = literal_type;<commit_title>[PATCH] Do not allocate memory for zero len... |
<vulnerable_code>
for(FrameBuffer::ConstIterator q=fr.begin();q!=fr.end();q++)
{
string name(q.name());
if(name=="ZBack")
{<commit_title>[PATCH] enforce xSampling/ySampling==1 in CompositeDeepScanLine<commit_description><fixed_code>
for(FrameBuffer::ConstIterator q=fr.begin(... |
<vulnerable_code>__version__ = "0.57a1"
__version_info__ = tuple(__version__.split("."))<commit_title>[PATCH] Release 0.57<commit_description>Refs #263, #615, #619, #1238, #1257, #1305, #1308, #1320, #1332, #1337, #1349, #1353, #1359, #1360<fixed_code>
__version__ = "0.57"
__version_info__ = tuple(__version__.split("."... |
<vulnerable_code> RequisitionsService.startTiming();
RequisitionsService.saveForeignSourceDefinition($scope.foreignSourceDef).then(
function() { // success
growl.success('The definition for the requisition ' + $scope.foreignSource + ' has been saved.');
form.$dirty = false;
... |
<vulnerable_code> $scope.goBack();
// If node was just created, it has no label yet
if (node.nodeLabel) {
growl.success('The node ' + node.nodeLabel + ' has been deleted.');
} else {
growl.success('The node has been deleted.');
... |
<vulnerable_code> */
$scope.provision = function() {
$scope.isSaving = true;
growl.info($sanitize('The node ' + $scope.node.nodeLabel + ' is being added to requisition ' + $scope.node.foreignSource + '. Please wait...'));
var successMessage = $sanitize('The node ' + $scope.node.nodeLabel + ' ha... |
<vulnerable_code> * @param {object} The node's object to delete
*/
$scope.deleteNode = function(node) {
bootbox.confirm('Are you sure you want to remove the node ' + node.nodeLabel + '?', function(ok) {
if (ok) {
RequisitionsService.startTiming();
RequisitionsService.deleteN... |
<vulnerable_code> }
});
modalInstance.result.then(function(targetForeignSource) {
bootbox.confirm('This action will override the existing foreign source definition for the requisition named ' + targetForeignSource + ', using ' + foreignSource + ' as a template. Are you sure you want to contin... |
<vulnerable_code> RequisitionsService.startTiming();
RequisitionsService.synchronizeRequisition(requisition.foreignSource, rescanExisting).then(
function() { // success
growl.success('The import operation has been started for ' + requisition.foreignSource + ' (rescanExisting... |
<vulnerable_code>'use strict';
const angular = require('angular-js');
require('angular-mocks');
require('../../../../../src/main/assets/js/apps/onms-requisitions/requisitions');
<commit_title>[PATCH] NMS-13126: Escape foreignSource and nodeLabel string in<commit_description><fixed_code>
'use strict';
const angular = ... |
<vulnerable_code> int i, j;
char buf[128];
ArmOpcode aop = {.off = off};
for (i = j = 0; i < sizeof (buf) - 1 && str[i]; i++, j++) {
if (str[j] == '#') {
i--; continue;
}<commit_title>[PATCH] Fix #12417/#12418 (arm assembler heap overflows)<commit_description><fixed_code>
int i, j;
char buf[128];
ArmOpcode... |
<vulnerable_code> } else if (!strncmp (token, "asr", 3)) {
op->operands[operand].shift = ARM_ASR;
}
if (op->operands[operand].shift != ARM_NO_SHIFT) {
op->operands_count ++;
op->operands[operand].shift_amount = r_num_math (NULL, token + 4);
if (op->operands[operand].shift_amount > 63) {<commit_title>[P... |
<vulnerable_code> protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
super.onSubmit(target, form);
LockUtils.write(getBuild().getArtifactsLockKey(), new Callable<Void>() {
@Override
public Void call() throws Exception {
File artifactsDir = getBuild().getArtifactsDir();
... |
<vulnerable_code> ACPI_PARSE_OBJECT *Arguments[ACPI_OBJ_NUM_OPERANDS];
UINT32 ArgCount = 0;
UINT32 Index = WalkState->NumOperands;
UINT32 i;
/* Create the interpreter arguments, in reverse order */
Index--;
for (i = 0; i < ArgCount;... |
<vulnerable_code>from airflow.configuration import AIRFLOW_CONFIG, conf
from airflow.datasets import Dataset
from airflow.exceptions import AirflowException, ParamValidationError, RemovedInAirflow3Warning
from airflow.executors.executor_loader import ExecutorLoader
from airflow.jobs.base_job import BaseJob
from airflow... |
<vulnerable_code> gpio_dev = platform_get_drvdata(pdev);
gpiochip_remove(&gpio_dev->gc);
pinctrl_unregister(gpio_dev->pctrl);
return 0;
}<commit_title>[PATCH] pinctrl/amd: Drop pinctrl_unregister for devm_ registered<commit_description><fixed_code>
gpio_dev = platform_get_drvdata(pdev);
gpiochip_remove(&gpio_de... |
<vulnerable_code> // 4x memory for OEM to UTF-8 output here.
OemToCharA((char *)&CmtRaw[0],(char *)&CmtRaw[0]);
#endif
CharToWide((char *)&CmtRaw[0],CmtData->Addr(0),CmtLength);
CmtData->Alloc(wcslen(CmtData->Addr(0)));
}
#endif<commit_title>[PATCH] 5.6.1.4: Use in-memory archive instead of file IO<com... |
<vulnerable_code>#include "arccmt.cpp"
Archive::Archive(RAROptions *InitCmd)
{
Cmd=NULL; // Just in case we'll have an exception in 'new' below.
SilentOpen=false;
}
#ifdef USE_QOPEN
bool Archive::Open(const wchar *Name,uint Mode)
{
// Important if we reuse Archive object and it has virtual QOpen
// fil... |
<vulnerable_code><commit_title>[PATCH] 5.6.1.4: Use in-memory archive instead of file IO<commit_description><fixed_code>
ArcMemory::ArcMemory()
{
Loaded=false;
SeekPos=0;
}
void ArcMemory::Load(const byte *Data,size_t Size)
{
ArcData.Alloc(Size);
memcpy(&ArcData[0],Data,Size);
Loaded=true;
SeekPos=0;
}
... |
<vulnerable_code> ProcessExtra50(&Raw,(size_t)ExtraSize,&MainHead);
#ifdef USE_QOPEN
if (MainHead.Locator && MainHead.QOpenOffset>0 && Cmd->QOpenMode!=QOPEN_NONE)
{
// We seek to QO block in the end of archive when processing
// QOpen.Load, so we need to preserve current bl... |
<vulnerable_code> else
if (*Command==0)
{
wcsncpy(Command,Arg,ASIZE(Command));
*Command=toupperw(*Command);
{
if (MatchedArg!=NULL && MatchedArgSize>0)
*MatchedArg=0;
if (wcslen(FileHead.FileName)>=NM)
return 0;
bool Dir=FileHead.Dir;
if (ExclCheck(FileHead.FileName,Dir,false,true... |
<vulnerable_code>
void QuickOpen::Load(uint64 BlockPos)
{
if (!Loaded) // If loading the first time, perform additional intialization.
{
SeekPos=Arc->Tell();
UnsyncSeekPos=false;
SaveFilePos SavePos(*Arc);
Arc->Seek(BlockPos,SEEK_SET);
if (Arc->ReadHeader()==0 || Arc->GetHeaderType()!=HEAD_SERV... |
<vulnerable_code> ErrHandler.SetSilent(Cmd->AllYes || Cmd->MsgStream==MSG_NULL);
Cmd->OutTitle();
Cmd->ProcessCommand();
delete Cmd;
}<commit_title>[PATCH] 5.6.1.4: Use in-memory archive instead of file IO<commit_description><fixed_code>
ErrHandler.SetSilent(Cmd->AllYes || Cmd->MsgStream==MSG_NULL... |
<vulnerable_code> return false; // Number part is missing in the name.
while (Num>ArcName && IsDigit(*(Num-1)))
Num--;
wcsncpyz(Num,L"*.*",ASIZE(ArcName)-(Num-ArcName));
wchar FirstVolName[NM];<commit_title>[PATCH] 5.6.1.4: Use in-memory archive instead of file IO<commit_description><fixed_code>
ret... |
<vulnerable_code> {
mbstate_t ps;
memset(&ps,0,sizeof(ps));
if (wcrtomb(Dest+DestPos,Src[SrcPos],&ps)==-1)
{
Dest[DestPos]='_';
Success=false;
}
mbstate_t ps;
memset(&ps,0,sizeof(ps));
if (mbrtowc(Dest+DestPos,Src+SrcPos,MB_CUR_MAX,&ps)==-1)
{
// For ... |
<vulnerable_code>}
bool Unpack::AddVMCode(uint FirstByte,byte *Code,int CodeSize)
{
VMCodeInp.InitBitInput();
memcpy(VMCodeInp.InBuf,Code,Min(BitInput::MAX_SIZE,CodeSize));
if (NewFilter)
{
uint VMCodeSize=RarVM::ReadData(VMCodeInp);
if (VMCodeSize>=0x10000 || VMCodeSize==0)
return false;
Ar... |
<vulnerable_code> break;
}
if (((WriteBorder-UnpPtr) & MaxWinMask)<MAX_LZ_MATCH+3 && WriteBorder!=UnpPtr)
{
UnpWriteBuf();
if (WrittenFileSize>DestUnpSize)<commit_title>[PATCH] 5.6.1.4: Use in-memory archive instead of file IO<commit_description><fixed_code>
break;
}
if ... |
<vulnerable_code> while (Item<Border)
{
UnpPtr&=MaxWinMask;
if (((WriteBorder-UnpPtr) & MaxWinMask)<MAX_LZ_MATCH+3 && WriteBorder!=UnpPtr)
{
UnpWriteBuf();
if (WrittenFileSize>DestUnpSize)
break;
}
}
if (((WriteBorder-UnpPtr) & MaxWinMask)<MAX_LZ_MATCH+3 && WriteBorder!=... |
<vulnerable_code>_forceinline void Unpack::CopyString(uint Length,uint Distance)
{
size_t SrcPtr=UnpPtr-Distance;
if (SrcPtr<MaxWinSize-MAX_LZ_MATCH && UnpPtr<MaxWinSize-MAX_LZ_MATCH)
{
// If we are not close to end of window, we do not need to waste time
// to "& MaxWinMask" pointer protection.
{
... |
<vulnerable_code> @wraps(callback)
def wrapper(ok, store_ctx):
x509 = _lib.X509_STORE_CTX_get_current_cert(store_ctx)
res = _lib.X509_up_ref(x509)
_openssl_assert(res == 1)
cert = X509._from_raw_x509_ptr(x509)
error_number = _lib.X509_STORE_CTX_... |
<vulnerable_code> encoding,
# https://github.com/python/mypy/issues/4374
map_dict, # type: ignore
) #type: ignore
_predefined_cmap: Dict[str, str] = {<commit_title>[PATCH] fix mypy2<commit_description><fixed_code>
encoding,
# https://github.com/python/mypy/issues/4374... |
<vulnerable_code> char_u *buf_ffname = curbuf->b_ffname; // name to use for
// priority computation
int use_tfu = 1;
// remember the matches for the last used tag
static int num_matches = 0;
* When desired match not found yet, try to find it (and others).
*/
if (use_tagstack)
n... |
<vulnerable_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
245,
/**/<commit_title>[PATCH] patch 9.0.0246: using freed memory when 'tagfunc' deletes the<commit_description><fixed_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
... |
<vulnerable_code>%
*/
static unsigned int XBMInteger(Image *image,short int *hex_digits)
{
int
c;
{
c=ReadBlobByte(image);
if (c == EOF)
return(0);
} while ((c == ' ') || (c == '\t') || (c == '\n') || (c == '\r'));
/*
Evaluate number.
value+=hex_digits[c];
c=ReadBlobByte(image);... |
<vulnerable_code><commit_title>[PATCH] Add unit tests for MediaDevicesSource<commit_description><fixed_code>
/**
*
* @copyright Copyright (c) 2022, Daniel Calviño Sánchez (danxuliu@gmail.com)
*
* @license AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify
* it under the te... |
<vulnerable_code><commit_title>[PATCH] Added html escaping to help with XSS. Added frame busting to<commit_description><fixed_code>
/*
* Copyright 2014-2017 Ping Identity Corporation
* All Rights Reserved.
*/
package com.unboundid.webapp.ssam;
import org.springframework.stereotype.Component;
import javax.servlet.F... |
<vulnerable_code><commit_title>[PATCH] Added html escaping to help with XSS. Added frame busting to<commit_description><fixed_code>
/*
* Copyright 2014-2017 Ping Identity Corporation
* All Rights Reserved.
*/
package com.unboundid.webapp.ssam;
import org.springframework.stereotype.Component;
import javax.servlet.F... |
<vulnerable_code>import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.client.RestTemplate;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
model.ad... |
<vulnerable_code><commit_title>[PATCH] Added html escaping to help with XSS. Added frame busting to<commit_description><fixed_code>
// frame busting
function buster(document_in, top_in) {
if (self === top_in) {
document_in.documentElement.style.display = "block";
} else {
top_in.location = self.location;
}
}
... |
<vulnerable_code>// @flow
import { jitsiLocalStorage } from '@jitsi/js-utils';
import _ from 'lodash';
if (config) {
try {
return JSON.parse(config) || undefined;
} catch (e) {
// Somehow incorrect data ended up in the storage. Clean it up.
jitsiLocalStorage.re... |
<vulnerable_code>// @flow
import { jitsiLocalStorage } from '@jitsi/js-utils/jitsi-local-storage';
import { browser } from '../lib-jitsi-meet';
if (shouldUseHostPageLocalStorage(urlParams)) {
try {
const localStorageContent = JSON.parse(urlParams['appData.localStorageContent']);
... |
<vulnerable_code>// @flow
import { NativeModules } from 'react-native';
import { loadScript } from '../util';
try {
const configTxt = await loadScript(url, 10 * 1000 /* Timeout in ms */, true /* skipeval */);
const configJson = await JavaScriptSandbox.evaluate(`${configTxt}\nJSON.stringify(config)... |
<vulnerable_code>// @flow
import { jitsiLocalStorage } from '@jitsi/js-utils';
import md5 from 'js-md5';
if (persistedState) {
try {
persistedState = JSON.parse(persistedState);
} catch (error) {
logger.error(
... |
<vulnerable_code>/* @flow */
import { reportError } from './helpers';
/**
* Parses the query/search or fragment/hash parameters out of a specific URL and
* returns them as a JS object.
const param = part.split('=');
const key = param[0];
if (!key) {
return;
}
... |
<vulnerable_code>/* @flow */
import { i18next } from '../../base/i18n';
import logger from '../logger';
import {
id: member.getId(),
displayName: member.getDisplayName(),
recordingStats:
JSON.parse(member.getProperty(PROPERTY_STATS) ||... |
<vulnerable_code>/* @flow */
import { jitsiLocalStorage } from '@jitsi/js-utils';
import logger from '../logger';
if (dataStr !== null) {
try {
const dataObject = JSON.parse(dataStr);
this._sessionsMetadata = dataObject;
} catch (e) {<commit_title>[PAT... |
<vulnerable_code>// @flow
import { jitsiLocalStorage } from '@jitsi/js-utils';
import { APP_WILL_MOUNT } from '../base/app';
if (str) {
try {
return JSON.parse(str);
} catch (error) {
logger.warn('Failed to parse legacy recent-room list!');
}<commit_title>[PATCH] f... |
<vulnerable_code>// @flow
/* eslint-disable react/jsx-no-bind, no-return-assign */
import Spinner from '@atlaskit/spinner';
import { jitsiLocalStorage } from '@jitsi/js-utils/jitsi-local-storage';
import React, { useState, useEffect } from 'react';
import uuid from 'uuid';
function VirtualBackground({ _jitsiTrack, _sel... |
<vulnerable_code> :copyright: (c) 2010 by Thadeus Burgess.
:license: BSD, see LICENSE for more details.
"""
try:
import cPickle as pickle
except ImportError: # pragma: no cover
self.default_timeout = default_timeout
self.ignore_errors = False
self._serializer = serializer_impl
... |
<vulnerable_code> *p = '\0';
direction = p[1]; /* Either '>' or '<' */
slot = atoi(argv[j]+1);
p += 3;
cn = clusterLookupNode(p);
if (!cn) {
} else {
start = stop = atoi(argv[j]);
}
... |
<vulnerable_code>
/* attempts to malloc memory, if fails print error and call abort */
void*
xmalloc (size_t num, size_t size)
{
size_t res;
if (check_mul_overflow(num, size, &res))
abort();
void *ptr = malloc (res);
if (!ptr
&& (size != 0)) /* some libc don't like size == 0 */
... |
<vulnerable_code> }
else
{
v->data.buf = CHECKED_XMALLOC(unsigned char, v->len);
memmove (v->data.buf, buf+idx, v->len);
}
idx += pad_to_4byte(v->len);<commit_title>[PATCH] fix another strdup() on unt... |
<vulnerable_code>IOEventFlags jsiGetDeviceFromClass(JsVar *class) {
// Devices have their Object data set up to something special
// See jspNewObject
if (class->varData.str[0]=='D' &&
class->varData.str[1]=='E' &&
class->varData.str[2]=='V')
return (IOEventFlags)class->varData.str[3];<commit_title... |
<vulnerable_code>However software serial doesn't use `ck`, `cts`, `parity`, `flow` or `errors` parts of the initialisation object.
*/
void jswrap_serial_setup(JsVar *parent, JsVar *baud, JsVar *options) {
IOEventFlags device = jsiGetDeviceFromClass(parent);
JshUSARTInfo inf;
*/
#ifndef SAVE_ON_FLASH
void jswrap_se... |
<vulnerable_code> // The options are also hung off the class instance variable in a property symbolically called
// DEVICE_OPTIONS_NAME ("_options").
//
IOEventFlags device = jsiGetDeviceFromClass(parent);
JshSPIInfo inf;
) {
// Debug
// jsiConsolePrintf("jswrap_spi_send called: parent=%j, srcdata=%j, n... |
<vulnerable_code> ecma_value_t property, /**< property name */
ecma_value_t value) /**< ecma value */
{
ecma_object_t *obj_p = ecma_get_object_from_value (base);
ecma_string_t *prop_name_p = ecma_get_string_from_value (property);
ecma_string_t *private_key_p = NULL;
ecma_... |
<vulnerable_code> s.add("org.apache.tomcat.dbcp.dbcp2.datasources.PerUserPoolDataSource");
s.add("org.apache.tomcat.dbcp.dbcp2.datasources.SharedPoolDataSource");
DEFAULT_NO_DESER_CLASS_NAMES = Collections.unmodifiableSet(s);
}
<commit_title>[PATCH] Fixed #2999<commit_description><fixed_code... |
<vulnerable_code> return;
var err = new Array();
if (i.value.match(/[^A-Za-z0-9_]/))
err[err.length] = 'Username can only contain letters, numbers and underscores';
if (i.value.length < 3)
err[err.length] = 'Username too short';
if (err != '') {
obj.style.color = '#ff0000... |
<vulnerable_code> }
}
function addseccheck_button(){
if (document.getElementById('values[people][SECONDARY][RELATIONSHIP]').value != ''){
document.getElementById('rss').checked=true;<commit_title>[PATCH] Version 7.4 release update<commit_description>Version 7.4 release update<fixed_code>
}
}
functi... |
<vulnerable_code> $("#editorloadingbox").css("padding", "10px");
$("#editorloadingbox").css("padding-top", "45px");
$("#editorloadingbox").html("<div style='text-align:left;color:red;font-size:16px;'><b>An error occurred</b><br>The error was reported with the following id: '" + errorId + "'<br><b... |
<vulnerable_code>
if (add==NULL) add = "(null)";
addlen=strlen(add)+1; /* only compute once */
if (_buf_alloc(out, alloclen, (*outlen)+addlen)!=SASL_OK)
return SASL_NOMEM;
strncpy(*out + *outlen, add, addlen);
*outlen += addlen-1;
return SASL_OK;
}<commit_title>[PATCH] Re-fix _sasl_add_string #587<co... |
<vulnerable_code> var selects = django.jQuery(selectsSelector);
selects.find('option').each(function() {
if (this.value == objId) {
this.innerHTML = newRepr;
this.value = newId;
}
});<commit_title>[PATCH] [1.8.x] Fixed XSS in admin's add/change related popup.<commit_de... |
<vulnerable_code> var s = link.getElementsByTagName('span')[0];
var uarr = String.fromCharCode(0x25b6);
var darr = String.fromCharCode(0x25bc);
s.innerHTML = s.innerHTML == uarr ? darr : uarr;
return false;
}
function switchPastebinFriendly(link) {
s1 = "Switch to copy-and-pas... |
<vulnerable_code>
class ArticleAdmin(admin.ModelAdmin):
list_display = ('content', 'date', callable_year, 'model_year',
'modeladmin_year', 'model_year_reversed')
list_filter = ('date', 'section')
view_on_site = False
fieldsets = (<commit_title>[PATCH] [1.8.x] Fixed XSS in admin's add... |
<vulnerable_code>from django.utils.encoding import python_2_unicode_compatible
class Section(models.Model):
"""
A simple section that links to articles, to test linking to related items
"""
name = models.CharField(max_length=100)
@property
def name_property(self):
"""<commit_title>[PA... |
<vulnerable_code> self.assertEqual(Pizza.objects.count(), 1)
self.assertEqual(Topping.objects.count(), 2)
def test_list_editable_raw_id_fields(self):
parent = ParentWithUUIDPK.objects.create(title='test')
parent2 = ParentWithUUIDPK.objects.create(title='test2')<commit_title>[PATCH] [... |
<vulnerable_code>
import numpy as np
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import test_util
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import gradient_checker
from tensorflow.python.ops import grad... |
<vulnerable_code> appbuilder = current_app.appbuilder
dag_id = (
request.args.get("dag_id")
or request.form.get("dag_id")
or (request.is_json and request.json.get("dag_id"))
or None<commit_title>[PATCH] Check for DAG ID in query par... |
<vulnerable_code> check_content_in_response(href, resp)
def test_dag_details_trigger_origin_dag_details_view(app, admin_client):
app.dag_bag.get_dag("test_graph_view").create_dagrun(
run_type=DagRunType.SCHEDULED,
delete_roles(app)
def test_delete_just_dag_per_dag_permissions(new_dag_to_delete, p... |
<vulnerable_code>{
int *d0, *d1, *d2, *r, *g, *b;
const int *y, *cb, *cr;
unsigned int maxw, maxh, max;
int offset, upb;
unsigned int i, j;
upb = (int)img->comps[0].prec;
offset = 1<<(upb - 1); upb = (1<<upb)-1;
d1 = g = (int*)malloc(sizeof(int) * (size_t)max);
d2 = b = (int*)malloc(sizeof(int) * (size_t)max... |
<vulnerable_code>
/* DWT init */
if (ff_vc2enc_init_transforms(&s->transform_args[i].t,
s->plane[0].coef_stride,
s->plane[0].dwt_height))
goto alloc_fail;
}
<commit_title>[PATCH] vc2enc_dwt: pad the temporary... |
<vulnerable_code> deinterleave(data, stride, width, height, synth);
}
av_cold int ff_vc2enc_init_transforms(VC2TransformContext *s, int p_width, int p_height)
{
s->vc2_subband_dwt[VC2_TRANSFORM_9_7] = vc2_subband_dwt_97;
s->vc2_subband_dwt[VC2_TRANSFORM_5_3] = vc2_subband_dwt_53;
s->buffer = av_m... |
<vulnerable_code> return 0;
}
static void proxy_process_command(conn *c, char *command, size_t cmdlen, bool multiget) {
assert(c != NULL);
LIBEVENT_THREAD *thr = c->thread;
if (!multiget && pr.cmd_type == CMD_TYPE_GET && pr.has_space) {
uint32_t keyoff = pr.tokens[pr.keytoken];
while (pr... |
<vulnerable_code>
# TODO: there's a potential data loss here
if self.guild_id:
guild = self.guild or Object(id=self.guild_id)
try:
member = data["member"] # type: ignore
except KeyError:
pass
else:
cache_fla... |
<vulnerable_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
220,
/**/<commit_title>[PATCH] patch 9.0.0221: accessing freed memory if compiling nested<commit_description><fixed_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
221... |
<vulnerable_code> int r = FAIL;
compiletype_T compile_type;
isn_T *funcref_isn = NULL;
if (eap->forceit)
{
else
{
// Define a local variable for the function reference.
lvar_T *lvar = reserve_local(cctx, func_name, name_end - name_start,
TRUE, ufunc->uf_func_type);
if (lvar ... |
<vulnerable_code> return trimMultiple(options, ['username', 'email', 'phoneNumber']);
}
export default {
toSnakeCase: toSnakeCase,
toCamelCase: toCamelCase,
extend: extend,
getOriginFromUrl: getOriginFromUrl,
getLocationFromUrl: getLocationFromUrl,
trimUserDetails: trimUserDetails
};<commit_title>[PATCH] ... |
<vulnerable_code> original: err
};
if (err.response && err.response.statusCode) {
errObj.statusCode = err.response.statusCode;
}<commit_title>[PATCH] Merge pull request from GHSA-prfq-f66g-43mp<commit_description>* Applied #1085 from auth0.js (fixes broken tests)
* Added an object hel... |
<vulnerable_code> });
});
});
});<commit_title>[PATCH] Merge pull request from GHSA-prfq-f66g-43mp<commit_description>* Applied #1085 from auth0.js (fixes broken tests)
* Added an object helper for setting properties at a deep level
* Masking password in original error object<fixed_code>
});
});
... |
<vulnerable_code> { keepOriginalCasing: true }
)(null, assert_data);
});
});<commit_title>[PATCH] Merge pull request from GHSA-prfq-f66g-43mp<commit_description>* Applied #1085 from auth0.js (fixes broken tests)
* Added an object helper for setting properties at a deep level
* Masking password in original ... |
<vulnerable_code>
return (val_a^((val_a^val_b)|(((val_a-val_b)&0xffffffff)^val_b)))>>31
def ct_gt_u32(val_a, val_b):
"""
Return 1 if val_a > val_b, 0 otherwise. Constant time.
"""
return ct_lt_u32(val_b, val_a)
def ct_le_u32(val_a, val_b):
"""
Return 1 if val_a <= val_b, 0 otherwise. Const... |
<vulnerable_code>
from tlslite.utils.constanttime import ct_lt_u32, ct_gt_u32, ct_le_u32, \
ct_lsb_prop_u8, ct_isnonzero_u32, ct_neq_u32, ct_eq_u32, \
ct_check_cbc_mac_and_pad, ct_compare_digest
from hypothesis import given, example
import hypothesis.strategies as st
self.assertEqual(((i & 0x1)... |
<vulnerable_code>
// Get configuration
var env = process.env.NODE_ENV || 'dev';
var config = require('./config.json')[env];
global.__basedir = __dirname;
// Database connection<commit_title>[PATCH] Update JWT generation<commit_description>JWT is now dynamic
config files have moved<fixed_code>
// Get configuration
var... |
<vulnerable_code>// Secret for JWT tokens creation (make it dynamic for production)
var jwtSecret = "ASy4FVjsXNLQl09LbieroWsjO5UXjvX5";
exports.jwtSecret = jwtSecret;
/* ROLES LOGIC
}
try {
var customRoles = require('./roles.json')}
catch(error) {
var customRoles = []
}<commit_title>[PATCH] Update JWT gener... |
<vulnerable_code>var html2ooxml = require('./html2ooxml');
var _ = require('lodash');
var Image = require('mongoose').model('Image');
var reportConfig = require('./report.json');
// Generate document with docxtemplater
async function generateDoc(audit) {
var zip = new JSZip(content);
var settings = JSON.pars... |
<vulnerable_code> // Get settings
app.get("/api/settings", acl.hasPermission('settings:read'), function(req, res) {
try {
var settings = JSON.parse(fs.readFileSync(`${__basedir}/lib/app-settings.json`))
Object.keys(defaultSettings).forEach(key => {
if (... |
<vulnerable_code> return rstrscat(NULL, rpmfiDN(fi), rpmfiBN(fi), suffix ? suffix : "", NULL);
}
/** \ingroup payload
* Directory name iterator.
*/
typedef struct dnli_s {
rpmfiles fi;
char * active;
int reverse;
int isave;
int i;
} * DNLI_t;
/** \ingroup payload
* Destroy directory name ite... |
<vulnerable_code> return url_path_join(self.base_url, 'proxy', host_and_port)
def get_client_uri(self, protocol, host, port, proxied_path):
context_path = self._get_context_path(host, port)
if self.absolute_url:
client_path = url_path_join(context_path, proxied_path)
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.