text
stringlengths
79
3.72M
<vulnerable_code>/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ /* * lsquic_str.c *<commit_title>[PATCH] Release 3.1.0<commit_description><fixed_code> /* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICENSE. */ /* * lsquic_str.c *
<vulnerable_code>/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ /* * lsquic_stream.c -- stream processing */<commit_title>[PATCH] Release 3.1.0<commit_description><fixed_code> /* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICENSE. */ /* * lsquic_stream.c -- stream processin...
<vulnerable_code>/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ #include <assert.h> #include <stddef.h> #include <stdlib.h><commit_title>[PATCH] Release 3.1.0<commit_description><fixed_code> /* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICENSE. */ #include <assert.h> #include...
<vulnerable_code>/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ /* * lsquic_varint.c -- routines dealing with IETF QUIC varint. */<commit_title>[PATCH] Release 3.1.0<commit_description><fixed_code> /* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICENSE. */ /* * lsquic_varint...
<vulnerable_code>/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ /* xxHash - Fast Hash algorithm Copyright (C) 2012-2014, Yann Collet.<commit_title>[PATCH] Release 3.1.0<commit_description><fixed_code> /* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICENSE. */ /* xxHash - Fast H...
<vulnerable_code>/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ /* * This is not really a test: this program prints out cwnd histogram * for visual inspection.<commit_title>[PATCH] Release 3.1.0<commit_description><fixed_code> /* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LI...
<vulnerable_code>/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ /* * Convert from our hexdump format to binary: *<commit_title>[PATCH] Release 3.1.0<commit_description><fixed_code> /* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICENSE. */ /* * Convert from our hexdump forma...
<vulnerable_code>/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ /* Test both generation and parsing of IETF ACK frames */ #include <assert.h><commit_title>[PATCH] Release 3.1.0<commit_description><fixed_code> /* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICENSE. */ /* Test b...
<vulnerable_code>/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ /* Test ACK merge */ #include <assert.h><commit_title>[PATCH] Release 3.1.0<commit_description><fixed_code> /* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICENSE. */ /* Test ACK merge */ #include <assert.h>
<vulnerable_code>/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ /* * Test how ACK frame is encoded. Receive history module is tested by a * separate unit test.<commit_title>[PATCH] Release 3.1.0<commit_description><fixed_code> /* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See L...
<vulnerable_code>/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ #include <assert.h> #include <stdlib.h> #include <sys/queue.h><commit_title>[PATCH] Release 3.1.0<commit_description><fixed_code> /* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICENSE. */ #include <assert.h> #incl...
<vulnerable_code>/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ /* Test adapted from Chromium bandwidth_sampler_test.cc */ // Copyright 2016 The Chromium Authors. All rights reserved. <commit_title>[PATCH] Release 3.1.0<commit_description><fixed_code> /* Copyright (c) 2017 - 2022 LiteSpeed Te...
<vulnerable_code>/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ /* * test_chlo_gen.c -- Test Client Hello generation. */<commit_title>[PATCH] Release 3.1.0<commit_description><fixed_code> /* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICENSE. */ /* * test_chlo_gen.c -- Test...
<vulnerable_code>/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ #include <assert.h> #include <stdint.h> #include <stdio.h><commit_title>[PATCH] Release 3.1.0<commit_description><fixed_code> /* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICENSE. */ #include <assert.h> #include ...
<vulnerable_code>/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ /* * test_dec.c -- Benchmark decryption using aligned and non-aligned buffers. */<commit_title>[PATCH] Release 3.1.0<commit_description><fixed_code> /* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICENSE. */ /* ...
<vulnerable_code>/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ /* * Test the "nocopy" data in stream */<commit_title>[PATCH] Release 3.1.0<commit_description><fixed_code> /* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICENSE. */ /* * Test the "nocopy" data in stream */
<vulnerable_code>/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ #include <assert.h> #include <stdlib.h> #include <string.h><commit_title>[PATCH] Release 3.1.0<commit_description><fixed_code> /* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICENSE. */ #include <assert.h> #include...
<vulnerable_code>/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ /* * Write several things to HEADERS stream and check the results. What * varies is the amount of bytes that are written to stream every time.<commit_title>[PATCH] Release 3.1.0<commit_description><fixed_code> /* Copyright (c)...
<vulnerable_code>/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ /* * Generate a few thousand headers, frame them using frame writer, read them * using frame reader, parse them, and compare with the original list: the<commit_title>[PATCH] Release 3.1.0<commit_description><fixed_code> /* Copy...
<vulnerable_code>/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ /* * test_h3_framing.c -- test generation of H3 frames */<commit_title>[PATCH] Release 3.1.0<commit_description><fixed_code> /* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICENSE. */ /* * test_h3_framing.c -- t...
<vulnerable_code>/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ #include <assert.h> #include <string.h> #include <openssl/ssl.h><commit_title>[PATCH] Release 3.1.0<commit_description><fixed_code> /* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICENSE. */ #include <assert.h> #in...
<vulnerable_code>/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ /* Test min heap or benchmark heap creation */ /* Floyd mechanism has been removed. It's not faster. */<commit_title>[PATCH] Release 3.1.0<commit_description><fixed_code> /* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc....
<vulnerable_code>/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ /* Tests adopted from Chromium windowed_filter_test.cc */ // Copyright (c) 2016 The Chromium Authors. All rights reserved. <commit_title>[PATCH] Release 3.1.0<commit_description><fixed_code> /* Copyright (c) 2017 - 2022 LiteSpeed...
<vulnerable_code>/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ /* Test packet resizing */ #include <assert.h><commit_title>[PATCH] Release 3.1.0<commit_description><fixed_code> /* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICENSE. */ /* Test packet resizing */ #include <as...
<vulnerable_code>/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ /* * test_send_headers.c -- Test what happens when lsquic_stream_send_headers() * is called.<commit_title>[PATCH] Release 3.1.0<commit_description><fixed_code> /* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICEN...
<vulnerable_code>/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ #include <assert.h> #include <stdio.h> #include <stdint.h><commit_title>[PATCH] Release 3.1.0<commit_description><fixed_code> /* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICENSE. */ #include <assert.h> #include ...
<vulnerable_code>/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ /* Tests in this file have been migrated out of maintest.c */ /* TODO: fix warnings */ <commit_title>[PATCH] Release 3.1.0<commit_description><fixed_code> /* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICENSE. */ ...
<vulnerable_code>/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ /* * test_trapa.c -- Test transport parameters. */<commit_title>[PATCH] Release 3.1.0<commit_description><fixed_code> /* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICENSE. */ /* * test_trapa.c -- Test transpor...
<vulnerable_code>/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ /* Tests based on rechist tests */ #include <assert.h><commit_title>[PATCH] Release 3.1.0<commit_description><fixed_code> /* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICENSE. */ /* Tests based on rechist tests ...
<vulnerable_code>/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ #include <assert.h> #include <stddef.h> #include <stdint.h><commit_title>[PATCH] Release 3.1.0<commit_description><fixed_code> /* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICENSE. */ #include <assert.h> #include...
<vulnerable_code> 'pytz', 'pyOpenSSL', 'python-dateutil', 'six' ] <commit_title>[PATCH] Fix XXE in XML parsing (related to #366)<commit_description>This fixes XXE issues on anything where pysaml2 parses XML directly as part of issue #366. It doesn't address the xmlsec issues discussed on that ticket as t...
<vulnerable_code> import cElementTree as ElementTree except ImportError: from elementtree import ElementTree root_logger = logging.getLogger(__name__) root_logger.level = logging.NOTSET """ if not isinstance(xml_string, six.binary_type): xml_string = xml_string.encode('utf-8') tr...
<vulnerable_code> import cElementTree as ElementTree except ImportError: from elementtree import ElementTree NAMESPACE = "http://schemas.xmlsoap.org/soap/envelope/" FORM_SPEC = """<form method="post" action="%s"> :param text: The SOAP object as XML :return: header parts and body as saml.saml...
<vulnerable_code> except ImportError: #noinspection PyUnresolvedReferences from elementtree import ElementTree logger = logging.getLogger(__name__) :param expected_tags: What the tag of the SAML thingy is expected to be. :return: SAML thingy as a string """ envelope = ElementTree.fr...
<vulnerable_code> import cElementTree as ElementTree except ImportError: from elementtree import ElementTree ITEMS = { NameID: ["""<?xml version="1.0" encoding="utf-8"?> assert kl == None def test_ee_1(): ee = saml2.extension_element_from_string( """<?xml version='1.0' encoding...
<vulnerable_code> import cElementTree as ElementTree except ImportError: from elementtree import ElementTree import saml2.samlp as samlp from saml2.samlp import NAMESPACE as SAMLP_NAMESPACE NAMESPACE = "http://schemas.xmlsoap.org/soap/envelope/" assert len(body) == 1 saml_part = body[0] ...
<vulnerable_code>from future.backports.urllib.parse import parse_qs from future.backports.urllib.parse import urlencode from future.backports.urllib.parse import urlparse from saml2.argtree import add_path from saml2.cert import OpenSSLWrapper from saml2.authn_context import INTERNETPROTOCOLPASSWORD from saml2.client ...
<vulnerable_code>) from langchain.document_loaders.epub import UnstructuredEPubLoader from langchain.document_loaders.evernote import EverNoteLoader from langchain.document_loaders.facebook_chat import FacebookChatLoader from langchain.document_loaders.figma import FigmaFileLoader from langchain.document_loaders.gcs_di...
<vulnerable_code><commit_title>[PATCH 02/23] Fixed multi input prompt for MapReduceChain (#4979)<commit_description># Fixed multi input prompt for MapReduceChain Added `kwargs` support for inner chains of `MapReduceChain` via `from_params` method Currently the `from_method` method of intialising `MapReduceChain` chain...
<vulnerable_code>""" from __future__ import annotations from typing import Any, Dict, List, Optional from pydantic import Extra prompt: BasePromptTemplate, text_splitter: TextSplitter, callbacks: Callbacks = None, **kwargs: Any, ) -> MapReduceChain: """Construct a map-redu...
<vulnerable_code> """Return the 3 most salient high-level questions about recent observations.""" prompt = PromptTemplate.from_template( "{observations}\n\n" + "Given only the information above, what are the 3 most salient" + " high-level questions we can answer about ...
<vulnerable_code> def get_tools(self) -> List[BaseTool]: """Get the tools in the toolkit.""" return [ QuerySQLDataBaseTool(db=self.db), InfoSQLDatabaseTool(db=self.db), ListSQLDatabaseTool(db=self.db), QueryCheckerTool(db=self.db, llm=self.llm), ...
<vulnerable_code> name = "schema_sql_db" description = """ Input to this tool is a comma-separated list of tables, output is the schema and sample rows for those tables. Be sure that the tables actually exist by calling list_tables_sql_db first! Example Input: "table1, table2, table3" """<commi...
<vulnerable_code> attachment_texts = self.process_attachment(page["id"]) else: attachment_texts = [] text = BeautifulSoup( page["body"]["storage"]["value"], "lxml" ).get_text() + "".join(attachment_texts) if include_comments: comments = self...
<vulnerable_code>class ConfluenceLoader(BaseLoader): """ Load Confluence pages. Port of https://llamahub.ai/l/confluence This currently supports both username/api_key and Oauth2 login. Specify a list page_ids and/or space_key to load in the corresponding pages into Document objects, if both are spe...
<vulnerable_code> if run_manager: run_manager.on_text(str(plan), verbose=self.verbose) for step in plan.steps: _new_inputs = {"previous_steps": self.step_container, "current_step": step} new_inputs = {**_new_inputs, **inputs} response = self.executor.step( ...
<vulnerable_code> {agent_scratchpad}""" def load_agent_executor( llm: BaseLanguageModel, tools: List[BaseTool], verbose: bool = False ) -> ChainExecutor: agent = StructuredChatAgent.from_llm_and_tools( llm, tools, human_message_template=HUMAN_MESSAGE_TEMPLATE, input_variables=[...
<vulnerable_code> from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler DEFAULT_ANSWER_PREFIX_TOKENS = ["\nFinal", " Answer", ":"] class FinalStreamingStdOutCallbackHandler(StreamingStdOutCallbackHandler): Only the final output of the agent will be streamed. """ def __init__(se...
<vulnerable_code> chat = self.client.start_chat(context=context, **self._default_params) for pair in history.history: chat._history.append((pair.question.content, pair.answer.content)) response = chat.send_message(question.content) text = self._enforce_stop_words(response.text...
<vulnerable_code> def program(self, *items: Any) -> tuple: return items def func_call(self, func_name: Any, *args: Any) -> FilterDirective: func = self._match_func_name(str(func_name)) if isinstance(func, Comparator): return Comparison(comparator=func, attribute=args[0][0], v...
<vulnerable_code> actual = parsed.value expected = x.lower() == "true" assert actual == expected<commit_title>[PATCH 02/23] Fixed multi input prompt for MapReduceChain (#4979)<commit_description># Fixed multi input prompt for MapReduceChain Added `kwargs` support for inner chains of `MapReduceChain` via `fr...
<vulnerable_code>from langchain.chains.pal.base import PALChain from langchain.requests import TextRequestsWrapper from langchain.tools.arxiv.tool import ArxivQueryRun from langchain.tools.base import BaseTool from langchain.tools.bing_search.tool import BingSearchRun from langchain.tools.ddg_search.tool import DuckDuc...
<vulnerable_code>from langchain.retrievers.knn import KNNRetriever from langchain.retrievers.metal import MetalRetriever from langchain.retrievers.pinecone_hybrid_search import PineconeHybridSearchRetriever from langchain.retrievers.remote_retriever import RemoteLangChainRetriever from langchain.retrievers.self_query.b...
<vulnerable_code><commit_title>[PATCH 02/23] Fixed multi input prompt for MapReduceChain (#4979)<commit_description># Fixed multi input prompt for MapReduceChain Added `kwargs` support for inner chains of `MapReduceChain` via `from_params` method Currently the `from_method` method of intialising `MapReduceChain` chain...
<vulnerable_code> ListPowerBITool, QueryPowerBITool, ) from langchain.tools.scenexplain.tool import SceneXplainTool from langchain.tools.shell.tool import ShellTool from langchain.tools.steamship_image_generation import SteamshipImageGenerationTool "tool", "YouTubeSearchTool", "BraveSearch", ]<commit...
<vulnerable_code><commit_title>[PATCH 02/23] Fixed multi input prompt for MapReduceChain (#4979)<commit_description># Fixed multi input prompt for MapReduceChain Added `kwargs` support for inner chains of `MapReduceChain` via `from_params` method Currently the `from_method` method of intialising `MapReduceChain` chain...
<vulnerable_code>from langchain.utilities.metaphor_search import MetaphorSearchAPIWrapper from langchain.utilities.openweathermap import OpenWeatherMapAPIWrapper from langchain.utilities.powerbi import PowerBIDataset from langchain.utilities.python import PythonREPL from langchain.utilities.searx_search import SearxSea...
<vulnerable_code><commit_title>[PATCH 02/23] Fixed multi input prompt for MapReduceChain (#4979)<commit_description># Fixed multi input prompt for MapReduceChain Added `kwargs` support for inner chains of `MapReduceChain` via `from_params` method Currently the `from_method` method of intialising `MapReduceChain` chain...
<vulnerable_code><commit_title>[PATCH 02/23] Fixed multi input prompt for MapReduceChain (#4979)<commit_description># Fixed multi input prompt for MapReduceChain Added `kwargs` support for inner chains of `MapReduceChain` via `from_params` method Currently the `from_method` method of intialising `MapReduceChain` chain...
<vulnerable_code><commit_title>[PATCH 02/23] Fixed multi input prompt for MapReduceChain (#4979)<commit_description># Fixed multi input prompt for MapReduceChain Added `kwargs` support for inner chains of `MapReduceChain` via `from_params` method Currently the `from_method` method of intialising `MapReduceChain` chain...
<vulnerable_code> "tool", "YouTubeSearchTool", "BraveSearch", ] <commit_title>[PATCH 02/23] Fixed multi input prompt for MapReduceChain (#4979)<commit_description># Fixed multi input prompt for MapReduceChain Added `kwargs` support for inner chains of `MapReduceChain` via `from_params` method Currently the...
<vulnerable_code> List, Optional, Tuple, Union, ) from langchain.vectorstores.base import VectorStore if TYPE_CHECKING: from pymongo import MongoClient logger = logging.getLogger(__name__) from pymongo import MongoClient mongo_client = MongoClient("<YOUR-CONNECTION-STRING...
<vulnerable_code> import os from time import sleep from typing import TYPE_CHECKING, Optional import pytest CONNECTION_STRING = os.environ.get("MONGODB_ATLAS_URI") DB_NAME, COLLECTION_NAME = NAMESPACE.split(".") def get_test_client() -> Optional[MongoClient]: try: from pymongo import MongoClient ...
<vulnerable_code> values["client"] = cohere.Client(cohere_api_key) except ImportError: raise ImportError( "Could not import cohere python package. " "Please install it with `pip install cohere`." )<commit_title>[PATCH 02/23] Fixed multi input p...
<vulnerable_code> **kwargs, ) @classmethod def get_connection_string(cls, kwargs: Dict[str, Any]) -> str: connection_string: str = get_from_dict_or_env(<commit_title>[PATCH 02/23] Fixed multi input prompt for MapReduceChain (#4979)<commit_description># Fixed multi input prompt for Ma...
<vulnerable_code>from langchain.callbacks.argilla_callback import ArgillaCallbackHandler from langchain.callbacks.clearml_callback import ClearMLCallbackHandler from langchain.callbacks.comet_ml_callback import CometCallbackHandler from langchain.callbacks.human import HumanApprovalCallbackHandler from langchain.callba...
<vulnerable_code><commit_title>[PATCH 02/23] Fixed multi input prompt for MapReduceChain (#4979)<commit_description># Fixed multi input prompt for MapReduceChain Added `kwargs` support for inner chains of `MapReduceChain` via `from_params` method Currently the `from_method` method of intialising `MapReduceChain` chain...
<vulnerable_code>"""Handle chained inputs.""" from typing import Dict, List, Optional _TEXT_COLOR_MAPPING = { "blue": "36;1", return f"\033[1m{text}\033[0m" def print_text(text: str, color: Optional[str] = None, end: str = "") -> None: """Print text with highlighting and no end characters.""" if colo...
<vulnerable_code> ) yt = YouTube(f"https://www.youtube.com/watch?v={self.video_id}") video_info = { "title": yt.title, "description": yt.description, "view_count": yt.views, "thumbnail_url": yt.thumbnail_url, "publish_date": yt.publi...
<vulnerable_code> except neo4j.exceptions.ClientError: raise ValueError( "Could not use APOC procedures. " "Please install the APOC plugin in Neo4j." ) @property<commit_title>[PATCH 02/23] Fixed multi input prompt for MapReduceChain (#4979)<commit_desc...
<vulnerable_code> strict); } /* check whether memory at (regno + off) is accessible for t = (read | write) * if t==write, value_regno is a register which value is stored into memory * if t==read, value_regno is a register which will receive the value from memory if (!err && size < BPF_REG_SIZE && value_regno...
<vulnerable_code> var slash = '/'; var backslash = /\\/g; var enclosure = /[\{\[].*[\/]*.*[\}\]]$/; var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/; var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g; <commit_title>[PATCH] fix: eliminate ReDoS<commit_description>This change fixes a regular expression denial of service vulnerabilit...
<vulnerable_code> done(); }); }); if (isWin32) {<commit_title>[PATCH] fix: eliminate ReDoS<commit_description>This change fixes a regular expression denial of service vulnerability. Refs: https://github.com/gulpjs/glob-parent/issues/32 Refs: https://app.snyk.io/vuln/SNYK-JS-GLOBPARENT-1016905<fixed_code> d...
<vulnerable_code> for (i = 0; i < image->numcomps-1; i++) { if ((image->comps[0].dx != image->comps[i+1].dx) ||(image->comps[0].dy != image->comps[i+1].dy) ||(image->comps[0].prec != image->comps[i+1].prec)) { fclose(fdest); fprintf(stderr, "Unable to c...
<vulnerable_code> FILE *fdest = NULL; int adjustR, adjustG, adjustB; if (image->comps[0].prec < 8) { fprintf(stderr, "Unsupported number of components: %d\n", image->comps[0].prec); return 1; } if (image->numcomps >= 3 && image->comps[0].dx == image->comps[1].dx<commit_title>[PATCH] ...
<vulnerable_code> if(dirptr->filename_buf) free(dirptr->filename_buf); free(dirptr); } if (numDecompressedImages) { fprintf(stdout, "decode time: %d ms\n", (int)( (tCumulative * 1000.0) / (OPJ_FLOAT64)numDecompressedImages)); } return failed ? EXIT_FAILURE : EXIT_SUCCESS;<commit_title>[PATCH] Changes for issue...
<vulnerable_code> i, l_img_comp->dx, l_img_comp->dy); return OPJ_FALSE; } if( l_img_comp->prec > 38) { /* TODO openjpeg won't handle more than ? */ opj_event_msg(p_manager, EVT_ERROR, ...
<vulnerable_code>{ if(!m_pDataFile) { return 0; } // load it if needed if(!m_pDataFile->m_ppDataPtrs[Index]) { void CDataFileReader::UnloadData(int Index) { if(Index < 0) return; //<commit_title>[PATCH] Add bound check in datafile.cpp anywhere m_ppDataPtrs is<commit_description><fixed_code> { if(!m_pDataFil...
<vulnerable_code> Mockito.when(lookup.lookup(ResourceProvider.class)) .thenReturn(resourceProvider); Mockito.when(context.getAttribute(Lookup.class.getName())) .thenReturn(lookup); getServlet().init(config);<commit_title>[PA...
<vulnerable_code> this._custom = {}; if (custom != null) { for (var key in custom) { if (custom.hasOwnProperty(key)){ this._custom['$' + key] = custom[key]; } } } else { for (var key in candidate) { if (candidate.hasOwnProperty(key)){ this._deeperArray(key); this._valida...
<vulnerable_code> for i in range(n): total += i return total # import dis; dis.dis(testfunc) opt = _testinternalcapi.get_uop_optimizer() with temporary_optimizer(opt): # for i, (opname, oparg) in enumerate(ex): # print(f"{i:4d}: {opname...
<vulnerable_code>#include "pycore_object.h" // _PyObject_GC_TRACK() #include "pycore_moduleobject.h" // PyModuleObject #include "pycore_opcode.h" // EXTRA_CASES #include "pycore_opcode_utils.h" // MAKE_FUNCTION_* #include "pycore_pyerrors.h" // _PyErr_GetRaisedException() #include "pycore_pystate.h...
<vulnerable_code> _Py_CODEUNIT *initial_instr = instr; int trace_length = 0; int max_length = buffer_size; #ifdef Py_DEBUG char *uop_debug = Py_GETENV("PYTHONUOPSDEBUG"); if (uop_debug != NULL && *uop_debug >= '0') { lltrace = *uop_debug - '0'; // TODO: Parse an int and all that } #defi...
<vulnerable_code> received from the proxy server to the CONNECT request sent to set the tunnel. If the CONNECT request was not sent, the method returns an empty dictionary. """ return ( _parse_header_lines(self._raw_proxy_headers) if self._raw_prox...
<vulnerable_code> headers = self.conn.get_proxy_response_headers() self.assertIn(expected_header, headers.items()) def test_tunnel_leak(self): sock = None <commit_title>[PATCH 04/19] gh-106446: Fix failed doctest in stdtypes (#106447)<commit_description><fixed_code> headers = self.co...
<vulnerable_code> _setSSLError(get_state_ctx(self), NULL, 0, __FILE__, __LINE__); return NULL; } /* bpo43522 and OpenSSL < 1.1.1l: copy hostflags manually */ #if !defined(LIBRESSL_VERSION_NUMBER) && OPENSSL_VERSION < 0x101010cf X509_VERIFY_PARAM *ssl_params = SSL_get0_param(self->ssl); ...
<vulnerable_code> add('"') return ''.join(text) def output_templates(self, f): parameters = list(f.parameters.values()) assert parameters assert isinstance(parameters[0].converter, self_converter) del parameters[0] requires_defining_class = False i...
<vulnerable_code> Package, ) from ._legacy import ( contents, open_binary, read_binary, open_text, read_text, is_resource, path, Resource, ) from .abc import ResourceReader __all__ = [ 'Package', 'Resource', 'ResourceReader', 'as_file', 'contents', 'files',...
<vulnerable_code>import functools import os import pathlib import types import warnings from typing import Union, Iterable, ContextManager, BinaryIO, TextIO, Any from . import _common Package = Union[types.ModuleType, str] Resource = str def deprecated(func): @functools.wraps(func) def wrapper(*args, **kwa...
<vulnerable_code> class OpcodeTests(unittest.TestCase): def test_stack_effect(self): self.assertEqual(stack_effect(dis.opmap['POP_TOP']), -1) self.assertEqual(stack_effect(dis.opmap['BUILD_SLICE'], 0), -1)<commit_title>[PATCH 04/19] gh-106446: Fix failed doctest in stdtypes (#106447)<commit_descrip...
<vulnerable_code>#include "Python.h" #include "opcode.h" #include "internal/pycore_code.h" /*[clinic input] _opcode.get_specialization_stats Return the specialization stats static PyMethodDef opcode_functions[] = { _OPCODE_STACK_EFFECT_METHODDEF _OPCODE_GET_SPECIALIZATION_STATS_METHODDEF {NULL, NULL, 0...
<vulnerable_code>#include "pycore_pystate.h" // _Py_GetConfig() #include "pycore_symtable.h" // PySTEntryObject, _PyFuture_FromAST() #include "pycore_opcode_metadata.h" // _PyOpcode_opcode_metadata, _PyOpcode_num_popped/pushed #define COMP_GENEXP 0 #define COMP_LISTCOMP 1 return stack_effect(opcode, ...
<vulnerable_code>#include "pycore_pymem.h" // _PyMem_IsPtrFreed() #include "pycore_opcode_utils.h" #define NEED_OPCODE_METADATA #include "pycore_opcode_metadata.h" // _PyOpcode_opcode_metadata, _PyOpcode_num_popped/pushed #undef NEED_OPCODE_METADATA #undef SUCCESS<commit_title>[PATCH 04/19] gh-106446: Fix fa...
<vulnerable_code> for name, value in flags.bitmask.items(): out.emit( f"#define OPCODE_{name[:-len('_FLAG')]}(OP) " f"(_PyOpcode_opcode_metadata[(OP)].flags & ({name}))") @dataclasses.dataclass self.write_provenance_header() self.write_pseud...
<vulnerable_code> def get_map(self): return self._map def _key_from_fd(self, fd): """Return the key associated to a given file descriptor. Parameters: fd -- file descriptor Returns: corresponding key, or None if not found """ try: ret...
<vulnerable_code> # See issues #9427, #1553375. Commented out for now. #if getattr(self, 'fullstack', False): # traceback.print_stack(tb.tb_frame.f_back, file=sio) traceback.print_exception(ei[0], ei[1], tb, None, sio) s = sio.getvalue() sio.close() if s[-1:] ==...
<vulnerable_code><commit_title>[PATCH 04/19] gh-106446: Fix failed doctest in stdtypes (#106447)<commit_description><fixed_code>
<vulnerable_code> # Verification that the jump goes past END_FOR # is done by manual inspection of the output if __name__ == "__main__": unittest.main()<commit_title>[PATCH 04/19] gh-106446: Fix failed doctest in stdtypes (#106447)<commit_description><fixed_code> # Verification that the jum...
<vulnerable_code> _PyListIterObject *it = (_PyListIterObject *)iter; assert(Py_TYPE(iter) == &PyListIter_Type); PyListObject *seq = it->it_seq; if (seq == NULL || it->it_index >= PyList_GET_SIZE(seq)) { exhausted = Py_True; } else { ...
<vulnerable_code> from clinic import DSLParser class FakeConverter: def __init__(self, name, args): self.name = name _module_and_class = clinic.Clinic._module_and_class class ClinicWholeFileTest(TestCase): def test_eol(self): # regression test: # clinic's block parser didn't r...