text stringlengths 79 3.72M |
|---|
<vulnerable_code> * otherwise download size will be less than real size.
*/
#define MAX_DOWNLOAD_DATA (MAX_PAYLOAD_SIZE + 32)
#define COAP_MAX_RETRY 3
#define MAX_IP_SIZE 30
#define SHA256_HEX_DIGEST_SIZE ((TC_SHA256_DIGEST_SIZE * 2) + 1)
}
if (verification_download == ctx.downloaded_size) {
if (attempts_down... |
<vulnerable_code> this.server = https.createServer(await getCertificate(options.https));
}
this.wss = new WebSocket.Server({server: this.server});
this.server.listen(options.hmrPort, resolve);
});
<commit_title>[PATCH] fix security vuln<commit_description><fixed_code>
this.server =... |
<vulnerable_code>
@staticmethod
def sanitize_uri(uri):
"""Unquote and remove /../ to prevent access to other data."""
uri = unquote(uri)
trailing_slash = "/" if uri.endswith("/") else ""
uri = posixpath.normpath(uri)
trailing_slash = "" if uri == "/" else trailing_slash
... |
<vulnerable_code> if( poSRSIn != nullptr )
{
poSRS_->SetWellKnownGeogCS( "WGS84" );
if( !poSRS_->IsSame(poSRSIn) )
{
poCT_ = OGRCreateCoordinateTransformation( poSRSIn, poSRS_ );<commit_title>[PATCH] KML: set OAMS_TRADITIONAL_GIS_ORDER for SRS returned on<commit_description><f... |
<vulnerable_code> self.assertContains(response, "Network to Code", status_code=404)
response_content = response.content.decode(response.charset)
self.assertInHTML(
"If further assistance is required, please join the <code>#nautobot</code> channel "
'on <a href="https://sla... |
<vulnerable_code> {
// use an extender to copy original catalog elements and update version if required
PDFDocumentCopyingContext* copyingContext = CreatePDFCopyingContext(inModifiedFileParser);
ModifiedDocCatalogWriterExtension catalogUpdate(copyingContext,requiresVersionUpdate,inModifiedPDFVersion);
... |
<vulnerable_code> doff = offset + 8;
/* Sanity checks */
if ((doff + s < doff) || (doff + s < s) || (doff + s > size)) {
exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData",
"Tag data past end of buffer (%u > %u)", doff+s, size);
return 0;
}
unsigned int ds, ExifLong o, ExifLong s)
{
... |
<vulnerable_code>from tlslite.extensions import SNIExtension
from tlsfuzzer.utils.lists import natural_sort_keys
version = 1
def help_msg():
print(" --no-sni do not send server name extension.")
print(" Sends extension by default if the hostname is a")
print(" valid DN... |
<vulnerable_code> print(" --repeat rep How many timing samples should be gathered for each test")
print(" 100 by default")
print(" --quick Only run a basic subset of tests")
print(" --help this message")
interface = None
quick = False
cipher = CipherSuite.TLS... |
<vulnerable_code>class TimingRunner:
"""Repeatedly runs tests and captures timing information."""
def __init__(self, name, tests, out_dir, ip_address, port, interface):
"""
Check if tcpdump is present and setup instance parameters.
:param str ip_address: Server IP address
:para... |
<vulnerable_code> fprintf(f, "log-target-override=%s\n", log_target_to_string(log_get_target()));
for (q = 0; q < _MANAGER_TIMESTAMP_MAX; q++) {
/* The following timestamps only apply to the host system, hence only serialize them there */
if (in_initrd() &&
... |
<vulnerable_code>
if(U_FAILURE(errorCode)) {
Nan::ThrowError("Failed to set ICU charset detector’s text.");
return;
}
if(U_FAILURE(errorCode)) {
Nan::ThrowError("Failed to detect charset.");
return;
}
if(U_FAILURE(errorCode)) {
Nan::ThrowError("Failed to get name from charset match.");
return;
}
... |
<vulnerable_code> for(int i=0; i<length; i++) {
free((*data)[i]);
}
free(*data);
}<commit_title>[PATCH] Fix a double free in the List functions<commit_description>The code was set up so that it would free the individual items and the data
in `freeListData`, but there was already a Go `defer` to fr... |
<vulnerable_code> wmf_error = wmf_api_create(&API, wmf_options_flags, &wmf_api_options);
if (wmf_error != wmf_E_None)
{
if (API)
wmf_api_destroy(API);
if (image->debug != MagickFalse)
{
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
(void) LogMagickEvent(Coder... |
<vulnerable_code>import java.lang.reflect.AnnotatedElement;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
return true;
}
if (!csrfTokenInSession.equals(request.getHeader("X-CSRF-Token"))) {
if (getLo... |
<vulnerable_code> case OSRTCBOR_UTF8STR: {
OSUTF8CHAR* utf8str;
ret = rtCborDecDynUTF8Str (pCborCtxt, ub, (char**)&utf8str);
ret = rtJsonEncStringValue (pJsonCtxt, utf8str);
rtxMemFreePtr (pCborCtxt, utf8str);<commit_title>[PATCH] fixed missing return status test error<commit_description><fix... |
<vulnerable_code> object = _elements_to_dict(encoded, as_class, tz_aware, uuid_subtype)
position += obj_size
if "$ref" in object:
return (DBRef(object.pop("$ref"), object.pop("$id"),
object.pop("$db", None), object), position)
return object, position
<commit_title>[PATCH] Fi... |
<vulnerable_code>
Py_INCREF(collection);
PyDict_DelItemString(value, "$ref");
Py_INCREF(id);
PyDict_DelItemString(value, "$id");
if (database == NULL) {
database = Py_None;<commit_title>[PATCH] Fix null pointer when dec... |
<vulnerable_code>
from bson.binary import Binary, UUIDLegacy, OLD_UUID_SUBTYPE, UUID_SUBTYPE
from bson.code import Code
from bson.objectid import ObjectId
from bson.py3compat import b
from bson.son import SON
self.assertRaises(InvalidDocument, c.save, {"x": c})
warnings.simplefilter("default")
def ... |
<vulnerable_code>from RestrictedPython.Utilities import utility_builtins
from zExceptions import Unauthorized
from AccessControl.SecurityInfo import secureModule
from AccessControl.SecurityManagement import getSecurityManager
from AccessControl.SimpleObjectPolicies import ContainerAssertions
math.__allow_access_to_unp... |
<vulnerable_code> c.attr = PublicMethod()
self.assertPolicyAllows(c, 'attr')
def testUnicodeAttributeLookups(self):
item = self.item
r_item = self.a.r_item<commit_title>[PATCH] Merge pull request from GHSA-qcx9-j53g-ccgf<commit_description><fixed_code>
c.attr = PublicMethod()... |
<vulnerable_code>
device_lock(&dev->dev);
if (!device_is_registered(&dev->dev)) {
rc = -ENODEV;
goto error;
}
device_lock(&dev->dev);
if (!device_is_registered(&dev->dev)) {
rc = -ENODEV;
goto error;
}
device_lock(&dev->dev);
if (!device_is_registered(&dev->dev)) {
rc = -ENODEV;
goto error;
}
... |
<vulnerable_code>package io.onedev.server.web.resource;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import org.apache.shiro.authz.UnauthorizedException;
import org.apache.tika.io.IOUtils;
import org.apache.wicket.request.mapper.parameter.PagePar... |
<vulnerable_code> # straight back in again
try:
length = await make_deferred_yieldable(
read_body_with_max_size(response, output_stream, max_size)
)
except BodyExceededMaxSize:
raise SynapseError(
HTTPStatus.BAD_GATEWAY,
... |
<vulnerable_code> register(app)
console.log(`
欢迎使用 Gin-Vue-Admin
当前版本:V2.4.6 Apache
加群方式:微信:shouzi_1994 QQ群:622360840
默认自动化文档地址:http://127.0.0.1:${import.meta.env.VITE_SERVER_PORT}/swagger/index.html
默认前端文件运行地址:http://127.0.0.1:${import.meta.env.VITE_CLI_PORT}<commit_title>[PAT... |
<vulnerable_code>)
class AuthenticationService(object):
def __init__(self, backend):
self.backend = backend
if (
user is None or
user.password != password
):
raise AuthenticationException()
<commit_title>[PATCH] Prevent timing attacks on passwords<commi... |
<vulnerable_code> # EmailAuthBackend, there should be password field here.
self.assert_in_success_response(["id_password"], result)
@override_settings(
AUTHENTICATION_BACKENDS=(
"zproject.backends.ZulipLDAPAuthBackend",<commit_title>[PATCH] CVE-2023-28623: Prevent unautho... |
<vulnerable_code> return_data=return_data,
)
if user is None:
can_use_different_backend = email_auth_enabled(realm) or (
len(get_external_method_dicts(realm)) > 0
)
if settings.LDAP_APPEND_DOMAIN:
... |
<vulnerable_code>
size_t
columns,
number_threads;
number_threads=(size_t) GetMagickResourceLimit(ThreadResource);
pixels=(PixelChannels **) AcquireQuantumMemory(number_threads,
sizeof(*pixels));
if (pixels == (PixelChannels **) NULL)
return((PixelChannels **) NULL);
(void) memset(pixels,0,num... |
<vulnerable_code>/*
* Copyright 2010-2018 Andrew Beekhof <andrew@beekhof.net>
*
* This source code is licensed under the GNU General Public License version 2
* or later (GPLv2+) WITHOUT ANY WARRANTY.
#include <corosync/cmap.h>
#include <crm/cluster/internal.h>
#include <crm/common/mainloop.h>
enum cluster_type_e ... |
<vulnerable_code>/*
* Copyright (C) 2004 Andrew Beekhof <andrew@beekhof.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your optio... |
<vulnerable_code>/*
* Copyright 2004-2018 Andrew Beekhof <andrew@beekhof.net>
*
* This source code is licensed under the GNU Lesser General Public License
* version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
#include <crm/msg_xml.h>
cpg_handle_t pcmk_cpg_handle = 0; /* TODO: Remove, use cluster.cpg_handle */
... |
<vulnerable_code> *
* \param[in] client Connection instance obtained from crm_ipc_new()
*
* \return TRUE on success, FALSE otherwise (in which case errno will be set)
*/
bool
crm_ipc_connect(crm_ipc_t * client)
{
client->need_reply = FALSE;
client->ipc = qb_ipcc_connect(client->name, client->buf_size);
... |
<vulnerable_code>from PyPDF2._utils import (
mark_location,
matrix_multiply,
read_until_regex,
read_until_whitespace,
skip_over_comment,
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] == erro... |
<vulnerable_code>import os
import signal
import socket
import sys
import threading
from http.server import BaseHTTPRequestHandler, HTTPServer
class ProtectedHandler(BaseHandler):
def do_HEAD(self) -> None:
"""HEAD not supported"""
web_util.echo_json_response(self, 405, "HEAD not supported")
pr... |
<vulnerable_code>
/* numCoefficients should be at least 7. */
assert(numCoefficients >= 7 && numCoefficients <= 255);
m_msadpcmNumCoefficients = numCoefficients;
<commit_title>[PATCH] Always check the number of coefficients<commit_description>When building the library with NDEBUG, asserts are eliminated
so it... |
<vulnerable_code> }
sptr = (u16 *)szLine;
i = (u32) gf_utf8_wcstombs(szLineConv, 1024, (const unsigned short **) &sptr);
szLineConv[i] = 0;
strcpy(szLine, szLineConv);
/*this is ugly indeed: since input is UTF16-LE, there are many chances the fgets never reads the \0 after a \n*/<commit_title>[PATCH] check error c... |
<vulnerable_code>
if (*li + 4 > tpktlength)
{
WLog_ERR(TAG, "tpdu length %" PRIu16 " > tpkt header length %" PRIu16, li, tpktlength);
return FALSE;
}
<commit_title>[PATCH] core: fix invalid inttype and reference<commit_description>The error message in tpdu_read_header() printed the pointer address and
used PRIu1... |
<vulnerable_code> act_code = GetGifWord(i, &context);
casspecial = (u8)act_code;
old_code = act_code;
WritePixel(i, &context, casspecial); npix--;
} else {
read_byt = act_code;
if(act_code >= free) { /* code pas encore dans alphabet */
/* act_code est concret */
casspecial = (u8)act_code; /* de... |
<vulnerable_code> has_strip_bits = s->strippos || s->strips || s->stripoff || s->rps || s->sot || s->sstype || s->stripsize || s->stripsizesoff;
if (has_tile_bits && has_strip_bits) {
av_log(avctx, AV_LOG_WARNING, "Tiled TIFF is not allowed to strip\n");
}
/* now we have the data and may start ... |
<vulnerable_code>/*
Copyright (c) 2000, 2010, Oracle and/or its affiliates
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
DBUG_PRINT("my",("org_name: '%s' tmp_name: '%s' MyFlags: %d",
org_name,tmp_name,MyFlags))... |
<vulnerable_code>my_bool my_disable_async_io=0;
my_bool my_disable_flush_key_blocks=0;
my_bool my_disable_symlinks=0;
/*
Note that PSI_hook and PSI_server are unconditionally<commit_title>[PATCH] don't use my_copystat in the server<commit_description>it was supposed to be used in command-line tools only.
Different f... |
<vulnerable_code> (void) SetImageProperty(image,"exif:Orientation","1",exception);
error=heif_decode_image(image_handle,&heif_image,heif_colorspace_YCbCr,
heif_chroma_420,decode_options);
if (IsHeifSuccess(&error,image,exception) == MagickFalse)
{
heif_image_handle_release(image_handle);
retu... |
<vulnerable_code> SSL *ssl = NULL;
int n, finished = 0;
X509_VERIFY_PARAM *param;
uint8_t verify_crls = cred->x509Credential.x509CrlVerifyMode;
if (!(ssl_ctx = SSL_CTX_new(SSLv23_client_method())))
{
/* Setup verification if not anonymous */
if (!anonTLS)
{
if (cred->x509Credential.x509CACertFile)... |
<vulnerable_code> for (k in t) {
if (deep &&
type.object(t[k]) &&
!(t[k] instanceof Monkey)) {
o[k] = merger(true, o[k] || {}, t[k]);
}
else {<commit_title>[PATCH] Security Fix for Prototype Pollution (#511)<commit_description><fixed_code>
for (k in t) {
if (de... |
<vulnerable_code>
/* Call setuid() and use capset() to adjust capabilities */
static void
drop_privs (bool keep_requested_caps)
{
assert (!keep_requested_caps || !is_privileged);
/* Drop root uid */
if (geteuid () == 0 && setuid (opt_sandbox_uid) < 0)
die_with_error ("unable to drop root uid");
drop_all_ca... |
<vulnerable_code> if (opt_userns_fd != -1 && is_privileged)
die ("--userns doesn't work in setuid mode");
/* We have to do this if we weren't installed setuid (and we're not
* root), so let's just DWIM */
if (!is_privileged && getuid () != 0 && opt_userns_fd == -1)<commit_title>[PATCH 2/3] Don't support --... |
<vulnerable_code>/* Call setuid() and use capset() to adjust capabilities */
static void
drop_privs (bool keep_requested_caps,
bool changed_uid)
{
assert (!keep_requested_caps || !is_privileged);
/* Drop root uid */
if (is_privileged && !changed_uid &&
setuid (opt_sandbox_uid) < 0)
die_with_... |
<vulnerable_code> from email import message as emailmessage
import urllib.parse as urllib
import urllib.request as urllib2
from urllib.error import URLError as URLError
import configparser as ConfigParser
import xmlrpc.client as xmlrpclib
import urllib.parse as urlparse
from email import ... |
<vulnerable_code> if ssl:
https_handler = VerifiedHTTPSHandler()
return urllib2.build_opener(https_handler, *args)
if not ssl and os.environ.get('PIP_ALLOW_NO_SSL', '') == '1':
return urllib2.build_opener(*args)
else:
rai... |
<vulnerable_code> void __user *buffer, size_t *lenp,
loff_t *ppos)
{
int ret = proc_dointvec(table, write, buffer, lenp, ppos);
if (ret || !write)
return ret;<commit_title>[PATCH] perf/core: Fix the perf_cpu_time_max_percent check<commit_description>Use "proc_dointvec_minmax" instead of "proc_dointvec" to c... |
<vulnerable_code><commit_title>[PATCH] Polish flask_mail tests and code<commit_description><fixed_code>
# https://pythonhosted.org/Flask-Mail/
# https://github.com/mattupstate/flask-mail/blob/1709c70d839a7cc7b1f7eeb97333b71cd420fe32/flask_mail.py#L239
# tmp: this test cover RFS to any part of the message, but can be s... |
<vulnerable_code> return PTR_ERR(stub_clk_chan.mbox);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
freq_reg = devm_ioremap(dev, res->start, resource_size(res));
if (!freq_reg)
return -ENOMEM;<commit_title>[PATCH] =?UTF-8?q?clk:=20hisilicon:=20hi3660=EF=BC=9AFix=20potent?=<commit_description><fixed_code>... |
<vulnerable_code> strong(src, maskedSrc, prevChar = '') {
let match = this.rules.inline.strong.start.exec(src);
console.log(match);
if (match && (!match[1] || (match[1] && (prevChar === '' || this.rules.inline.punctuation.exec(prevChar))))) {
maskedSrc = maskedSrc.slice(-1 * src.length);
cons... |
<vulnerable_code> }
var match = this.rules.inline.strong.start.exec(src);
console.log(match);
if (match && (!match[1] || match[1] && (prevChar === '' || this.rules.inline.punctuation.exec(prevChar)))) {
maskedSrc = maskedSrc.slice(-1 * src.length);<commit_title>[PATCH] Remove Libs and m... |
<vulnerable_code> * Copyright (c) 2011-2020, Christopher Jeffrey. (MIT Licensed)
* https://github.com/markedjs/marked
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).marked=t... |
<vulnerable_code>
length = s;
pos = (u_int8_t*)frame;
if (length < SONMP_SIZE) {
log_warnx("sonmp", "too short SONMP frame received on %s", hardware->h_ifname);
goto malformed;
}<commit_title>[PATCH] sonmp: fix heap overflow when reading SONMP packets<commit_description>By sending short SONMP packets, an attack... |
<vulnerable_code>IEEE 802.3 Ethernet
Destination: Bay-Networks-(Synoptics)-autodiscovery (01:00:81:00:01:00)
Source: 5e:10:8e:e7:84:ad (5e:10:8e:e7:84:ad)
Length: 22
Logical-Link Control
DSAP: SNAP (0xaa)
IG Bit: Individual
IEEE 802.3 Ethernet
Destination: Bay-Networks-(Synoptics)-autodiscover... |
<vulnerable_code> */
public void openURL(final String url)
{
Thread launchBrowserThread
= new Thread(getClass().getName())
{<commit_title>[PATCH] Adds a check for valid http link when opening a browser.<commit_description><fixed_code>
*/
public void openURL(f... |
<vulnerable_code> string server = bfs::initial_path().parent_path().filename().generic_string();
//transform to 'internal' name
replace(server.begin(), server.end(), '-', '_');
replace_string(server, ".", "__");
transform(server.begin(), server.end(), server.begin(), ::tolower);
<commit_title>[PA... |
<vulnerable_code>
memset(&no_server, 0, sizeof(no_server));
code = validate_as_request(kdc_active_realm, request, *princ,
no_server, kdc_time, status, &e_data);
if (code) {<commit_title>[PATCH] Ignore password attributes for S4U2Self requests<commit_descriptio... |
<vulnerable_code> code = k5_get_init_creds(context, &creds, &client, NULL, NULL, 0, NULL,
opts, krb5_get_as_key_noop, &userid, &use_master,
NULL);
if (code == 0 || code == KRB5_PREAUTH_FAILED) {
*canon_user = userid.user;
userid.user = NUL... |
<vulnerable_code># Get forwardable creds for service1 in the default cache.
realm.kinit(service1, None, ['-f', '-k'])
# Try krb5 -> S4U2Proxy with forwardable user creds. This should fail
# at the S4U2Proxy step since the DB2 back end currently has no
# support for allowing it.<commit_title>[PATCH] Ignore password at... |
<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>#define THREADS_MAX 64
#define ELF_PACKAGE_METADATA_ID 0xcafe1a7e
static void *dw_dl = NULL;
static void *elf_dl = NULL;
return r;
if (ret) {
r = RET_NERRNO(pipe2(return_pipe, O_CLOEXEC));
if (r < 0)
return r;
}
... |
<vulnerable_code> char *last;
if (*str == 0) {
if (ptr) *ptr = (char *)str;
return 0;
}
errno = 0;
d = number(str, &last, shp->inarith ? 0 : 10, NULL);
if (*last) {
if (*last != '.' || last[1] != '.') {
d = strval(shp, str, &last, arith, mode);
Var... |
<vulnerable_code>}
static int getid(char ch) {
const char *keys = "[]<>+-,.";
const char *cidx = strchr (keys, ch);
return cidx? cidx - keys + 1: 0;
}
#define BUFSIZE_INC 32
static bool decode(RArchSession *as, RAnalOp *op, RArchDecodeMask mask) {
int len = op->size;
const ut8 *_buf = op->bytes;
const ut64 addr... |
<vulnerable_code> isValidCall = false;
}
if (isValidCall) {
ut8 buf[4] = {0};
r_io_read_at (core->io, op.jump, buf, 4);
isValidCall = memcmp (buf, "\x00\x00\x00\x00", 4);
}
if (isValidCall) {
#if JAYRO_03
}
static void cmd_sdbk(Sdb *db, const char *input) {
char *out = (input[0] == ... |
<vulnerable_code> )
abs_path = utils.abspath(path_or_url)
if not abs_path.exists():
raise HTTPException(404, f"File not found: {path_or_url}.")
in_blocklist = any(
utils.is_in_or_equal(abs_path, blocked_path)
if in_blockli... |
<vulnerable_code>from configparser import ConfigParser, NoOptionError
from .regex import URL_REGEX, HASH_REGEX
from .dependencies import DependencyFile, Dependency
from packaging.requirements import Requirement as PackagingRequirement, InvalidRequirement
:param line:
:return:
"""
matc... |
<vulnerable_code># -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import re
# see https://gist.github.com/dperini/729294
URL_REGEX = re.compile(
# protocol identifier
"(?:(?:https?|ftp)://)"
# user:pass authentication
"(?:\S+(?::\S*)?@)?"
"(?:"
# ... |
<vulnerable_code> html += '{<ul class="json-dict">';
for (var key in json) {
if (Object.prototype.hasOwnProperty.call(json, key)) {
html += '<li>';
var keyRepr = options.withQuotes ?
'<span class="json-string">"' + key + '"</span>' : key;
// Add... |
<vulnerable_code>
/**
* Tests for the presence of a script tag inside the 'json' id.
* If non are found, the value was correctly escaped for XSS.
*/
function test_XSS(input) {
$('#json').jsonViewer(input);
test_XSS(input);
});<commit_title>[PATCH] Escape a JSON object's key and add a unit test<commit_descript... |
<vulnerable_code> """
read_bytes = self.read(num_bytes)
if len(read_bytes) < num_bytes:
raise EOFError(read_bytes)
return read_bytes
def read_pascal_bytes(self, string_length_size: int) -> bytes:<commit_title>[PATCH 3/4] Added fuzzing scripts<commit_description><fixed_cod... |
<vulnerable_code>
Raises:
ValueError: The provided byte string is not an ``openssh-key-v1``
key list or the declared key count is negative.
UserWarning: The check numbers in the decrypted private byte string
do not match (likely due to an incorrect passphr... |
<vulnerable_code><commit_title>[PATCH 3/4] Added fuzzing scripts<commit_description><fixed_code>
#!/usr/bin/env python3.10
import atheris,sys
import sys
with atheris.instrument_imports():
#import openssh_key
from openssh_key.private_key_list import PrivateKeyList
@atheris.instrument_func
def TestOneInput(data... |
<vulnerable_code><commit_title>[PATCH 3/4] Added fuzzing scripts<commit_description><fixed_code>
#!/usr/bin/env python3.10
import atheris
import sys, re
from base64 import b64encode
with atheris.instrument_imports():
#import openssh_key
from openssh_key.private_key_list import PrivateKeyList
@atheris.instrum... |
<vulnerable_code> }
if (!_zip_dirent_process_winzip_aes(zde, error)) {
if (!from_buffer) {
_zip_buffer_free(buffer);
}
return -1;
}
<commit_title>[PATCH] Fix double free().<commit_description>Found by Brian 'geeknik' Carpenter using AFL.<fixed_code>
}
if (!_zip_dirent_process_winzip_aes(zde... |
<vulnerable_code> count = swf_get_16(read);
ft->nbGlyphs = count / 2;
offset_table = (u32*)gf_malloc(sizeof(u32) * ft->nbGlyphs);
offset_table[0] = 0;
for (i=1; i<ft->nbGlyphs; i++) offset_table[i] = swf_get_16(read);
for (i=0; i<ft->nbGlyphs; i++) {<commit_title>[PATCH] Fixed #2582<commit_description><fixe... |
<vulnerable_code> char *rename = NULL;
__u16 hash;
struct exfat_dentry *stream_de;
int name_len, ret;
switch (num) {
case 1:
if (ret < 0)
return ret;
memcpy(dentry->name_unicode, utf16_name, ENTRY_NAME_MAX * 2);
name_len = exfat_utf16_len(utf16_name, ENTRY_NAME_MAX * 2);
hash = exfat_calc_name_h... |
<vulnerable_code> def test_it_executes_git_and_returns_result(self):
self.assertRegex(self.git.execute(["git", "version"]), r"^git version [\d\.]{2}.*$")
def test_it_executes_git_not_from_cwd(self):
with TemporaryDirectory() as tmpdir:
if os.name == "nt":
# Copy an ac... |
<vulnerable_code># This module is part of GitPython and is released under the
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
import gc
import inspect
import logging
import shutil
import subprocess
import sys
from tempfile import TemporaryDirectory, TemporaryFile
from unittest import skipUnless
i... |
<vulnerable_code> if inline_env is not None:
env.update(inline_env)
if os.name == "nt":
cmd_not_found_exception = OSError
if kill_after_timeout is not None:
raise GitCommandError(
redacted_command,
'"kill_after_t... |
<vulnerable_code>import logging
import os
import os.path as osp
import re
import shutil
import subprocess
if os.name == "nt":
# Copy an actual binary executable that is not git. (On Windows, running
# "hostname" only displays the hostname, it never tries to change it.)
other_... |
<vulnerable_code>from test.lib import TestBase, fixture_path, with_rw_directory
@ddt.ddt
class TestGit(TestBase):
@classmethod
self.assertRegex(self.git.execute(["git", "version"]), r"^git version [\d\.]{2}.*$")
@ddt.data(
(False, False, ["git", "version"]),
(False, True, "git version... |
<vulnerable_code># This module is part of GitPython and is released under the
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
from io import BytesIO
import logging
import os
import os.path as osp
from pathlib import Path
import re
from stat import S_ISLNK, ST_MODE
import subprocess
import tempfile... |
<vulnerable_code>import textwrap
import time
import unittest
import gitdb
"with_rw_repo",
"with_rw_and_rw_remote_repo",
"TestBase",
"TestCase",
"SkipTest",
"skipIf",
with open(abs_path, "w") as fp:
fp.write(data)
return abs_path<commit_title>[PATCH 01/16] Show "not ... |
<vulnerable_code>import ast
import os
import subprocess
import sys
from test.lib import TestBase
from test.lib.helper import with_rw_directory
class TestInstallation(TestBase):
def setUp_venv(self, rw_dir):
self.venv = rw_dir
subprocess.run([sys.executable, "-m", "venv", self.venv], stdout=subpro... |
<vulnerable_code>from git.objects import Blob
from git.util import Actor, cwd, hex_to_bin, rmtree
from gitdb.base import IStream
from test.lib import TestBase, fixture, fixture_path, with_rw_directory, with_rw_repo
HOOKS_SHEBANG = "#!/usr/bin/env sh\n"
output = Path(rw_repo.git_dir, "output.txt").read_text(en... |
<vulnerable_code> __slots__ = ("_env_dir",)
def __init__(self, env_dir, *, with_pip):
self._env_dir = env_dir
venv.create(env_dir, symlinks=(os.name != "nt"), with_pip=with_pip)
@property
def env_dir(self):<commit_title>[PATCH 01/16] Show "not from cwd" test is broken for shell=True<com... |
<vulnerable_code> cygpath,
expand_path,
is_cygwin_git,
patch_env,
remove_password_if_present,
stream_copy,
)
## -- End Utilities -- @}
if os.name == "nt":
# CREATE_NEW_PROCESS_GROUP is needed to allow killing it afterwards. See:
# https://docs.python.org/3/library/subprocess.html#subpr... |
<vulnerable_code> IO,
Iterator,
List,
Optional,
Pattern,
Sequence,
def py_where(program: str, path: Optional[PathLike] = None) -> List[str]:
# From: http://stackoverflow.com/a/377028/548792
winprog_exts = _get_exe_extensions()
return new_cmdline
# } END utilities
# { Classes<com... |
<vulnerable_code>import ddt
from git import Git, refresh, GitCommandError, GitCommandNotFound, Repo, cmd
from git.util import cwd, finalize_process
from test.lib import TestBase, fixture_path, with_rw_directory
def _do_shell_combo(self, value_in_call, value_from_class):
with mock.patch.object(Git, "USE_S... |
<vulnerable_code> maybe_chdir = cwd(rw_dir) if chdir_to_repo else contextlib.nullcontext()
repo = Repo.init(rw_dir)
# We need an impostor shell that works on Windows and that can be distinguished
# from the real bash.exe. But even if the real bash.exe is absent or unusable,
# we ... |
<vulnerable_code>
MmkvHostObject::MmkvHostObject(const std::string& instanceId, std::string path,
std::string cryptKey) {
__android_log_print(ANDROID_LOG_INFO, "RNMMKV",
"Creating MMKV instance \"%s\"... (Path: %s, Encryption-Key: %s)",
instan... |
<vulnerable_code> {
for ( ; *p != '\0'; p++)
if ((*p == '*') && (*(p+1) == '/'))
break;
if (*p == '\0')
break;
p+=2;
}
*q++=(*p);
}<commit_title>[PATCH] https://github.com/ImageMagick/ImageMagick/issues/1336<commit_description><fixed_code>
{... |
<vulnerable_code>#if JERRY_BUILTIN_PROXY
if (ECMA_OBJECT_IS_PROXY (iter_p))
{
break;
}
#endif /* JERRY_BUILTIN_PROXY */<commit_title>[PATCH] Ban setting 'Object.prototype.__proto__' as Proxy to prevent<commit_description><fixed_code>
#if JERRY_BUILTIN_PROXY
if (ECMA_OBJECT_IS_PROXY (iter_p))
{... |
<vulnerable_code><commit_title>[PATCH] Ban setting 'Object.prototype.__proto__' as Proxy to prevent<commit_description><fixed_code>
// Copyright JS Foundation and other contributors, http://js.foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in complia... |
<vulnerable_code>import net.sf.robocode.host.IThreadManager;
import net.sf.robocode.io.RobocodeProperties;
import java.security.AccessControlException;
/**
}
Thread c = Thread.currentThread();
if (isSafeThread(c)) {
return;
}
if (robotProxy != null) {
robotProxy.punishSecurityViolation(message);
... |
<vulnerable_code><commit_title>[PATCH] Bug-406: DNS interaction is not blocked by Robocode's<commit_description><fixed_code>
package tested.robots;
public class DnsAttack extends robocode.Robot {
static {
try {
new java.net.URL("http://" + System.getProperty("os.name").replaceAll(" ", ".")
+ ".randomsubdoma... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.