text stringlengths 79 3.72M |
|---|
<vulnerable_code>
flash_lock();
__enable_irq();
}
void flash_erase_page(uint8_t page)<commit_title>[PATCH] patches to improve resistance to fault injection<commit_description><fixed_code>
flash_lock();
/* Perform option byte loading which triggers a device reset. */
FLASH->CR |= FLASH_CR_OBL_LA... |
<vulnerable_code> config->retry_connrefused = toggle;
break;
case 'h': /* --retry-delay */
err = str2unum(&config->retry_delay, nextarg);
if(err)
return err;
break;
case 'i': /* --retry-max-time */
err = str2unum(&config->retry_maxtime, nextarg);
... |
<vulnerable_code> return PARAM_OK;
}
/*
* Parse the string and write the double in the given address. Return PARAM_OK
* on success, otherwise a parameter specific error enum.<commit_title>[PATCH] curl: cap the maximum allowed values for retry time arguments<commit_description>... to avoid integer overflows later wh... |
<vulnerable_code> }
PersistentTopic topic = (PersistentTopic) getTopicReference(topicName);
ManagedLedgerImpl ledger = (ManagedLedgerImpl) topic.getManagedLedger();
ledger.asyncReadEntry(new PositionImpl(ledgerId, entryId), new AsyncCallbacks.ReadEntryCallback() {
... |
<vulnerable_code> Assert.assertEquals(responseCaptor.getValue().getStatus(), Response.Status.NO_CONTENT.getStatusCode());
}
@Test
public void testGetMessageIdByTimestamp() throws Exception {
TenantInfoImpl tenantInfo = new TenantInfoImpl(Sets.newHashSet("role1", "role2"), Sets.newHashSet("te... |
<vulnerable_code>def test_load_blp2_dxt1a():
with Image.open("Tests/images/blp/blp2_dxt1a.blp") as im:
assert_image_equal_tofile(im, "Tests/images/blp/blp2_dxt1a.png")<commit_title>[PATCH] Fix BLP DOS -- CVE-2021-28678<commit_description>* BlpImagePlugin did not properly check that reads after jumping to
... |
<vulnerable_code> raise OSError("Truncated Blp file") from e
return 0, 0
def _read_palette(self):
ret = []
for i in range(256):
try:
b, g, r, a = struct.unpack("<4B", self.fd.read(4))
except struct.error:
break
r... |
<vulnerable_code>#include "image_int.hpp"
#include "basicio.hpp"
#include "error.hpp"
#include "futils.hpp"
#include "types.hpp"
} else if (chunkType == "iCCP") {
// The ICC profile name can vary from 1-79 characters.
uint32_t iccOffset = 0;
w... |
<vulnerable_code><commit_title>[PATCH] Avoid negative integer overflow when `chunkLength == 0`.<commit_description>This fixes #789.<fixed_code>
import system_tests
class SegvInPngImageReadMetadata(
metaclass=system_tests.CaseMeta):
"""
Regression test for the bug described in:
https://github.com/E... |
<vulnerable_code>
# Generate certificates
print 'generating certificates'
os.system('server/bin/pulp-gen-ca-certificate')
os.system('nodes/common/bin/pulp-gen-nodes-certificate')
if warnings:
print "\n***\nPossible problems: Please read below\n***"<commit_title>[PATCH] Fix copyright date a... |
<vulnerable_code>
memcpy(p, serv->document_root, serv->document_root_len);
p += serv->document_root_len;
uint32_t n = params ? params - url : request->url_length;
memcpy(p, url, n);
p += n;
*p = 0;
char real_path[PATH_MAX];
if (!realpath(buffer.filename, real_path))<commit_title>[PATCH]... |
<vulnerable_code> unsigned char suffix;
} gif_lzw;
typedef struct
{
int w, h;
int flags, bgindex, ratio, transparent, eflags;
unsigned char pal[256][3];
unsigned char lpal[256][3];
gif_lzw codes[4096];
unsigned char *color_table;
int parse, step;
int lflags;
signed int codesize, codemask,... |
<vulnerable_code>
for (;;) {
switch (gif_get8(s)) {
case 0x2C: /* Image Descriptor */
x = gif_get16le(s);
y = gif_get16le(s);
w = gif_get16le(s);
h = gif_get16le(s);
if (((x + w) > (g->w)) || ((y + h) > (g->h))) {
sixel_help... |
<vulnerable_code> GdkPixbuf *pixbuf;
GdkPixbufAnimation *animation;
GdkPixbufLoader *loader = NULL;
#if 1
GdkPixbufAnimationIter *it;
GTimeVal time_val;
#endif
sixel_frame_t *frame = NULL;
int stride;
unsigned char *p;
#if (!GLIB_CHECK_VERSION(2, 36, 0))
g_type_init();
#endif
g_ge... |
<vulnerable_code> char *out;
size_t len;
if (!strlen(text)) return "empty string";
for (out=escaped, len=0; *text; ++len, ++out, ++text) {
/* Make sure there's plenty of room for a quoted character */<commit_title>[PATCH] actually return empty stringand not 'em,pty string' as<commit_description><fixed_code>
cha... |
<vulnerable_code> 347, 353, 356, 374, 387, 424, 425, 430, 446, 459,
472, 485, 502, 503, 509, 508, 524, 523, 539, 553,
554, 559, 560, 561, 562, 567, 652, 698, 756, 801,
802, 806, 831, 867, 913, 935, 944, 953, 968, 980,
994, ... |
<vulnerable_code>
/* Recursion avoidance in each contexts */
int recursion[PERF_NR_CONTEXTS];
/* Keeps track of cpu being initialized/exited */
bool online;
};
static DEFINE_PER_CPU(struct swevent_htable, swevent_htable);
hwc->state = !(flags & PERF_EF_START);
head = find_swevent_head(swhash, event);
if... |
<vulnerable_code>
# Import python libs
import os
import subprocess
# Import salt libs
result = __salt__['cmd.run_all'](cmd,
cwd=cwd,
runas=runas,
env=env,
... |
<vulnerable_code> result = git._add_http_basic_auth(**kwargs)
self.assertEqual(result, expected)
if __name__ == '__main__':
from integration import run_tests<commit_title>[PATCH] Git: Don't leak https user/pw to log<commit_description><fixed_code>
result = git._add_http_basic_au... |
<vulnerable_code>from typing import TYPE_CHECKING, Generator, TypeVar, cast
from pdm import termui
from pdm.exceptions import CandidateInfoNotFound, CandidateNotFound, PackageWarning
from pdm.models.candidates import Candidate, make_candidate
from pdm.models.requirements import (
Requirement,
def _read_lockfi... |
<vulnerable_code> document.getElementById("city").setAttribute("value",city);
}
<commit_title>[PATCH] fixed csrf bug,improved admin/atask/setting.php and added<commit_description><fixed_code>
document.getElementById("city").setAttribute("value",city);
}
//set token
function setToken(token)
{
document.getEle... |
<vulnerable_code> textDiv.addClassName("text");
var iconSpan = createElement("span", null, "icons");
textDiv.appendChild(iconSpan);
textDiv.appendChild(document.createTextNode(eventText.replace(/(\\r)?\\n/g, "<BR/>")));
// Add alarm and classification icons
if (event[9] == 1)<commit_title>[PATCH... |
<vulnerable_code> tester("ntpath.normpath('\\\\foo')", '\\\\foo')
tester("ntpath.normpath('\\\\')", '\\\\')
def test_realpath_curdir(self):
expected = ntpath.normpath(os.getcwd())
tester("ntpath.realpath('.')", expected)<commit_title>[PATCH] add test cases<commit_description><fixed_... |
<vulnerable_code>from PIL import Image
import pytest
from .helper import assert_image_equal_tofile
<commit_title>[PATCH] Review, typos and lint<commit_description><fixed_code>
import pytest
from PIL import Image
from .helper import assert_image_equal_tofile
|
<vulnerable_code>import io
import pytest
from PIL import EpsImagePlugin, Image, features
@pytest.mark.timeout(timeout=5)
@pytest.mark.parametrize(
"test_file",
[
("Tests/images/timeout-d675703545fee17acab56e5fec644c19979175de.eps")
],
)
def test_timeout(test_file):
with open(test_file, "rb") as... |
<vulnerable_code> with Image.open("Tests/images/combined_larger_than_size.psd"):
pass
@pytest.mark.parametrize(
"test_file,raises",
[
("Tests/images/timeout-1ee28a249896e05b83840ae8140622de8e648ba9.psd", Image.UnidentifiedImageError),
("Tests/images/timeout-598843abc37fc080ec... |
<vulnerable_code> )
def test_string_dimension(self):
# Assert that an error is raised if one of the dimensions is a string
with pytest.raises(OSError):
with Image.open("Tests/images/string_dimension.tiff") as im:
im.load()
@pytest.mark.skipif(not is_win32(), reason=... |
<vulnerable_code> :param size: Number of bytes to read.
:returns: A string containing <i>size</i> bytes of data.
Raises an OSError if the file is truncated and the read can not be completed
"""
if size <= 0:
return b"".join(data)
class PyCodecState:
def __init__(self):
self.xsiz... |
<vulnerable_code> finally:
self.__fp = None
def _layerinfo(fp, ct_bytes):
# read layerinfo block
layers = []<commit_title>[PATCH] Review, typos and lint<commit_description><fixed_code>
finally:
self.__fp = None
def _layerinfo(fp, ct_bytes):
# read layerinfo block
... |
<vulnerable_code> }
advance = I32(ptr);
if (advance == 0 ) {
// If there's no advance, we're in in infinite loop
state->errcode = IMAGING_CODEC_BROKEN;
return -1;
}<commit_title>[PATCH] Review, typos and lint<commit_description><fixed_code>
}
... |
<vulnerable_code><commit_title>[PATCH] XWIKI-20291: Improved translations of logging administration<commit_description><fixed_code>
/*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* u... |
<vulnerable_code><commit_title>[PATCH] XWIKI-20291: Improved translations of logging administration<commit_description><fixed_code>
/*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* u... |
<vulnerable_code> private static Object[] getVarArgs(InvocationOnMock invocationOnMockRender, int i)
{
Object[] parameters;
if (invocationOnMockRender.getArguments().length > i) {
Object argument = invocationOnMockRender.getArgument(i);
if (argument instanceof String) {
... |
<vulnerable_code>}
function searchkey(query,res){
connection.query('select * from bi_posts where concat(title,content) like "%'+ query +'%"', function(err, rows) {
if(err){ log(err,3);}
if(rows[0] === undefined){
res.contentType('application/json');<commit_title>[PATCH] Fix sql injection<commit_descrip... |
<vulnerable_code>from tensorflow.python.layers import convolutional
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import control_flow_ops
from tensorflow.python.ops import gradient_checker
from tensorflow.python.ops import gradients_impl
from tensorflow.python.ops import math_ops
x2 = self.... |
<vulnerable_code> m_webserver_k8s_audit_endpoint = m_config->get_scalar<string>("webserver", "k8s_audit_endpoint", "/k8s_audit");
m_webserver_ssl_enabled = m_config->get_scalar<bool>("webserver", "ssl_enabled", false);
m_webserver_ssl_certificate = m_config->get_scalar<string>("webserver", "ssl_certificate","/etc/fal... |
<vulnerable_code><commit_title>[PATCH] Monitor syscall event drops + optional actions<commit_description>Start actively monitoring the kernel buffer for syscall event drops,
which are visible in scap_stats.n_drops, and add the ability
to take actions when events are dropped. The -v (verbose) and
-s (stats filename) arg... |
<vulnerable_code>#include "chisel.h"
#include "sysdig.h"
#include "configuration.h"
#include "falco_engine.h"
#include "config_falco.h"
uint64_t do_inspect(falco_engine *engine,
falco_outputs *outputs,
sinsp* inspector,
uint64_t duration_to_tot_ns,
string &stats_filename,
uint64_t stats_i... |
<vulnerable_code>import urllib.parse
from django.contrib.contenttypes.models import ContentType
from django.test import RequestFactory, override_settings
from django.test.utils import override_script_prefix
from django.urls import get_script_prefix, reverse
from prometheus_client.parser import text_string_to_metric_fa... |
<vulnerable_code>from django.conf import settings
from django.conf.urls import include
from django.urls import path
from django.views.static import serve
from nautobot.core.views import CustomGraphQLView, HomeView, StaticMediaFailureView, SearchView, nautobot_metrics_view
from nautobot.extras.plugins.urls import (
... |
<vulnerable_code>import sys
import time
from django.apps import apps
import prometheus_client
from django.conf import settings
from django.contrib.auth.mixins import AccessMixin
from django.http import HttpResponseServerError, JsonResponse, HttpResponseForbidden, HttpResponse
from django.shortcuts import redirect, ren... |
<vulnerable_code> } else if (
request.contentType === null &&
key.length === 12 &&
key.toLowerCase() === 'content-type'
) {
request.contentType = val
request.headers += `${key}: ${val}\r\n`<commit_title>[PATCH] Merge pull request from GHSA-f772-66g8-q5h3<commit_description><fixed_code>
} else i... |
<vulnerable_code><commit_title>[PATCH] Merge pull request from GHSA-f772-66g8-q5h3<commit_description><fixed_code>
'use strict'
const { createServer } = require('http')
const { test } = require('tap')
const { request, errors } = require('..')
test('should validate content-type CRLF Injection', (t) => {
t.plan(2)
... |
<vulnerable_code> error(1, s, "Erroneous end of voice overlap");
return;
}
if (p_voice->time != over_mxtime)
error(1, s, tx_wrong_dur);
curvoice = &voice_tb[over_voice];
over_mxtime = 0;
over_voice = -1;
over_time = -1;<commit_title>[PATCH] fix: array overflow when wrong duration in voice overlay<co... |
<vulnerable_code> data: values,
success: function(data){
try {
var error = $(data).filter("#erro");
//var error = $(data).find('#erro'); use this if div is nested
alert(error.html());
}
catch(err) {
//console.log("Error not found");
}
populateDivTable("leilaoinscritos.php","... |
<vulnerable_code> }
reset_cur_state();
reset_globals();
passert(GLOBALS_ARE_RESET());
}
/*
*/
{
struct ikev2_ke *ke;
ke = &md->chain[ISAKMP_NEXT_v2KE]->payload.v2ke;
st->st_oakley.group = lookup_group(ke->isak_group);
if (st->st_oakley.group == NULL) {
char fromname[ADDRTOT_BUF];
addrtot(&md->se... |
<vulnerable_code>
function ajax(url, handler) {
// URL should start with a slash, but cannot start with two slashes.
// (Otherwise we have an XSS vulnerability.)
if (url[0] != '/' || url[1] == '/')
url = (''+location).replace( /[#\?].*/, ''... |
<vulnerable_code>import fs from 'fs';
import Users from '/imports/api/users';
import './settings';
import { lookup as lookupUserAgent } from 'useragent';
import { check } from 'meteor/check';
import Logger from './logger';
import Redis from './redis';
}));
});
WebApp.connectHandlers.use('/useragent', (req, res) => {... |
<vulnerable_code> if (current_option + option_length > data + data_len)
{
PRINTF("OPTION %u (delta %u, len %u) has invalid length.\n", option_number, option_delta, option_length);
return BAD_REQUEST_4_00;
}
else
/*TODO length > 270 not implemented (actually not required) */
... |
<vulnerable_code><commit_title>[PATCH] Memory leak while processing crafted packet<commit_description>Merge the Wakaama #425 and add unitary test
Fix another leak
Resolves: LE-15016
Change-Id: Ib1e6cf39aeaa663d4d7e3601135311a0aa48e536
Signed-off-by: Frederic DUR <fdur@sierrawireless.com><fixed_code>
//----------------... |
<vulnerable_code>{
return;
}<commit_title>[PATCH] Memory leak while processing crafted packet<commit_description>Merge the Wakaama #425 and add unitary test
Fix another leak
Resolves: LE-15016
Change-Id: Ib1e6cf39aeaa663d4d7e3601135311a0aa48e536
Signed-off-by: Frederic DUR <fdur@sierrawireless.com><fixed_code>
{
... |
<vulnerable_code> goto exit;
}
CU_basic_set_mode(CU_BRM_VERBOSE);
CU_basic_run_tests();
exit:<commit_title>[PATCH] Memory leak while processing crafted packet<commit_description>Merge the Wakaama #425 and add unitary test
Fix another leak
Resolves: LE-15016
Change-Id: Ib1e6cf39aeaa663d4d7e3601135311a0... |
<vulnerable_code> {
if (!match_at_original_text(match)
&& STRNCMP(match->cp_str, str, len) == 0
&& match->cp_str[len] == NUL)
return NOTDONE;
match = match->cp_next;
} while (match != NULL && !is_first_match(match));<commit_title>[PATCH] patch 9.0.0046: reading past end of completion with dupli... |
<vulnerable_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
45,
/**/<commit_title>[PATCH] patch 9.0.0046: reading past end of completion with duplicate<commit_description><fixed_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
4... |
<vulnerable_code>typedef struct rpki_rtr_pdu_error_report_ {
rpki_rtr_pdu pdu_header;
u_char encapsulated_pdu_length[4]; /* Encapsulated PDU length */
} rpki_rtr_pdu_error_report;
/*
/*
* Print a single PDU.
*/
static int
rpki_rtr_pdu_print (netdissect_options *ndo, const u_char *tptr, u_int indent)
{
co... |
<vulnerable_code> /* count number of bytes */
for (z = 0; (tmp & 0x80) && (z <= 4); z++, tmp = (tmp << 1) & 0xFF);
if (z > 4 || (x + (z - 1) > inlen)) {
return CRYPT_INVALID_PACKET;
}
<commit_title>[PATCH] Fixes #507<commit_description><fixed_code>
/* count number of bytes */
... |
<vulnerable_code> _Reasons.UNSUPPORTED_SERIALIZATION,
)
sk_x509 = p7.d.sign.cert
num = self._lib.sk_X509_num(sk_x509)
certs = []
for i in range(num):
x509 = self._lib.sk_X509_value(sk_x509, i)
self.openssl_assert(x509 != self._ffi.NULL)... |
<vulnerable_code> mode="rb",
)
# We have no public verification API and won't be adding one until we get
# some requirements from users so this function exists to give us basic<commit_title>[PATCH] Fixed crash when loading a PKCS#7 bundle with no certificates<commit_description><fixed_code>... |
<vulnerable_code>"""
from __future__ import annotations
import warnings
import ast
from typing import Any, Dict, List, Optional
from pydantic import Extra, root_validator
from langchain.prompts.base import BasePromptTemplate
from langchain.utilities import PythonREPL
DEFAULT_CODE_VALIDATIONS = {'solution_expression'... |
<vulnerable_code>import sys
from io import StringIO
from typing import Dict, Optional
from pydantic import BaseModel, Field
import multiprocessing
from multiprocessing import Pool
class PythonREPL(BaseModel):
"""Simulates a standalone Python REPL."""
locals: Optional[Dict] = Field(default_factory=dict, alias... |
<vulnerable_code>"""Test LLM PAL functionality."""
import sys
import ast
sys.path.append(r"C:\projects\langchain")
import pytest
from langchain.chains.pal.base import PALChain
from langchain.chains.pal.math_prompt import MATH_PROMPT
from langchain.chains.pal.colored_object_prompt import COLORED_OBJECT_PROMPT
from tes... |
<vulnerable_code> rows = form->rows ? form->rows : 1;
col = COLPOS(l, a->start.pos);
for (c_rows = 0; c_rows < rows; c_rows++, l = l->next) {
if (rows > 1) {
pos = columnPos(l, col);
a = retrieveAnchor(buf->formitem, l->linenumber, pos);<commit_title>[PATCH] Prevent invalid columnPos() call in formUpdateBuff... |
<vulnerable_code>//
// END: User preferences allow/disallow UI
// ------------------------------------------------------------------<commit_title>[PATCH] Require POST method to delete servers in Setup<commit_description><fixed_code>
//
// END: User preferences allow/disallow UI
// --------------------------------------... |
<vulnerable_code>"use strict";
/* global describe,it*/
const should = require("should");
const async = require("async");
const debugLog = require("node-opcua-debug").make_debugLog(__filename);
const MessageBuilder = require("..").MessageBuilder;
const MessageChunker = require("..").MessageChunker;
describe("SecureM... |
<vulnerable_code> return emulate_exception(ctxt, NM_VECTOR, 0, false);
}
static inline void assign_eip_near(struct x86_emulate_ctxt *ctxt, ulong dst)
{
switch (ctxt->op_bytes) {
case 2:
ctxt->_eip = (u32)dst;
break;
case 8:
ctxt->_eip = dst;
break;
default:
WARN(1, "unsupported eip assignment size\n");
... |
<vulnerable_code> s.add("org.apache.shiro.realm.jndi.JndiRealmFactory");
s.add("org.apache.shiro.jndi.JndiObjectFactory");
DEFAULT_NO_DESER_CLASS_NAMES = Collections.unmodifiableSet(s);
}
<commit_title>[PATCH] Block one more gadget type (ignite-jta, CVE-2020-10650)<commit_description>Merged ... |
<vulnerable_code> NDPI_LOG_DBG2(ndpi_struct, "calculating ORACLE over tcp\n");
/* Oracle Database 9g,10g,11g */
if ((dport == 1521 || sport == 1521)
&& (((packet->payload[0] == 0x07) && (packet->payload[1] == 0xff) && (packet->payload[2] == 0x00))
|| ((packet->payload_packet_len >= 232) && ((packet->... |
<vulnerable_code> "git_version": git_version,
"k8s_or_k8scelery_executor": IS_K8S_OR_K8SCELERY_EXECUTOR,
"rest_api_enabled": False,
}
backends = conf.get("api", "auth_backends")<commit_title>[PATCH] Disable allowing by default testing of connnections in UI<commit_desc... |
<vulnerable_code>/* global document, DOMParser, $, CodeMirror */
import { getMetaValue } from "./utils";
const restApiEnabled = getMetaValue("rest_api_enabled") === "True";
const connectionTestUrl = getMetaValue("test_url");
*/
function handleTestConnection(connectionType, testableConnections) {
const testButton =... |
<vulnerable_code>
return crlSet;
}
/**
* Returns a Set of byte arrays with the certificate or CRL encodings.
private Set search(String attributeName, String attributeValue,
String[] attrs) throws CertStoreException
{
String filter = attributeName + "=" + attr... |
<vulnerable_code> connect(socket, &QIODevice::readyRead,
this, &LanLinkProvider::dataReceived);
}
}
<commit_title>[PATCH] Do not let lanlink connections stay open for long without<commit_description><fixed_code>
connect(socket, &QIODevice::readyRead,
this, &LanLinkPro... |
<vulnerable_code> return NJS_ERROR;
}
frame->function->context = capability;
ret = njs_function_lambda_call(vm);
if (ret == NJS_OK) {
ret = njs_function_call(vm, njs_function(&capability->resolve),
njs_int_t ret;
njs_value_t **cur_local, **cur_closures, **cur_... |
<vulnerable_code>
njs_int_t
njs_function_lambda_call(njs_vm_t *vm)
{
uint32_t n;
njs_int_t ret;
frame = (njs_frame_t *) vm->top_frame;
function = frame->native.function;
if (function->global && !function->closure_copied) {
ret = njs_function_capture_global_closur... |
<vulnerable_code> return ret;
}
ret = njs_vmcode_interpreter(vm, vm->start);
return (ret == NJS_ERROR) ? NJS_ERROR : NJS_OK;
}<commit_title>[PATCH] Fixed recursive async function calls.<commit_description>Previously, PromiseCapability record was stored (function->context)
directly in function objec... |
<vulnerable_code>static njs_jump_off_t njs_vmcode_return(njs_vm_t *vm, njs_value_t *invld,
njs_value_t *retval);
static njs_jump_off_t njs_vmcode_await(njs_vm_t *vm, njs_vmcode_await_t *await);
static njs_jump_off_t njs_vmcode_try_start(njs_vm_t *vm, njs_value_t *value,
njs_value_t *offset, u_char *pc);
njs... |
<vulnerable_code><commit_title>[PATCH] Fixed recursive async function calls.<commit_description>Previously, PromiseCapability record was stored (function->context)
directly in function object during a function invocation. This is
not correct, because PromiseCapability record should be linked to
current execution conte... |
<vulnerable_code> fn = fib6_add_1(root, &rt->rt6i_dst.addr, rt->rt6i_dst.plen,
offsetof(struct rt6_info, rt6i_dst), allow_create,
replace_required);
if (IS_ERR(fn)) {
err = PTR_ERR(fn);
goto out;
}
<commit_title>[PATCH] net: fib: fib6_add: fix potential NULL pointer dereference<commit_description>When the ... |
<vulnerable_code> # We need to use a raw socket to test this, as the client will normalize
# the path before sending it to the server.
reader, writer = await asyncio.open_connection(client.host, client.port)
writer.write("GET /../private_file HTTP/1.1\r\n\r\n".encode())
response = await reader.readun... |
<vulnerable_code> const ut64 buf_off = R_MAX (addr, r_io_submap_from (sm)) - addr;
const int read_len = R_MIN (r_io_submap_to ((&fake_sm)),
r_io_submap_to (sm)) - (addr + buf_off) + 1;
if (map->perm & R_PERM_RELOC) {
ret &= map->reloc_map->read (io, map, addr + buf_off, &buf[buf_off], read_len);
} e... |
<vulnerable_code> result.push_back(ch);
continue;
}
int escapeStart = i;
if (!(input.length() - 1 > i)) {
result.push_back(ch);
continue;<commit_title>[PATCH] Type of escapeStart should be size_t.<commit_description><fixe... |
<vulnerable_code> iris_info.minimum_value=ReadBlobMSBLong(image);
iris_info.maximum_value=ReadBlobMSBLong(image);
iris_info.sans=ReadBlobMSBLong(image);
(void) ReadBlob(image,sizeof(iris_info.name),(unsigned char *)
iris_info.name);
iris_info.name[sizeof(iris_info.name)-1]='\0';
if (*iris_i... |
<vulnerable_code> if (LocaleCompare(image_info->filename,read_info->filename) != 0)
(void) RelinquishUniqueFileResource(read_info->filename);
read_info=DestroyImageInfo(read_info);
return((Image *) NULL);
}
hdr_info=ImfInputHeader(file);
if (LocaleCompare(image_info->filename,re... |
<vulnerable_code>import org.xwiki.resource.ResourceReferenceHandlerException;
import org.xwiki.resource.ResourceType;
import org.xwiki.security.authentication.AuthenticationResourceReference;
import com.xpn.xwiki.XWikiContext;
import com.xpn.xwiki.XWikiContextInitializer;
@Inject
private Execution execution;
... |
<vulnerable_code>import org.xwiki.context.ExecutionContext;
import org.xwiki.model.reference.WikiReference;
import org.xwiki.resource.ResourceReferenceHandlerChain;
import org.xwiki.security.authentication.AuthenticationAction;
import org.xwiki.security.authentication.AuthenticationResourceReference;
import org.xwiki.t... |
<vulnerable_code>
if ((mng_info->mng_width > 65535L) ||
(mng_info->mng_height > 65535L))
ThrowReaderException(ImageError,"WidthOrHeightExceedsLimit");
(void) FormatLocaleString(page_geometry,MaxTextExtent,
"%.20gx%.20g+0+0",(double) mng_info->mng_widt... |
<vulnerable_code>import { ref } from 'vue'
const routerListArr = []
const keepAliveRoutersArr = []
const formatRouter = (routes, routeMap) => {
}
item.meta.btns = item.btns
item.meta.hidden = item.hidden
routeMap[item.name] = item
if (item.children && item.children.length > 0) {
formatRouter... |
<vulnerable_code>package ratpack.session.clientside;
import java.time.Duration;
/**
* Client side session configuration.
private static final String LAST_ACCESS_TIME_TOKEN = "ratpack_lat";
private String sessionCookieName = "ratpack_session";
private String secretToken = Long.toString(System.currentTimeMillis... |
<vulnerable_code>**
** Represents the scan including the scan header.
**
** $Id: aclosslessscan.cpp,v 1.42 2020/08/31 07:50:43 thor Exp $
**
*/
//
while(m_Coder.Get(mset.X[i])) {
m <<= 1;
i++;
}
//
m >>= 1;<commit_title>[PATCH] Add... |
<vulnerable_code>**
** Represents the scan including the scan header.
**
** $Id: acsequentialscan.cpp,v 1.51 2016/10/28 13:58:53 thor Exp $
**
*/
while(m_Coder.Get(m_Context[dc].DCMagnitude.X[i])) {
m <<= 1;
i++;
if (m == 0)
JPG_THROW(MALFORMED_STREAM,"ACSequ... |
<vulnerable_code>**
** Represents the scan including the scan header.
**
** $Id: losslessscan.cpp,v 1.50 2015/03/25 08:45:43 thor Exp $
**
*/
v = 0;
} else if (symbol == 16) {
v = -32768;
} else {
LONG thre = 1L << (symbol - 1);
LONG diff = m_Stream.Get(symbol); ... |
<vulnerable_code>}
int extractVersionQuadFromString(const char* string, int* quad) {
char versionString[128];
char* nextDot;
char* nextNumber;
int i;
strcpy(versionString, string);
nextNumber = versionString;
for (i = 0; i < 4; i++) {
if (i == 3) {
nextDot = st... |
<vulnerable_code>import os
import Bcfg2.Server.Plugin
def async_run(prog, args):
pid = os.fork()
if pid:
os.waitpid(pid, 0)
else:
dpid = os.fork()
if not dpid:
os.system(" ".join([prog] + args))
os._exit(0)
class Trigger(Bcfg2.Server.Plugin.Plugin,
... |
<vulnerable_code> await m(path.join(__dirname, 'fixtures', 'slip3.zip'), '/tmp/dist');
}, {message: /Refusing/});
});
test.serial('throw when chained symlinks to /private/tmp/dist2 allow escape outside root directory', async t => {
await t.throwsAsync(async () => {
await m(path.join(__dirname, 'fixtures', 'slip3a... |
<vulnerable_code> }
if (num_clips && clips_ptr) {
clips = kzalloc(num_clips * sizeof(*clips), GFP_KERNEL);
if (!clips) {
ret = -ENOMEM;<commit_title>[PATCH] drm: integer overflow in drm_mode_dirtyfb_ioctl()<commit_description>There is a potential integer overflow in drm_mode_dirtyfb_ioctl()
if userspace passes... |
<vulnerable_code> var newKey = key.substring(0, objectIndex);
var subKey = key.substring(objectIndex + 1);
if(newKey == "__proto__" || key == "constructor" || key == "prototype") return res;
tmpVal = res[newKey];
if(!tmpVal)<commit_title>[PATCH] Update<commit_description><fixed_code>
var newKey... |
<vulnerable_code> useful_lines = [line for line in lines if not re.match(r"^[{}\[\],]*$", line)]
return ["\n".join(useful_lines)]
VALID_URL_PATTERN = "^https:\/\/[0-9A-Za-z]+(\.[0-9A-Za-z]+)*\/[0-9A-Za-z_\/]*\.json$"
class JSONLoader(BaseLoader):
@staticmethod
def _check_content(content):
... |
<vulnerable_code> if self.version >= (3,2): #For TLS 1.1, remove explicit IV
b = b[self._readState.encContext.block_size : ]
#Check padding
paddingGood = True
paddingLength = b[-1]<commit_title>[PATCH] Fix IndexError on junk message.<co... |
<vulnerable_code> shutil.rmtree(b_collection_path)
os.makedirs(b_collection_path)
with tarfile.open(self.b_path, mode='r') as collection_tar:
files_member_obj = collection_tar.getmember('FILES.json')
with _tarfile_extract(collection_tar, files_member_obj) as files_obj... |
<vulnerable_code><commit_title>[PATCH] ansible-galaxy - Fix tar path traversal issue during install<commit_description><fixed_code>
#!/usr/bin/env python
# Copyright: (c) 2020, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute... |
<vulnerable_code>import json
import os
import pytest
import tarfile
import uuid
os.path.isfile(output_file)
def test_require_one_of_collections_requirements_with_both():
cli = GalaxyCLI(args=['ansible-galaxy', 'collection', 'verify', 'namespace.collection', '-r', 'requirements.yml'])
<commit_title>[PATCH] an... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.