text
stringlengths
79
3.72M
<vulnerable_code><commit_title>[PATCH] replace multiple sort/order parameters by parameter object<commit_description><fixed_code> package ch.puzzle.itc.mobiliar.business.domain.commons; import com.google.common.collect.ImmutableList; import java.io.Serializable; import java.util.Iterator; import java.util.List; impor...
<vulnerable_code>import ch.puzzle.itc.mobiliar.business.deploy.entity.DeploymentEntity.ApplicationWithVersion; import ch.puzzle.itc.mobiliar.business.deploy.entity.DeploymentState; import ch.puzzle.itc.mobiliar.business.domain.commons.CommonFilterService; import ch.puzzle.itc.mobiliar.business.environment.control.Conte...
<vulnerable_code> import ch.puzzle.itc.mobiliar.test.testrunner.PersistenceTestRunner; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import javax.persistence.PersistenceContext; import javax.persistence.Query; import java.util.ArrayList; import java.util.List; import java.util.loggin...
<vulnerable_code>/* * Copyright (C) 2019 Yago Fontoura do Rosario <yago.rosario@hotmail.com.br> * All rights reserved. * * Redistribution and use in source and binary forms, with or without /*---------------------------------------------------------------------------*/ static void sysDescr_handler(snmp_varbind_t *...
<vulnerable_code>/* * Copyright (C) 2019 Yago Fontoura do Rosario <yago.rosario@hotmail.com.br> * All rights reserved. * * Redistribution and use in source and binary forms, with or without<commit_title>[PATCH] Refactored SNMP engine after vulnerabilities<commit_description><fixed_code> /* * Copyright (C) 2019-202...
<vulnerable_code>/* * Copyright (C) 2019 Yago Fontoura do Rosario <yago.rosario@hotmail.com.br> * All rights reserved. * * Redistribution and use in source and binary forms, with or without /** * \file * An implementation of the Simple Network Management Protocol (RFC 3411-3418) * \author * Yago Font...
<vulnerable_code>/* * Copyright (C) 2019 Yago Fontoura do Rosario <yago.rosario@hotmail.com.br> * All rights reserved. * * Redistribution and use in source and binary forms, with or without /** * \file * An implementation of the Simple Network Management Protocol (RFC 3411-3418) * \author * Yago Font...
<vulnerable_code>/* * Copyright (C) 2019 Yago Fontoura do Rosario <yago.rosario@hotmail.com.br> * All rights reserved. * * Redistribution and use in source and binary forms, with or without /** * \file * An implementation of the Simple Network Management Protocol (RFC 3411-3418) * \author * Yago Font...
<vulnerable_code>/* * Copyright (C) 2019 Yago Fontoura do Rosario <yago.rosario@hotmail.com.br> * All rights reserved. * * Redistribution and use in source and binary forms, with or without /** * \file * An implementation of the Simple Network Management Protocol (RFC 3411-3418) * \author * Yago Font...
<vulnerable_code>/* * Copyright (C) 2019 Yago Fontoura do Rosario <yago.rosario@hotmail.com.br> * All rights reserved. * * Redistribution and use in source and binary forms, with or without /** * \file * An implementation of the Simple Network Management Protocol (RFC 3411-3418) * \author * Yago Font...
<vulnerable_code>/* * Copyright (C) 2019 Yago Fontoura do Rosario <yago.rosario@hotmail.com.br> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must re...
<vulnerable_code>/* * Copyright (C) 2019 Yago Fontoura do Rosario <yago.rosario@hotmail.com.br> * All rights reserved. * * Redistribution and use in source and binary forms, with or without /** * \file * An implementation of the Simple Network Management Protocol (RFC 3411-3418) * \author * Yago Font...
<vulnerable_code>/* Generated by re2c 0.15.3 on Wed Aug 16 15:51:34 2017 */ #line 1 "ext/date/lib/parse_date.re" /* * The MIT License (MIT) } else { if (yych <= '@') goto yy3; if (yych <= 'D') goto yy165; goto yy1521; } } else { if (yych <= 'd') { if (yych <= 'Z') goto yy165; if (yych >= 'a') got...
<vulnerable_code> exception); if (status == MagickFalse) return(DestroyImageList(image)); if ((image_info->ping == MagickFalse) && (jng_color_type >= 12)) { AcquireMagickMemory(sizeof(ImageInfo)); if (alpha_image_info == (ImageInfo *) NULL) ...
<vulnerable_code> static OPCODE_DESC* avr_op_analyze(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *buf, int len, CPU_MODEL *cpu) { OPCODE_DESC *opcode_desc; ut16 ins = (buf[1] << 8) | buf[0]; int fail; char *t;<commit_title>[PATCH] Fix oobread in avr<commit_description><fixed_code> static OPCODE_DESC* avr_op_ana...
<vulnerable_code> test('%(title4)#S', 'foo_bar_test') test('%(title4).10S', ('foo "bar" ', 'foo "bar"' + ('#' if compat_os_name == 'nt' else ' '))) if compat_os_name == 'nt': test('%(title4)q', ('"foo \\"bar\\" test"', ""foo ⧹"bar⧹" test"")) test('%(formats.:.id)#q', ('"id...
<vulnerable_code>import io import itertools import json import xml.etree.ElementTree from yt_dlp.compat import ( InAdvancePagedList, LazyList, OnDemandPagedList, age_restricted, args_to_str, base_url, assert extract_basic_auth('http://user:@foo.bar') == ('http://foo.bar', 'Basic dXNlcjo...
<vulnerable_code>if compat_os_name == 'nt': def compat_shlex_quote(s): import re return s if re.match(r'^[-_\w./]+$', s) else '"%s"' % s.replace('"', '\\"') else: from shlex import quote as compat_shlex_quote # noqa: F401 <commit_title>[PATCH] [core] Prevent RCE when using `--exec` with `%q`<co...
<vulnerable_code>import subprocess from .common import PostProcessor from ..compat import compat_shlex_quote from ..utils import PostProcessingError, encodeArgument, variadic class ExecPP(PostProcessor): def run(self, info): for tmpl in self.exec_cmd: cmd = self.parse_cmd(tmpl, info) ...
<vulnerable_code> _fix('LD_LIBRARY_PATH') # Linux _fix('DYLD_LIBRARY_PATH') # macOS def __init__(self, *args, env=None, text=False, **kwargs): if env is None: env = os.environ.copy() self._fix_pyinstaller_ld_path(env) kwargs['universal_newlines'] = True # F...
<vulnerable_code> alBITMAPINFOHEADER bih; memcpy(&bih, hdrl_data + i, sizeof(alBITMAPINFOHEADER)); AVI->bitmap_info_header = (alBITMAPINFOHEADER *) gf_malloc(str2ulong((unsigned char *)&bih.bi_size)); if (AVI->bitmap_info_header != NULL) memcpy(AVI->bitmap_...
<vulnerable_code> if (pipenum == -1) return; /* Parse all of the netlink configuration. */ nl_parse(pipenum, &config); <commit_title>[PATCH] Set init processes as non-dumpable<commit_description>This sets the init processes that join and setup the container's namespaces as non-dumpable before they setns to the con...
<vulnerable_code> return deniedFiles.includes(base) || deniedFileTypes.includes(ext); } function isAllowedFile(file) { const allowedFiles = ['manifest.json']; const allowedPath = '/assets/'; const alwaysDeny = ['.hbs']; const ext = path.extname(file); const base = path.basename(file); retu...
<vulnerable_code> done(); }); }); });<commit_title>[PATCH] =?UTF-8?q?=F0=9F=94=92=20Fixed=20path=20traversal=20issue?=<commit_description><fixed_code> done(); }); }); it('should disallow path traversal', function (done) { req.path = '/assets/built%2F..%2F..%2F...
<vulnerable_code> for i in range(index): offset += get_size_of_type(typ.members[attrs[i]]) return LLLnode.from_list(["add", parent, offset], typ=subtype, location="storage",) elif location == "storage_prehashed": return LLLnode.from_list( ["add"...
<vulnerable_code> OPT_VERBOSE, OPT_INFILE, OPT_DEBUG, OPT_MAXMEM } optid_t; {OPT_VERBOSE, "verbose", 0}, {OPT_INFILE, "f", JAS_OPT_HASARG}, {OPT_DEBUG, "debug-level", JAS_OPT_HASARG}, #if defined(JAS_DEFAULT_MAX_MEM_USAGE) {OPT_MAXMEM, "memory-limit", JAS_OPT_HASARG}, #endif char *fmtname; int debug; size_t ...
<vulnerable_code>{ size_t i; size_t j; uchar *dp; dp = data; for (i = 0; i < len; i += 16) { fprintf(out, "%04zx:", i);<commit_title>[PATCH] The generation of the configuration file jas_config.h has<commit_description><fixed_code> { size_t i; size_t j; jas_uchar *dp; dp = data; for (i = 0; i < len; i += 16)...
<vulnerable_code> static jas_iccattrval_t *jas_iccattrval_create0(void); static int jas_iccgetuint(jas_stream_t *in, int n, ulonglong *val); static int jas_iccgetuint8(jas_stream_t *in, jas_iccuint8_t *val); static int jas_iccgetuint16(jas_stream_t *in, jas_iccuint16_t *val); static int jas_iccgetsint32(jas_stream_t *...
<vulnerable_code>#include <jasper/jas_config.h> #include <jasper/jas_types.h> uchar jas_iccprofdata_srgb[] = { 0x00, 0x00, 0x0c, 0x48, 0x4c, 0x69, 0x6e, 0x6f, 0x02, 0x10, 0x00, 0x00, 0x6d, 0x6e, 0x74, 0x72, int jas_iccprofdata_srgblen = sizeof(jas_iccprofdata_srgb); uchar jas_iccprofdata_sgray[] = { 0x00, 0x00, 0...
<vulnerable_code> int clrspc) { jas_image_t *image; uint_fast32_t rawsize; uint_fast32_t inmem; int cmptno; jas_image_cmptparm_t *cmptparm; if (!(image = jas_image_create0())) { return 0; } image->clrspc_ = clrspc; image->maxcmpts_ = numcmpts; image->inmem_ = true; /* Allocate memory for the per-compon...
<vulnerable_code>* Constructors and destructors. \******************************************************************************/ jas_matrix_t *jas_seq2d_create(int xstart, int ystart, int xend, int yend) { jas_matrix_t *matrix; assert(xstart <= xend && ystart <= yend); return matrix; } jas_matrix_t *jas_matrix_cr...
<vulnerable_code>* Includes. \******************************************************************************/ #include <assert.h> #if defined(HAVE_FCNTL_H) #include <fcntl.h> #endif #include <stdlib.h> #include <stdarg.h> #include <stdio.h> #include <ctype.h> #if defined(HAVE_UNISTD_H) #include <unistd.h> #endif #if d...
<vulnerable_code>* Includes. \******************************************************************************/ #include <stdio.h> #include <stdlib.h> #include <time.h> * Code. \******************************************************************************/ #if defined(HAVE_GETTIMEOFDAY) void jas_tmr_start(jas_tmr_t *...
<vulnerable_code>#include "jasper/jas_image.h" #include "jasper/jas_malloc.h" #include "jasper/jas_debug.h" #include "bmp_cod.h" /******************************************************************************\ * Local prototypes. \******************************************************************************/ static ...
<vulnerable_code>#include "jasper/jas_debug.h" #include "jasper/jas_malloc.h" #include "jasper/jas_version.h" #include "jp2_cod.h" #include "jp2_dec.h" /* Does the number of components indicated in the IHDR box match the value specified in the code stream? */ if (dec->ihdr->data.ihdr.numcmpts != JAS_CAST(uint, ...
<vulnerable_code> jpc_ms_dump(ms, stderr); } if (JAS_CAST(ulong, jas_stream_tell(tmpstream)) != ms->len) { jas_eprintf( "warning: trailing garbage in marker segment (%ld bytes)\n", ms->len - jas_stream_tell(tmpstream)); if (!(ppm->data = jas_malloc(ppm->len))) { goto error; } if (JAS_CAST(u...
<vulnerable_code>jpc_streamlist_t *jpc_ppmstabtostreams(jpc_ppxstab_t *tab) { jpc_streamlist_t *streams; uchar *dataptr; uint_fast32_t datacnt; uint_fast32_t tpcnt; jpc_ppxstabent_t *ent;<commit_title>[PATCH] The generation of the configuration file jas_config.h has<commit_description><fixed_code> jpc_streamlist_t...
<vulnerable_code> com = &enc->mrk->parms.com; com->len = JAS_CAST(uint_fast16_t, strlen(buf)); com->regid = JPC_COM_LATIN; if (!(com->data = JAS_CAST(uchar *, jas_strdup(buf)))) { abort(); } if (jpc_putms(enc->out, enc->cstate, enc->mrk)) {<commit_title>[PATCH] The generation of the configuration file jas_config...
<vulnerable_code>* Types. \******************************************************************************/ /* JPEG decoder data sink type. */ typedef struct jpg_dest_s { static jas_image_t *jpg_mkimage(j_decompress_ptr cinfo); /******************************************************************************\ * \******...
<vulnerable_code> int jpg_validate(jas_stream_t *in) { uchar buf[JPG_MAGICLEN]; int i; int n; <commit_title>[PATCH] The generation of the configuration file jas_config.h has<commit_description><fixed_code> int jpg_validate(jas_stream_t *in) { jas_uchar buf[JPG_MAGICLEN]; int i; int n;
<vulnerable_code> int mif_validate(jas_stream_t *in) { uchar buf[MIF_MAGICLEN]; uint_fast32_t magic; int i; int n; static mif_hdr_t *mif_hdr_get(jas_stream_t *in) { uchar magicbuf[MIF_MAGICLEN]; char buf[4096]; mif_hdr_t *hdr; bool done;<commit_title>[PATCH] The generation of the configuration file jas_config....
<vulnerable_code> int pgx_validate(jas_stream_t *in) { uchar buf[PGX_MAGICLEN]; uint_fast32_t magic; int i; int n; static int pgx_gethdr(jas_stream_t *in, pgx_hdr_t *hdr) { int c; uchar buf[2]; if ((c = jas_stream_getc(in)) == EOF) { goto error;<commit_title>[PATCH] The generation of the configuration file ja...
<vulnerable_code> int pnm_validate(jas_stream_t *in) { uchar buf[2]; int i; int n; <commit_title>[PATCH] The generation of the configuration file jas_config.h has<commit_description><fixed_code> int pnm_validate(jas_stream_t *in) { jas_uchar buf[2]; int i; int n;
<vulnerable_code> int ras_validate(jas_stream_t *in) { uchar buf[RAS_MAGICLEN]; int i; int n; uint_fast32_t magic;<commit_title>[PATCH] The generation of the configuration file jas_config.h has<commit_description><fixed_code> int ras_validate(jas_stream_t *in) { jas_uchar buf[RAS_MAGICLEN]; int i; int n; uint_...
<vulnerable_code>} void ga_init2(garray_T *gap, int itemsize, int growsize) { ga_init(gap); gap->ga_itemsize = itemsize; * When out of memory nothing changes and FAIL is returned. */ int ga_add_string(garray_T *gap, char_u *p) { char_u *cp = vim_strsave(p); return OK; } /* * Concatenate a ...
<vulnerable_code> if (STRCMP("RESET", error) == 0) ga_clear_strings(&ignore_error_list); else ga_add_string(&ignore_error_list, error); } static int<commit_title>[PATCH] patch 8.2.4040: keeping track of allocated lines is too<commit_description><fixed_code> if (STRCMP("RESET", error) == 0) ga_clear_s...
<vulnerable_code> char_u *line = NULL; ga_init2(&ga, sizeof(char_u *), 10); if (ga_add_string(&ga, p) == FAIL) return retp; // If the argument ends in "}" it must have been concatenated already emsg(_(e_missing_rcurly)); break; } if (ga_add_string(&ga, line) == FAIL) break; if (*sk...
<vulnerable_code> /* * Handle line continuation in function arguments or body. * Get a next line, store it in "eap" if appropriate and use "line_to_free" to * handle freeing the line later. */ static char_u * get_function_line( exarg_T *eap, char_u **line_to_free, int indent, getline_opt_T getline_option...
<vulnerable_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 4039, /**/<commit_title>[PATCH] patch 8.2.4040: keeping track of allocated lines is too<commit_description><fixed_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 4040,...
<vulnerable_code> * Compile a nested :def command. */ static char_u * compile_nested_function(exarg_T *eap, cctx_T *cctx, char_u **line_to_free) { int is_global = *eap->arg == 'g' && eap->arg[1] == ':'; char_u *name_start = eap->arg; goto theend; } ufunc = define_function(eap, lambda_name, line_...
<vulnerable_code> { // Continuation line of an unrecognized item. if (writing) ga_add_string(&virp->vir_barlines, virp->vir_line); } else { default: // copy unrecognized line (for future use) if (writing) ga_add_string(&virp->vir_barlines, virp->vir_line); } for (i = 0; i < values...
<vulnerable_code> } public Condition balanceAtBlockEquals(final Amount expectedBalance, final BigInteger block) { return new ExpectAccountBalanceAtBlock(eth, this, block, expectedBalance.getValue(), Unit.WEI); } public Condition balanceDoesNotChange(final int startingBalance) {<commit_title>[PATCH 2/2] Rem...
<vulnerable_code><commit_title>[PATCH 2/2] Remove block size and transaction size riders from EIP<commit_description><fixed_code> /* * Copyright ConsenSys AG. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy ...
<vulnerable_code> final MutableBlockchain blockchain = protocolContext.getBlockchain(); final IbftExecutors ibftExecutors = IbftExecutors.create(metricsSystem); final IbftBlockCreatorFactory blockCreatorFactory = new IbftBlockCreatorFactory( gasLimitCalculator, protocolContex...
<vulnerable_code> */ package org.hyperledger.besu.config; import java.util.Map; import com.fasterxml.jackson.databind.node.ObjectNode; import com.google.common.collect.ImmutableMap; public class IbftConfigOptions { ibftConfigRoot, "futuremessagesmaxdistance", DEFAULT_FUTURE_MESSAGES_MAX_DISTANCE); } Ma...
<vulnerable_code> assertThat(configOptions.getTransitions().getIbftForks().get(1).getValidators().get().size()) .isEqualTo(1); } }<commit_title>[PATCH 2/2] Remove block size and transaction size riders from EIP<commit_description><fixed_code> assertThat(configOptions.getTransitions().getIbftForks().get...
<vulnerable_code> Optional.empty(), TransactionPoolConfiguration.DEFAULT_PRICE_BUMP); final IbftBlockCreatorFactory blockCreatorFactory = new IbftBlockCreatorFactory( (gasLimit) -> gasLimit, protocolContext, protocolSchedule, miningPara...
<vulnerable_code>import org.hyperledger.besu.config.GenesisConfigOptions; import org.hyperledger.besu.config.IbftConfigOptions; import org.hyperledger.besu.ethereum.MainnetBlockValidator; import org.hyperledger.besu.ethereum.core.PrivacyParameters; import org.hyperledger.besu.ethereum.core.Wei; import org.hyperledger.b...
<vulnerable_code> final Function<Long, Long> gasLimitCalculator, final Wei minTransactionGasPrice, final Double minBlockOccupancyRatio, final BlockHeader parentHeader) { super( localAddress, extraDataCalculator, protocolSchedule, gasLimitCalculator, min...
<vulnerable_code> protected final ProtocolContext protocolContext; protected final ProtocolSchedule protocolSchedule; private final Address localAddress; private volatile Bytes vanityData; private volatile Wei minTransactionGasPrice; final ProtocolContext protocolContext, final ProtocolSchedule pr...
<vulnerable_code><commit_title>[PATCH 2/2] Remove block size and transaction size riders from EIP<commit_description><fixed_code> /* * Copyright ConsenSys AG. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy ...
<vulnerable_code> parentGasLimit -> parentGasLimit, Wei.ZERO, 0.8, parentHeader); final int secondsBetweenBlocks = 1; final Block block = blockCreator.createBlock(parentHeader.getTimestamp() + 1);<commit_title>[PATCH 2/2] Remove block size and transaction size rid...
<vulnerable_code>import org.hyperledger.besu.ethereum.core.Address; import org.hyperledger.besu.ethereum.core.BlockHeader; import org.hyperledger.besu.ethereum.core.MutableWorldState; import org.hyperledger.besu.ethereum.core.ProcessableBlockHeader; import org.hyperledger.besu.ethereum.core.Transaction; import org.hype...
<vulnerable_code>import org.hyperledger.besu.ethereum.core.BlockHeader; import org.hyperledger.besu.ethereum.core.MutableAccount; import org.hyperledger.besu.ethereum.core.MutableWorldState; import org.hyperledger.besu.ethereum.core.ProcessableBlockHeader; import org.hyperledger.besu.ethereum.core.Wei; import org.hyper...
<vulnerable_code> */ package org.hyperledger.besu.ethereum.mainnet; import org.hyperledger.besu.ethereum.core.BlockHeader; import org.hyperledger.besu.ethereum.core.MutableAccount; import org.hyperledger.besu.ethereum.core.MutableWorldState; import org.hyperledger.besu.ethereum.core.ProcessableBlockHeader; import org....
<vulnerable_code> private ProcessableBlockHeader createPendingBlockHeader(final long timestamp) { final long newBlockNumber = parentHeader.getNumber() + 1; final long gasLimit; if (ExperimentalEIPs.eip1559Enabled && protocolSpec.isEip1559()) { gasLimit = protocolSpec.getEip1559().orElseThrow().eip15...
<vulnerable_code> : FRONTIER_TRANSACTIONS); } public boolean isValidGasLimit(final Transaction transaction) { if (transaction == null) { return false; } return transaction.getGasLimit() <= feeMarket.getPerTxGaslimit(); } private void guardActivation() { if (!ExperimentalEI...
<vulnerable_code> long getInitialBasefee(); long getPerTxGaslimit(); long getSlackCoefficient(); static FeeMarket eip1559() { ExperimentalEIPs.targetGasUsed, ExperimentalEIPs.slackCoefficient, ExperimentalEIPs.decayRange, ExperimentalEIPs.initialBasefee, ExperimentalEI...
<vulnerable_code> private final long targetGasUsed; private final long decayRange; private final long initialBasefee; private final long perTxGaslimit; private final long slackCoefficient; private final long maxGas; private final long gasIncrementAmount; final long targetGasUsed, final long sla...
<vulnerable_code> return false; } if (!validatePerTransactionGasLimit(block)) { return false; } return false; } private boolean validatePerTransactionGasLimit(final Block block) { if (!ExperimentalEIPs.eip1559Enabled || maybeEip1559.isEmpty()) { return true; } final T...
<vulnerable_code>import org.hyperledger.besu.ethereum.mainnet.headervalidationrules.AncestryValidationRule; import org.hyperledger.besu.ethereum.mainnet.headervalidationrules.CalculatedDifficultyValidationRule; import org.hyperledger.besu.ethereum.mainnet.headervalidationrules.ConstantFieldValidationRule; import org.hy...
<vulnerable_code> "transaction format is invalid, accepted transaction types are %s", acceptedTransactionTypes.toString())); } if (!eip1559.isValidGasLimit(transaction)) { return ValidationResult.invalid( TransactionInvalidReason.EXCEEDS_PER_TRANSACTION_GAS...
<vulnerable_code> verifyZeroInteractions(transactionFilter); } @Test public void shouldRejectTransactionIfGasLimitExceedsPerTransactionGasLimit() { final long forkBlock = 845L; final EIP1559 eip1559 = new EIP1559(forkBlock); ExperimentalEIPs.eip1559Enabled = true; final MainnetTransactionValid...
<vulnerable_code> util.setProperty(o, 'prop.subprop', { subsub2: 7}); test.same(o, {prop1: [5, 6], prop: {subprop: [{subsub: [5,6]}, {subsub2: 7}]}}, "should convert nested properties to array"); test.end(); });<commit_title>[PATCH] test: add unit test<commit_description><fixed_code> ...
<vulnerable_code> self._getForwarded = function(message) { try { var forwarded_message = $(message.getNode()).find('forwarded[xmlns="' + NS_URN_FORWARD + '"]:first message:first'); if(forwarded_message[0]) { return JSJaCPacket.wrapNode(forwarded_message[0]); ...
<vulnerable_code> parser = lxml.etree.XMLParser(ns_clean=False, recover=True, encoding='utf-8') xml = lxml.etree.fromstring(text.encode(), parser=parser) <commit_title>[PATCH] Disable entities while parsing XML<commit_description><fixed_code> ...
<vulnerable_code>const unflatten = (obj, delimiter) => { const result = {} const seperator = delimiter || defaultDelimiter if (typeof obj !== 'object' || isDate(obj)) return obj Object.keys(original).forEach((key) => { const newKeys = key.split(seperator) newKeys.reduce((o, k, i) => { re...
<vulnerable_code> t.deepEqual(unflatten(original), expected) })<commit_title>[PATCH] fix(unflat): fix potential for prototype pollution<commit_description><fixed_code> t.deepEqual(unflatten(original), expected) }) test('it should not pollute the prototype', (t) => { const original = { '__proto__.polluted': ...
<vulnerable_code>/* * Copyright 2013-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * * @author Thomas Darimont * @author Oliver Gierke */ public class JpaSort extends Sort { super(co...
<vulnerable_code>import javax.persistence.metamodel.PluralAttribute; import org.springframework.core.annotation.AnnotationUtils; import org.springframework.data.domain.Sort; import org.springframework.data.domain.Sort.Order; import org.springframework.data.mapping.PropertyPath; import org.springframework.util.Assert; ...
<vulnerable_code>/* * Copyright 2013-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. import org.springframework.data.domain.Sort; import org.springframework.data.domain.Sort.Direction; import ...
<vulnerable_code>/* * Copyright 2008-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. import org.hamcrest.Matcher; import org.junit.Test; import org.springframework.data.domain.Sort; /** * U...
<vulnerable_code> //subsample info is only signaled for encrypted samples if (is_encrypted) { if (sai->IV_size) gf_bs_read_data(bs, (char *)sai->IV, sai->IV_size); <commit_title>[PATCH] add IV_size check on senc_Parse (#1341, #1342)<commit_description><fixed_code> //subsample info is only signaled for enc...
<vulnerable_code> else if (obj->type == JS_CREGEXP) { if (!strcmp(name, "source")) { js_pushliteral(J, obj->u.r.source); return 1; } if (!strcmp(name, "global")) {<commit_title>[PATCH] Fix use-after-free in regexp source property access.<commit_description>The underlying string of the "source" property of ...
<vulnerable_code>}; static u32 crc32sum(u32 crc, u8 * RESTRICT buf, size_t size) { while (size--) crc = crc32Table[(crc ^ *(buf++)) & 0xff] ^ (crc >> 8); return crc; } /* LZP code. These constants were manually tuned to give the best compression ratio while using relatively<commit_title>[PATCH] safety checks ...
<vulnerable_code> new_size = read_neutral_s32(byteswap_buf); xread_noeof(&byteswap_buf, 1, 4, input_des); old_size = read_neutral_s32(byteswap_buf); xread_noeof(buffer, 1, new_size, input_des); bytes_read += 8 + new_size; if ...
<vulnerable_code> const uchar *src, size_t srclen, uint flags) { size_t len, dstlen0= dstlen; len= (uint) (strmake((char*) dst, (char*) src, MY_MIN(dstlen, srclen)) - (char*) dst); len= thai2sortable(dst, len); set_if_smaller(dstlen, nweights); set_if_smaller(len, dstlen); ...
<vulnerable_code> } // endif f pID = vfork(); sprintf(fn, "-o%s", filename); if (pID == 0) {<commit_title>[PATCH 01/19] Fix tests for PLUGIN_PARTITION=NO<commit_description><fixed_code> } // endif f pID = fork(); sprintf(fn, "-o%s", filename); if (pID == 0) {
<vulnerable_code> size_t well_formed_nchars; size_t well_formed_length; size_t fixed_length; set_if_smaller(src_length, dst_length); well_formed_nchars= cs->cset->well_formed_char_length(cs, src, src + src_length, ...
<vulnerable_code> info->last_key.data + share->base.max_key_length*2, info->save_lastkey_data_length + info->save_lastkey_ref_length); info->update= info->save_update | HA_STATE_WRITTEN; info->lastinx= info->save_lastinx; info->cur_row.lastpos= info->save_lastpos; info->last_key.data_le...
<vulnerable_code> router.delete('/api/v1/groups/:id', apiv1, canUser('groups:delete'), apiCtrl.groups.deleteGroup) // Users router.get('/api/v1/users', apiv1, canUser('accounts:view'), apiCtrl.users.getWithLimit) router.post('/api/v1/users/create', apiv1, canUser('accounts:create'), apiCtrl.users.create) rout...
<vulnerable_code> ) } /** * @api {put} /api/v1/users/:username Update User * @apiName updateUser<commit_title>[PATCH] fix(accounts): security enhancement<commit_description><fixed_code> ) } apiUsers.profileUpdate = function (req, res) { if (!req.user) return res.status(400).json({ success: false, error: 'Inval...
<vulnerable_code> } $http .put('/api/v1/users/' + data.username, { aId: id, aFullname: data.fullname, aPass: data.password,<commit_title>[PATCH] fix(accounts): security enhancement<commit_description><fixed_code> } $http .put('/api...
<vulnerable_code>from synapse.federation.persistence import TransactionActions from synapse.federation.units import Edu, Transaction from synapse.http.endpoint import parse_server_name from synapse.logging.context import ( make_deferred_yieldable, nested_logging_context, return {"event": ret_pdu.get_pdu...
<vulnerable_code> PATH = "/send_leave/(?P<room_id>[^/]*)/(?P<event_id>[^/]*)" async def on_PUT(self, origin, content, query, room_id, event_id): content = await self.handler.on_send_leave_request(origin, content, room_id) return 200, (200, content) PREFIX = FEDERATION_V2_PREFIX async ...
<vulnerable_code>from synapse.events.snapshot import EventContext from synapse.events.validator import EventValidator from synapse.handlers._base import BaseHandler from synapse.logging.context import ( make_deferred_yieldable, nested_logging_context, ) async def on_exchange_third_party_invite_...
<vulnerable_code> p=GetCoderInfo(module,exception); if (p != (CoderInfo *) NULL) (void) CopyMagickString(module_name,p->name,MagickPathExtent); rights=AllPolicyRights; if (IsRightsAuthorized(ModulePolicyDomain,rights,module_name) == MagickFalse) { errno=EPERM;<commit_title>[PATCH] Use the correct r...
<vulnerable_code> p=GetCoderInfo(module,exception); if (p != (CoderInfo *) NULL) (void) CopyMagickString(module_name,p->name,MagickPathExtent); rights=AllPolicyRights; if (IsRightsAuthorized(ModulePolicyDomain,rights,module_name) == MagickFalse) { errno=EPERM; */ MagickExport void RegisterStaticMod...
<vulnerable_code> static void append_command(char_u *cmd) { char_u *s = cmd; char_u *d; STRCAT(IObuff, ": "); d = IObuff + STRLEN(IObuff); while (*s != NUL && d - IObuff + 5 < IOSIZE)<commit_title>[PATCH] patch 8.2.5063: error for a command may go over the end of<commit_description><fixed_code> ...
<vulnerable_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 5062, /**/<commit_title>[PATCH] patch 8.2.5063: error for a command may go over the end of<commit_description><fixed_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 50...