text
stringlengths
79
3.72M
<vulnerable_code> { (void) ThrowMagickException(exception,GetMagickModule(),OptionError, "InvalidGeometry","`%s'",option); image=DestroyImage(image); return((Image *) NULL); }<commit_title>[PATCH] https://github.com/ImageMagick/ImageMagick/issues/1601<commit_desc...
<vulnerable_code>//This script dumps information about byte and instructions in neighborhoods around function starts //and returns to an XML file //@category FunctionStartPatterns import java.beans.XMLEncoder; import java.io.*; import java.util.List; File savedFile = new File(saveDir.getAbsolutePath() + File.separat...
<vulnerable_code> import java.math.BigInteger; /** * class for representing the values a specific context register assumes within a function body. */ public class ContextRegisterInfo { String contextRegister;//the context register String value;//the value it assumes (needed because a BigInteger will not serialize...
<vulnerable_code> */ package ghidra.bitpatterns.info; import java.util.ArrayList; import java.util.List; /** * An object of this class stores all the function bit pattern information for an executable. * It records the number of bytes and instructions for each category (first, pre, and return), as public class Fil...
<vulnerable_code>package ghidra.bitpatterns.info; import java.awt.Component; import java.beans.XMLDecoder; import java.io.*; import java.util.*; numFiles++; FileBitPatternInfo fileInfo = null; try (XMLDecoder xmlDecoder = new XMLDecoder(new FileInputStream(dataFile))) { fileInfo = (FileBitPatternInfo) xmlDe...
<vulnerable_code>import java.math.BigInteger; import java.util.*; import ghidra.program.model.address.Address; import ghidra.program.model.address.AddressSetView; import ghidra.program.model.lang.Register; import ghidra.program.model.symbol.FlowType; import ghidra.program.model.symbol.RefType; import ghidra.util.Msg; ...
<vulnerable_code> import java.util.*; /** * An object in this class stores a sequence of instructions along with the sizes and operands of each. * These sequences come from function starts, function returns, or immediately before function starts. public class InstructionSequence { private String[] instructions;...
<vulnerable_code> import java.io.*; import java.nio.charset.StandardCharsets; import java.util.regex.Matcher; import java.util.regex.Pattern; import generic.jar.ResourceFile; import ghidra.util.Msg; import ghidra.util.NumericUtilities; /** * A set of utility methods for working with XML. return value; } /** *...
<vulnerable_code>import airflow.templates from airflow import settings, utils from airflow.api_internal.internal_api_call import internal_api_call from airflow.configuration import conf, secrets_backend_list from airflow.exceptions import ( AirflowDagInconsistent, AirflowException, from airflow.models.baseopera...
<vulnerable_code>from datetime import datetime from typing import TYPE_CHECKING, Any, Callable, Iterable, Iterator, NamedTuple, Sequence, TypeVar, overload from sqlalchemy import ( Boolean, Column, ) from sqlalchemy.exc import IntegrityError from sqlalchemy.ext.associationproxy import association_proxy from sq...
<vulnerable_code>from airflow.models.abstractoperator import AbstractOperator from airflow.models.dag import DAG, get_dataset_triggered_next_run_info from airflow.models.dagcode import DagCode from airflow.models.dagrun import DagRun, DagRunType from airflow.models.dataset import DagScheduleDatasetReference, DatasetDag...
<vulnerable_code>from airflow import settings from airflow.callbacks.callback_requests import DagCallbackRequest from airflow.decorators import setup, task, task_group, teardown from airflow.models import ( DAG, DagBag, from airflow.utils.types import DagRunType from tests.models import DEFAULT_DATE as _DEFAULT...
<vulnerable_code>from airflow.utils.session import create_session from airflow.utils.types import DagRunType from tests.test_utils.api_connexion_utils import create_test_client from tests.test_utils.www import check_content_in_response f'<textarea style="display: none;" id="json_start" name="json_start">{expe...
<vulnerable_code>*/ static MagickBooleanType WriteMSLImage(const ImageInfo *image_info,Image *image) { assert(image_info != (const ImageInfo *) NULL); assert(image_info->signature == MagickSignature); assert(image != (Image *) NULL); assert(image->signature == MagickSignature); if (image->debug != MagickFalse...
<vulnerable_code> binary_output=False, name=None)) if __name__ == "__main__": googletest.main()<commit_title>[PATCH] Fix RaggedBincount Segmentation Fault from the Splits arg<commit_description>PiperOrigin-RevId: 461715364<fixed_code> binary_output=False, name=...
<vulnerable_code> else if (gf_isom_has_sync_shadows(file, TrackNum) || gf_isom_has_sample_dependency(file, TrackNum)) { flags |= GP_RTP_PCK_SYSTEMS_CAROUSEL; } gf_odf_desc_del((GF_Descriptor*)esd); } break; case GF_ISOM_SUBTYPE_3GP_H263: hintType = GF_RTP_PAYT_H263;<commit_title>[PATCH] fixed...
<vulnerable_code> if (s->keys == NULL) { free(s->name); dlt_log(LOG_ERR, "Cannot allocate memory for internal data structure\n"); return -1; }<commit_title>[PATCH] Fix a double-free bug.<commit_description>In the dlt_config_file_set_section function of dlt_config_file_parser.c: s-name ...
<vulnerable_code> break; *p++=(unsigned char) c; } if (i != (ssize_t) length) { profile=DestroyStringInfo(profile); image->filename); return(FALSE); } error_manager->profile=NULL; icc_profile=(StringInfo *) GetImageProfile(image,"icc"); if (icc_profile != (StringInfo *) NU...
<vulnerable_code><commit_title>[PATCH] fix: Tightened sanitisation in some view elements - on the<commit_description><fixed_code>
<vulnerable_code> }); cy.get('label[for="newsletterRegister"]').click(); cy.wait('@checkNewsletter').its('response.statusCode').should('equal', 200); cy.contains('You have subscribed to the newsletter.').should('exist'); // Verify the subscription from the newsletter recipients ...
<vulnerable_code><commit_title>[PATCH] Tyr out chunked encoding enforcer<commit_description><fixed_code> package com.netflix.zuul.netty.server.http2; import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelInboundHandlerAdapter; import io.netty.handler.codec.http.H...
<vulnerable_code> package com.netflix.zuul.netty.server.http2; import com.netflix.netty.common.channel.config.ChannelConfig; import com.netflix.netty.common.channel.config.CommonChannelConfigKeys; import com.netflix.netty.common.http2.DynamicHttp2FrameLogger; import io.netty.handler.ssl.ApplicationProtocolNames; impor...
<vulnerable_code> pipeline.addLast("h2_downgrader", new Http2StreamFrameToHttpObjectCodec(true)); pipeline.addLast(http2StreamErrorHandler); pipeline.addLast(http2StreamHeaderCleaner); } protected void copyAttrsFromParentChannel(Channel parent, Channel child)<commit_title>[PATCH] Tyr out...
<vulnerable_code>} Name WasmBinaryBuilder::getFunctionIndexName(Index i) { return wasm.functions[i]->name; } auto index = exportIndexes[curr]; switch (curr->kind) { case ExternalKind::Function: { if (index >= wasm.functions.size()) { throwError("bad function export index"); }...
<vulnerable_code> data->type = PLIST_STRING; data->strval = (char *) malloc(sizeof(char) * (size + 1)); memcpy(data->strval, *bnode, size); data->strval[size] = '\0'; data->length = strlen(data->strval);<commit_title>[PATCH] bplist: Make sure to bail out if malloc() fails in<commit_description><fixe...
<vulnerable_code> continue; } if (is_private) { parser_check_duplicated_private_field (context_p, SCANNER_PRIVATE_FIELD_PROPERTY_GETTER_SETTER); } bool is_constructor_literal = context_p->token.type == LEXER_LITERAL && parser_is_constructor_literal (context_p); if (is_private && is...
<vulnerable_code> >>> available_on_pypi(prerelease=False).is_prerelease False """ client = ServerProxy('https://pypi.python.org/pypi') versions = client.package_releases('pwntools', True) versions = map(packaging.version.Version, versions) if not prerelease:<commit_title>[PATCH] Apparently p...
<vulnerable_code> }; URI.parseUserinfo = function(string, parts) { // extract username:password var firstBackSlash = string.indexOf('\\'); var firstSlash = string.indexOf('/'); var slash = firstBackSlash === -1 ? firstSlash : (firstSlash !== -1 ? Math.min(firstBackSlash, firstSlash): firstSlash) ...
<vulnerable_code> idn: false, punycode: false } } ]; <commit_title>[PATCH] fix(parse): treat backslash as forwardslash in authority<commit_description><fixed_code> idn: false, punycode: false } }, { name: 'backslashes authority, no ending slash', url: 'http...
<vulnerable_code>(function (Prism) { var keyword = /\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char8_t|char16_t|char32_t|class|compl|concept|const|consteval|constexpr|constinit|const_cast|continue|co_await|co_return|co_yield|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern...
<vulnerable_code>!function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char8_t|char16_t|char32_t|class|compl|concept|const|consteval|constexpr|constinit|const_cast|continue|co_await|co_return|co_yield|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|float|for|friend...
<vulnerable_code>Prism.languages.elixir = { 'comment': /#.*/m, // ~r"""foo""" (multi-line), ~r'''foo''' (multi-line), ~r/foo/, ~r|foo|, ~r"foo", ~r'foo', ~r(foo), ~r[foo], ~r{foo}, ~r<foo> 'regex': { pattern: /~[rR](?:("""|''')(?:\\[\s\S]|(?!\1)[^\\])+\1|([\/|"'])(?:\\.|(?!\2)[^\\\r\n])+\2|\((?:\\.|[^\\)\r\n])+\)|...
<vulnerable_code>Prism.languages.elixir={comment:/#.*/m,regex:{pattern:/~[rR](?:("""|''')(?:\\[\s\S]|(?!\1)[^\\])+\1|([\/|"'])(?:\\.|(?!\2)[^\\\r\n])+\2|\((?:\\.|[^\\)\r\n])+\)|\[(?:\\.|[^\\\]\r\n])+\]|\{(?:\\.|[^\\}\r\n])+\}|<(?:\\.|[^\\>\r\n])+>)[uismxfr]*/,greedy:!0},string:[{pattern:/~[cCsSwW](?:("""|''')(?:\\[\s\S...
<vulnerable_code>Prism.languages.ini= { 'comment': /^[ \t]*[;#].*$/m, 'selector': /^[ \t]*\[.*?\]/m, 'constant': /^[ \t]*[^\s=]+?(?=[ \t]*=)/m, 'attr-value': { pattern: /=.*/, inside: { 'punctuation': /^[=]/ } } };<commit_title>[PATCH 1/3] C++: Added missing keywords and modules (#2763)<commit_description...
<vulnerable_code>Prism.languages.ini={comment:/^[ \t]*[;#].*$/m,selector:/^[ \t]*\[.*?\]/m,constant:/^[ \t]*[^\s=]+?(?=[ \t]*=)/m,"attr-value":{pattern:/=.*/,inside:{punctuation:/^[=]/}}};<commit_title>[PATCH 1/3] C++: Added missing keywords and modules (#2763)<commit_description><fixed_code> Prism.languages.ini={comme...
<vulnerable_code> bool use_http = true; struct stat statsBuf; int stat_rc; static char *http_options[] = { (char*)"listening_ports", ports, (char*)"enable_directory_listing", (char*)"no",<commit_title>[PATCH] Added code to randomize values returned by rand()<commit_description><fixed_code> bool use_ht...
<vulnerable_code> except Exception as ex: logging.exception(ex) # Get the list of servers (and tokens, if available) servers = server.split(',') tokens = token.split(',') server += '/' logging.debug('XML to be submitted: %s', checkresults) ...
<vulnerable_code>import logging def send_request(url, **kwargs): """ Send an HTTP POST request to given url. """ try: r = requests.post(url, data=kwargs, verify=False, allow_redirects=True) except requests.exceptions.HTTPError as e: logging.error("HTTP Error: %s", e) except r...
<vulnerable_code> @NonNull final String filePath, @NonNull final String baseDirPath) throws IOException { File file = new File(filePath); File baseDir = new File(baseDirPath); return !file.getCanonicalPath().startsWith(baseDir.getCanonicalPath()); } /**<commit_title>[PATCH 2/2] Replace String:...
<vulnerable_code> @NonNull final String filePath, @NonNull final String baseDirPath) throws IOException { File file = new File(filePath); File baseDir = new File(baseDirPath); return !file.getCanonicalPath().startsWith(addTrailingSeparator(baseDir.getCanonicalPath())); } private static String ...
<vulnerable_code> Assertions.assertEquals(expectedResult, actualResult); } @Test void normalize_null_successfully() { Assertions.assertNull(FileSecurityUtils.normalize(null));<commit_title>[PATCH 2/2] Replace String::startsWith with Path::startsWith in<commit_description><fixed_code> Assertions.assert...
<vulnerable_code> def test_passing_password_to_submrg(convert2rhel): username = "testname" password = "&hTYGHKPvU7Ewd" with convert2rhel(f"-y --no-rpm-va -u {username} -p {password}") as c2r: # Just to be sure, try to run through all three tries # of the registration process in case the race...
<vulnerable_code> try: remove = False with open(fname, "rb") as f: expires = self._serializer.load(f) remove = (expires != 0 and expires <= now) or idx % 3 == 0 if remove: os.remove(fname) filename...
<vulnerable_code><commit_title>[PATCH] Initial json support<commit_description><fixed_code> import json class BytesSerializer: """Serializer wrapper with auto str2bytes casting""" def __init__(self, serializer): self._serializer = serializer def dumps(self, obj, *args, **kwargs): result =...
<vulnerable_code># -*- coding: utf-8 -*- import errno import os import flask import pytest import flask_caching as fsc # build the path to the uwsgi marker file # when running in tox, this will be relative to the tox env f.write(item.name + "\n") @pytest.fixture def app(request): app = flask.Flask(...
<vulnerable_code> class TestSimpleCache(GenericCacheTests): @pytest.fixture def make_cache(self): return backends.SimpleCache def test_purge(self): c = backends.SimpleCache(threshold=2) class TestFileSystemCache(GenericCacheTests): @pytest.fixture def make_cache(self, tmpdir): ...
<vulnerable_code> BOTOCORE_PRESENT = False VERSION = "1.34.3" SERVICE = "elasticfilesystem" AMAZON_LINUX_2_RELEASE_ID = "Amazon Linux release 2 (Karoo)" return lower_bound, upper_bound def choose_tls_port_and_get_bind_sock(config, options): if "tlsport" in options: ports_to_try = [int(options["t...
<vulnerable_code> AMAZON_LINUX_2_RELEASE_ID, AMAZON_LINUX_2_PRETTY_NAME, ] VERSION = "1.34.3" SERVICE = "elasticfilesystem" CONFIG_FILE = "/etc/amazon/efs/efs-utils.conf"<commit_title>[PATCH] Fix potential tlsport selection collision by using state<commit_description><fixed_code> AMAZON_LINUX_2_RELEASE_ID,...
<vulnerable_code> mocker.patch("mount_efs.create_certificate") mocker.patch("os.rename") mocker.patch("os.kill") process_mock = MagicMock() process_mock.communicate.return_value = ( ) mocker.patch("mount_efs.write_tls_tunnel_state_file", return_value="~mocktempfile") mocker.patch("os.kil...
<vulnerable_code># Licensed under the MIT License. See the LICENSE accompanying this file # for the specific language governing permissions and limitations under # the License. import random import socket from unittest.mock import MagicMock import pytest return config def test_choose_tls_port_first_try(mocker):...
<vulnerable_code> for (ptr = db->head; (NULL != ptr) #if KEEP_NIS_AT_END && (NULL != ptr->line) && ( ('+' != ptr->line[0]) && ('-' != ptr->line[0])) #endif ; ptr = ptr->next) { n++; } #if KEEP_NIS_AT_END if ((NULL != ptr) && (NULL != ptr->line)) { nis = ptr; } #endif<...
<vulnerable_code> presult->flags |= parg->flags; checktype(presult, L_ABSOLUTE); checktype(parg, L_ABSOLUTE); presult->value /= parg->value; } void oprlist(struct result* presult, struct result* parg)<commit_title>[PATCH] Prevent division by zero.<commit_description>Under specific test cases, the application co...
<vulnerable_code> # unroutable addresses. self.url_preview_ip_range_blacklist = generate_ip_set( config["url_preview_ip_range_blacklist"], ["0.0.0.0/8", "::"], config_path=("url_preview_ip_range_blacklist",), ) <commit_title>[PATCH] Reve...
<vulnerable_code> # Always blacklist 0.0.0.0, :: self.ip_range_blacklist = generate_ip_set( ip_range_blacklist, ["0.0.0.0/8", "::"], config_path=("ip_range_blacklist",) ) self.ip_range_whitelist = generate_ip_set( # Always blacklist 0.0.0.0, :: self.federatio...
<vulnerable_code> return -EPROTONOSUPPORT; hu->proto = p; set_bit(HCI_UART_PROTO_READY, &hu->flags); err = hci_uart_register_dev(hu); if (err) { clear_bit(HCI_UART_PROTO_READY, &hu->flags); return err; } return 0; } <commit_title>[PATCH] Bluetooth: hci_ldisc: Postpone HCI_UART_PROTO_READY bit set<commit_d...
<vulnerable_code> # Retrieve the latest, remote root.json *WITHOUT* verifying it just yet. # We will verify it soon if all goes well. latest_root_metadata_file = self._get_file( 'root.json', lambda f: True, 'meta', DEFAULT_ROOT_UPPERLENGTH, download_safely=False) latest_root_metadata = s...
<vulnerable_code> spaceCharacters = "".join(spaceCharacters) quoteAttributeSpec = re.compile("[" + spaceCharacters + "\"'=<>`]") try: from codecs import register_error, xmlcharrefreplace_errors class HTMLSerializer(object): # attribute quoting options quote_attr_values = False quote_char = '"' us...
<vulnerable_code> throwsWithLatin1([["Comment", "\u0101"]]) @pytest.fixture def lxml_parser(): return etree.XMLParser(resolve_entities=False)<commit_title>[PATCH] Fix #11, #12: quote attributes that need escaping in legacy<commit_description><fixed_code> throwsWithLatin1([["Comment", "\u0101"]]) @pytest....
<vulnerable_code> sockfd_put(csock); return err; } err = hidp_connection_add(&ca, csock, isock); if (!err && copy_to_user(argp, &ca, sizeof(ca)))<commit_title>[PATCH] Bluetooth: hidp: fix buffer overflow<commit_description>Struct ca is copied from userspace. It is not checked whether the "name" field is NUL...
<vulnerable_code><commit_title>[PATCH] tests for Fli OOB reads<commit_description><fixed_code> #!/usr/bin/env python from PIL import Image repro_ss2 = ('images/fli_oob/06r/06r00.fli', 'images/fli_oob/06r/others/06r01.fli', 'images/fli_oob/06r/others/06r02.fli', 'images/fli_oob/0...
<vulnerable_code> if not current_user.role_edit_shelfs() and to_save.get("is_public") == "on": flash(_(u"Sorry you are not allowed to create a public shelf"), category="error") return redirect(url_for('web.index')) shelf.is_public = 1 if to_save.get("is_public") else 0 if ...
<vulnerable_code> row.getColumnValueAsString('C1'), JSON.stringify({a: 1})); // object assert.deepStrictEqual(row.getColumnValue('C2'), {a: 1}); assert.strictEqual( row.getColumnValueAsString('C2'), JSON.stringify({a: 1})); // array assert.deepS...
<vulnerable_code> free(result[--i]); } free(result); free(copy); return NULL; } result = tmp;<commit_title>[PATCH] Remove double free() in contrib/shpsrt, issue #39<commit_description>This fixes issue #39<fixed_code> free(result[--i]); } free(result); return NULL; ...
<vulnerable_code> threshold_image=CloneImage(image,0,0,MagickTrue,exception); if (threshold_image == (Image *) NULL) return((Image *) NULL); if (width == 0) return(threshold_image); status=SetImageStorageClass(threshold_image,DirectClass,exception); if (status == MagickFalse)<commit_title>[PATCH] https...
<vulnerable_code> Gif_DeleteArray(gfc.suffix); Gif_DeleteArray(gfc.length); gfc.gfi = 0; if (gfs) gfs->errors = gfc.errors[1];<commit_title>[PATCH] gif_read: Set last_name = NULL unconditionally.<commit_description>With a non-malicious GIF, last_name is set to NULL when a name extension is followed by an im...
<vulnerable_code> case BT_LEAD##n: \ if (end - ptr < n) \ return XML_TOK_PARTIAL_CHAR; \ if (! IS_NAME_CHAR(enc, ptr, n)) { ...
<vulnerable_code> if (rex.input == rex.line) { // backup to last char of previous line --rex.lnum; rex.line = reg_getline(rex.lnum); // Just in case regrepeat() didn't count<commit_title>[PATCH] patch 8.2.4440: crash with specific regexp pattern and string<commit_description>Problem: Cra...
<vulnerable_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 4439, /**/<commit_title>[PATCH] patch 8.2.4440: crash with specific regexp pattern and string<commit_description>Problem: Crash with specific regexp pattern and string. Solution: Stop at the start of the strin...
<vulnerable_code>import java.util.Set; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import jadx.core.utils.exceptions.JadxRuntimeException; import jadx.core.utils.files.FileUtils; import jadx.core.xmlgen.ResContaine...
<vulnerable_code> private List<GHPoint> getPointsFromRequest(HttpServletRequest httpServletRequest, String profile) { String url = httpServletRequest.getRequestURI(); String urlStart = "/navigate/directions/v5/gh/" + profile + "/"; int index = url.indexOf(urlStart); if (index < 0) thr...
<vulnerable_code> rcu_read_lock(); indev = __in_dev_get_rcu(skb->dev); if (indev != NULL) { ifa = indev->ifa_list; newdst = ifa->ifa_local; }<commit_title>[PATCH] netfilter: nf_nat_redirect: add missing NULL pointer check<commit_description>Commit 8b13eddfdf04cbfa561725cfc42d6868fe896f56 ("netfilter: refa...
<vulnerable_code>int wmain(int argc, wchar_t **wargv) { // Convert our argument list from UTF-16 to UTF-8. char **argv = (char **)malloc(argc * sizeof(char *)); if (!argv) { fprintf(stderr, "malloc(): %s\n", strerror(errno)); exit(1); } for (int i = 0; i < argc; i++) { ...
<vulnerable_code> do { \ char *binary = byte_to_binary(byte); \ if (NULL == binary) { \ fprintf(stderr, "Malloc failed in DEBUG_BINARY\n"); \ abort(); ...
<vulnerable_code>import os import re import smtplib from email.mime.application import MIMEApplication from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText if attempt < self.smtp_retry_limit: continue raise AirflowException("...
<vulnerable_code>from airflow.providers.smtp.hooks.smtp import SmtpHook from airflow.utils import db from airflow.utils.session import create_session smtplib_string = "airflow.providers.smtp.hooks.smtp.smtplib" ) @patch(smtplib_string) def test_connect_and_disconnect(self, mock_smtplib): mock...
<vulnerable_code> sizeof(*clone_image->colormap)); if (clone_image->colormap == (PixelInfo *) NULL) { clone_image=DestroyImage(clone_image); ThrowImageException(ResourceLimitError,"MemoryAllocationFailed"); } (void) CopyMagickMemory(clone_image->colormap,image->col...
<vulnerable_code>from redash.utils import json_loads, query_is_select_no_limit, add_limit_to_query from rq.timeouts import JobTimeoutException from redash.utils.requests_session import requests, requests_session logger = logging.getLogger(__name__) return query_text def is_private_address(url): hos...
<vulnerable_code>import logging import yaml import requests import io from redash import settings from redash.query_runner import * from redash.utils import json_dumps args.pop('url', None) ua = args['user-agent'] args.pop('user-agent', None) if is_private_address(path...
<vulnerable_code>import yaml import datetime from funcy import compact, project from redash import settings from redash.utils import json_dumps from redash.query_runner import ( BaseHTTPQueryRunner, TYPE_FLOAT, TYPE_INTEGER, TYPE_STRING, is_private_address, ) if "url" not in query: ...
<vulnerable_code>import requests from redash import settings class ConfiguredSession(requests.Session): def request(self, *args, **kwargs): if not settings.REQUESTS_ALLOW_REDIRECTS: kwargs.update({"allow_redirects": False})<commit_title>[PATCH] Merge pull request from GHSA-fcpv-hgq6-87h7<commi...
<vulnerable_code>import mock from unittest import TestCase from redash.utils.requests_session import requests, ConfiguredSession from redash.query_runner import BaseHTTPQueryRunner mock_response = mock.Mock() mock_response.status_code = 500 mock_response.text = "Server Error" http_err...
<vulnerable_code> case 0: { /* String */ char* str = (char*) (buf+i); i += strlen (str); sprintf (name, "str: \"%s\"", str); break; } case 1: { /* Floating point */<commit_title>[PATCH] patch Heap overflow<commit_description><fixed_code> case 0: { /* String */ char* str = (char*)...
<vulnerable_code>{ OPJ_UINT32 l_data_size; /* The +1 is needed for https://github.com/uclouvain/openjpeg/issues/835 */ l_data_size = 1 + (OPJ_UINT32)((p_code_block->x1 - p_code_block->x0) * (p_code_block->y1 - p_code_block->y0) * (OPJ_INT32)sizeof(OPJ_UINT32)); if (l...
<vulnerable_code> wait_event_interruptible(*wq, !vcpu->arch.pause); } /** * kvm_arch_vcpu_ioctl_run - the main VCPU run function to execute guest code * @vcpu: The VCPU pointer int ret; sigset_t sigsaved; /* Make sure they initialize the vcpu with KVM_ARM_VCPU_INIT */ if (unlikely(vcpu->arch.target < 0)) retu...
<vulnerable_code> * is appended to the sequence header to allow guard * against poor streaming servers */ /* XXX, should this be done using the packetizer ? */ p_enc->fmt_out.p_extra = malloc( len + sizeof( eos ) ); if(...
<vulnerable_code> g_source_remove(client->remote->auth_timeout); } client->remote->auth_timeout = 0; } return 0; } &lrmd_remote_fd_cb); g_hash_table_insert(client_connections, new_client->id, new_client); /* Alert other clients ...
<vulnerable_code> for (; i < filterObjectArray->GetLength(); ++i) { PDFObjectCastPtr<PDFName> filterObjectItem(filterObjectArray->QueryObject(i)); if (filterObjectItem->GetValue() == "Crypt") break; } if (i < filterObjectArray->GetLength()) {<commit_title>[PATCH] Fix a segfault through returning...
<vulnerable_code> if(idArray.GetPtr() && idArray->GetLength() == 2) { PDFObjectCastPtr<PDFHexString> firstID = idArray->QueryObject(0); if(firstID.GetPtr()) mModifiedDocumentID = firstID->GetValue(); } <commit_title>[PATCH] Fix a segfault through returning null in QueryObject<comm...
<vulnerable_code> RefCountPtr<PDFObject> lowerLeftY(inPDFArray->QueryObject(1)); RefCountPtr<PDFObject> upperRightX(inPDFArray->QueryObject(2)); RefCountPtr<PDFObject> upperRightY(inPDFArray->QueryObject(3)); outPDFRectangle.LowerLeftX = ParsedPrimitiveHelper(lowerLeftX.GetPtr()).GetAsDouble(); outPDFRectangle.Lo...
<vulnerable_code> GF_TrackBox *ptr = (GF_TrackBox *)s; if (ptr->sample_encryption && ptr->sample_encryption->load_needed) { GF_Err e = senc_Parse(ptr->moov->mov->movieFileMap->bs, ptr, NULL, ptr->sample_encryption); if (e) return e; }<commit_title>[PATCH] fixed #1757<commit_description><fixed_code> GF_TrackBox ...
<vulnerable_code> tmp = Sprintf("<INPUT_ALT hseq=\"%d\" fid=\"%d\" name=\"%s\" type=\"%s\" value=\"%s\">", obuf->input_alt.hseq, obuf->input_alt.fid, obuf->input_alt.name->ptr, obuf->input_alt.type->ptr, obuf->input_alt.value->ptr); push_tag(obuf, tmp->ptr, HTML_INPUT_ALT); } ...
<vulnerable_code> /* Update the firewall for running applications matching the application ID. */ bool DBusService::firewallApp(const QString& appName, const QString& state) { logger.debug() << "Setting" << appName << "to firewall state" << state; // Update the split tunnelling state for any running apps. /* Upda...
<vulnerable_code>from zoneinfo import ZoneInfo import django_filters from django.db import transaction from django.db.models import ( Exists, F, OuterRef, Prefetch, Q, Subquery, prefetch_related_objects, ftype, ignored = mimetypes.guess_type(image_file.name) extension = os.path.basename(ima...
<vulnerable_code> file = BytesIO(data['content']) try: image = Image.open(file) # verify() must be called immediately after the constructor. image.verify() # We want to do more than just verify(), so we need to re-open the file if hasa...
<vulnerable_code> @property def is_image(self): return any(self.file.name.lower().endswith(e) for e in ('.jpg', '.png', '.gif', '.tiff', '.bmp', '.jpeg')) @property def file_name(self):<commit_title>[PATCH] [SECURITY] Do not allow Pillow to parse EPS files<commit_description><fixed_code> @...
<vulnerable_code> else: a = op.answers.filter(question_id=question_id).first() or a if not a or not a.file or not any(a.file.name.lower().endswith(e) for e in (".jpg", ".jpeg", ".png", ".gif", ".bmp", ".tif", ".tiff")): return None else: if etag:<commit_title>...
<vulnerable_code> 'form_class': ExtFileField, 'form_kwargs': dict( label=_('Header image'), ext_whitelist=(".png", ".jpg", ".gif", ".jpeg"), max_size=settings.FILE_UPLOAD_MAX_SIZE_IMAGE, help_text=_('If you provide a logo image, we will by default not show ...
<vulnerable_code> @property def is_img(self): return any(self.file.name.lower().endswith(e) for e in ('.jpg', '.jpeg', '.png', '.gif')) def __str__(self): if hasattr(self.file, 'display_name'):<commit_title>[PATCH] [SECURITY] Do not allow Pillow to parse EPS files<commit...
<vulnerable_code> organizer_logo_image = ExtFileField( label=_('Header image'), ext_whitelist=(".png", ".jpg", ".gif", ".jpeg"), max_size=settings.FILE_UPLOAD_MAX_SIZE_IMAGE, required=False, help_text=_('If you provide a logo image, we will by default not show your organizati...
<vulnerable_code>import logging from io import BytesIO from django.core.exceptions import ValidationError from django.utils.translation import gettext_lazy as _ from PIL.Image import MAX_IMAGE_PIXELS, DecompressionBombError try: try: image = Image.open(file) # verify() must be call...