text
stringlengths
79
3.72M
<vulnerable_code> fileNameStr += " ("+getSizeStr(filesize)+")"; pd.filename.html(fileNameStr); obj.fileCounter++; obj.selectedFiles++; if(s.showPreview) ts.fileData = fd; var pd = new createProgressDiv(obj, s); pd.file...
<vulnerable_code>self.__precacheManifest = [ { "revision": "f761f5e5af17e9fa7726", "url": "static/css/main.82aeebdd.chunk.css" }, { "revision": "f761f5e5af17e9fa7726", "url": "static/js/main.f761f5e5.chunk.js" }, { "revision": "b7f3a89c186b069a4989", "revision": "11bbcff6f99be028bf04e2...
<vulnerable_code>importScripts("https://storage.googleapis.com/workbox-cdn/releases/3.6.3/workbox-sw.js"); importScripts( "precache-manifest.6a6cf59d0e8f4babe46316c29c96f1c4.js" ); workbox.clientsClaim();<commit_title>[PATCH] Bug fix 3.7/escape jquery uploadfile plugin filestring and<commit_description><fixed_code>...
<vulnerable_code>/*! For license information please see main.f761f5e5.chunk.js.LICENSE.txt */ (window.webpackJsonp=window.webpackJsonp||[]).push([[0],[,,,,,,,,function(e,t,i){"use strict";i.d(t,"a",(function(){return n})),i.d(t,"b",(function(){return r})),i.d(t,"c",(function(){return a})),i.d(t,"d",(function(){return o...
<vulnerable_code> case XWD_GRAY_SCALE: if (bpp != 1 && bpp != 8) return AVERROR_INVALIDDATA; if (pixdepth == 1) { avctx->pix_fmt = AV_PIX_FMT_MONOWHITE; } else if (pixdepth == 8) { avctx->pix_fmt = AV_PIX_FMT_GRAY8; } break;<commit_title>[PA...
<vulnerable_code> x=inputs, x_min=[[1.0], [2.0], [4.0]], x_max=1.0)) class RequantizeOpTest(test_util.TensorFlowTestCase): @test_util.run_in_graph_and_eager_modes<commit_title>[PATCH] Fix QuantizedAvgPool invalid rank issue.<commit_description>Passing in an invalid rank in eager mode led to a runtime ...
<vulnerable_code>from tensorflow.python.client import session from tensorflow.python.framework import constant_op from tensorflow.python.framework import dtypes from tensorflow.python.framework import meta_graph from tensorflow.python.framework import ops from tensorflow.python.framework import test_util # No more ...
<vulnerable_code> if (ndo->ndo_vflag) { ND_TCHECK(dp->icmp6_data16[0]); ND_PRINT((ndo,", id 0x%04x", EXTRACT_16BITS(&dp->icmp6_data16[0]))); if (dp->icmp6_data16[1] & 0xc0) ND_PRINT((ndo," ")); if (dp->icmp6_data16[1] & 0x80)<commit_title>[PATCH] CVE-2017-13021/ICMP6: Add a missing bounds check.<commit...
<vulnerable_code>/* $OpenBSD: monitor.c,v 1.165 2016/09/05 13:57:31 djm Exp $ */ /* * Copyright 2002 Niels Provos <provos@citi.umich.edu> * Copyright 2002 Markus Friedl <markus@openbsd.org> #include "misc.h" #include "servconf.h" #include "monitor.h" #include "monitor_mm.h" #ifdef GSSAPI #include "ssh-gss.h" #endif ...
<vulnerable_code>/* $OpenBSD: monitor_mm.c,v 1.21 2015/02/06 23:21:59 millert Exp $ */ /* * Copyright 2002 Niels Provos <provos@citi.umich.edu> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are m...
<vulnerable_code>/* $OpenBSD: packet.c,v 1.238 2016/09/19 19:02:19 markus Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland /* NOTREACHED */ } /* Serialise compression state into a blob for privsep */ static int ssh_packet_get_compress_state(struct ss...
<vulnerable_code> /* $OpenBSD: servconf.c,v 1.295 2016/08/25 23:57:54 djm Exp $ */ /* * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland * All rights reserved }; static const struct multistate multistate_compression[] = { { "delayed", COMP_DELAYED }, { "yes", COMP_ZLIB }, { "no...
<vulnerable_code>/* $OpenBSD: sshconnect2.c,v 1.248 2016/09/22 02:29:57 dtucker Exp $ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. * Copyright (c) 2008 Damien Miller. All rights reserved. compat_cipher_proposal(options.ciphers); myproposal[PROPOSAL_COMP_ALGS_CTOS] = myproposal[PROPOSAL_...
<vulnerable_code>/* $OpenBSD: sshd.c,v 1.475 2016/08/28 22:28:12 djm Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland #include "dispatch.h" #include "channels.h" #include "session.h" #include "monitor_mm.h" #include "monitor.h" #ifdef GSSAPI #include "...
<vulnerable_code> private static final Long CASE_ID = 1L; private static final Long CASE_ID_GRANTED = 2L; private static final String USER_ID = "89000"; private static final String USER_ID_GRANTED = "89001"; private static final String CASE_ROLE = "[DEFENDANT]"; @PersistenceContext private ...
<vulnerable_code>import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.mockito.Mockito.verify; import org.junit.Before; import org.junit.Test; private static final Long CASE_ID = 1L; private static final Long CASE_ID_GRANTED = 2L; private stati...
<vulnerable_code> "classpath:sql/insert_case_users.sql", }) public void shouldFindCasesUserIdHasAccessTo() { final List<Long> casesId = repository.findCasesUserIdHasAccessTo(USER_ID); assertThat(casesId.size(), equalTo(1)); assertThat(casesId.get(0), equalTo(CASE_ID)); f...
<vulnerable_code>import java.util.HashMap; import java.util.Map; import java.util.Optional; import static java.util.Arrays.asList; import static org.junit.jupiter.api.Assertions.assertAll; import static org.mockito.Matchers.any; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import ...
<vulnerable_code> "classpath:sql/insert_case_users.sql", }) public void shouldFindCasesUserIdHasAccessTo() { List<Long> casesId = repository.findCasesUserIdHasAccessTo(USER_ID); assertThat(casesId.size(), equalTo(1)); assertThat(casesId.get(0), equalTo(CASE_ID)); casesId...
<vulnerable_code> private static final String TEST_FIELD_VALUE = "Tim"; private SearchQueryFactoryOperation subject; private SearchQueryFactoryOperation subjectTest; private final CriterionFactory criterionFactory = new CriterionFactory(); @Mock userAuthorisation, authorised...
<vulnerable_code> verify(em, times(1)).createNativeQuery("SELECT * FROM case_data WHERE case_type_id = ?0 AND id IN (SELECT cu.case_data_id FROM case_users AS cu WHERE user_id = '2') ORDER BY created_date ASC", CaseDetailsEntity.class); verify(result, times(1)).setParameter(0, TEST_CASE_TYPE_VALUE); ...
<vulnerable_code> private Map<String, String> params; private Set<String> roles = null; private UserAuthorisation userAuthorisationTest = new UserAuthorisation("2", UserAuthorisation.AccessLevel.GRANTED,roles); @Before public void prepare() { criterionFactory, em, ...
<vulnerable_code> public void setFixedListItems(List<FixedListItem> fixedListItems) { this.fixedListItems = fixedListItems; } public List<CaseField> getComplexFields() { return complexFields; }<commit_title>[PATCH 01/18] Bump jackson-databind to v2.9.9 for CVE-2019-12086<commit_descripti...
<vulnerable_code><commit_title>[PATCH 01/18] Bump jackson-databind to v2.9.9 for CVE-2019-12086<commit_description>RDM-4823<fixed_code> package uk.gov.hmcts.ccd.domain.types; import javax.inject.Named; import javax.inject.Singleton; import java.util.ArrayList; import java.util.Collections; import java.util.List; impo...
<vulnerable_code><commit_title>[PATCH 01/18] Bump jackson-databind to v2.9.9 for CVE-2019-12086<commit_description>RDM-4823<fixed_code> package uk.gov.hmcts.ccd.domain.types; import java.util.Collections; import java.util.List; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Moc...
<vulnerable_code> item.setCode(itemCode); caseField.getFieldType() .getFixedListItems() .add(item); return this; } }<commit_title>[PATCH 01/18] Bump jackson-databind to v2.9.9 for CVE-2019-12086<commit_description>RDM-4823<fixed_code> item.setCode(it...
<vulnerable_code> if (errno != EPIPE) { if (conf_verbose) log_ppp_info2("pptp: write: %s\n", strerror(errno)); return -1; } } } <commit_title>[PATCH] Fix post_msg implementation bug<commit_description>I think the error handling code of `post_msg` is wrongly implemented due to coding typo. The `EPIP...
<vulnerable_code> + packetbuf_payload_len; if(req_size > sizeof(uip_buf)) { LOG_ERR( "input: packet dropped, minimum required IP_BUF size: %d+%d+%d=%d (current size: %u)\n", uncomp_hdr_len, (uint16_t)(frag_offset << 3), packetbuf_payload_len, req_size, (unsigned)sizeof(uip...
<vulnerable_code> // Jump after central file header extra field and file comment mFile.Seek(ze.eclength + ze.clength,SEEK_CUR); items.push_back(ze); } /* go through list and figure out file header lengths */<commit_title>[PATCH] [filesystem] ZipManager: skip path traversal<commit_description><fixed_cod...
<vulnerable_code><commit_title>[PATCH] [filesystem] ZipManager: skip path traversal<commit_description><fixed_code> /* * Copyright (C) 2017 Team XBMC * http://xbmc.org * * This Program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as publ...
<vulnerable_code>#endif if (meta_bc == 4) { if (*dp++ != (csum & 0xff) || *dp++ != ((csum >> 8) & 0xff) || *dp++ != ((csum >> 16) & 0xff) || *dp++ != ((csum >> 24) & 0xff)) return FALSE; } else { csum ^= csum >> 16; ...
<vulnerable_code> request.set_time_zone(QTimeZone::systemTimeZoneId().toStdString()); auto ret = request_launch(parser); if (ret == ReturnCode::Ok && request.instance_name() == petenv_name.toStdString() && MP_SETTINGS.get_as<bool>(mounts_key)) { QString mount_source{}; try<commit...
<vulnerable_code> TEST_F(Client, shell_cmd_skips_automount_when_disabled) { const grpc::Status ok{}, notfound{grpc::StatusCode::NOT_FOUND, "msg"}; EXPECT_CALL(mock_settings, get(Eq(mp::mounts_key))).WillRepeatedly(Return("false")); EXPECT_CALL(mock_daemon, launch(_, _, _)).WillOnce(Return(ok)); EXPECT_...
<vulnerable_code> ND_PRINT((ndo, "smb_bcc=%u\n", bcc)); if (bcc > 0) { smb_fdata(ndo, data1 + 2, f2, maxbuf - (paramlen + datalen), unicodestr); if (strcmp((const char *)(data1 + 2), "\\MAILSLOT\\BROWSE") == 0) { print_browse(ndo, param, paramlen, data, datalen); return; } if (strcmp((const char ...
<vulnerable_code> print("Number of users updated:" + str(users_info_updated_count)) dev_tokens_users = get_dev_token_users_from_mongo() #print("dev_tokens_users: " + str(dev_tokens_users)) #################### # TRIED DO UPDATE WITH PASSED LIST NONE OF THIS WORKED # HAD To build up the entire s...
<vulnerable_code> clut_image=RemoveFirstImageFromList(images); if (clut_image == (Image *) NULL) { status=MagickFalse; break; } reconstruct_image=RemoveFirstImageFromList(images); if (reconstruct_image == (Image *...
<vulnerable_code> _images. */ new_images=RemoveFirstImageFromList(&_images); clut_image=RemoveLastImageFromList(&_images); /* FUTURE - produce Exception, rather than silent fail */ if (clut_image == (Image *) NULL) break; (void) ClutIma...
<vulnerable_code> return element; }, measureString: function(string, parentClasses, elementClasses, additionalStyles) { var element = this._setupStringMeasurement(parentClasses, elementClasses, additionalStyles); element.innerHTML = string; return { width: element.cli...
<vulnerable_code> buffer.push('<div class="flame-checkbox-box"></div>'); this.renderCheckMark(buffer); buffer.push('<label class="flame-checkbox-label">'); buffer.push(Ember.isNone(this.get('title')) ? '' : this.get('title')); buffer.push('</label>'); }, <commit_title>[PATCH] ...
<vulnerable_code> return; } var itemTitleKey = this.get('itemTitleKey'); var allTitles = items.reduce(function(currentTitles, item) { var nextTitle = Ember.get(item, itemTitleKey); return currentTitles + nextTitle + '<br>'; }, ''); // Give the m...
<vulnerable_code> var owner = this.get('owner'); var selection = owner.get('selection'); var dataCell = owner.get('selectedDataCell'); var readOnlyValue = owner.editableValue(dataCell, true); this.selectionContent = selection.html(); selection.html(...
<vulnerable_code> } if (this.get('content.title')) { buffer.push('<div class="panel-title">%@</div>'.fmt(this.get('content.title'))); didRenderTitle = true; } headerLabel = header.get ? header.get('headerLabel') : header.label; if (!headerLabel) ...
<vulnerable_code> if(!readingDecrypted) { streamReader = mParser->StartReadingFromStreamForPlainCopying(inStream); } while (it.MoveNext() && PDFHummus::eSuccess == status) {<commit_title>[PATCH] Fix append pages when stream is not readable<commit_description>Fixes #191<fixed_code> if(!readingDecrypted) { stre...
<vulnerable_code>describe('AppendPagesTest', function() { it('should complete without error', function() { var pdfWriter = require('../muhammara').createWriter(__dirname + '/output/AppendPagesTest.pdf'); pdfWriter.appendPDFPagesFromPDF(__dirname + '/TestMaterials/Original.pdf'); pdfWriter.appendPDFPagesFromPDF(...
<vulnerable_code> } } long WebPImage::getHeaderOffset(byte *data, long data_size, byte *header, long header_size) { long pos = -1; for (long i=0; i < data_size - header_size; i++) { if (memcmp(header, &data[i], header_size) == 0) {<commit_t...
<vulnerable_code> from tensorflow.python.framework import constant_op from tensorflow.python.framework import dtypes from tensorflow.python.framework import test_util from tensorflow.python.ops import array_ops from tensorflow.python.ops import boosted_trees_ops from tensorflow.python.ops import sparse_ops from tensorf...
<vulnerable_code>import { SAMPLE_DB_ID, SAMPLE_DB_TABLES } from "__support__/e2e/cypress_data"; const { STATIC_ORDERS_ID, * @param {object} question * @param {{callback: function, mode: (undefined|"notebook")}} config */ export function visitQuestionAdhoc(question, { callback, mode } = {}) { const questionMode ...
<vulnerable_code>/** * Executes native query and waits for the results to load. * Makes sure that the question is not "dirty" after the query successfully ran. * @param {string} [xhrAlias ="dataset"] */ export function runNativeQuery(xhrAlias = "dataset") { cy.get(".NativeQueryEditor .Icon-play").click(); cy.wa...
<vulnerable_code> .and("eq", `/question/${questionId}-test-question`); }); }); });<commit_title>[PATCH] Do not autorun ad-hoc native queries (#25675) (#25732)<commit_description><fixed_code> .and("eq", `/question/${questionId}-test-question`); }); }); it("should not autorun ad-hoc native q...
<vulnerable_code>import { restore, visitQuestion } from "__support__/e2e/helpers"; describe("scenarios > permissions", () => { beforeEach(restore); const PATHS = [ "/dashboard/1", "/question/1", "/collection/1", "/admin", // this url is a native query pointing at the sample db "/question#e...
<vulnerable_code> restore, withDatabase, adhocQuestionHash, } from "__support__/e2e/helpers"; const PG_DB_ID = 2; cy.visit(`/question#` + adhocQuestionHash(questionDetails)); cy.wait("@getDatabases"); cy.findByText("Doing science...").should("be.visible"); cy.get("body").type("{cmd}{enter...
<vulnerable_code> raise errors[-1] def rand_user_password(pwlen=9): return util.rand_str(pwlen, select_from=PW_SET) <commit_title>[PATCH] cc_set_password: increase random pwlength from 9 to 20<commit_description>Increasing the bits of security from 52 to 115. LP: #1860795<fixed_code> raise errors...
<vulnerable_code>const _ = require('lodash'); const nodePath = require('path'); const uuid = require('uuid'); const Promise = require('bluebird'); const {createReadStream, createWriteStream, constants} = require('fs'); const fsAsync = require('./helpers/fs-async'); })(); const fsPath = (() => { const res...
<vulnerable_code> if (anim->to) { /* now that we have a target, if there is a to value to parse, create the attribute and parse it */ gf_node_get_attribute_by_tag((GF_Node *)anim->animation_elt, TAG_SVG_ATT_to, GF_TRUE, GF_FALSE, &info); gf_svg_parse_attribute((GF_Node *)anim->animation_elt, &info, anim->to, ...
<vulnerable_code> while (*content == ' ') content++; if (strstr(content, "defer")) { par->defer = 1; content += 4; } else { content = attribute_content; } *(SVG_String *)info->far_ptr = gf_strdup(attribute_content); break; default: GF_LOG(GF_LOG_WARNING, GF_LOG_PARSER, ("[SVG Parsing] Cannot parse attri...
<vulnerable_code>size_t _dl_dst_count (const char *name, int is_path) { size_t cnt = 0; do { size_t len = 1; /* $ORIGIN is not expanded for SUID/GUID programs. */ if ((((!__libc_enable_secure && strncmp (&name[1], "ORIGIN", 6) == 0 && (len = 7) != 0) || (strncmp (&name[1], "PLATF...
<vulnerable_code> v->iov_base = buf + msgoff; v->iov_len = bufsize - msgoff; ++v; v->iov_base = (char *) "\n"; v->iov_len = 1; (void)__writev(STDERR_FILENO, iov, 2); } /* Prepare for multiple users. We have to take care: open and<commit_title>[PATCH] Update.<commit_description>1999-11-09 Ulrich Drepper...
<vulnerable_code># define SWITCH_ENUM_CAST(x) (x) # endif /* How many characters in the character set. */ # define CHAR_SET_SIZE 256 # ifdef SYNTAX_TABLE extern char *re_syntax_table; # else /* not SYNTAX_TABLE */ static char re_syntax_table[CHAR_SET_SIZE]; static void init_syntax_once () { register int c; ...
<vulnerable_code><commit_title>[PATCH] Update.<commit_description>1999-11-09 Ulrich Drepper <drepper@cygnus.com> * elf/dl-load.c (_dl_dst_count): Allow $ORIGIN to point to directory with the reference since this is as secure as using the object with the dependency. (_dl_dst_substitute): Likewise. * elf/dl-load...
<vulnerable_code> int result = 0; struct utmp *ut, line, buffer; { int d = __open ("/dev/tty", 0); if (d < 0) return errno; result = __ttyname_r (d, real_tty_path, sizeof (tty_pathname)); (void) __close (d); if (result != 0) { __set_errno (result); return result; } } ...
<vulnerable_code> timeleft = "{STRING_TIMELEFT}", redirectUrl = "{REDIRECT_URL}", and = "{AND}", time_left_span; <!-- BEGIN enddate --> test_end = (new Date({ENDYEAR}, {ENDMONTH}, {ENDDAY}, {ENDHOUR}, {ENDMINUTE}, {ENDSECOND})).getTime() / 1000; setWorkingTime(); } $(function() { time_left_span = $(...
<vulnerable_code> redirectUrl = "{REDIRECT_URL}", and = "{AND}", time_left_span, check_url = "{CHECK_URL}"; <!-- BEGIN enddate --> test_end = (new Date({ENDYEAR}, {ENDMONTH}, {ENDDAY}, {ENDHOUR}, {ENDMINUTE}, {ENDSECOND})).getTime() / 1000; * submit form to redirectUrl */ function redirect() { $("#l...
<vulnerable_code> if(!il.UI.page.isSmallScreen()) { let next_focus_target = event.relatedTarget; let current_slate = event.currentTarget; if (!$.contains(current_slate, next_focus_target)) { onClickDisengageAll(); } }<commit_title>[PATCH 03/48] fixed html object output<commit_descriptio...
<vulnerable_code>const is_binary_js_1 = require("./is-binary.js"); const debug_1 = require("debug"); // debug() const debug = (0, debug_1.default)("socket.io-parser"); // debug() /** * Protocol version. * } } exports.Encoder = Encoder; /** * A socket.io Decoder instance * static isPayloadValid(type, payload...
<vulnerable_code>import { isBinary, hasBinary } from "./is-binary.js"; import debugModule from "debug"; // debug() const debug = debugModule("socket.io-parser"); // debug() /** * Protocol version. * return buffers; // write all the buffers } } /** * A socket.io Decoder instance * static isPayloadVal...
<vulnerable_code> } ed.execCommand('mceToggleFormat', false, t); ed.focus(); ed.selection.collapse(false); this.autoResize(); } <commit_title>[PATCH 03/48] fixed html object output<commit_description><fixed_code> } ed.execCommand('mceToggleFormat', false, t); ed.focus(); //ed.select...
<vulnerable_code><commit_title>[PATCH] Taken backport from owncloud/files_pdfviewer#92 Fixing<commit_description><fixed_code> /* * Copyright (c) 2013-2014 Lukas Reschke <lukas@owncloud.com> * * This file is licensed under the Affero General Public License version 3 * or later. * * See the COPYING-README file. * ...
<vulnerable_code>MLFLOW_MULTIPART_DOWNLOAD_CHUNK_SIZE = _EnvironmentVariable( "MLFLOW_MULTIPART_DOWNLOAD_CHUNK_SIZE", int, 100 * 1024**2 )<commit_title>[PATCH] Add env var to disable redirects again (#10673)<commit_description>Signed-off-by: Daniel Lok <daniel.lok@databricks.com><fixed_code> MLFLOW_MULTIPART_DOWNLO...
<vulnerable_code> backoff_jitter, retry_codes, raise_on_status=True, **kwargs, ): """ session = _get_request_session( max_retries, backoff_factor, backoff_jitter, retry_codes, raise_on_status ) return session.request(method, url, **kwargs) def cloud_storage_http_request(<commit_...
<vulnerable_code> headers["Authorization"] = "Basic dXNlcjpwYXNz" assert args == ("PUT", "host/clusters/list") assert kwargs == { "headers": headers, "verify": True, "json": {"a": "b"},<commit_title>[PATCH] Add env var to disable redirects again (#10673)<commit...
<vulnerable_code> request_mock.assert_called_with( "put", f"{MOCK_AZURE_SIGNED_URI}?comp=blocklist", data=ANY, headers=filtered_azure_headers, timeout=None, request_mock.assert_any_call( "put", f"{MOCK_ADLS_GEN2_SIGNED_UR...
<vulnerable_code> assert args == ("POST", "https://hello/api/2.0/mlflow/experiments/search") kwargs = {k: v for k, v in kwargs.items() if v is not None} assert kwargs == { "json": {"view_type": "ACTIVE_ONLY"}, "headers": DefaultRequestHeaderProvider().request_headers(), ...
<vulnerable_code> download_path=download_path, http_uri="https://example.com", )<commit_title>[PATCH] Add env var to disable redirects again (#10673)<commit_description>Signed-off-by: Daniel Lok <daniel.lok@databricks.com><fixed_code> download_path=download_pat...
<vulnerable_code> request.assert_called_with( "GET", "http://my-host/my/endpoint", verify=True, headers=DefaultRequestHeaderProvider().request_headers(), timeout=120, request.assert_called_with( "GET", "http://my-host/my/endpoint", verify=True, ...
<vulnerable_code>/** * Original by Aaron Harun: http://aahacreative.com/2012/07/31/php-syntax-highlighting-prism/ * Modified by Miles Johnson: http://milesj.me * * Supports the following: * - Extends clike syntax * - Support for PHP 5.3+ (namespaces, traits, generators, etc) * - Smarter constant and functi...
<vulnerable_code>!function(n){n.languages.php=n.languages.extend("clike",{keyword:/\b(?:__halt_compiler|abstract|and|array|as|break|callable|case|catch|class|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|eval|exit|extends|final|finally|for|forea...
<vulnerable_code>(function (Prism) { var keywords = /\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|null|open|opens|package|private|protected|prov...
<vulnerable_code>!function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|null|open|opens|package|private|protected|provides|public|record...
<vulnerable_code> Prism.languages.insertBefore('inside', 'attr-value', { 'style-attr': { pattern: /\s*style=("|')(?:\\[\s\S]|(?!\1)[^\\])*\1/i, inside: { 'attr-name': { pattern: /^\s*style/i, inside: markup.tag.inside }, 'punctuation': /^\s*=\s*['"]|['"]\s*$/, 'attr-value': ...
<vulnerable_code>!function(e){var s=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-]+[\s\S]*?(?:;|(?=\s*\{))/,inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\((?!\s*\))\s*)(?:[^()]|\((?:[^()]|\([^()]*\))*\))+?(?=\s*\))/,loo...
<vulnerable_code> user_warned = True except APIError as e: if (e.http_status not in [502, 429]) or (attempt == num_attempts): raise backoff = backoff_base ** (attempt + 2)<commit_title>[PATCH] Retry 503 OpenAI errors (#...
<vulnerable_code> return TEMPLATE_FRAGMENT_KEY_TEMPLATE % (fragment_name, "_".join(vary_on)) class Cache(object): """This class is used to control the cache objects.""" def _set_cache(self, app: Flask, config) -> None: import_me = config["CACHE_TYPE"] if "." not in import_me: ...
<vulnerable_code> ) credential_results = None verified = True credentials = JsonLdProcessor.get_values(presentation, "verifiableCredential") credential_results = await asyncio.gather( ] ) verified = all([result.verified for result in credential_results]) return PresentationVer...
<vulnerable_code> limit_record_ids = pres_spec_payload.get("record_ids") reveal_doc_frame = pres_spec_payload.get("reveal_doc") if not pres_definition: if "options" in proof_request: challenge = proof_request["options"].get("challenge") domain =...
<vulnerable_code> """ import posixpath def sanitize_path(path): """Make absolute (with leading slash) to prevent access to other data. continue new_path = posixpath.join(new_path, part) trailing_slash = "" if new_path.endswith("/") else trailing_slash return new_path + trailing_slash<...
<vulnerable_code>import time import sys from contextlib import contextmanager from .. import config, ical FOLDER = os.path.expanduser(config.get("storage", "filesystem_folder")) class Collection(ical.Collection): """Collection stored in a flat ical file.""" @property def _path(self): """Absolute p...
<vulnerable_code>from . import filesystem from .. import ical from .. import log class Collection(filesystem.Collection): """Collection stored in several files per calendar.""" def _create_dirs(self): if not os.path.exists(self._path): os.makedirs(self._path) @property def headers...
<vulnerable_code> void msetGenericCommand(client *c, int nx) { int j; int setkey_flags = 0; if ((c->argc % 2) == 0) { addReplyErrorArity(c); return; } } setkey_flags |= SETKEY_DOESNT_EXIST; } for (j = 1; j < c->argc; j += 2) { c->argv[j+1...
<vulnerable_code> with Image.open("Tests/images/decompression_bomb.gif"): pass def test_exception_bmp(self): with pytest.raises(Image.DecompressionBombError): with Image.open("Tests/images/bmp/b/reallybig.bmp"):<commit_title>[PATCH] Added GIF decompression bomb check<...
<vulnerable_code> x1, y1 = x0 + i16(s, 4), y0 + i16(s, 6) if (x1 > self.size[0] or y1 > self.size[1]) and update_image: self._size = max(x1, self.size[0]), max(y1, self.size[1]) frame_dispose_extent = x0, y0, x1, y1 flags = s[8] <commit_...
<vulnerable_code> sun_info.length || !sun_info.length) ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); number_pixels=(MagickSizeType) image->columns*image->rows; if ((sun_info.type != RT_ENCODED) && (sun_info.depth >= 8) && ((number_pixels*((sun_info.depth+7)/8)) > sun_in...
<vulnerable_code> if(a->name) { if(!strcasecmp(a->name, "mid")) { /* Found mid attribute */ if(m->type == JANUS_SDP_AUDIO && m->port > 0) { JANUS_LOG(LOG_VERB, "[%"SCNu64"] Audio mid: %s\n", handle->handle_id, a->value); if(strlen(a->value) > 16) {<commit_title>[PATCH] Fixed NULL pointer der...
<vulnerable_code> _ABLE_TO_COMPILE_EXTENSIONS = True except ImportError: warnings.warn("Cannot compile native C code, because of a missing build dependency") _ABLE_TO_COMPILE_EXTENSIONS = False if _ABLE_TO_COMPILE_EXTENSIONS: pyarrow_version = tuple(int(x) for x in pyarrow.__version__.split(".")) ...
<vulnerable_code>) from ..errorcode import ( ER_IDP_CONNECTION_ERROR, ER_NO_HOSTNAME_FOUND, ER_UNABLE_TO_OPEN_BROWSER, ) EXTERNAL_BROWSER_AUTHENTICATOR, PYTHON_CONNECTOR_USER_AGENT, ) from . import Auth from .by_plugin import AuthByPlugin, AuthType socket_connection.listen(0) # no back...
<vulnerable_code> warnings.warn( "The 'warn' method is deprecated, " "use 'warning' instead", DeprecationWarning, 2, ) self.warning(msg, path_name, func_name, *args, **kwargs) <commit_title>[PATCH] SNOW-761004 Added URL Validator and URL escaping of strings<com...
<vulnerable_code><commit_title>[PATCH] SNOW-761004 Added URL Validator and URL escaping of strings<commit_description><fixed_code> # # Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved. # from __future__ import annotations import re import urllib.parse from logging import getLogger logger = getLog...
<vulnerable_code>SERVICE_NAME = "" REF_PROOF_KEY = "MOCK_PROOF_KEY" REF_SSO_URL = "https://testsso.snowflake.net/sso" def mock_webserver(target_instance, application, port): account="account", auth_class=auth_inst, )<commit_title>[PATCH] SNOW-761004 Added URL Va...
<vulnerable_code><commit_title>[PATCH] SNOW-761004 Added URL Validator and URL escaping of strings<commit_description><fixed_code> # # Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved. # try: from snowflake.connector.url_util import is_valid_url, url_encode_str except ImportError: def is_v...
<vulnerable_code>from collections import OrderedDict import django.forms from django.utils.translation import gettext_lazy as _ from wagtail.admin.forms import WagtailAdminPageForm def get_field_options(self, field): options = {} options['label'] = field.label options['help_text'] = field....
<vulnerable_code> self.assertTemplateUsed(response, 'tests/form_page.html') self.assertTemplateNotUsed(response, 'tests/form_page_landing.html') # check that variables defined in get_context are passed through to the template (#1429) self.assertContains(response, "<p>hello world</p>") ...