text
stringlengths
79
3.72M
<vulnerable_code> teardownDb: dbUtils.teardown, truncate: dbUtils.truncate, setup: setup, createUser: createUser, createPost: createPost,<commit_title>[PATCH] =?UTF-8?q?=F0=9F=94=92=20Fixed=20filtering=20on=20private?=<commit_description><fixed_code> teardownDb: dbUtils.teardown, truncate: ...
<vulnerable_code> int not_first = !!(h1m->flags & H1_MF_CLEN); struct ist word; word.ptr = value->ptr - 1; // -1 for next loop's pre-increment e = value->ptr + value->len; while (++word.ptr < e) { /* skip leading delimiter and blanks */ if (unlikely(HTTP_IS_LWS(*word.ptr))) continue; /* digits only now ...
<vulnerable_code> */ void mlock_vma_page(struct page *page) { BUG_ON(!PageLocked(page)); if (!TestSetPageMlocked(page)) { unsigned int nr_pages; struct zone *zone = page_zone(page); BUG_ON(!PageLocked(page)); /*<commit_title>[PATCH] mm: try_to_unmap_cluster() should lock_page() before mlocking<commit_descripti...
<vulnerable_code> BUG_ON(!page || PageAnon(page)); if (locked_vma) { mlock_vma_page(page); /* no-op if already mlocked */ if (page == check_page) ret = SWAP_MLOCK; continue; /* don't unmap */ } <commit_title>[PATCH] mm: try_to_unmap_cluster() should lock_page() before mlocking<commit_description>A ...
<vulnerable_code> fast_mix(fast_pool); add_interrupt_bench(cycles); if (unlikely(crng_init == 0)) { if ((fast_pool->count >= 64) &&<commit_title>[PATCH] random32: update the net random state on interrupt and<commit_description><fixed_code> fast_mix(fast_pool); add_interrupt_bench(cycles); this_cpu_add(net_ran...
<vulnerable_code>#include <linux/sched/debug.h> #include <linux/slab.h> #include <linux/compat.h> #include <linux/uaccess.h> #include <asm/unistd.h> scheduler_tick(); if (IS_ENABLED(CONFIG_POSIX_TIMERS)) run_posix_cpu_timers(); } /**<commit_title>[PATCH] random32: update the net random state on interrupt and<comm...
<vulnerable_code>} #endif static DEFINE_PER_CPU(struct rnd_state, net_rand_state) __latent_entropy; /** * prandom_u32_state - seeded pseudo-random number generator.<commit_title>[PATCH] random32: update the net random state on interrupt and<commit_description><fixed_code> } #endif DEFINE_PER_CPU(struct rnd_state, n...
<vulnerable_code>import java.io.File; import java.io.IOException; import java.nio.file.Files; /** * Utility class. * @throws IOException if a file could not be created. */ public static File createTempFile() throws IOException { final File file = Files.createTempFile("rep", "tmp").toFile(); ...
<vulnerable_code><commit_title>[PATCH] priviliged action for security exception<commit_description>Signed-off-by: Maxim Nesen <maxim.nesen@oracle.com><fixed_code> /* * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the *...
<vulnerable_code> } do { if (WelsTargetMbConstruction (pCtx)) { WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "WelsTargetSliceConstruction():::MB(%d, %d) construction error. pCurSlice_type:%d\n", pCurLayer->iMbX, pCurLayer->iMbY, pCurSlice->eSliceType); ++pCtx->iTotalNumMbRec; } ...
<vulnerable_code>import graphql.validation.Validator; import java.util.List; import java.util.Optional; import java.util.function.Predicate; import static java.util.Optional.ofNullable; // we allow the caller to specify new parser options by context ParserOptions parserOptions = executionInput...
<vulnerable_code>import static graphql.Assert.assertShouldNeverHappen; import static graphql.collect.ImmutableKit.emptyList; import static graphql.collect.ImmutableKit.map; import static graphql.parser.StringValueParsing.parseSingleQuotedString; import static graphql.parser.StringValueParsing.parseTripleQuotedString; i...
<vulnerable_code>package graphql.parser; import graphql.PublicApi; import graphql.language.Document; import graphql.language.Node; import java.io.UncheckedIOException; import java.util.List; import java.util.Optional; import java.util.function.BiFunction; import java.util.function.Consumer; /** * This can parse grap...
<vulnerable_code>public class ParserOptions { /** * An graphql hacking vector is to send nonsensical queries that burn lots of parsing CPU time and burn * memory representing a document that wont ever execute. To prevent this for most users, graphql-java * set this value to 15000. ANTLR parsing ti...
<vulnerable_code> import java.util.HashMap; import java.util.Map; import java.util.function.Consumer; /** */ @Internal public class SafeTokenSource implements TokenSource { private final TokenSource lexer; private final int maxTokens; private final Consumer<Token> whenMaxTokensExceeded; private final ...
<vulnerable_code> /** * This is not a test - it's a program we can run to show the system reacts to certain bad inputs */ public class BadParserSituations { static Integer STEP = 5000; String runState = "Limited Tokens"; // on the second run - have unlimited tokens if (runNumbe...
<vulnerable_code> def testSnapshotRecoveryFailsWithBadSplitNames(self, bad_split_filename): cluster, _ = self.setup() write_file(os.path.join(self.source_dir(), bad_split_filename)) with self.assertRaisesRegex(ValueError, "can't parse"): cluster.restart_dispatcher() @combinations.generate(test_bas...
<vulnerable_code>from tensorflow.python.eager import context from tensorflow.python.eager import monitoring from tensorflow.python.eager.def_function import function from tensorflow.python.framework import device from tensorflow.python.framework import errors from tensorflow.python.framework import ops # The TPU_SY...
<vulnerable_code> if (iter) { class_dev_iter_exit(iter); kfree(iter); } } <commit_title>[PATCH] block: fix use-after-free in seq file<commit_description>I got a KASAN report of use-after-free: ================================================================== BUG: KASAN: use-after-free in klist_iter_exit+...
<vulnerable_code> const decodedURI = decodeURIComponent(req.path) const pathOnDisk = path.resolve(path.join(`./public/`, decodedURI)) if (await pathExists(pathOnDisk)) { return res.sendFile(pathOnDisk) } const jobContentDigest = await cache.get(decodedURI) const cacheResult = jobContentDi...
<vulnerable_code>function lazyJobsEnabled() { return ( process.env.gatsby_executing_command === `develop` && !isCI() && !( process.env.ENABLE_GATSBY_EXTERNAL_JOBS === `true` || process.env.ENABLE_GATSBY_EXTERNAL_JOBS === `1`<commit_title>[PATCH] fix(gatsby-plugin-sharp): don't serve static ass...
<vulnerable_code> }) spawn.on(`close`, function () { expect(stderr).toEqual(``) expect(stdout).not.toEqual(``) done()<commit_title>[PATCH] fix(gatsby-plugin-sharp): don't serve static assets that are<commit_description><fixed_code> }) spawn.on(`close`, function () { stderr = stderr .repla...
<vulnerable_code> if not pytest.config.getoption('--hge-jwt-key-file'): pytest.skip('--hge-jwt-key-file is missing, skipping JWT basic tests', allow_module_level=True) if not pytest.config.getoption('--hge-jwt-conf'): pytest.skip('--hge-jwt-key-conf is missing, skipping JWT basic tests', allow_module_level=Tr...
<vulnerable_code> ) ) @staticmethod def from_lazy_load_member_list(members: Iterable[str]) -> "StateFilter": """Creates a filter that returns all non-member events, plus the member for s in state_keys ] def get_member_split(self) -> Tuple["StateFilter", "Stat...
<vulnerable_code> private TokenValidator tokenValidator; @Override protected void internalInit() { // checks this.mappedClaims = mappedClaims; } @Override public String toString() { return toNiceString(this.getClass(), "clientId", clientId, "secret", "[protected]", ...
<vulnerable_code>import java.io.IOException; import java.util.Map; import javax.naming.AuthenticationException; import org.pac4j.core.context.WebContext; import org.pac4j.core.context.session.SessionStore; import org.pac4j.core.credentials.Credentials; httpResponse.getContent()); final var...
<vulnerable_code> final var _clientID = new ClientID(configuration.getClientId()); for (var jwsAlgorithm : jwsAlgorithms) { if ("none".equals(jwsAlgorithm.getName())) { jwsAlgorithm = null; } // build validator final IDTokenValidator idTok...
<vulnerable_code><commit_title>[PATCH] reinforce security on OIDC<commit_description><fixed_code> package org.pac4j.oidc.profile.creator; import com.nimbusds.jose.JWSAlgorithm; import com.nimbusds.oauth2.sdk.id.Issuer; import com.nimbusds.openid.connect.sdk.op.OIDCProviderMetadata; import com.nimbusds.openid.connect.s...
<vulnerable_code> class UserFactory(factory.django.DjangoModelFactory): username = factory.Sequence(lambda n: f"user-{n}") class Meta: model = "accounts.User"<commit_title>[PATCH 3/6] :bug: Moved cors headers middleware higher up the chain<commit_description>This ensures the headers can be added to res...
<vulnerable_code><commit_title>[PATCH 3/6] :bug: Moved cors headers middleware higher up the chain<commit_description>This ensures the headers can be added to responses from other middleware, most notably CommonMiddleware.<fixed_code> # SPDX-License-Identifier: EUPL-1.2 # Copyright (C) 2019 - 2020 Dimpact # # Documenta...
<vulnerable_code> "openzaak.utils.middleware.LogHeadersMiddleware", "django.contrib.sessions.middleware.SessionMiddleware", # 'django.middleware.locale.LocaleMiddleware', "django.middleware.common.CommonMiddleware", "django.middleware.csrf.CsrfViewMiddleware", "django.contrib.auth.middleware.Auth...
<vulnerable_code># https://developer.mozilla.org/en-US/docs/Glossary/Preflight_request from unittest.mock import patch from django.test import override_settings, tag from django.urls import path from rest_framework import views HTTP_ORIGIN="https://evil.com", ) self.assertNotEqual(respons...
<vulnerable_code> import git import sentry_sdk from sentry_sdk.integrations import django, redis # NLX directory urls # # DJANGO-CORS-MIDDLEWARE # CORS_ORIGIN_ALLOW_ALL = True CORS_ALLOW_HEADERS = ( "x-requested-with", "content-type", "accept", "origin", "authorization", "x-csrftoken", "use...
<vulnerable_code> if "split" in kwargs: kwargs.pop("split") kwargs["cast"] = Csv() if default is not undefined and default is not None: kwargs.setdefault("cast", type(default))<commit_title>[PATCH 3/6] :bug: Moved cors headers middleware higher up the chain<commit_description>This ensure...
<vulnerable_code> * with BigBlueButton; if not, see <http://www.gnu.org/licenses/>. * */ package org.bigbluebutton.presentation.imp; import java.io.File; import java.util.HashMap; import java.util.Map; import org.bigbluebutton.presentation.ConversionMessageConstants; import org.bigbluebutton.presentation.Supported...
<vulnerable_code> free(info_blob); LOG_TEST_RET(ctx, SC_ERROR_UNKNOWN_DATA_RECEIVED, "Invalid length of 'oid' received"); } if (oid_len) { oid = info_blob + offs + 2; if (*oid != 0x06 || (*(oid + 1) != oid_len - 2)) { free(info_blob);<commit_title>[PATCH] oberthur: Handle 1B OIDs<commit_description>Thanks...
<vulnerable_code> static int numPartsWithin(int size, int part_size, int stride) { return (size - part_size + stride) / stride; } static size_t getBlockHistogramSize(Size block_size, Size cell_size, int nbins) { Size cells_per_block = Size(block_size.width / cell_size.width, block_size.height / cell_s...
<vulnerable_code> im.seek(50) assert_image_equal_tofile(im, "Tests/images/a_fli.png")<commit_title>[PATCH] Fix FLI DOS -- CVE-2021-28676<commit_description>* FliDecode did not properly check that the block advance was non-zero, potentally leading to an infinite loop on load. * This dates to the PIL Fo...
<vulnerable_code> return -1; } advance = I32(ptr); if (advance < 0 || advance > bytes) { state->errcode = IMAGING_CODEC_OVERRUN; return -1;<commit_title>[PATCH] Fix FLI DOS -- CVE-2021-28676<commit_description>* FliDecode did not properly check that the blo...
<vulnerable_code> icmp6->icmp_sum = CHECKSUM_CARRY(sum); break; case IPPROTO_IP: if (ipv4) { ipv4->ip_sum = 0; sum = do_checksum_math((uint16_t *)data, ip_hl); ipv4->ip_sum = CHECKSUM_CARRY(sum); } break;...
<vulnerable_code> assert(ip_hdr); if (pkthdr->caplen < (sizeof(*ip_hdr) + l2len)) { tcpedit_setwarn(tcpedit, "caplen too small to read IPv4 header: %u", pkthdr->caplen); return TCPEDIT_WARN; } if (ip_hdr->ip_v != 4) { tcpedit_seterr(tcpedit, "Invalid packet: Expe...
<vulnerable_code> } } /* do we need to fix checksums? -- must always do this last! */ if ((tcpedit->fixcsum || needtorecalc)) { if (ip_hdr != NULL) { dbgx(3, "doing IPv4 checksum: needtorecalc=%d", needtorecalc); retval = fix_ipv4_checksums(tcpedit, *pkthdr, ip_hdr, l...
<vulnerable_code> /* room needed to store l_nb_code_blocks code blocks for a precinct*/ OPJ_UINT32 l_nb_code_blocks_size; /* size of data for a tile */ OPJ_UINT32 l_data_size; l_cp = p_tcd->cp; l_tcp = &(l_cp->tcps[p_tile_no]); l_tilec->data_size_needed = l_tile_data_size; } ...
<vulnerable_code> def get(image_file, domain, title, singer, album): import base64 import json import requests headers = {'Content-type': 'application/json', 'Accept': 'text/plain'} status = try_get_cached(domain, {"title": title, "singer": singer, "album": album}) status ...
<vulnerable_code> image = img.save(file_name) print(f"Saved {file_name} from {file_db_entry}.") print(f"Returning {file_db_entry}.") return str(file_db_entry) def run_server_api():<commit_title>[PATCH] sec fix<commit_description><fixed_code> image = img.save(file_name) print(f"Saved {file_n...
<vulnerable_code>void SanitizeFilename(char *filename) { int i; for (i = 0; i < strlen(filename); ++i) { if (! (isalnum(filename[i]) || (filename[i] == '.') || (filename[i] == '\\'))) { filename[i] = '_'; } }<commit_title>[PATCH] Add '/' as a prohibited path character as well.<commit_description>I'l...
<vulnerable_code> if (max_width < rulewidth) max_width = rulewidth; check_maximum_width(t); #ifdef MATRIX<commit_title>[PATCH] Truncate max_width for renderTable<commit_description>Bug-Debian: https://github.com/tats/w3m/issues/25<fixed_code> if (max_width < rulewidth) max_width = rulewidth; #define MAX...
<vulnerable_code>#include "sfendian.h" #include "common.h" /*----------------------------------------------------------------------------------------------- ** psf_log_printf allows libsndfile internal functions to print to an internal parselog which ** can later be displayed. int maxlen ; char *start ; maxlen = ...
<vulnerable_code> { SFE_BAD_CHUNK_MARKER , "Error : Bad chunk marker." }, { SFE_BAD_CHUNK_DATA_PTR , "Error : Bad data pointer in SF_CHUNK_INFO struct." }, { SFE_FILENAME_TOO_LONG , "Error : Supplied filename too long." }, { SFE_MAX_ERROR , "Maximum error number." }, { SFE_MAX_ERROR + 1 , NULL } /* Ultimate s...
<vulnerable_code> if (byte[i] & 0x7f) break; if (byte[i] & 0x40) i--; byte[i] &= 0x7f; if (negative) if (byte[i] & 0x7f) break; if (byte[i] & 0x40) i--; byte[i] &= 0x7f; for (j = 4; j >= i; j--)<commit_title>[PATCH] encode: protect from stack under-flow<commit_description>From G...
<vulnerable_code>{ struct RClass *sc, *c; if (o->c->tt == MRB_TT_SCLASS) return; sc = MRB_OBJ_ALLOC(mrb, MRB_TT_SCLASS, mrb->class_class); sc->flags |= MRB_FL_CLASS_IS_INHERITED; break; } obj = mrb_basic_ptr(v); prepare_singleton_class(mrb, obj); return obj->c; }<commit_title>[PATCH] class.c: add `...
<vulnerable_code> public Query build(MetaData metadata, Map<String, String> params, boolean isCountQuery) { final List<Criterion> criteria = criterionFactory.build(metadata, params); String queryString = String.format(isCountQuery ? MAIN_COUNT_QUERY : MAIN_QUERY, ...
<vulnerable_code> state=dict(type='str', default='present', choices=['absent', 'present']), digest=dict(type='str', default='sha256'), privatekey_path=dict(type='path'), privatekey_content=dict(type='str'), privatekey_passphrase=dict(type='str', no_log=True), ...
<vulnerable_code> - If set to C(yes), will return the (current or generated) private key's content as I(privatekey). - Note that especially if the private key is not encrypted, you have to make sure that the returned value is treated appropriately and not accidentally written to log...
<vulnerable_code> module = AnsibleModule( argument_spec=dict( path=dict(type='path'), content=dict(type='str'), passphrase=dict(type='str', no_log=True), return_private_key_data=dict(type='bool', default=False), select_crypto_backend=dict(type='str'...
<vulnerable_code> force=dict(type='bool', default=False), path=dict(type='path', required=True), privatekey_path=dict(type='path'), privatekey_content=dict(type='str'), format=dict(type='str', default='PEM', choices=['OpenSSH', 'PEM']), privatekey_p...
<vulnerable_code> module = AnsibleModule( argument_spec=dict( privatekey_path=dict(type='path'), privatekey_content=dict(type='str'), privatekey_passphrase=dict(type='str', no_log=True), path=dict(type='path', required=True), select_crypto_backend=d...
<vulnerable_code> # General properties of a certificate privatekey_path=dict(type='path'), privatekey_content=dict(type='str'), privatekey_passphrase=dict(type='str', no_log=True), # provider: assertonly ownca_path=dict(type='path'), o...
<vulnerable_code> path=dict(type='path', required=True), format=dict(type='str', default='pem', choices=['pem', 'der']), privatekey_path=dict(type='path'), privatekey_content=dict(type='str'), privatekey_passphrase=dict(type='str', no_log=True), iss...
<vulnerable_code> import freemarker.cache.StringTemplateLoader; import freemarker.core.ParseException; import freemarker.template.Configuration; import freemarker.template.TemplateException; public static Configuration getConfiguration(AMWTemplateExceptionHandler templateExceptionHandler) { Configuration ...
<vulnerable_code> assertTrue(result.isSuccess()); } private TemplateDescriptorEntity createTemplate(String templateContent) { TemplateDescriptorEntity templateDescriptorEntity = new TemplateDescriptorEntity();<commit_title>[PATCH] prevent usage of dangerous freemarker functions<commit_description><fixed...
<vulnerable_code>function merge(dst, ...sources) { for (src of sources) { for (let key in src) { let s = src[key], d = dst[key] if (Object(s) == s && Object(d) === d) { dst[key] = merge(d, s)<commit_title>[PATCH] Fix for Prototype Pollution<commit_description><fixed_code> function me...
<vulnerable_code>var b = {"b":{"yellow":"mango"}} var c = {"a":{"orange":"orange"}} merge(a,b,c) console.log(a)<commit_title>[PATCH] Fix for Prototype Pollution<commit_description><fixed_code> var b = {"b":{"yellow":"mango"}} var c = {"a":{"orange":"orange"}} merge(a,b,c) console.log(a) //Test case for prototype pollu...
<vulnerable_code> FREE(&mx.mbox); } mutt_account_tourl(&idata->conn->account, &url); url.path = mbox; url_tostring(&url, cachepath, sizeof(cachepath), U_PATH);<commit_title>[PATCH] Selectively cache headers<commit_description>Co-authored-by: JerikoOne <jeriko.one@gmx.us><fixed_code> FREE(&mx.mbox); } ...
<vulnerable_code> offsets[i] = getoffset(ttf,offsize); dicts = malloc((count+1)*sizeof(struct topdicts *)); for ( i=0; i<count; ++i ) { dicts[i] = readcfftopdict(ttf,fontnames!=NULL?fontnames[i]:NULL, offsets[i+1]-offsets[i], info); if ( parent_dict!=NULL && parent_dict->fontmatrix_set ) {<commit_title>[PAT...
<vulnerable_code> stack[sp++] = -(v-251)*256 - *type1++ - 108; --len; } else { int val = (*type1<<24) | (type1[1]<<16) | (type1[2]<<8) | type1[3]; stack[sp++] = val; type1 += 4;<commit_title>[PATCH] Fix out of bounds read condition and buffer overflow<commit_description><fixed_code> stack[sp++] = -(v-25...
<vulnerable_code> if ( dummy->names[ttf_uniqueid]==NULL || *dummy->names[ttf_uniqueid]=='\0' ) { time(&now); tm = localtime(&now); sprintf( buffer, "%s : %s : %d-%d-%d", BDFFoundry?BDFFoundry:TTFFoundry?TTFFoundry:"FontForge 2.0", sf->fullname!=NULL?sf->fullname:sf->fontname, tm->tm_mday, tm->tm_mon+1, tm->...
<vulnerable_code> } else { // We don't know what this packet is, so we'll let the parser continue // just so that we can dequeue it in one shot working_segment_size = packet_size + PACKET_SIZE_TYPE_SIZE; if (working_segment_size > CRSF_MAX_PACKET_LEN) { parser_statistics->invalid_unknown_packet_...
<vulnerable_code> import java.io.File; import java.io.IOException; import java.util.Set; import org.apache.commons.io.FileUtils; import org.eclipse.jgit.lib.Repository; /** * Simple snippet which shows how to list all Tags * System.out.println("Repository at " + repository.getWorkTree()); ...
<vulnerable_code> if ( node.node_type == 'object' ) { var group = 'object'; var label = dataHandler.generate_label(node); var labelHtml = label + '</br><i>' + escapeHtml(node.comment) + '</i>' label += ' ' + escapeHtml(node.comment) ...
<vulnerable_code> if (len > 0) { /* Evaluate the line */ jerry_value_t ret_val_eval = jerry_eval (buffer, len, JERRY_PARSE_NO_OPTS); <commit_title>[PATCH] Add a validation before evaluating the source code<commit_description>This patch checks whether the source code is a valid UTF-8 string b...
<vulnerable_code>if __name__ == "__main__": reload_javascript() demo.queue(concurrency_count=CONCURRENT_COUNT).launch( server_name=server_name, server_port=server_port, share=share,<commit_title>[PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20blocked=20path?=<commit_description><fixed_code> if __...
<vulnerable_code>"use strict"; System.register(["angular", "app/core/utils/kbn", "jquery", "jquery.flot", "jquery.flot.time", "./lib/perfect-scrollbar.min"], function (_export, _context) { "use strict"; var angular, kbn, $, PerfectScrollbar; return { setters: [function (_angular) { angular = _angular....
<vulnerable_code> var formatted = ctrl.formatValue(item.series.data[0][1]); body = '<div class="piechart-tooltip-small"><div class="piechart-tooltip-time">'; body += '<div class="piechart-tooltip-value">' + item.series.label + ': ' + formatted; body += " (" + percent + "%)" + '</div>'; ...
<vulnerable_code>import $ from "jquery"; import "jquery.flot"; import "jquery.flot.time"; import PerfectScrollbar from "./lib/perfect-scrollbar.min"; angular name = panel.legend.header; } var html = '<th class="pointer" data-stat="' + statName + '">' + name; if (panel.legend...
<vulnerable_code> return '' def valid_id(opts, id_): ''' Returns if the passed id is valid ''' try: return bool(clean_path(opts['pki_dir'], id_)) except (AttributeError, KeyError) as e: return False <commit_title>[PATCH] Add clean_id function to salt.utils.verify.py<commit_descr...
<vulnerable_code> None. """ # Set the next version of root to download. next_version = current_root_metadata['version'] + 1 # Temporarily set consistent snapshot. Will be updated to whatever is set # in the latest root.json after running through the intermediates with # _update_metadata()...
<vulnerable_code># to suspend execution for a specified amount of time. See # theupdateframework/tuf/issue#338. SLEEP_BEFORE_ROUND = None<commit_title>[PATCH] address @lukpueh comments<commit_description>Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com><fixed_code> # to suspend execution for a spe...
<vulnerable_code> return rc; } static int fsmSetFCaps(const char *path, const char *captxt) { int rc = 0; #if WITH_CAP if (captxt && *captxt != '\0') { cap_t fcaps = cap_from_text(captxt); if (fcaps == NULL || cap_set_file(path, fcaps) != 0) { rc = RPMERR_SETCAP_FAILED; } if (_fsm_debug) { rpm...
<vulnerable_code>#include "CRtspSession.h" #include <stdio.h> #include <time.h> CRtspSession::CRtspSession(SOCKET aRtspClient, CStreamer * aStreamer) : m_RtspClient(aRtspClient),m_Streamer(aStreamer) { char * TmpPtr; char CP[128]; //static char CP[1024]; char * pCP; ClientPortPtr = strstr(CurRequest,"...
<vulnerable_code> return true; } catch (IllegalArgumentException e) { context.disableDefaultConstraintViolation(); context.buildConstraintViolationWithTemplate(e.getMessage()).addConstraintViolation(); return false; } }<commit_title>[PATCH] Update CronV...
<vulnerable_code>package org.dpppt.backend.sdk.ws.controller; import com.fasterxml.jackson.core.JsonProcessingException; import io.jsonwebtoken.Jwts; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import org.dpppt.backend.sdk.data.gaen.GAENDataService; import org.dpppt....
<vulnerable_code><commit_title>[PATCH] [MAPR] Setted responses retention time on fake requests<commit_description><fixed_code> /* * Copyright (c) 2020 Gobierno de España * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * f...
<vulnerable_code><commit_title>[PATCH] [MAPR] Setted responses retention time on fake requests<commit_description><fixed_code> /* * Copyright (c) 2020 Gobierno de España * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * f...
<vulnerable_code><commit_title>[PATCH] [MAPR] Setted responses retention time on fake requests<commit_description><fixed_code> /* * Copyright (c) 2020 Gobierno de España * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * f...
<vulnerable_code> r = pthread_mutex_trylock(mutex); if (r && r != EBUSY && r != EAGAIN) abort(); if (r) return -1; else return 0; } r = pthread_rwlock_tryrdlock(rwlock); if (r && r != EBUSY && r != EAGAIN) abort(); if (r) return -1; else return 0; } r = pthread_rwlock...
<vulnerable_code>#include "internal.h" #define HAVE_SRWLOCK_API() (pTryAcquireSRWLockShared != NULL) #define HAVE_CONDVAR_API() (pInitializeConditionVariable != NULL) #ifdef _MSC_VER /* msvc */ #endif inline static int uv__rwlock_srwlock_init(uv_rwlock_t* rwlock); inline static void uv__rwlock_srwlock_destroy(uv_r...
<vulnerable_code>sSetFileCompletionNotificationModes pSetFileCompletionNotificationModes; sCreateSymbolicLinkW pCreateSymbolicLinkW; sCancelIoEx pCancelIoEx; sInitializeSRWLock pInitializeSRWLock; sAcquireSRWLockShared pAcquireSRWLockShared; sAcquireSRWLockExclusive pAcquireSRWLockExclusive; sTryAcquireSRWLockShared pT...
<vulnerable_code> return 0; }<commit_title>[PATCH] win: fix unsavory rwlock fallback implementation<commit_description>Before this patch an uv_mutex_t (backed by a critical section) could be released by a tread different from the thread that acquired it, which is not allowed. This is fixed by using a semaphore instea...
<vulnerable_code> else if (jsvIsFloat(var)) jsiConsolePrintf("Double %f", jsvGetFloat(var)); else if (jsvIsFunctionParameter(var)) jsiConsolePrintf("Param %q ", var); else if (jsvIsArrayBufferName(var)) jsiConsolePrintf("ArrayBufferName[%d] ", jsvGetInteger(var)); else if (jsvIsArrayBuffer(var)) jsiConsolePrintf...
<vulnerable_code> p[4] != '\0' || p[5] != '\0') { /* Chunk is malformed */ return(-1); } } (void) SetImageProfile(image,"exif",profile, error_info->exception); return(1); } /* PNG image is corrupt. */...
<vulnerable_code> this.ss.on('info', function(isMatch, data, start, end) { if (data && !self.maxed) { if (self.nread + (end - start) > MAX_HEADER_SIZE) { end = (MAX_HEADER_SIZE - self.nread); self.nread = MAX_HEADER_SIZE; } else self.nread += (end - start);<commit_title>[PATCH] ...
<vulnerable_code> *pheight = imsy; *ncolors = max_color_index + 1; *palette = (unsigned char *) AcquireQuantumMemory(*ncolors,4); for (n = 0; n < (ssize_t) *ncolors; ++n) { (*palette)[n * 4 + 0] = sixel_palet[n] >> 16 & 0xff; (*palette)[n * 4 + 1] = sixel_palet[n] >> 8 & 0xff;<commit_titl...
<vulnerable_code> assert( functionGenerators_.find(F) == functionGenerators_.end() && "Adding same function twice."); functionGenerators_[F] = std::move(BFG); } <commit_title>[PATCH] Re-sync with internal repository (#822)<commit_description>Co-authored-by: Facebook Community Bot <6422482+facebook-github...
<vulnerable_code> opts.staticBuiltinsEnabled = context->getOptimizationSettings().staticBuiltins; opts.verifyIR = compileFlags.verifyIR; auto bytecode = createBCProviderFromSrc( hbc::generateBytecodeModule(&M, M.getTopLevelFunction(), opts)); bytecode->singleFunction_ = isSingleFunctionExpression(par...
<vulnerable_code> debugCache = hbciSel.getDebugCache(); } BMGen.setFunctionGenerator(&F, std::move(funcGen)); } sourceMapGen, std::move(baseBCProvider)); if (options.format == OutputFormatKind::EmitBundle) { assert(BM != nullptr); BytecodeSerializer BS{OS, options};<commit_title>...
<vulnerable_code> "Cannot access variables in inner scopes"); int32_t delta = curScopeDepth.getValue() - instScopeDepth.getValue(); assert(delta > 0 && "HBCResolveEnvironment for current scope"); BCFGen_->emitGetEnvironment(encodeValue(Inst), delta - 1); } void HBCISel::generateHBCStoreToEnvironmentInst(<com...
<vulnerable_code> std::shared_ptr<Context> context = M.shareContext(); CompileResult result{Success}; if (cl::BytecodeFormat == cl::BytecodeFormatKind::HBC) { result.bytecodeProvider = hbc::BCProviderFromSrc::createBCProviderFromSrc( hbc::generateBytecodeModule(&M, M.getTopLevelFunction(), genOptions))...
<vulnerable_code> // Note that this will do nothing after the very first time a lazy function // is called, so we only resize before we save any registers at all. if (LLVM_UNLIKELY(selfHandle->getCodeBlock(runtime)->isLazy())) { selfHandle->getCodeBlock(runtime)->lazyCompile(runtime); if (LLVM_UNLIKELY( ...
<vulnerable_code>#include "hermes/IRGen/IRGen.h" #include "hermes/Support/Conversions.h" #include "hermes/Support/PerfSection.h" #include "hermes/VM/GCPointer-inline.h" #include "hermes/VM/Runtime.h" #include "hermes/VM/RuntimeModule.h" } } // namespace void CodeBlock::lazyCompileImpl(Runtime &runtime) { assert(isLa...