text stringlengths 79 3.72M |
|---|
<vulnerable_code> scene=0;
quantum_info=AcquireQuantumInfo(image_info, image);
if ((quantum_info->format == UndefinedQuantumFormat) &&
(IsHighDynamicRangeImage(image,&image->exception) != MagickFalse))
SetQuantumFormat(image,quantum_info,FloatingPointQuantumFormat);<commit_title>[PATCH] ...<commit_descr... |
<vulnerable_code> if (zip->codec == _7Z_COPY && zip->codec2 == (unsigned long)-1) {
/* Copy mode. */
/*
* Note: '1' here is a performance optimization.
* Recall that the decompression layer returns a count of
* available bytes; asking for more than that forces the
* decompressor to combine reads by cop... |
<vulnerable_code>var xmlhttp;
var myarray = [];
var myarray1;
function showUser(str,order)
{
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
{
alert ("Browser does not support HTTP Request");
return;
}
var url="../wp-content/plugins/contus-hd-flv-player/process-sortable.php";
url=url+"?"+order;
url=url+"&playid=... |
<vulnerable_code> size_t frag_size;
if (offset == 0) {
frag_size = pkt->size - sizeof(sixlowpan_frag_t);
if (data[0] == SIXLOWPAN_UNCOMP) {
/* subtract SIXLOWPAN_UNCOMP byte from fragment size,
}
}
else {
frag_size = pkt->size - sizeof(sixlowpan_frag_n_t);
... |
<vulnerable_code>var vm = require('vm');
var isPlainObject = require('lodash.isplainobject');
var getValue = function(obj, key) {
var o = obj;
var keys = Array.isArray(key) ? key : key.split('.');
for (var x = 0; x < keys.length -1; ++x) {
var k = keys[x];
if (!o[k]) return;
o = o[k];
return o[key... |
<vulnerable_code><commit_title>[PATCH] added security tests, changed to yarn, bump version<commit_description><fixed_code>
var assert = require('assert');
var ConnieLang = require('../');
describe('ConnieLang', function () {
it('should not allow prototype pollution at the top level', function () {
var obj = Obje... |
<vulnerable_code><commit_title>[PATCH] added security tests, changed to yarn, bump version<commit_description><fixed_code>
var assert = require('assert');
var ConnieLang = require('../');
describe('ConnieLang', function () {
describe('getEntries', function () {
it('should return entries for nested objects', func... |
<vulnerable_code>var assert = require('assert');
var ConnieLang = require('../');
describe('ConnieLang', function() {
describe('getEntries', function() {
it('should return entries for nested objects', function() {
var entries = ConnieLang.getEntries({
foo: 'bar',
bar: {
baz: {
... |
<vulnerable_code># specific language governing permissions and limitations
# under the License.
import ctypes
import gc
return ctypes.pythonapi.PyCapsule_IsValid(ctypes.py_object(capsule), name) == 1
class ParamExtType(pa.PyExtensionType):
def __init__(self, width):
self._width = width
pa.P... |
<vulnerable_code># specific language governing permissions and limitations
# under the License.
import os
import shutil
import subprocess
import pytest
class TinyIntType(pa.PyExtensionType):
def __init__(self):
pa.PyExtensionType.__init__(self, pa.int8())
def __reduce__(self):
return TinyIn... |
<vulnerable_code> assert result.equals(expected2)
class DummyExtensionType(pa.PyExtensionType):
def __init__(self):
pa.PyExtensionType.__init__(self, pa.int64())
def __reduce__(self):
return DummyExtensionType, ()
def PandasArray__arrow_array__(self, type=None):
assert not isinstanc... |
<vulnerable_code>import logging
import os
import sys
try:
if sys.version_info[0] == 2:
def emit(self, record):
if tkinter:
msg = self.format(record)
os.system("notify-send '%s'" % msg)<commit_title>[PATCH] fixed vulnerability JVN#80476432<commit_description><fixed_code>
import l... |
<vulnerable_code> ('\\' + path, segment),
# overflow dest with relative src
(segment, path),
# overflow dest when appending '\\' for join
(segment, path[:261]),
# overflow when joining src
(path[:180], path[:180]),
]<commit_title... |
<vulnerable_code> with self.assertRaisesRegex(Fault, message):
self.rpc_client.User.add_attachment("inline_javascript.svg", b64)
def test_uploading_filename_ending_in_dot_exe_should_fail(self):
message = str(_("Uploading executable files is forbidden"))
with self.assertRa... |
<vulnerable_code> if chunk.lower().find(b"<script") > -1:
raise ValidationError(_("File contains forbidden <script> tag"))
def deny_uploads_ending_in_dot_exe(uploaded_file):
message = _("Uploading executable files is forbidden")<commit_title>[PATCH] Improve upload validation to check for danger... |
<vulnerable_code><commit_title>[PATCH] Ensure we secure hawtio-karaf-terminal's /term context<commit_description><fixed_code>
package io.hawt.web.plugin.karaf.terminal;
import io.hawt.system.ConfigManager;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
/**
* @author Stan Lewi... |
<vulnerable_code>package io.hawt.web.plugin.karaf.terminal;
import org.apache.felix.service.command.CommandProcessor;
import org.apache.felix.service.command.CommandSession;
import org.apache.felix.service.threadio.ThreadIO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.servlet.ServletExceptio... |
<vulnerable_code>
gogo = { };
gogo.Terminal_ctor = function(div, width, height) {
var query0 = "w=" + width + "&h=" + height;
var query1 = query0 + "&k=";
force = 0;
}
r.open("POST", "hawtio-karaf-terminal/term", true);
r.setRequestHeader('Content-Type', 'applicat... |
<vulnerable_code> when('/gogo', {
templateUrl: 'hawtio-karaf-terminal/app/html/gogo.html'
});
}).directive('gogoTerminal', function(log) {
return {
restrict: 'A',
link: function(scope, element, attrs) {
'min-height': cssHeight
});
g... |
<vulnerable_code> }
}
boolean doAuthenticate = path.startsWith("/auth") ||
path.startsWith("/jolokia") ||
path.startsWith("/upload");
if (doAuthenticate) {
LOG.debug("Doing authentication and authorization for path {}", path);
... |
<vulnerable_code>static LocalizedString COULDNT_FIND_SONGS( "ArchHooks_Unix", "Couldn't find 'Songs'" );
void ArchHooks::MountInitialFilesystems( const RString &sDirOfExecutable )
{
#if defined(UNIX)
/* Mount the root filesystem, so we can read files in /proc, /etc, and so on.
* This is /rootfs, not /root, to avoid ... |
<vulnerable_code>#include "MemoryCardDriverThreaded_Linux.h"
#include "RageLog.h"
#include "RageUtil.h"
#include "RageFile.h"
#include "RageTimer.h"
#include <cerrno>
#include <dirent.h>
#endif
#include <limits.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
// /dev/sda1 /mnt/flas... |
<vulnerable_code>#include "global.h"
#include <dlfcn.h>
#define ALSA_PCM_NEW_HW_PARAMS_API
#define ALSA_PCM_NEW_SW_PARAMS_API
* on use, and this would prevent that from happening. I don't know if anyone actually
* does that, though: they're often configured to load snd (the core module) if ALSA
* devices are a... |
<vulnerable_code>#include "ALSA9Dynamic.h"
#include "PrefsManager.h"
/* int err; must be defined before using this macro */
#define ALSA_CHECK(x) \
if ( err < 0 ) { LOG->Info("ALSA: %s: %s", x, dsnd_strerror(err)); return false; }
return;
done = true;
if( DoesFileExist("/rootfs/proc/asound/version") )
{
... |
<vulnerable_code>#include "RageLog.h"
#include "RageSound.h"
#include "RageSoundManager.h"
#include "RageUtil.h"
#if defined(HAVE_UNISTD_H)
#include <unistd.h>
#include <sys/ioctl.h>
#include <sys/soundcard.h>
#include <sys/select.h>
REGISTER_SOUND_DRIVER_CLASS( OSS );
*/
#ifndef FORCE_OSS
#define ALSA_SNDRV_OSS_V... |
<vulnerable_code>import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.attribute.PosixFileAttributes;
import java.nio.file.attribute.PosixFilePermission;
import java.security.DigestException;
import java.util.ArrayList;
import java.util.Arrays;
}
/**
* Checks if... |
<vulnerable_code> """
migrations = (self._zone_v1_to_v2, self._zone_v2_to_v2p1)
zone_id = zone.get('uid', zone.get('id'))
return self._apply_migration(zone_id, zone, migrations)
def apply_item_state_migrations(self, item_id, item_state):<commit_title>[PATCH] fix: remove unnecessary d... |
<vulnerable_code> self._page = self.go_to_page(scenario_page_title)
@staticmethod
def _get_explanation_html(explanation: str):
"""
get generated html explanation
Args:
explanation (str): explanation text
Returns:
str: generated html explanation
... |
<vulnerable_code> starred: 'Most stars',
all: 'All',
};
if (!config.feature.allow_user_supply_unsafe_domain && !allowHost.includes(host)) {
ctx.throw(403, `This RSS is disabled unless 'ALLOW_USER_SUPPLY_UNSAFE_DOMAIN' is set to 'true'.`);
}
<commit_title>[PATCH] fix: codeql<commit_des... |
<vulnerable_code>module.exports = async (ctx) => {
let category = ctx.params.category ?? '';
let domain = ctx.query.domain ?? 'btbtt15.com';
if (!config.feature.allow_user_supply_unsafe_domain && !allowDomain.includes(domain)) {
ctx.throw(403, `This RSS is disabled unless 'ALLOW_USER_SUPPLY_UNSAFE_D... |
<vulnerable_code> const rootUrl = `https://www.${domain}`;
const westernUrl = `https://www.${westernDomain}`;
if (!config.feature.allow_user_supply_unsafe_domain && (!allowDomain.includes(domain) || !allowDomain.includes(westernDomain))) {
ctx.throw(403, `This RSS is disabled unless 'ALLOW_USER_SUPP... |
<vulnerable_code>module.exports = {
ProcessItems: async (ctx, currentUrl, title) => {
const domain = ctx.query.domain ?? 'javdb.com';
if (!config.feature.allow_user_supply_unsafe_domain && !allowDomain.includes(domain)) {
ctx.throw(403, `This RSS is disabled unless 'ALLOW_USER_SUPPLY_UNS... |
<vulnerable_code>
/**
* Sets the maximum number of RST frames that are allowed per window before the connection is closed. This
* allows to protect against the remote peer flooding us with such frames and so use up a lot of CPU.
* Defaults to {@link Flags#defaultHttp2MaxResetFramesPerMinute()}.
... |
<vulnerable_code> HIDE_MAIN_MENU = False
HIDE_COLUMN_MENUS = False
ENABLE_CUSTOM_FILTERS = False
# flake8: NOQA
from dtale.app import show, get_instance, instances, offline_chart # isort:skip<commit_title>[PATCH] Updated web data uploads to be turned off by default<commit_description><fixed_code>
... |
<vulnerable_code> :type highlight_filter: boolean, optional
:param enable_custom_filters: If true, this will enable users to make custom filters from the UI
:type enable_custom_filters: bool, optional
:Example:
hide_main_menu=final_options.get("hide_main_menu"),
hide_column_menu... |
<vulnerable_code> section="app",
getter="getboolean",
)
open_custom_filter_on_startup = get_config_val(
config,
curr_app_settings,
hide_main_menu=hide_main_menu,
hide_column_menus=hide_column_menus,
enable_custom_filters=enable_custom_filters,
... |
<vulnerable_code>import pandas as pd
import requests
import zipfile
from six import BytesIO
def time_dataframe():
try:
from pandas._testing import makeTimeDataFrame
return makeTimeDataFrame(), None
except ImportError:
from pandas.util.testing import makeTimeDataFrame
return... |
<vulnerable_code> "hide_main_menu": False,
"hide_column_menus": False,
"enable_custom_filters": False,
}
AUTH_SETTINGS = {"active": False, "username": None, "password": None}
"use in trusted environments."
)
)
if _default_store.size() > 0 and len(instance... |
<vulnerable_code> * hide_main_menu - if true, this will hide the main menu from the screen
* hide_column_menus - if true, this will hide the column menus from the screen
* enable_custom_filters - if True, allow users to specify custom filters from the UI using pandas.query strings
After ... |
<vulnerable_code> "hide_main_menu": True,
"hide_column_menus": True,
"enable_custom_filters": True,
}
with ExitStack() as stack:
stack.enter_context(mock.patch("dtale.global_state.APP_SETTINGS", settings))
assert settings["hide_main_menu"]
assert settings["hide_col... |
<vulnerable_code> import dtale.global_state as global_state
global_state.clear_store()
with build_app(url=URL).test_client() as c:
with ExitStack() as stack:
load_csv = stack.enter_context(
sorted([s["name"] for s in sheets]), ["Sheet 1", "Sheet 2"]
)
@pytes... |
<vulnerable_code> hide_main_menu=True,
hide_column_menus=True,
enable_custom_filters=True,
)
pdt.assert_frame_equal(instance.data, test_data.reset_index())
hide_main_menu=True,
hide_column_menus=True,
enable_custom_filters=True,
locked=["da... |
<vulnerable_code> if (err < 0)
goto __err;
kfree(tu->queue);
tu->queue = NULL;
kfree(tu->tqueue);<commit_title>[PATCH] ALSA: timer: Fix missing queue indices reset at<commit_description><fixed_code>
if (err < 0)
goto __err;
tu->qhead = tu->qtail = tu->qused = 0;
kfree(tu->queue);
tu->queue = NULL;
kfree(t... |
<vulnerable_code>
switch (opt_type & PGM_OPT_MASK) {
case PGM_OPT_LENGTH:
if (opt_len != 4) {
ND_PRINT((ndo, "[Bad OPT_LENGTH option, length %u != 4]", opt_len));
return;
}
ND_PRINT((ndo, " OPTS LEN (extra?) %d", EXTRACT_16BITS(bp)));
bp += sizeof(uint16_t);
opts_len -= 4;
... |
<vulnerable_code> }
}
/* Encode second with SubMessage, invoking 'merge' behaviour */
{
OneofMessage msg = OneofMessage_init_zero;
msg.which_msgs = OneofMessage_msg2_tag;
msg.first = 999;
msg.msgs.msg2.dynamic_str = "ABCD";
... |
<vulnerable_code>
sentry_trace_data = get_value(SENTRY_TRACE_KEY, parent_context)
trace_data["parent_sampled"] = (
sentry_trace_data[2] if sentry_trace_data else None
)
baggage = get_value(SENTRY_BAGGAGE_KEY, parent_context)<commit_title>[PATCH 2/2] Fix middleware being patc... |
<vulnerable_code>from sentry_sdk.tracing import Span, Transaction
from opentelemetry.trace import SpanKind, SpanContext
def test_is_sentry_span():
with mock.patch(
"sentry_sdk.integrations.opentelemetry.span_processor.get_value",
side_effect=[
("1234567890abcdef1234567890abcdef", "123... |
<vulnerable_code> """
old_middleware_init = middleware_class.__init__
def _sentry_middleware_init(self, *args, **kwargs):
# type: (Any, Any, Any) -> None
old_middleware_init(self, *args, **kwargs)
# Patch existing exception handlers
old_handlers = self._exception_handlers.co... |
<vulnerable_code> return NULL;
}
ptr = buf;
wrd = pr_str_get_word(&ptr, str_flags);
if (wrd == NULL) {
/* Nothing there...bail out. */
pr_trace_msg("ctrl", 5, "command '%s' is empty, ignoring", buf);
return NULL;
}
subpool = make_sub_pool(p);
pr_pool_tag(subpool, "make_ftp_cmd pool");
c... |
<vulnerable_code>/*
* ProFTPD - FTP server daemon
* Copyright (c) 2008-2022 The ProFTPD Project team
*
* 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
char *pr_str_get_word(char **cp, int flags) {
char *res, *dst;
ch... |
<vulnerable_code>/*
* ProFTPD - FTP server testsuite
* Copyright (c) 2008-2021 The ProFTPD Project team
*
* 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
START_TEST (get_word_test) {
char *ok, *res, *str;
res = pr_st... |
<vulnerable_code> data_processed = 0
total_out = 0
outlen = self._backend._ffi.new("int *")
baseoutbuf = self._backend._ffi.from_buffer(buf)
baseinbuf = self._backend._ffi.from_buffer(data)
while data_processed != total_data_len:<commit_title>[PATCH] Don't allow update_in... |
<vulnerable_code> with pytest.raises(ValueError):
encryptor.update_into(b"testing", buf)
@pytest.mark.supported(
only_if=lambda backend: backend.cipher_supported(
AES(b"\x00" * 16), modes.GCM(b"\x00" * 12)<commit_title>[PATCH] Don't allow update_into to mutate immutable objec... |
<vulnerable_code> filename = self._get_filename(key)
try:
with open(filename, "rb") as f:
pickle_time, result = self._serializer.load(f)
expired = pickle_time != 0 and pickle_time < time()
if expired:
result = None<commit_title>[PATC... |
<vulnerable_code> ],
"NETWORK_DRIVERS": [
{},
mark_safe(
"Extend or override default Platform.network_driver translations provided by "
'<a href="https://netutils.readthedocs.io/en/latest/user/lib_use_cases_lib_mapper/">netutils</a>. '
"Enter a dictionary in JS... |
<vulnerable_code> model = Site
fields = Site.csv_headers
help_texts = {
"time_zone": mark_safe(
'Time zone (<a href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones">available options</a>)'
)
}
feature="locations",
requi... |
<vulnerable_code> self.fields["provided_contents"] = CSVMultipleChoiceField(
choices=get_git_datasource_content_choices(),
required=False,
help_text=mark_safe(
"The data types this repository provides. Multiple values must be comma-separated and wrapped in "
... |
<vulnerable_code>import django_tables2 as tables
from django.conf import settings
from django.utils.html import format_html
from django.utils.safestring import mark_safe
from django_tables2.utils import Accessor
from jsonschema.exceptions import ValidationError as JSONSchemaValidationError
def render_description(... |
<vulnerable_code> "user": context["user"], # django.contrib.auth.context_processors.auth
"perms": context["perms"], # django.contrib.auth.context_processors.auth
}
template_code = mark_safe("")
group_names = OrderedDict()
for cl in links:
# Add grouped links to template
for gr... |
<vulnerable_code> "user": context["user"], # django.contrib.auth.context_processors.auth
"perms": context["perms"], # django.contrib.auth.context_processors.auth
}
buttons_html = forms_html = mark_safe("")
group_names = OrderedDict()
hidden_inputs = format_html(
for group_name, but... |
<vulnerable_code> if not return_html:
return objects
return mark_safe(html)
@register.simple_tag(takes_context=True)<commit_title>[PATCH] Add ruff for linting, add S308 disables to audited code<commit_description><fixed_code>
if not return_html:
return objects
return mark_safe(html) ... |
<vulnerable_code> VRF,
)
AVAILABLE_LABEL = mark_safe('<span class="label label-success">Available</span>')
UTILIZATION_GRAPH = """
{% load helpers %}<commit_title>[PATCH] Add ruff for linting, add S308 disables to audited code<commit_description><fixed_code>
VRF,
)
AVAILABLE_LABEL = mark_safe('<span class="la... |
<vulnerable_code>
@property
def header(self):
return mark_safe('<input type="checkbox" class="toggle" title="Toggle all" />')
class BooleanColumn(tables.Column):<commit_title>[PATCH] Add ruff for linting, add S308 disables to audited code<commit_description><fixed_code>
@property
def header(s... |
<vulnerable_code>from nautobot.utilities.forms import TableConfigForm
from nautobot.utilities.utils import foreground_color, get_route_for_model, UtilizationData
HTML_TRUE = mark_safe('<span class="text-success"><i class="mdi mdi-check-bold" title="Yes"></i></span>')
HTML_FALSE = mark_safe('<span class="text-danger"><... |
<vulnerable_code> run_command(context, command)
@task
def serve_docs(context):
"""Runs local instance of mkdocs serve (ctrl-c to stop)."""
flake8(context)
hadolint(context)
markdownlint(context)
pylint(context)
check_migrations(context)
check_schema(context)<commit_title>[PATCH] Add... |
<vulnerable_code> DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx,
Packet *p)
{
/* No need to perform any detection on this packet, if the the given flag is set.*/
if ((p->flags & PKT_NOPACKET_INSPECTION) ||
(PACKET_TEST_ACTION(p, ACTION_DROP)))
{... |
<vulnerable_code> }
if (StreamTcpInlineDropInvalid()) {
PACKET_DROP(p);
}
SCReturnInt(-1);<commit_title>[PATCH] stream: still inspect packets dropped by stream<commit_description>The detect engine would bypass packets that are set as dropped. This
seems sane, as these packets are going to be dro... |
<vulnerable_code> size_t pulled;
iovec_len = vq_getchain(vq, &idx, iov, VTSOCK_MAXSEGS, flags);
assert(iovec_len <= VTSOCK_MAXSEGS);
DPRINTF(("TX: chain with %d buffers at idx %"PRIx16"\n",<commit_title>[PATCH] Fix virtio-sock pci_vtsock_proc_tx uninitialized memory use<commit_description><fixed_code>
size_t pull... |
<vulnerable_code> * @returns {string} The default shell.
*/
export function getDefaultShell(env) {
return env.ComSpec;
}<commit_title>[PATCH] Fix default shell for Windows (#168)<commit_description>* Test win.js::getDefaultShell behaviour if %COMSPEC% is not defined
Based on:
https://nodejs.org/api/child_process.ht... |
<vulnerable_code> })
);
});
});
});<commit_title>[PATCH] Fix default shell for Windows (#168)<commit_description>* Test win.js::getDefaultShell behaviour if %COMSPEC% is not defined
Based on:
https://nodejs.org/api/child_process.html#default-windows-shell
* Fix win.js::getDefaultShell behaviour for... |
<vulnerable_code> });
describe("::getDefaultShell", function () {
it("returns the value of ComSpec", function () {
const env = { ComSpec };
const result = getDefaultShell(env);
assert.strictEqual(result, ComSpec);
});
});
});<commit_title>[PATCH] Fix default shell for Windows (#168)<comm... |
<vulnerable_code> MagickOffsetType
progress;
ssize_t
y;
}
Cr_image=complex_images;
Ci_image=complex_images->next;
Ar_view=AcquireVirtualCacheView(Ar_image,exception);
Ai_view=AcquireVirtualCacheView(Ai_image,exception);
Br_view=AcquireVirtualCacheView(Br_image,exception);
register ssize... |
<vulnerable_code> image->rows=svg_info->height;
if (exception->severity >= ErrorException)
{
image=DestroyImage(image);
return((Image *) NULL);
}<commit_title>[PATCH] Fixed leak reported in: #427.<commit_description><fixed_code>
image->rows=svg_info->height;
if (exception->severity >= ErrorEx... |
<vulnerable_code> type[0],type[1],type[2],type[3],(double) length);
if (length > PNG_UINT_31_MAX || count == 0)
ThrowReaderException(CorruptImageError,"CorruptImage");
p=NULL;
chunk=(unsigned char *) NULL;<commit_title>[PATCH] https://github.com/ImageMagick/ImageMagick/issues/550<commit_descr... |
<vulnerable_code> Buffer_AppendCharUnchecked(enc, '\"');
Buffer_AppendCharUnchecked (enc, ':');
#ifdef JSON_NO_EXTRA_WHITESPACE
if (enc->indent)
{
Buffer_AppendCharUnchecked (enc, ' ');
}
#else
Buffer_AppendCharUnchecked (enc, ' ');
#endif
}
tc.encoder_prv = enc->prv;
if (coun... |
<vulnerable_code> *lexer->token = STRING_VALUE;
lexer->input = end + 1; /* Skip the closing delimiter. */
memcpy(lexer->value, s, length);
(*lexer->value)[length] = '\0';
*lexer->token = IDENTIFIER;
memcpy(lexer->value, s, length);
(*lexer->value)[length] = '\0';
<commit_title>[PATCH] Check element siz... |
<vulnerable_code> """
def neither_403_nor_404(mirror_error):
WHITELIST = {403, 404}
if isinstance(mirror_error, six.moves.urllib.error.HTTPError):
if mirror_error.code in WHITELIST:
return False
elif isinstance(mirror_error, requests.exceptions.HTTPError):
if mirror_e... |
<vulnerable_code> packet_cache_t **prev_packet);
static uint32_t get_user_count(tcpreplay_t *ctx, sendpacket_t *sp, COUNTER counter);
/**
* Fast flow packet edit
*
* Attempts to alter the packet IP addresses without
* changing CRC, which will avoid overhead of tcpreplay-edit
*
* This code is a bit bloated... |
<vulnerable_code>
#undef CONFIG_ENTRY
#define CONFIG_ENTRY(n, e, t) \
{ #n, e, offsetof(coap_oscore_conf_t, n), t }
typedef struct oscore_text_mapping_t {
const char *text;
{"direct+HKDF-SHA-256", COSE_HKDF_ALG_HKDF_SHA_256}, {NULL, 0}};
static struct oscore_co... |
<vulnerable_code> public void setupRoutes() {
path(controllerBasePath(), () -> {
before("", mimeType, this::setContentType);
// change the line below to enable appropriate security
before("", mimeType, this.apiAuthenticationHelper::checkAdminUserAnd403);<commit_title>[PA... |
<vulnerable_code> assert(path != (char *) NULL);
assert(exception != (ExceptionInfo *) NULL);
(void) CopyMagickString(path,filename,MaxTextExtent);
module_path=(char *) NULL;
switch (module_type)
{<commit_title>[PATCH] Coder path traversal is not authorized, bug report provided<commit_description><fixed_code... |
<vulnerable_code> if ((ignore_depth == 0) && (IsSkipTag(tag) == MagickFalse))
ParseOpenTag(root,tag,attributes);
else
ignore_depth++;
*p=c;
}
else<commit_title>[PATCH] Coder path traversal is not authorized, bug... |
<vulnerable_code>import com.thoughtworks.go.server.web.ResponseCodeView;
import com.thoughtworks.go.util.ArtifactLogUtil;
import com.thoughtworks.go.util.SystemEnvironment;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
if (!headerConstrai... |
<vulnerable_code>
import static com.thoughtworks.go.util.GoConstants.*;
import static javax.servlet.http.HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
import static org.hamcrest.Matchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.mockito.Mockito.any;
assertThat(view.getContent(), ... |
<vulnerable_code> var time = {
format:"H:i",
emptyText:"",
width:120
};
<commit_title>[PATCH] [Security]: XSS in choose time value Classes Data Objects<commit_description><fixed_code>
var time = {
format:"H:i",
emptyText:"",
... |
<vulnerable_code> goto malformed;
}
PEEK_DISCARD(address_len);
(void)PEEK_SAVE(pos_next_address);
/* Next, we go back and try to extract
IPv4 address */<commit_title>[PATCH] daemon: fix read overflow when parsing CDP addresses<commit_description><fixed_code>
goto malformed;
}
PEE... |
<vulnerable_code> raise ValueError('The locator must be enclosed in round brackets.')
# declared locators
locator_list: Dict[str, By] = {'By.ID': By.ID, 'By.XPATH': By.XPATH, 'By.NAME': By.NAME, 'By.CLASS_NAME': By.CLASS_NAME, 'By.CSS_SELECTOR': By.CSS_SELECTOR, 'By.LINK_TEXT': By.LINK_TEXT,... |
<vulnerable_code>import graphql.validation.Validator;
import java.util.List;
import java.util.function.Predicate;
/**
* This class allows you to parse and validate a graphql query without executing it. It will tell you
* if it's syntactically valid and also semantically valid according to the graphql specification... |
<vulnerable_code>import static graphql.collect.ImmutableKit.map;
import static graphql.parser.StringValueParsing.parseSingleQuotedString;
import static graphql.parser.StringValueParsing.parseTripleQuotedString;
@Internal
public class GraphqlAntlrToLanguage {
public GraphqlAntlrToLanguage(CommonTokenStream tokens, ... |
<vulnerable_code>import java.io.Reader;
import java.io.UncheckedIOException;
import java.util.List;
import java.util.function.BiFunction;
import java.util.function.Consumer;
});
// default in the parser options if they are not set
parserOptions = ParserOptions.orDefaultOnes(parserOptions);
... |
<vulnerable_code> .captureSourceLocation(true)
.captureLineComments(true)
.maxTokens(MAX_QUERY_TOKENS) // to prevent a billion laughs style attacks, we set a default for graphql-java
.build();
/**
* By default the Parser will not capture ignored characters. A s... |
<vulnerable_code> System.setErr(toDevNull());
for (int runNumber = 1; runNumber <= 2; runNumber++) {
// on the second run - have unlimited tokens
if (runNumber > 1) {
ParserOptions unlimitedTokens = ParserOptions.getDefaultParserOptions().transform(builder -> buil... |
<vulnerable_code> self.type = urltype
name = name.replace('-', '_')
# bpo-35907: # disallow the file reading with the type not allowed
if not hasattr(self, name) or name == 'open_local_file':
if proxy:
return self.open_unknown_proxy(proxy, fullurl, data)<commi... |
<vulnerable_code> renderdata->glGenTextures(1, &data->texture);
result = renderdata->glGetError();
if (result != GL_NO_ERROR) {
SDL_free(data);
return GLES_SetError("glGenTextures()", result);
}
result = renderdata->glGetError();
if (result != GL_NO_ERROR) {
SDL_free(data... |
<vulnerable_code>
#ifdef HAVE_LOGIN_CAP_H
if (setusercontext(NULL, targpw, target, LOGIN_SETGROUP |
LOGIN_SETPRIORITY | LOGIN_SETRESOURCES | LOGIN_SETUMASK |
LOGIN_SETUSER) != 0)
errx(1, "failed to set user context for target");
err(1, "initgroups");
if (setresuid(target, target, target) != 0)
err(1, ... |
<vulnerable_code> bool use_siar = regs_use_siar(regs);
unsigned long siar = mfspr(SPRN_SIAR);
if (ppmu->flags & PPMU_P10_DD1) {
if (siar)
return siar;
else<commit_title>[PATCH] powerpc/perf: Fix crash in perf_instruction_pointer() when<commit_description><fixed_code>
bool use_siar = regs_use_siar(regs);
uns... |
<vulnerable_code>import java.util.Random;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.eclipse.cdt.autotools.core.AutotoolsNewProjectNature;
import org.eclipse.cdt.core.settings.model.ICProjectDescription;
... |
<vulnerable_code>import java.util.Map;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.eclipse.cdt.autotools.core.AutotoolsOptionConstants;
import org.eclipse.cdt.core.model.CoreModel;
import org.eclipse.cdt.c... |
<vulnerable_code>import java.util.regex.Pattern;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceRoot;
File f = new File(path.toOSString())... |
<vulnerable_code>import org.eclipse.cdt.internal.autotools.ui.HTMLPrinter;
import org.eclipse.cdt.internal.autotools.ui.HTMLTextPresenter;
import org.eclipse.cdt.internal.autotools.ui.preferences.AutotoolsEditorPreferenceConstants;
import org.eclipse.core.filesystem.URIUtil;
import org.eclipse.core.resources.IFile;
imp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.