text stringlengths 79 3.72M |
|---|
<vulnerable_code> stream.ReadUI32(m_Reserved[2]);
// read the name unless it is empty
int name_size = size-(AP4_FULL_ATOM_HEADER_SIZE+20);
if (name_size == 0) return;
char* name = new char[name_size+1];
stream.Read(name, name_size);
name[name_size] = '\0'; // force a null termination
... |
<vulnerable_code> bgp_vpn_rd_print(ndo, tptr),
isonsap_string(ndo, tptr+BGP_VPN_RD_LEN,tlen-BGP_VPN_RD_LEN)));
/* rfc986 mapped IPv4 address ? */
if (EXTRACT_32BITS(tptr+BGP_VPN_R... |
<vulnerable_code> minor = SwapWord((BYTE*)data, size);
major = SwapWord((BYTE*)data + 2, size - 2);
sprintf(TNEF->version, "TNEF%i.%i", major, minor);
return 0;
}
<commit_title>[PATCH] increase version field, otherwise TNEFVersion might generate<commit_description><fixed_code>
minor = SwapWord((BYTE*)data, si... |
<vulnerable_code> JANUS_LOG(LOG_VERB, "[%"SCNu64"] Remote SDP:\n%s", handle->handle_id, jsep_sdp);
/* Is this valid SDP? */
char error_str[512];
int audio = 0, video = 0, data = 0;
janus_sdp *parsed_sdp = janus_sdp_preparse(handle, jsep_sdp, error_str, sizeof(error_str), &audio, &video, &data);
if(pars... |
<vulnerable_code> JANUS_LOG(LOG_VERB, "[%"SCNu64"] Audio mid: %s\n", handle->handle_id, a->value);
if(strlen(a->value) > 16) {
JANUS_LOG(LOG_ERR, "[%"SCNu64"] Audio mid too large: (%zu > 16)\n", handle->handle_id, strlen(a->value));
return NULL;
}
if(handle->audio_mid == NULL)
... |
<vulnerable_code>import asyncio
import enum
import inspect
import json
)
from pydantic import BaseModel
from pydantic.error_wrappers import ErrorWrapper, ValidationError
from pydantic.fields import ModelField
from starlette import routing
from starlette.concurrency import run_in_threadpool
from starlette.exceptions imp... |
<vulnerable_code>
def test_post_broken_body():
response = client.post("/items/", data={"name": "Foo", "price": 50.5})
assert response.status_code == 422, response.text
assert response.json() == {
"detail": [
{
"ctx": {
"colno": 1,
... |
<vulnerable_code> if compress:
data = gzip.compress(data)
headers["Content-Encoding"] = "gzip"
response = client.post("/sum", data=data, headers=headers)
assert response.json() == {"sum": n}
<commit_title>[PATCH] =?UTF-8?q?=F0=9F=90=9B=20Check=20Content-Type=20request?=<commit_description><fi... |
<vulnerable_code>{
/* don't do anything here: "fault" will set up page table entries */
vma->vm_ops = &mon_bin_vm_ops;
vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP;
vma->vm_private_data = filp->private_data;
mon_bin_vma_open(vma);<commit_title>[PATCH] usb: mon: make mmapped memory read only<commit_description>Syzb... |
<vulnerable_code>from synapse.storage.databases.main.lock import Lock
from synapse.storage.databases.main.roommember import extract_heroes_from_room_summary
from synapse.storage.roommember import MemberSummary
from synapse.synapse_rust.acl import ServerAclEvaluator
from synapse.types import JsonDict, StateMap, get_doma... |
<vulnerable_code>+---------------------------------------------------------------------*/
AP4_DataAtom::AP4_DataAtom(const AP4_MetaData::Value& value) :
AP4_Atom(AP4_ATOM_TYPE_DATA, AP4_ATOM_HEADER_SIZE),
m_DataType(DATA_TYPE_BINARY)
{
AP4_MemoryByteStream* memory = new AP4_MemoryByteStream();
AP4_Size ... |
<vulnerable_code>'use strict';
const { url_for } = require('hexo-util');
function listTagsHelper(tags, options) {
if (!options && (!tags || !Object.prototype.hasOwnProperty.call(tags, 'length'))) {
result += `<li class="${liClass}">`;
result += `<a class="${aClass}" href="${url_for.call(this, tag.path)... |
<vulnerable_code> ].join(''));
});
});<commit_title>[PATCH] Escape HTML by default in list_tag ecape the Tag values. It<commit_description><fixed_code>
].join(''));
});
});
describe('list_tags transform', () => {
const Hexo = require('../../../lib/hexo');
const hexo = new Hexo(__dirname);
const Post ... |
<vulnerable_code>from __future__ import annotations
import warnings
from typing import Any, Dict, List, Optional
from pydantic import Extra, Field, root_validator
from langchain.base_language import BaseLanguageModel
INTERMEDIATE_STEPS_KEY = "intermediate_steps"
class SQLDatabaseChain(Chain):
"""Chain for inte... |
<vulnerable_code><commit_title>[PATCH] Add validations to SQL chain<commit_description><fixed_code>
"""Test SQL functionality."""
import sqlite3
import pytest
from langchain import SQLDatabase
from langchain.chains.sql_database.base import (
SQLDatabaseChain,
SQLDatabaseSequentialChain,
SQLValidation,
... |
<vulnerable_code>
return 0;
err_free:
kfree(priv);
return ret;
}<commit_title>[PATCH] HID: elo: fix memory leak in elo_probe<commit_description>When hid_parse() in elo_probe() fails, it forgets to call usb_put_dev to
decrease the refcount.
Fix this by adding usb_put_dev() in the error handling code of elo_probe().
... |
<vulnerable_code>#include "jv_dtoa.h"
#include "jv_unicode.h"
#define ESC "\033"
#define COL(c) (ESC "[" c "m")
#define COLRESET (ESC "[0m")
}
}
}
switch (jv_get_kind(x)) {
default:
case JV_KIND_INVALID:
if (flags & JV_PRINT_INVALID) {<commit_title>[PATCH] Skip printing at MAX_DEPTH and deeper<co... |
<vulnerable_code> if (!quiet())
throwExceptionExplicit(MagickCore::ImageWarning,
"No image was loaded.");
}
ThrowImageException;
}<commit_title>[PATCH] Added missing return to avoid use after free.<commit_description><fixed_code>
if (!quiet())
throwExceptionExplicit(MagickCore... |
<vulnerable_code> oLogFacility, oLogLevel, oLogVerbose, oCiphers, oMacs,
oPubkeyAuthentication,
oKbdInteractiveAuthentication, oKbdInteractiveDevices, oHostKeyAlias,
oDynamicForward, oPreferredAuthentications, oHostbasedAuthentication,
oHostKeyAlgorithms, oBindAddress, oBindInterface, oPKCS11Provider,
oClearAllFor... |
<vulnerable_code>TAILQ_HEAD(idlist, identity);
struct cauthctxt {
const char *server_user;
const char *local_user;
const char *host;
/* setup authentication context */
memset(&authctxt, 0, sizeof(authctxt));
authctxt.server_user = server_user;
authctxt.local_user = local_user;
authctxt.host = host;
authctxt.... |
<vulnerable_code> * want to pad the entire buffer with zeros */
len--;
int l = 0;
while (*s && l<len) {
str[l] = s[l];
l++;
}<commit_title>[PATCH] fix jsvGetString regression<commit_description><fixed_code>
* want to pad the entire buffer with zeros */
len--;
int l = 0;
... |
<vulnerable_code> gf_list_del(l1);
gf_list_del(l2);
if (state->bs) {
if (gf_bs_get_position(state->bs)) {
u32 size;
gf_bs_get_content_no_truncate(state->bs, &state->frame_obus, &size, &state->frame_obus_alloc);
}
gf_bs_del(state->bs);
}
state->bs = NULL;<commit_title>[PATCH] fixed #1893<commit... |
<vulnerable_code> // "folder/" : {...},
// "folder/data.txt" : {...}
// }
this.files = {};
this.comment = null;
<commit_title>[PATCH] fix: Use a null prototype object for this.files<commit_description>This approach is taken to prevent overriding object methods that would
exist on a normal object... |
<vulnerable_code> */
forEach: function(cb) {
var filename, relativePath, file;
for (filename in this.files) {
if (!this.files.hasOwnProperty(filename)) {
continue;
}
file = this.files[filename];
relativePath = filename.slice(this.ro... |
<vulnerable_code> int numa_node = SOCKET_ID_ANY;
void *addr;
if (ctx->msg.size != sizeof(ctx->msg.payload.inflight)) {
VHOST_LOG_CONFIG(ERR, "(%s) invalid get_inflight_fd message size is %d\n",
dev->ifname, ctx->msg.size);
int fd, i;
int numa_node = SOCKET_ID_ANY;
fd = ctx->fds[0];
if (ctx->msg.size != siz... |
<vulnerable_code> EVP_PKEY_CTX* _ctx = nullptr;
};
class PKey {
public:
~PKey()
{
EVP_PKEY* _pkey = nullptr;
};
class X509Certificate {
public:
~X509Certificate()
QByteArray privateKeyToPem(const QByteArray key) {
Bio privateKeyBio;
BIO_write(priv... |
<vulnerable_code> await ctx.send(msg)
@commands.command(name="ping")
async def rep(self, ctx: MyContext, ip=None):
"""Get bot latency
You can also use this command to ping any other server"""
if ip is None:
m = await ctx.send("Ping...")
t = (m.created_... |
<vulnerable_code>class DagRunEditForm(DynamicForm):
"""Form for editing DAG Run.
We don't actually want to allow editing, so everything is read-only here.
"""
dag_id = StringField(lazy_gettext("Dag Id"), validators=[ReadOnly()], widget=BS3TextFieldROWidget())
class TaskInstanceEditForm(DynamicForm):... |
<vulnerable_code>
import six
from django.http import HttpResponse
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_exempt
from django.views.generic import View
def validate_request(self, request):
"""If configured for webhook basic auth, validate request has... |
<vulnerable_code>
ymax = FFMAX(0, s->ymax + 1);
// Zero out the end if ymax+1 is not h
for (i = 0; i < planes; i++) {
ptr = picture->data[i] + (ymax * picture->linesize[i]);
for (y = ymax; y < avctx->height; y++) {
memset(ptr, 0, out_line_size);
ptr += picture->linesi... |
<vulnerable_code>/* radare - LGPL3 - Copyright 2016-2020 - Matthieu (c0riolis) Tardy - l0stb1t*/
#include <r_io.h>
#include <r_bin.h>
}
static pyc_object *get_none_object(void) {
pyc_object *ret;
ret = R_NEW0 (pyc_object);
if (!ret) {
return NULL;
}
}
if (flag && ref_idx) {
free_object (ref_idx->data);
... |
<vulnerable_code> def readNextEndLine(self, stream, limit_offset=0):
debug = False
if debug: print(">>readNextEndLine")
line = b_("")
while True:
# Prevent infinite loops in malformed PDFs
if stream.tell() == 0 or stream.tell() == limit_offset:
... |
<vulnerable_code>import io
import os
import pytest
from PyPDF2.constants import Ressources as RES
from PyPDF2.errors import PdfReadError
from PyPDF2.filters import _xobj_to_image
TESTS_ROOT = os.path.abspath(os.path.dirname(__file__))
PROJECT_ROOT = os.path.dirname(TESTS_ROOT)
for outline in outlines:
if... |
<vulnerable_code> except OSError:
file_uid = None
try:
fd = os.open(path, os.O_RDONLY)
file_uid = os.fstat(fd).st_uid
os.close(fd)
except OSError:<commit_title>[PATCH] In the os.open call to get the fd to check if the user<commit_description><fixed_code>
... |
<vulnerable_code> ISOM_DECREASE_SIZE(ptr, 1);
iv_size = ptr->key_info[20] = gf_bs_read_u8(bs);
ISOM_DECREASE_SIZE(ptr, ptr->key_info[20]);
gf_bs_read_data(bs, ptr->key_info+21, iv_size);
}
return GF_OK;
}
<commit_title>[PATCH] fixed #1703<commit_description><fixed_code>
ISOM_DECREASE_SIZE(ptr, 1);
iv_size ... |
<vulnerable_code> bytes_data_ptr,
calculate_type_for_external_return,
check_external_call,
clamp,
clamp2,
clamp_basetype,
class ABIEncode(BuiltinFunction):
_id = "_abi_encode" # TODO prettier to rename this to abi.encode
# signature: *, ensure_tuple=<literal_bool> -> Bytes[<calculated le... |
<vulnerable_code> pollres = pqsecure_open_client(conn);
if (pollres == PGRES_POLLING_OK)
{
/* SSL handshake done, ready to send startup packet */
conn->status = CONNECTION_MADE;
return PGRES_POLLING_WRITING;
pollres = pqsecure_open_gss(conn);
if (pollres == PGRES_POLLING_OK)
{
... |
<vulnerable_code>function preprocessRFC2822(s) {
// Remove comments and folding whitespace and replace multiple-spaces with a single space
return s
.replace(/\([^)]*\)|[\n\t]/g, ' ')
.replace(/(\s\s+)/g, ' ')
.replace(/^\s\s*/, '')
.replace(/\s\s*$/, '');<commit_title>[PATCH] fix... |
<vulnerable_code> pixel.black=((aggregate.black+total_weight/2.0)/total_weight);
pixel.alpha=((aggregate.alpha+total_weight/2.0)/total_weight);
}
SetPixelViaPixelInfo(image,&pixel,q);
p+=GetPixelChannels(image);
q+=GetPixelChannels(enhance_image);
}<commit_title>[PATCH] ... |
<vulnerable_code> disk->queue = blk_mq_init_sq_queue(&cd->tag_set, &pcd_mq_ops,
1, BLK_MQ_F_SHOULD_MERGE);
if (IS_ERR(disk->queue)) {
disk->queue = NULL;
continue;
}
printk("%s: No CD-ROM drive found\n", name);
for (unit = 0, cd = pcd; unit < PCD_UNITS; unit++, cd++) {
blk_cleanup_queue(cd->dis... |
<vulnerable_code>
_ABLE_TO_COMPILE_EXTENSIONS = True
except ImportError:
warnings.warn("Cannot compile native C code, because of a missing build dependency")
_ABLE_TO_COMPILE_EXTENSIONS = False
if _ABLE_TO_COMPILE_EXTENSIONS:
pyarrow_version = tuple(int(x) for x in pyarrow.__version__.split("."))
... |
<vulnerable_code> warnings.warn(
"The 'warn' method is deprecated, " "use 'warning' instead",
DeprecationWarning,
2,
)
self.warning(msg, path_name, func_name, *args, **kwargs)
<commit_title>[PATCH] Specify stacklevel<commit_description><fixed_code>
warn... |
<vulnerable_code>
window.mermaid.mermaidAPI.parse($value.text())
$ele.addClass('mermaid')
$ele.html($value.text())
window.mermaid.init(undefined, $ele)
} catch (err) {
var errormessage = err<commit_title>[PATCH] Don't store mermaid diagrams in innerHTML<commit_description>Using jQuery'... |
<vulnerable_code> Document document;
try {
DocumentBuilderFactory factory =
DocumentBuilderFactory.newInstance();
DocumentBuilder documentBuilder = factory.newDocumentBuilder();
document = documentBuilder.parse(input);
<commit_title>[PATCH] added ... |
<vulnerable_code> /** Shared logger */
private static Log log = LogFactory.getLog(XpathUtils.class);
private static DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
/**
* InputStream to Document.<commit_title>[PATCH] added fix for xml parser vulnerability<commit_description><... |
<vulnerable_code> if (haveQuote) {
// *cmd = 0;
cmd++;
p = find_eoq (cmd + 1);
if (!p || !*p) {
eprintf ("Missing \" in (%s).", cmd);
return false;<commit_title>[PATCH] Fix #7727 - undefined pointers and out of band string access<commit_description><fixed_code>
if (haveQuote) {
// *cmd ... |
<vulnerable_code> break;
}
case 'h': RBININFO ("fields", R_CORE_BIN_ACC_FIELDS, NULL, 0); break;
case 'l': RBININFO ("libs", R_CORE_BIN_ACC_LIBS, NULL, obj? r_list_length (obj->libs): 0); break;
case 'L':
{
char *ptr = strchr (input, ' ');
break;
case 'r': RBININFO ("relocs", R_CORE_BIN_ACC_RELOCS... |
<vulnerable_code> free (charset);
RConsIsBreaked is_breaked = (bin && bin->consb.is_breaked)? bin->consb.is_breaked: NULL;
// may oobread
while (needle < to) {
if (is_breaked && is_breaked ()) {
break;
}
// smol optimization
if (needle + 4 < to) {
ut32 n1 = r_read_le32 (buf + needle - from);
if (!n1... |
<vulnerable_code> char *address = NULL;
uint16_t port = 0;
or_circuit_t *or_circ = NULL;
const or_options_t *options = get_options();
begin_cell_t bcell;
int rv;
uint8_t end_reason=0;
assert_circuit_ok(circ);
if (!CIRCUIT_IS_ORIGIN(circ))
or_circ = TO_OR_CIRCUIT(circ);
relay_header_unpack(&rh, ... |
<vulnerable_code>import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import com.vaadin.server.ClientConnector;
import com.vaadin.server.NoInputStreamException;
streamVariable = uI.getConnectorTracker()
.getStreamVariable(connectorId, variableName)... |
<vulnerable_code>
import java.io.IOException;
import java.io.Reader;
import java.util.Collection;
import java.util.logging.Level;
import java.util.logging.Logger;
}
/**
* Checks whether a given push id matches the session's push id.
*
* @param session
* the vaadin session for whi... |
<vulnerable_code><commit_title>[PATCH] Use POST action for logout links<commit_description><fixed_code>
// POST logout action
const logoutButton = function () {
const logoutForm = document.querySelector('[data-logout-form]')
if (!logoutForm) return
document.body.addEventListener('click', e => {
if (e.targe... |
<vulnerable_code>import Vue from 'vue'
import navToggle from '@/behaviors/navToggle'
import showEnvLine from '@/behaviors/showEnvLine'
import search from '@/main-search'
import merge from 'lodash/merge'
const A17Init = function () {
navToggle()
showEnvLine()
}
// User header dropdown<commit_title>[PATCH] Use POST... |
<vulnerable_code>static int aac_compat_ioctl(struct scsi_device *sdev, int cmd, void __user *arg)
{
struct aac_dev *dev = (struct aac_dev *)sdev->host->hostdata;
return aac_compat_do_ioctl(dev, cmd, (unsigned long)arg);
}
<commit_title>[PATCH] aacraid: missing capable() check in compat ioctl<commit_description>In com... |
<vulnerable_code> const getQueryString = queryString.stringify(this.getOptions(options));
fetch(`${this.apiUrl}${endpoint}?${getQueryString}`)
.then(response => EtsyClient._response(response, resolve, reject))
.catch(reject);
});
}
getOptions(options) {
var merged =... |
<vulnerable_code>const expect = require('chai').expect
const EtsyClient = require('../src/EtsyClient.js');
if (!process.env.ETSY_API_KEY) {
describe("Test Unauthenticated EtsyClient", function() {
expect(function () { new EtsyClient() } ).to.throw('apiKey is required');
});
});
}<commit_title>[PATCH... |
<vulnerable_code> self.log_failure(obj=obj, message=f"User '{user}' does not have permission to add a Site.")
else:
self._run_site_job(obj)
if isinstance(obj, Device):
if not user.has_perm("dcim.add_device"):
self.log_failure(obj=obj, messag... |
<vulnerable_code> views.JobResultDeleteView.as_view(),
name="jobresult_delete",
),
# Job Button Run
path("job-button/<uuid:pk>/run/", views.JobButtonRunView.as_view(), name="jobbutton_run"),
# Notes
path("notes/add/", views.NoteEditView.as_view(), name="note_add"),
path("notes/<sl... |
<vulnerable_code> s->vex_l = 0;
s->vex_v = 0;
next_byte:
b = cpu_ldub_code(env, s->pc);
s->pc++;
/* Collect prefixes. */<commit_title>[PATCH] tcg/i386: Check the size of instruction being translated<commit_description>This fixes the bug: 'user-to-root privesc inside VM via bad translation
caching' ... |
<vulnerable_code> }
}
macHdr.Value = payload[pktHeaderLen++];
// Accept frames of LoRaWAN Major Version 1 only<commit_title>[PATCH] Fixed potential buffer overflow in `ProcessRadioRxDone`<commit_description><fixed_code>
}
}
// Abort on empty radio frames
if( size == 0 )
{
... |
<vulnerable_code>
const metavm = require('metavm');
const getValue = (target, prop) => {
if (prop === 'Math') return Math;
const { expressions, data } = target;
if (!expressions.has(prop)) return data.get(prop);
const expression = expressions.get(prop);<commit_title>[PATCH] Prevent arbitrary js code execution<... |
<vulnerable_code> test.strictSame(sheet.values['I1'], Math.sin(Math.sqrt(Math.pow(100, -2))));
test.end();
});<commit_title>[PATCH] Prevent arbitrary js code execution<commit_description>PR-URL: https://github.com/metarhia/metacalc/pull/15<fixed_code>
test.strictSame(sheet.values['I1'], Math.sin(Math.sqrt(Math.pow... |
<vulnerable_code>
// First try the short file name, then the long file name.
match = fname_match(rmp, buf->b_sfname, ignore_case);
if (match == NULL)
match = fname_match(rmp, buf->b_ffname, ignore_case);
return match;<commit_title>[PATCH] patch 8.2.4938: crash when matching buffer with invalid<commit_... |
<vulnerable_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
4937,
/**/<commit_title>[PATCH] patch 8.2.4938: crash when matching buffer with invalid<commit_description><fixed_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
4938,... |
<vulnerable_code> value - pointer to long to contain the returned value
returns - CL_SUCCESS or CL_EFORMAT
*/
static int xar_get_numeric_from_xml_element(xmlTextReaderPtr reader, long * value)
{
const xmlChar * numstr;
if (xmlTextReaderRead(reader) == 1 && xmlTextReaderNodeType(reader) == XML_READER_TYP... |
<vulnerable_code> return e;
}
if (!((GF_DataInformationBox *)s)->dref) {
GF_LOG(GF_LOG_ERROR, GF_LOG_CONTAINER, ("[iso file] Missing dref box in dinf\n"));
((GF_DataInformationBox *)s)->dref = (GF_DataReferenceBox *)gf_isom_box_new(GF_ISOM_BOX_TYPE_DREF);
}
return GF_OK;
}<commit_title>[PATCH] prevent dref mem... |
<vulnerable_code> */
package io.fusionauth.samlv2.service;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
import javax.xml.crypto.KeySelector;
import javax.xml.crypto.MarshalException;
impo... |
<vulnerable_code><commit_title>[PATCH] Refactor utility methods into SAMLTools, add tests.<commit_description><fixed_code>
/*
* Copyright (c) 2021, Inversoft Inc., All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the Licens... |
<vulnerable_code>import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.math.BigInteger;
import java.net.URLDecoder;
import ... |
<vulnerable_code> if (link) {
struct pdu_data *pdu_data_tx;
u8_t pdu_data_tx_len;
pdu_data_tx = (void *)(tx->pdu +
lll->packet_tx_head_offset);
}
#endif /* CONFIG_BT_CTLR_LE_ENC */
lll->packet_tx_head_offset += pdu_data_tx_len;
if (lll->packet_tx_head_offset ==
lll->packet_tx_hea... |
<vulnerable_code> }
#endif
}
/* Compute collating sequences used by
** temporary tables needed to implement the compound select.<commit_title>[PATCH] Continuation of [e2bddcd4c55ba3cb]: Add another spot where it<commit_description><fixed_code>
}
#endif
}
if( pParse->nErr ) goto multi_select_end... |
<vulnerable_code> return format_html(
'<i class="mdi mdi-information-outline"></i> '
'<a href="https://www.markdownguide.org/cheat-sheet/#basic-syntax" rel="noopener noreferrer">Markdown</a> '
'syntax is supported, well as <a href="{}#render_markdown">a limited subset of HTML<... |
<vulnerable_code>from typing import Any
from typing import Optional
from poetry.core.utils._compat import Path
from poetry.core.utils._compat import decode
GitUrl = namedtuple("GitUrl", ["url", "revision"])
class GitConfig:
def __init__(self, requires_git_presence=False): # type: (bool) -> None
self._c... |
<vulnerable_code>import pytest
from poetry.core.utils._compat import Path
from poetry.core.vcs.git import Git
from poetry.core.vcs.git import GitError
from poetry.core.vcs.git import GitUrl
from poetry.core.vcs.git import ParsedUrl
@pytest.mark.parametrize(
def test_git_rev_parse_raises_error_on_invalid_repository()... |
<vulnerable_code> struct socket *sock;
int err = 0;
if (!asoc)
return -EINVAL;
<commit_title>[PATCH] sctp: do not peel off an assoc from one netns to another one<commit_description>Now when peeling off an association to the sock in another netns, all
transports in this assoc are not to be rehashed and keep use the... |
<vulnerable_code>from django.contrib import messages
from django.utils.html import format_html, format_html_join
def handle_protectederror(obj_list, request, e):
)
# Append dependent objects to error message
err_message += format_html_join(
", ",
'<a href="{}">{}</a>',
((dependent... |
<vulnerable_code> char *tableFile;
static struct stat info;
#define MAX_TABLEFILE_SIZE MAXSTRING * sizeof(char) * 2
if (table == NULL || table[0] == '\0') return NULL;
tableFile = (char *)malloc(MAX_TABLEFILE_SIZE);
<commit_title>[PATCH] add parentheses for define expression<commit_description><fixed_code>
char *t... |
<vulnerable_code> while self.to_create:
trigger_id, trigger_instance = self.to_create.popleft()
if trigger_id not in self.triggers:
self.triggers[trigger_id] = {
"task": asyncio.create_task(self.run_trigger(trigger_id, trigger_instance)),
... |
<vulnerable_code> if type(file_list) is not list:
file_list = [file_list]
# Sanitize any files in the list that are symlinks outside of the self.directory extraction directory.
for file_name in file_list:
if os.path.islink(file_name):
linktarget = os.path.... |
<vulnerable_code>import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
public class SimpleXmlParser {
private static final Logger log = LoggerFactory.getLogger(SimpleXmlParser.class);
private sta... |
<vulnerable_code><commit_title>[PATCH 1/4] for code review<commit_description><fixed_code>
/*
Copyright 2018-2020 Accenture Technology
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License a... |
<vulnerable_code> "http://apache.org/xml/features/disallow-doctype-decl"
};
private static final String FEATURES_TO_DISABLE[] = {
/*
* Features not recognized by DocumentBuilderFactory:
* http://xerces.apache.org/xerces-j/features.html#external-general-entities
... |
<vulnerable_code> * http://xerces.apache.org/xerces2-j/features.html#external-general-entities
* http://xerces.apache.org/xerces-j/features.html#external-parameter-entities
* http://xerces.apache.org/xerces2-j/features.html#external-parameter-entities
*
*/... |
<vulnerable_code> Document doc = dBuilder.parse(new ByteArrayInputStream(evilXml.getBytes(StandardCharsets.UTF_8)));
doc.getDocumentElement().normalize();
} catch (SAXParseException e) {
System.out.println(e.getMessage());
assertTrue(e.getMessage().contains("DOCTYP... |
<vulnerable_code>import org.platformlambda.core.models.LambdaFunction;
import org.platformlambda.core.system.AppStarter;
import org.platformlambda.core.system.Platform;
import org.platformlambda.core.system.ServerPersonality;
import org.platformlambda.services.HelloGeneric;
import org.platformlambda.services.HelloPoJo;... |
<vulnerable_code>
@Override
public Object handleEvent(Map<String, String> headers, Object body, int instance) throws AppException, IOException {
String id = headers.get("id");
if (id == null) {
throw new IllegalArgumentException("Missing parameter 'id'");
}
if (id.e... |
<vulnerable_code>
@Override
public Object handleEvent(Map<String, String> headers, Object body, int instance) throws AppException, IOException {
String id = headers.get("id");
if (id == null) {
throw new IllegalArgumentException("Missing parameter 'id'");
}
if (id.e... |
<vulnerable_code> SamplePoJo.class.getName() + ", actual: " + response.getBody().getClass().getName());
}
}
}
@GET<commit_title>[PATCH 1/4] for code review<commit_description><fixed_code>
SamplePoJo.class.getName() + ", actual: " + response.ge... |
<vulnerable_code>
import java.io.IOException;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
@MainApplication<commit_title>[PATCH 1/4] for code review<commit_description><fixed_code>
import java.io.IOException;
import java.util.List;
import java.util.c... |
<vulnerable_code>package org.platformlambda.automation.models;
public class WsInfo {<commit_title>[PATCH 1/4] for code review<commit_description><fixed_code>
/*
Copyright 2018-2020 Accenture Technology
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in com... |
<vulnerable_code>package org.platformlambda.automation.services;
import org.platformlambda.automation.config.RoutingEntry;
private static final Logger log = LoggerFactory.getLogger(ServiceResponseHandler.class);
private static final SimpleXmlWriter xmlWriter = new SimpleXmlWriter();
private static Concurr... |
<vulnerable_code>package org.platformlambda.automation.servlets;
import com.google.api.client.http.*;
private static final SimpleXmlWriter xmlWriter = new SimpleXmlWriter();
private static final ConcurrentMap<String, HttpRequestFactory> httpFactory = new ConcurrentHashMap<>();
private static final String ... |
<vulnerable_code>import org.platformlambda.automation.models.AssignedRoute;
import org.platformlambda.automation.models.AsyncContextHolder;
import org.platformlambda.automation.models.CorsInfo;
import org.platformlambda.automation.util.SimpleHttpUtility;
import org.platformlambda.core.exception.AppException;
import org... |
<vulnerable_code><commit_title>[PATCH 1/4] for code review<commit_description><fixed_code>
/*
Copyright 2018-2020 Accenture Technology
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License a... |
<vulnerable_code>package org.platformlambda.automation.util;
import org.platformlambda.automation.models.AsyncContextHolder;
public class AsyncTimeoutHandler extends Thread {
private static final Logger log = LoggerFactory.getLogger(AsyncTimeoutHandler.class);
private static ConcurrentMap<String, AsyncContext... |
<vulnerable_code> private static final Logger log = LoggerFactory.getLogger(SimpleXmlParser.class);
/*
* Contribution:
*
* The solution to avoid XML external entity (XXE) injection attack was provided by Sajeeb Lohani
* (github handles @prodigysml and @n33dle) on 1/6/2020.
*
* The ... |
<vulnerable_code>
import static org.junit.Assert.assertTrue;
/**
* Contribution:
*
* The solution to avoid XML external entity (XXE) injection attack was provided by Sajeeb Lohani
* (prodigysml and n33dle) on 1/6/2020.
*
* This test ensures that the FEATURES_TO_ENABLE and FEATURES_TO_DISABLE are verified.
*/
pu... |
<vulnerable_code>const shouldBehaveLikeTransparentUpgradeableProxy = require('./TransparentUpgradeableProxy.behaviour');
const TransparentUpgradeableProxy = artifacts.require('TransparentUpgradeableProxy');
contract('TransparentUpgradeableProxy', function (accounts) {
const [proxyAdminAddress, proxyAdminOwner] = ac... |
<vulnerable_code> saxParserFactory.setValidating(false);
SAXParser saxParser = saxParserFactory.newSAXParser();
XMLReader xmlReader = saxParser.getXMLReader();
xmlReader.setFeature("http://xml.org/sax/features/validation", false);
xmlReader.setFeature("http://apache.org/xml/features/nonvalidating/load-ext... |
<vulnerable_code> SAXParserFactory factory = SAXParserFactory.newInstance();
SAXParser parser = factory.newSAXParser();
XMLReader reader = parser.getXMLReader();
reader.setContentHandler(handler);
reader.setErrorHandler(handler);
<commit_title>[PATCH] XXE injection security vulnerability<commit_descriptio... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.