text
stringlengths
79
3.72M
<vulnerable_code># Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License...
<vulnerable_code>from airflow.utils.log.logging_mixin import LoggingMixin from airflow.utils.session import NEW_SESSION, provide_session from airflow.www.extensions.init_auth_manager import get_auth_manager from airflow.www.fab_security.sqla.manager import SecurityManager from airflow.www.utils import CustomSQLAInterfa...
<vulnerable_code>from airflow.utils.json import WebEncoder from airflow.utils.sqlalchemy import tuple_in_condition from airflow.utils.state import State, TaskInstanceState from airflow.www.forms import DateTimeWithTimezoneField from airflow.www.widgets import AirflowDateTimePickerWidget from sqlalchemy.sql import ...
<vulnerable_code> ) dashboard_alerts = [ fm for fm in settings.DASHBOARD_UIALERTS if fm.should_show(get_airflow_app().appbuilder.sm) ] def _iter_parsed_moved_data_table_names():<commit_title>[PATCH 04/11] Update es read query to not use body (#34792)<commit_description><fixe...
<vulnerable_code> # If not, store them as strings # And raise an exception if the field is not templateable forbidden_fields = set(inspect.signature(BaseOperator.__init__).parameters.keys()) if op.template_fields: for template_field in op.template_fields: if te...
<vulnerable_code> assert param.description == "hello" assert param.schema == {"type": "string"} def test_not_templateable_fields_in_serialized_dag( self, ): """ Test that when we use not templateable fields, an Airflow exception is raised. """ class Test...
<vulnerable_code> "readOnly": True, } in jmespath.search("spec.template.spec.containers[2].volumeMounts", docs[0]) @pytest.mark.parametrize( "airflow_version, expected_arg", [<commit_title>[PATCH 04/11] Update es read query to not use body (#34792)<commit_description><fixed_code>...
<vulnerable_code>from airflow_breeze.utils.cache import read_from_cache_file from airflow_breeze.utils.coertions import one_or_none_set from airflow_breeze.utils.common_options import ( argument_short_doc_packages_with_providers_index, option_airflow_constraints_reference, option_airflow_extras, option_...
<vulnerable_code>) from airflow_breeze.utils.ci_group import ci_group from airflow_breeze.utils.common_options import ( argument_packages, argument_short_doc_packages, argument_short_doc_packages_with_providers_index, option_airflow_constraints_mode_ci, option_airflow_constraints_mode_update, op...
<vulnerable_code>from pathlib import Path from airflow_breeze.utils.host_info_utils import Architecture from airflow_breeze.utils.path_utils import AIRFLOW_SOURCES_ROOT, PROVIDER_DEPENDENCIES_JSON_FILE_PATH RUNS_ON_PUBLIC_RUNNER = '["ubuntu-22.04"]' # we should get more sophisticated logic here in the future, but for...
<vulnerable_code>from dataclasses import dataclass from airflow_breeze.branch_defaults import AIRFLOW_BRANCH from airflow_breeze.utils.general_utils import get_docs_filter_name_from_short_hand providers_prefix = "apache-airflow-providers-" if AIRFLOW_BRANCH != "main": doc_args.append("--disable-p...
<vulnerable_code> if "docker-stack" in short_provider_package_ids: get_console().print("[info]Skipping docker-stack package. No back-reference needed.") short_provider_package_ids.remove("docker-stack") if short_provider_package_ids: all_providers = [ f"apache-airflow-provider...
<vulnerable_code> APACHE_AIRFLOW_GITHUB_REPOSITORY, AUTOCOMPLETE_INTEGRATIONS, DEFAULT_CELERY_BROKER, PROVIDERS_INDEX_KEY, SINGLE_PLATFORMS, START_AIRFLOW_ALLOWED_EXECUTORS, START_AIRFLOW_DEFAULT_ALLOWED_EXECUTORS, get_available_documentation_packages, ) from airflow_breeze.utils.custom_p...
<vulnerable_code># Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License...
<vulnerable_code><commit_title>[PATCH 04/11] Update es read query to not use body (#34792)<commit_description><fixed_code> # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyr...
<vulnerable_code> from __future__ import annotations import fnmatch import json import os from glob import glob import yaml from airflow_breeze.utils.general_utils import get_docs_filter_name_from_short_hand from airflow_breeze.utils.suspended_providers import get_removed_provider_ids CONSOLE_WIDTH = 180 ROOT_DIR ...
<vulnerable_code> if any(file.startswith(("airflow/", "docs/apache-airflow/")) for file in self._files): packages.append("apache-airflow") if any(file.startswith("docs/apache-airflow-providers/") for file in self._files): packages.append("providers-index") if any(file.star...
<vulnerable_code> import pytest from airflow_breeze.utils.general_utils import get_docs_filter_name_from_short_hand @pytest.mark.parametrize( ("apache-airflow", "helm-chart", "docker-stack"), id="non-providers-docs", ), pytest.param(("providers-index",), ("apache-airflow-provi...
<vulnerable_code><commit_title>[PATCH 04/11] Update es read query to not use body (#34792)<commit_description><fixed_code> # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyr...
<vulnerable_code> ], ) def test_upgrade_to_newer_dependencies( files: tuple[str, ...], expected_outputs: dict[str, str], pr_labels: tuple[str] ): stderr = SelectiveChecks( files=files, "docs/apache-airflow-providers/docs.rst", ), { "docs-list-as...
<vulnerable_code>from PyPDF2._utils import ( mark_location, matrix_multiply, read_block_backwards, read_previous_line, read_until_regex, read_until_whitespace, skip_over_comment,<commit_title>[PATCH] Minor flake8 fix<commit_description><fixed_code> from PyPDF2._utils import ( mark_locati...
<vulnerable_code>/* * ProFTPD: mod_copy -- a module supporting copying of files on the server * without transferring the data to the client and back * Copyright (c) 2009-2016 TJ Saunders * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU G...
<vulnerable_code> int words = bits >> 5; int remainder = bits & 0x1F; ld->bytes_left = ld->buffer_size - words*4; if (ld->bytes_left >= 4) {<commit_title>[PATCH] Fix a couple buffer overflows<commit_description>https://hackerone.com/reports/502816 https://hackerone.com/reports/507858 https://githu...
<vulnerable_code> while ((drc->additional_excluded_chns[n-1] = faad_get1bit(ld DEBUGVAR(1,104,"excluded_channels(): additional_excluded_chns"))) == 1) { for (i = num_excl_chan; i < num_excl_chan+7; i++) { drc->exclude_mask[i] = faad_get1bit(ld<commit_title>[PATCH] Fix a couple...
<vulnerable_code> goto error; } } #endif db_fptr = _mosquitto_fopen(outfile, "wb");<commit_title>[PATCH] [468] Set persistence file to only be readable by owner.<commit_description>Not implemented on Windows. Thanks to Moshe Zioni. Bug: https://github.com/eclipse/mosquitto/issues/468<fixed_code> goto error;...
<vulnerable_code> ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); count=ReadBlob(image,image->colors,sun_colormap); if (count != (ssize_t) image->colors) ThrowReaderException(CorruptImageError,"UnexpectedEndOfFile"); for (i=0; i < (ssize_t) image->colors; i+...
<vulnerable_code> QVariantMap Helper::flushPageCache() { QVariantMap reply; reply[QStringLiteral("success")] = true; <commit_title>[PATCH] Add missing authorization checking in<commit_description><fixed_code> QVariantMap Helper::flushPageCache() { if (!isCallerAuthorized()) { return {}; } ...
<vulnerable_code>} static void parse_alphanumeric(struct Flex * flex, unsigned int * phaseptr, char PhaseNo, unsigned int mw1, unsigned int len, int cont, int frag, int flex_groupmessage, int groupbit) { if (flex==NULL) return; verbprintf(3, "FLEX: Parse Alpha Numeric\n"); int currentChar = ...
<vulnerable_code> assert.done(); }; // Although libxml defaults to a utf-8 encoding, if not specifically specified // it will guess the encoding based on meta http-equiv tags available // This test shows that the "guessed" encoding can be overridden<commit_title>[PATCH] Ensure parseXml/parseHtml input is string or ...
<vulnerable_code> assert.done(); }; module.exports.parse_buffer = function(assert) { var filename = __dirname + '/fixtures/parser-utf16.xml'; var buf = fs.readFileSync(filename);<commit_title>[PATCH] Ensure parseXml/parseHtml input is string or buffer (#594)<commit_description><fixed_code> assert.done()...
<vulnerable_code> return archive_name def _call_external_zip(base_dir, zip_filename, verbose=False, dry_run=False): # XXX see if we want to keep an external call here if verbose: zipoptions = "-r" else: zipoptions = "-rq" from distutils.errors import DistutilsExecError from dist...
<vulnerable_code> for (i=1; (i < (ssize_t) dds_info->mipmapcount) && w && h; i++) { offset = (MagickOffsetType) w * h * pixel_size; (void) SeekBlob(image, offset, SEEK_CUR); w = DIV2(w); h = DIV2(h); }<commit_title>[PATCH]<commit_description><fixed_code> for (i=1;...
<vulnerable_code> } while (true) { key = keys[t]; if (banPrototypeModifications && key == '__proto__') { throw new TypeError('JSON-Patch: modifying `__proto__` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag ...
<vulnerable_code>!function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toSt...
<vulnerable_code> } while (true) { key = keys[t]; if (banPrototypeModifications && key == '__proto__') { throw new TypeError('JSON-Patch: modifying `__proto__` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag ...
<vulnerable_code> emsg(_(e_nesting)); return; } #ifdef FEAT_EVAL if (ignore_script) /* Not reading from script, also don't open one. Warning message? */<commit_title>[PATCH] patch 8.1.1365: source command doesn't check for the sandbox<commit_description>Problem: Source command doesn't check for the sandbo...
<vulnerable_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 1364, /**/<commit_title>[PATCH] patch 8.1.1365: source command doesn't check for the sandbox<commit_description>Problem: Source command doesn't check for the sandbox. (Armin Razmjou) Solution: Check for the sa...
<vulnerable_code> int error_no = ETIMEDOUT; /* assume time out for fbuf->pkt */ DEBUG("6lo sfr: ARQ timeout for datagram %u\n", fbuf->tag); fbuf->sfr.arq_timeout_event.msg.content.ptr = NULL; if (IS_ACTIVE(CONFIG_GNRC_SIXLOWPAN_SFR_MOCK_ARQ_TIMER)) { /* mock-up to emulate time having passed be...
<vulnerable_code> # [text](url) or [text](<url>) or [text](url "title") LINK_RE = NOIMG + BRK + \ r'''\(\s*(<.*?>|((?:(?:\(.*?\))|[^\(\)]))*?)\s*((['"])(.*?)\12\s*)?\)''' return normal_compile(LINK_RE) def prepare_realm_pattern(source: str) -> str:<commit_title>[PATCH] CVE-2019-16215: Fix DoS vulne...
<vulnerable_code> unleaf_state_nodeid1) == 2 else unleaf_state_nodeid2) self.node_dispatch = self.node_dispatch.union(dispatch_guest_result) def sync_tree(self): LOGGER.info("sync tree to host") self.transfer_inst.tree.rem...
<vulnerable_code> } emStrong(src, maskedSrc, prevChar = '') { console.log("trying to match:"); console.log(src); let match = this.rules.inline.emStrong.lDelim.exec(src); console.log(match); console.log(src); if (!match) { return; } let delimTotal = 0; let bothDelimTotal = 0...
<vulnerable_code> } dev_info(dev, "Xilinx EmacLite at 0x%08lX mapped to 0x%08lX, irq=%d\n", (unsigned long __force)ndev->mem_start, (unsigned long __force)lp->base_addr, ndev->irq); return 0; error:<commit_title>[PATCH] net: xilinx_emaclite: Do not print real IOMEM pointer<commit_description>Printing kerne...
<vulnerable_code> 'breakpoint', ]) # When new ast nodes are generated they have no 'lineno', 'end_lineno', # 'col_offset' and 'end_col_offset'. This function copies these fields from the '"{name}" is an invalid attribute name because it ends ' 'with "__roles__".'.format(name=node.at...
<vulnerable_code><commit_title>[PATCH] Merge pull request from GHSA-wqc8-x2pr-7jqh<commit_description>* move the commented fix into this branch * more verbose infos, and linting * 3 tests for generators * - add change log entry<fixed_code> from RestrictedPython import compile_restricted_exec def test_get_inspect_f...
<vulnerable_code> Parameters ---------- organizations : list[dict] List of organizations to validate. Each organization must have an id and input. Raises ------ if 'id' not in organization: raise ValidationError( ...
<vulnerable_code> assert ( details.find("a", {"href": link}) is None ), f"{link} found but should not have been in nav menu"<commit_title>[PATCH] Correctly escape output of ?_trace, refs #1360<commit_description><fixed_code> assert ( details.find("a", {...
<vulnerable_code> const char *msg; u_int8_t state; dh = skb_header_pointer(skb, dataoff, sizeof(_dh), &dh); BUG_ON(dh == NULL); state = dccp_state_table[CT_DCCP_ROLE_CLIENT][dh->dccph_type][CT_DCCP_NONE]; u_int8_t type, old_state, new_state; enum ct_dccp_roles role; dh = skb_header_pointer(skb, dataoff, sizeo...
<vulnerable_code> }); }); else if (quicklink_list) { $("#header_quick ul.dropdown-menu").html(quicklink_list); window.showSuccessMessage(window.update_success_msg); } }<commit_title>[PATCH] Fix XSS in quick access when adding /...
<vulnerable_code> async def get_endpoints(self, params=None, sockname=None): return await self.iserver.get_endpoints(params, sockname) async def create_session(self, params, sockname=None): self.logger.info('Create session request') result = ua.CreateSessionResult()<commit_title>[PATCH] ...
<vulnerable_code> response.Parameters = result # _logger.info("sending read response") self.send_response(requesthdr.RequestHandle, seqhdr, response) elif typeid == ua.NodeId(ua.ObjectIds.ReadRequest_Encoding_DefaultBinary): _logger.info("Read request (%s)", user)...
<vulnerable_code> sizeof(struct pdu_data_llctrl_ping_rsp); pdu_ctrl_tx->llctrl.opcode = PDU_DATA_LLCTRL_TYPE_PING_RSP; ctrl_tx_enqueue(conn, node_tx); return 0; } pdu_ctrl_tx->llctrl.length_rsp.max_tx_time = eff_tx_time; #endif /* CONFIG_BT_CTLR_PHY */ ctrl_tx_enqueue(conn, node_tx); } #endif /* CONFIG_BT_...
<vulnerable_code> if (quota_update(&quota, 0LL, 0LL, &overflow) == 0 && (overflow > 0 || quota.files >= user_quota_files || quota.size > user_quota_size || (max_filesize >= (off_t) 0 && (max_filesize = user_quota_size - quota.size) < (off_t) 0))) { overflow = 1; (v...
<vulnerable_code> } else if (reason) { if (is_pinned) { /* Only runtimes can be pinned */ g_print (_("\nInfo: app %s%s%s branch %s%s%s is end-of-life, with reason:\n"), on, ref_name, off, on, ref_branch, off); } g_print (" %s\n", reason);...
<vulnerable_code> input = Buffer.isBuffer(input) ? input.toString('utf8') : input; const { provider } = this; const svg = cheerio.default.html(this[_sanitize](cheerio.load(input, null, false)('svg'), options)); if (!svg) { throw new Error('SVG element not found in input. Check the SVG input');<co...
<vulnerable_code> s.add("org.apache.tomcat.dbcp.dbcp2.datasources.PerUserPoolDataSource"); s.add("org.apache.tomcat.dbcp.dbcp2.datasources.SharedPoolDataSource"); DEFAULT_NO_DESER_CLASS_NAMES = Collections.unmodifiableSet(s); } <commit_title>[PATCH] MNSTR-5023 backport security fix from jack...
<vulnerable_code> fprintf(stderr, "\tAOM AV1 stream - Resolution %d x %d\n", w, h); av1c = gf_isom_av1_config_get(file, trackNum, 1); fprintf(stderr, "\tversion=%u, profile=%u, level_idx0=%u, tier=%u\n", (u32)av1c->version, (u32)av1c->seq_profile, (u32)av1c->seq_level_idx_0, (u32)av1c->seq_tier_0); fprintf(stde...
<vulnerable_code> type: 'POST', dataType: 'json', timeout: 10000, data: { fork: { module: jsBackend.current.module,<commit_title>[PATCH] Add csrf protection to ajax calls<commit_description><fixed_code> type: 'POST', dataType: 'json', ...
<vulnerable_code>import org.suigeneris.jrcs.diff.DifferentiationFailedException; import org.suigeneris.jrcs.diff.delta.Delta; import org.suigeneris.jrcs.rcs.Version; import org.xwiki.context.Execution; import org.xwiki.context.ExecutionContext; import org.xwiki.display.internal.DocumentDisplayerParameters; import com.x...
<vulnerable_code> // make sure the content length is not over the maxContentLength if specified if (config.maxContentLength > -1 && Buffer.concat(responseBuffer).length > config.maxContentLength) { reject(createError('maxContentLength size of ' + config.maxContentLength + ' exceeded', ...
<vulnerable_code> janus_config_destroy(config); config = NULL; sessions = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, (GDestroyNotify)janus_videocall_session_destroy); usernames = g_hash_table_new_full(g_str_hash, g_str_equal, (GDestroyNotify)g_free, (GDestroyNotify)janus_videocall_session_unref); mes...
<vulnerable_code> dquot_disable(sb, -1, DQUOT_USAGE_ENABLED | DQUOT_LIMITS_ENABLED); ext2_xattr_put_super(sb); if (!(sb->s_flags & MS_RDONLY)) { struct ext2_super_block *es = sbi->s_es; ext2_msg(sb, KERN_ERR, "error: insufficient memory"); goto failed_mount3; } /* * set up enough so that it can read an i...
<vulnerable_code>#include <linux/buffer_head.h> #include <linux/init.h> #include <linux/slab.h> #include <linux/mbcache.h> #include <linux/quotaops.h> #include <linux/rwsem.h> #include <linux/security.h> static int ext2_xattr_set2(struct inode *, struct buffer_head *, struct ext2_xattr_header *); static int ext2...
<vulnerable_code>from keylime import json from keylime import registrar_client from keylime.agentstates import AgentAttestStates from keylime.common import states from keylime.db.verifier_db import VerfierMain from keylime.db.verifier_db import VerifierAllowlist from keylime.db.keylime_db import DBEngineManager, Sessio...
<vulnerable_code> agent_uuid = os.getenv("KEYLIME_AGENT_UUID", None) if agent_uuid is None: raise RuntimeError("Env variable KEYLIME_AGENT_UUID is empty, but agent_uuid is set to 'environment'") if config.STUB_VTPM and config.TPM_CANNED_VALUES is not None: # Use canned values for...
<vulnerable_code>from cryptography.hazmat.backends import default_backend from cryptography.x509 import load_der_x509_certificate from keylime.db.registrar_db import RegistrarMain from keylime.db.keylime_db import DBEngineManager, SessionManager from keylime import config agent_id = rest_params["agents"] ...
<vulnerable_code>from keylime import crypto from keylime.cmd import user_data_encrypt from keylime import ca_util from keylime.common import algorithms from keylime import ima_file_signatures from keylime import measured_boot from keylime import gpg if mytenant.agent_uuid.startswith('-----BEGIN PUBLIC KEY-----'...
<vulnerable_code>import tornado.web from keylime.requests_client import RequestsClient from keylime.common import states from keylime import config from keylime import json from keylime import keylime_logging agent_id = rest_params["agents"] if agent_id is not None: # Handle request for sp...
<vulnerable_code> writer_print_section_footer(w); } static void clear_log(int need_lock) { int i; else print_str_opt("color_space", av_color_space_name(frame->colorspace)); if (frame->color_primaries != AVCOL_PRI_UNSPECIFIED) print_str("color_primaries", av_color_primari...
<vulnerable_code># See the License for the specific language governing permissions and # limitations under the License. import logging import six from twisted.internet import defer from synapse.api.constants import MAX_DEPTH from synapse.api.errors import Codes, SynapseError from synapse.crypto.event_signing import ...
<vulnerable_code> @defer.inlineCallbacks @log_function def on_incoming_transaction(self, transaction_data): # keep this as early as possible to make the calculated origin ts as # accurate as possible. request_time = self._clock.time_msec() if not transaction.transaction_id: ...
<vulnerable_code> self.store = datastore @log_function def have_responded(self, transaction): """ Have we already responded to a transaction with the same id and origin? "transaction_id") return self.store.get_received_txn_response( tr...
<vulnerable_code> try: code, response = yield self.handler.on_incoming_transaction( transaction_data ) except Exception: logger.exception("on_incoming_transaction failed")<commit_title>[PATCH 1/5] Check that signatures on events are valid<commit_descri...
<vulnerable_code>) def _expect_edu(destination, edu_type, content, origin="test"): return { "origin": origin, "origin_server_ts": 1000000, } def _make_edu_json(origin, edu_type, content): return json.dumps(_expect_edu("test", edu_type, content, origin=origin)).encode( 'utf8' ...
<vulnerable_code> @patch('twisted.web.http.Request') @defer.inlineCallbacks def trigger(self, http_method, path, content, mock_request, federation_auth=False): """ Fire an HTTP event. Args: content : The HTTP body mock_request : Mocked request to pass to the event so...
<vulnerable_code>""" This is a reference implementation of a Matrix home server. """ __version__ = "0.33.3"<commit_title>[PATCH 1/5] Check that signatures on events are valid<commit_description>We should check that both the sender's server, and the server which created the event_id (which may be different from whateve...
<vulnerable_code> assert (await r.text()) == data async def test_follow_symlink_directory_transversal( tmp_path: pathlib.Path, aiohttp_client: AiohttpClient ) -> None: # Tests that follow_symlinks does not allow directory transversal await client.close() async def test_follow_symlink_directory_transv...
<vulnerable_code> sql_comp_t * sc = so->so_sc; op_table_t * ot = tb_dfe->_.sub.ot; sc->sc_fun_ref_temps = NULL; sc->sc_fun_ref_defaults = NULL; } fref->src_gen.src_after_code = code_to_cv (sc, post_fref_code); fref->fnr_default_values = dk_set_nreverse (sc->sc_fun_ref_defaults); fref->fnr_def...
<vulnerable_code> return headers def paginated_list( self, url: str, headers: dict = None ) -> tuple[Response, list]: """ Get all resources of a list endpoint by browsing through all pages The url of the list endpoint headers: dict The headers to u...
<vulnerable_code> q = q.filter(db.Node.last_seen >= args['last_seen_from']) if not self.r.v_glo.can(): if self.r.v_org.can(): # only the results of the user's organization are returned q = q.filter(db.Node.organization_id == auth_org_id) else:<...
<vulnerable_code> # filter by organization ids (include root role if desired) org_filters = args.getlist('organization_id') if org_filters: if 'include_root' in args and args['include_root']: q = q.filter(or_( db.Role.organization_id.in_(org_filters...
<vulnerable_code>#!/usr/bin/env node /** * Copyright 2020 Trent Mick. * Copyright 2014 Joyent Inc. * * json -- JSON love for your command line. *<commit_title>[PATCH] changelog reflow and typos/tweaks<commit_description><fixed_code> #!/usr/bin/env node /** * Copyright 2020 Trent Mick. * Copyright 2020 Joyent Inc...
<vulnerable_code>#include <assert.h> #include <string.h> #include <stdlib.h> #include <math.h> #include <float.h> That way we won't run our head into the wall each call */ static void Buffer_Realloc (JSONObjectEncoder *enc, size_t cbNeeded) { size_t curSize = enc->end - enc->start; size_t newSize = curSize * 2; ...
<vulnerable_code>import sys import uuid from collections import OrderedDict import pytest import ujson ujson.dumps(unjsonable_obj, default=default) """ def test_decode_numeric_int_frc_overflow(): input = "X.Y"<commit_title>[PATCH] Fix unchecked buffer overflows (CVE-2021-45958).<commit_description>Add a few ...
<vulnerable_code> allowing for negative compression */ if (offset2 == 0) offset2=(MagickOffsetType) (offset + TILE_WIDTH * TILE_WIDTH * 4* 1.5); /* seek to the tile offset */ if (SeekBlob(image, offset, SEEK_SET) != offset) ThrowBinaryException(CorruptImageError,"InsufficientImageDataInFil...
<vulnerable_code> (opcode != PDU_DATA_LLCTRL_TYPE_REJECT_EXT_IND)))) || (conn->role && ((!conn->refresh && /* As a workaround to IOP with some old peer controllers that * respond with Unknown Rsp PDU to our local Slave Initiated * Feature request during Encryption Setup initiated by the ...
<vulnerable_code> if (stack->elements) { for (i = 0; i < stack->top; i++) { if (((st_entry *)stack->elements[i])->data) { zval_ptr_dtor(&((st_entry *)stack->elements[i])->data); } if (((st_entry *)stack->elements[i])->varname) {<commit_title>[PATCH] Fix bug #72860: wddx_deserialize use-after-free<commit...
<vulnerable_code>angular.module('portainer.docker') .controller('ContainerConsoleController', ['$scope', '$transition$', 'ContainerService', 'ImageService', 'EndpointProvider', 'Notifications', 'ContainerHelper', 'ExecService', 'HttpRequestHelper', function ($scope, $transition$, ContainerService, ImageService, Endpoin...
<vulnerable_code> } } private void extract7z(ActionDescription aAction, Path aCachedFile, Path aTarget) throws IOException, RarException { // We always extract archives into a subfolder. Figure out the name of the folder. Path base = Paths.get(getBase(aCachedFile.getFileName(...
<vulnerable_code> }; } function fieldSanitizeStep1( field, bHtml=true, bSvg=true, bSvgFilters=true, text='' ) { if (field === undefined ||field === '') { return false; } let string = ''; text = (text === '') ? $(field).val() : text; /* // Sanitize string var tagsT...
<vulnerable_code>import yaml.parser import yaml.scanner __version__ = "0.17.0" FORMATS = ["cbor", "json", "msgpack", "toml", "yaml"] ), ) output_group = parser.add_mutually_exclusive_group() output_group.add_argument("output", nargs="?", default="-", help="output file") output_group...
<vulnerable_code> ) reference = read_file("numeric-key-null-value.toml") assert output == reference<commit_title>[PATCH] fix(yaml): limit maximum nodes<commit_description>Prevent a billion laughs attack carried out with YAML anchors. Thanks to Taichi Kotake of Akatsuki Inc. for finding this vuln...
<vulnerable_code> profile=GetImageProfile(image,name); p=GetStringInfoDatum(custom_profile); if (LocaleCompare(name,"EXIF") == 0) for (i=0; i < (ssize_t) GetStringInfoLength(profile); i+=65533L) { length=MagickMin(GetStringInfoLength(profile)-i,65533L); jpeg_write_marker(jpeg_info...
<vulnerable_code> if (connect(fSocket, (struct sockaddr*)&addr, sizeof(addr)) < 0) { jack_error("Cannot connect to server socket err = %s", strerror(errno)); close(fSocket); return -1; } error: unlink(fName); close(fSocket); return -1; } <commit_title>[PATCH] Set fSocket to -...
<vulnerable_code>#include <boost/log/sinks.hpp> #include <boost/log/sources/logger.hpp> #include <boost/algorithm/string/replace.hpp> #if defined(__clang__) #pragma clang diagnostic pop )); logging::core::get()->add_sink(m_sinkTextFile); ...
<vulnerable_code> rc = jsi_ArrayFlatSub(interp, nobj, t , depth-1); else if (!Jsi_ValueIsUndef(interp, t)) Jsi_ObjArrayAdd(interp, nobj, t); if ((++n + clen)>interp->maxArrayList) return Jsi_LogError("array size exceeded"); } return rc;<commit_title>[PATCH] Rel...
<vulnerable_code> sf->flags |= JSI_OPT_BITSET_ENUM; } if (sf->arrSize) { if (sf->arrSize>MAX_ARRAY_LIST) { rc = Jsi_LogError("array size too big: %d >= %d", sf->arrSize, MAX_ARRAY_LIST); goto bail; } if (sf->bits || isEnum) {...
<vulnerable_code> JSI_OPT(INT, Jsi_Interp, lockTimeout, .help="Thread time-out for mutex lock acquires (milliseconds)" ), JSI_OPT(CUSTOM,Jsi_Interp, logOpts, .help="Options for log output to add file/line/time", .flags=0, .custom=Jsi_Opt_SwitchSuboption, .data=jsi_InterpLogOptions), JSI_OPT(INT, Jsi_...
<vulnerable_code> if (!cp || !isdigit(*cp)) return JSI_OK; n = (int)strtol(cp, &ep, 0); if (n<0 || n >= interp->maxArrayList) return JSI_OK; hPtr->f.bits.isarrlist = 1; if (Jsi_ObjArraySizer(interp, obj, n) <= 0) int Jsi_ObjArraySizer(Jsi_Interp *interp, ...
<vulnerable_code> } /* TODO: array["1"] also extern the length of array */ if (arrayindex >= 0 && arrayindex < MAX_ARRAY_LIST && target->vt == JSI_VT_OBJECT && target->d.obj->arr) { return jsi_ObjArraySetDup(interp, target->d.obj, value, arrayindex); } Jsi_Obj *obj = target->d.ob...
<vulnerable_code> """Establish a connection to Drillbit.""" conn_md = self.get_connection(getattr(self, self.conn_name_attr)) creds = f"{conn_md.login}:{conn_md.password}@" if conn_md.login else "" if "/" in conn_md.host or "&" in conn_md.host: raise ValueError("Drill host sho...