text
stringlengths
79
3.72M
<vulnerable_code> (start.col <= request.column && request.column <= end.col))) { // The code block probably contains the breakpoint we want to set. // First, we compile it. codeBlock->lazyCompile(runtime_); // We've found the codeBlock at this level and expanded it, //...
<vulnerable_code> CallResult<HermesValue> Runtime::interpretFunctionImpl( CodeBlock *newCodeBlock) { newCodeBlock->lazyCompile(*this); #if defined(HERMES_MEMORY_INSTRUMENTATION) || !defined(NDEBUG) // We always call getCurrentIP() in a debug build as this has the effect #endif CodeBlock *calleeBlock =...
<vulnerable_code> auto *cb = func->getCodeBlock(runtime); // Even though it doesn't make sense logically, we need to compile the // function in order to access it flags. cb->lazyCompile(runtime); return !func->getCodeBlock(runtime)->getHeaderFlags().isCallProhibited( true); }<commit_title>[...
<vulnerable_code><commit_title>[PATCH] Re-sync with internal repository (#822)<commit_description>Co-authored-by: Facebook Community Bot <6422482+facebook-github-bot@users.noreply.github.com><fixed_code> /** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license f...
<vulnerable_code><commit_title>[PATCH] Re-sync with internal repository (#822)<commit_description>Co-authored-by: Facebook Community Bot <6422482+facebook-github-bot@users.noreply.github.com><fixed_code> /** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license f...
<vulnerable_code> body = { "name": "some-role-name", "description": "Testing if we can create a rol for another org", "rules": [rule.id for rule in all_rules], } result = self.app.post("/api/role", headers=headers, json=body) self.assertEqual(result.st...
<vulnerable_code>const REG_SKIPERROR = /epipe|invalid\sdistance/i; const REG_OLDCONF = /-/g; const REG_UTF8 = /[^\x20-\x7E]+/; const REG_TRAVEL = /(\/)?\.\.\//g; const FLAGS_INSTALL = ['get']; const FLAGS_DOWNLOAD = ['get', 'dnscache']; const QUERYPARSEROPTIONS = { maxKeys: 33 }; var headers = req.headers; req.$proto...
<vulnerable_code> def _get_insert_token(token): """Returns either a whitespace or the line breaks from token.""" # See issue484 why line breaks should be preserved. m = re.search(r'((\r\n|\r|\n)+) *$', token.value) if m is not None: return sql.Token...
<vulnerable_code> res = sqlparse.format(sql, strip_comments=True) assert res == 'select (select 2)' def test_strip_ws(self): f = lambda sql: sqlparse.format(sql, strip_whitespace=True) s = 'select\n* from foo\n\twhere ( 1 = 2 )\n'<commit_title>[PATCH] Optimize regular expressio...
<vulnerable_code> len = *p & 0x7f; if (*p++ & 0x80) { unsigned int a = 0; if (len > 4 || len > left) return SC_ERROR_INVALID_ASN1_OBJECT; left -= len;<commit_title>[PATCH] fixed out of bounds reads<commit_description>Thanks to Eric Sesterhenn from X41 D-SEC GmbH for reporting and suggesting security fixes.<fi...
<vulnerable_code> while (len != 0) { unsigned int amode, tlen = 3; if (len < 5 && p[0] != 0x80 && p[1] != 0x01) { sc_debug(card->ctx, SC_LOG_DEBUG_NORMAL, "invalid access mode encoding"); return SC_ERROR_INTERNAL; }<commit_title>[PATCH] fixed out of bounds reads<commit_description>Thanks to Eric Sesterhenn...
<vulnerable_code> sc_file_dup(&card->cache.current_df, file); if (cur_df_path.len) { memcpy(card->cache.current_df->path.value + cur_df_path.len, card->cache.current_df->path.value, card->cache.current_df->path.len); } sc_log_hex(ctx, "ACL data", file->sec_attr, file->sec_attr_len); for (ii ...
<vulnerable_code> cert_len = 0; cert_ptr = NULL; cert_type = 0; for (tl_ptr = tl, val_ptr=val; tl_len >= 2; val_len -= len, val_ptr += len, tl_len -= tl_head_len) { tl_start = tl_ptr; if (sc_simpletlv_read_tag(&tl_ptr, tl_len, &tag, &len) != SC_SUCCESS) break; tl_head_len = tl_ptr - tl_start; ...
<vulnerable_code> for (i=0; i < attribute_count; i++) { size_t record_len = coolkey_get_attribute_record_len(attr, object_record_type, buf_len); /* make sure we have the complete record */ if (buf_len < record_len) { return SC_ERROR_CORRUPTED_DATA; } /* does the attribute match the one we are looking for ...
<vulnerable_code> data->modulus = malloc(len); if (!data->modulus) SC_FUNC_RETURN(card->ctx, SC_LOG_DEBUG_VERBOSE,SC_ERROR_OUT_OF_MEMORY); p=rbuf; assert(*p=='E'); p+=2+p[1]; /* N */ assert(*p=='N'); ++p; if(*p++>0x80) {<commit_title>[PATCH] fixed out of bounds reads<commit_description>Thanks to Eric Sest...
<vulnerable_code> memcpy(mac_tlv + 2, &mac[mac_len - 16], 8); } else { unsigned char iv[8] = { 0 }; unsigned char tmp[8] = { 0 }; des_encrypt_cbc(exdata->sk_mac, 8, icv, apdu_buf, mac_len, mac); des_decrypt_cbc(&exdata->sk_mac[8], 8, iv, &mac[mac_len - 8], 8, tmp); memset(iv, 0x00, 8); des_encrypt_cbc(ex...
<vulnerable_code> if (sp[0] == 0x85) { unsigned int ac[3], n; file->id = (sp[4] << 8) | sp[5]; file->size = (sp[8] << 8) | sp[9]; file->record_length = sp[7];<commit_title>[PATCH] fixed out of bounds reads<commit_description>Thanks to Eric Sesterhenn from X41 D-SEC GmbH for reporting and suggesting securi...
<vulnerable_code> if (card->type == SC_CARD_TYPE_IASECC_SAGEM) { /* 5A 0A 92 50 00 20 10 10 25 00 01 3F */ /* 00 02 01 01 02 50 00 13 */ for (ii=0; ii < rbuf[1] - offs; ii++) *(card->serialnr.value + ii) = ((rbuf[ii + offs + 1] & 0x0F) << 4) + ((rbuf[ii + offs + 2] & 0xF0) >> 4) ; card->ser...
<vulnerable_code> memcpy(&path, in_path, sizeof(struct sc_path)); sc_log(card->ctx, "in_path; type=%d, path=%s, out %p", in_path->type, sc_print_path(in_path), file_out); sc_log(card->ctx, "current path; type=%d, path=%s", bn[1].data = NULL; LOG_FUNC_CALLED(card->ctx); sc_log(card->ctx, "offset %i; s...
<vulnerable_code> const u8 *data = in; pgp_blob_t *new; r = sc_asn1_read_tag(&data, blob->len - (in - blob->data), &cla, &tag, &len); if (r < 0 || data == NULL) { return SC_ERROR_OBJECT_NOT_VALID; } /* undo ASN1's split of tag & class */ for (tmptag = tag; tmptag > 0x0FF; tmptag >>= 8) { cla <...
<vulnerable_code> * the buffer is bigger, so it will not produce "ASN1.tag too long!" */ body = rbuf; if (sc_asn1_read_tag(&body, 0xffff, &cla_out, &tag_out, &bodylen) != SC_SUCCESS || body == NULL) { /* only early beta cards had this problem */ sc_log(card->ctx, "***** received buffer tag MISSING ")...
<vulnerable_code> set_acl_from_sec_attr(card, file); else r = SC_ERROR_UNKNOWN_DATA_RECEIVED; if (r) sc_file_free(file); else {<commit_title>[PATCH] fixed out of bounds reads<commit_description>Thanks to Eric Sesterhenn from X41 D-SEC GmbH for reporting and suggesting security fixes.<fixed_code> set_acl_from...
<vulnerable_code> /* Check all sub-AC definitions within the total AC */ while (len > 1) { /* minimum length = 2 */ int iACLen = buf[iOffset] & 0x0F; iPinCount = -1; /* default no pin required */ iMethod = SC_AC_NONE; /* default no authentication required */ /* Get KeyNumber if available */ if(iK...
<vulnerable_code> } p += tag_len; left -= (p - gdo); } if (!iccsn_found && iccsn_len)<commit_title>[PATCH] fixed out of bounds reads<commit_description>Thanks to Eric Sesterhenn from X41 D-SEC GmbH for reporting and suggesting security fixes.<fixed_code> } p += tag_len; left = gdo_len - (p - gdo); } ...
<vulnerable_code> sc_debug(p15card->card->ctx, SC_LOG_DEBUG_NORMAL, "Could not read EF_DatiPersonali: " "keeping generic card name"); } {<commit_title>[PATCH] fixed out of bounds reads<commit_description>Thanks to Eric Sesterhenn from X41 D-SEC GmbH for reporting and suggesting security fixes.<fixed_code> s...
<vulnerable_code> int i, rec_no=0; if(prkey_info.path.len>=2) prkey_info.path.len-=2; sc_append_file_id(&prkey_info.path, 0x5349); if(sc_select_file(card, &prkey_info.path, NULL)!=SC_SUCCESS){ sc_debug(ctx, SC_LOG_DEBUG_NORMAL, "Select(%s) failed\n", sc_print_path(&prkey_info.path)); if(buf[i]==0xB...
<vulnerable_code>{ sc_file_t *file; int r, file_type; u8 files[SC_MAX_APDU_BUFFER_SIZE]; r = sc_lock(card); if (r == SC_SUCCESS) } if (r == 0) { printf("Empty directory\n"); } else for (i = 0; i < r/2; i++) { sc_path_t tmppath; memset(&tmppath, 0, sizeof(tmppath)); memcpy(&tmppath, &path, siz...
<vulnerable_code> return input_name + " -> " + str(self.output_type) + ":" return input_name + ":" def calculate_arg_totals(self): """ Calculate base arguments, and totals. """ <commit_title>[PATCH] rewrite internal function calling convention<commit_description><fixed_code> ...
<vulnerable_code> # Remove block scopes self._scopes.remove(scope_id) def _new_variable(self, name: str, typ: NodeType, var_size: int, is_internal: bool) -> int: if is_internal: var_pos = self.memory_allocator.expand_memory(var_size) else: name=name, ...
<vulnerable_code> o.context = context o.total_gas = o.gas + calc_mem_gas(frame_size) o.func_name = sig.name return o, frame_size<commit_title>[PATCH] rewrite internal function calling convention<commit_description><fixed_code> o.context = context o.total_gas = o.gas + calc_mem_gas(frame_size) ...
<vulnerable_code>from vyper.utils import MemoryPositions def get_internal_arg_copier(total_size: int, memory_dest: int) -> List[Any]: """ Copy arguments. For internal functions, MSTORE arguments and callback pointer from the stack. :param total_size: total size to copy :param memory_dest: base ...
<vulnerable_code> return sig_compare, private_label def make_unpacker(ident, i_placeholder, begin_pos): start_label = "dyn_unpack_start_" + ident end_label = "dyn_unpack_end_" + ident return [ "seq_unchecked", ["mstore", begin_pos, "pass"], # get len ["mstore", i_placeholder, 0...
<vulnerable_code> for func_node in otherfuncs: func_type = func_node._metadata["type"] func_lll, frame_size = generate_lll_for_function( func_node, {**{"self": sigs}, **external_interfaces}, global_ctx, check_per_function ) if func_type.visibility == FunctionVisibility.IN...
<vulnerable_code> def __init__(self, maxlen): self.size_in_bytes = maxlen def allocate_return_buffer(context: Context) -> int: maxlen = abi_type_of(context.return_type).size_bound() return context.new_internal_variable(FakeType(maxlen=maxlen)) # Generate return code for stmt def make_return_stmt(r...
<vulnerable_code>) def _call_make_placeholder(stmt_expr, context, sig): if sig.output_type is None: return 0, 0, 0 output_placeholder = context.new_internal_variable(typ=sig.output_type) output_size = get_size_of_type(sig.output_type) * 32 if isinstance(sig.output_type, BaseType): re...
<vulnerable_code> return LLLnode.from_list("break", typ=None, pos=getpos(self.stmt)) def parse_Return(self): # allocate the return buffer BEFORE parsing the return value, # (registering it with the local context variable dictionary) # otherwise any private calls may clobber the buffe...
<vulnerable_code> method_ids.update(_generate_method_id(self.name, arg_types[:i])) return method_ids @property def is_constructor(self) -> bool: return self.name == "__init__"<commit_title>[PATCH] rewrite internal function calling convention<commit_description><fixed_code> ...
<vulnerable_code> # because this data type is single-bytes, we make it so it takes the max 32 byte # boundary as it's size, instead of giving it a size that is not cleanly divisble by 32 # TODO adding 64 here instead of 32 to be compatible with parser - fix this! return 64 + math.ceil(se...
<vulnerable_code> p = skipwhite(arg); ret = eval1(&p, rettv, evalarg); expr_end = p; p = skipwhite(p); // In Vim9 script a command block is not split at NL characters for // commands using an expression argument. Skip over a '#' comment to check // for a following NL. Require white space ...
<vulnerable_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 5168, /**/<commit_title>[PATCH] patch 8.2.5169: nested :source may use NULL pointer<commit_description>Problem: Nested :source may use NULL pointer. Solution: Do not use the NULL pointer.<fixed_code> static i...
<vulnerable_code> status = ares__expand_name_for_response(aptr, abuf, alen, &qname, &len); if (status != ARES_SUCCESS) goto failed_stat; aptr += len; qclass = DNS_QUESTION_TYPE(aptr);<commit_title>[PATCH] avoid read-heap-buffer-overflow (#332)<commit_description>Fix invalid read in ares_parse_soa_reply.c fo...
<vulnerable_code> if self.authorization_code.code_challenge: # Authorization code had PKCE but we didn't get one if not self.code_verifier: raise TokenError("invalid_request") if self.authorization_code.code_challenge_method == PKCE_METHOD_S256: ...
<vulnerable_code> return true; } static bool wasm_loader_push_pop_frame_ref(WASMLoaderContext *ctx, uint8 pop_cnt, uint8 type_push, uint8 type_pop, char *error_buf, uint32 error_buf_size) { for (int i = 0; i < pop_cnt; i++) { if (!wasm_loader...
<vulnerable_code> else: if path.startswith("/") == False and inodestr: import subprocess command = "locate -b '\%s'" % path try: output = subprocess.check_output(command, ...
<vulnerable_code> audit2allow = "/usr/bin/audit2allow" if os.path.exist(audit2allow): newbuf = "\n\naudit2allow" p = Popen([audit2allow], shell=True,stdin=PIPE, stdout=PIPE) newbuf += p.communicate(avcbuf)[0] if os.path.exists("/var...
<vulnerable_code> MagickPathExtent); cache_info->type=DiskCache; cache_info->offset=(*offset); if (OpenPixelCache(image,ReadMode,exception) == MagickFalse) return(MagickFalse); *offset+=cache_info->length+page_size-(cache_info->length % page_size);<commit_title>[PATCH] https://git...
<vulnerable_code> return -ENOMEM; status = devm_add_action_or_reset(&pdev->dev, spi_gpio_put, master); if (status) return status; if (of_id) status = spi_gpio_probe_dt(pdev, master);<commit_title>[PATCH] spi: gpio: prevent memory leak in spi_gpio_probe<commit_description>In spi_gpio_probe an SPI master is all...
<vulnerable_code> /* read variable length subobjects */ total_subobj_len = obj_tlen; while(total_subobj_len > 0) { subobj_len = EXTRACT_16BITS(obj_tptr); subobj_type = (EXTRACT_16BITS(obj_tptr+2))>>8; af = (EXTRACT_16BITS(obj_tptr+2))&0x00F...
<vulnerable_code> app.static("/static", static_file_directory, resource_type="unknown") @pytest.skipif( sys.platform == "win32", reason="Windows does not support double dotted directories", ) app: Sanic, static_file_directory: str, double_dotted_directory_file: Path ): app.static("/foo", static...
<vulnerable_code> }, // “Normal” string { pattern: /(^|[^\\](?:\\\\)*)(["'])(?:\\[\s\S]|\$\([^)]+\)|`[^`]+`|(?!\2)[^\\])*\2/, lookbehind: true, greedy: true, inside: insideString<commit_title>[PATCH] Fixed more exp backtracking<commit_description><fixed_code> }, // “Normal” string { ...
<vulnerable_code>!function(e){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LAN...
<vulnerable_code>!function(s){function a(e,s){return e.replace(/<<(\d+)>>/g,function(e,n){return"(?:"+s[+n]+")"})}function t(e,n,s){return RegExp(a(e,n),s||"")}function e(e,n){for(var s=0;s<n;s++)e=e.replace(/<<self>>/g,function(){return"(?:"+e+")"});return e.replace(/<<self>>/g,"[^\\s\\S]")}var n="bool byte char decim...
<vulnerable_code> greedy: true }, { pattern: /"(?:[^\\"\r\n]|\\(?:[abfnrtv\\"]|\d+|x[0-9a-fA-F]+))*"/, greedy: true } ],<commit_title>[PATCH] Fixed more exp backtracking<commit_description><fixed_code> greedy: true }, { pattern: /"(?:[^\\"\r\n]|\\.)*"/, greedy: true } ],
<vulnerable_code>Prism.languages.elm={comment:/--.*|{-[\s\S]*?-}/,char:{pattern:/'(?:[^\\'\r\n]|\\(?:[abfnrtv\\']|\d+|x[0-9a-fA-F]+))'/,greedy:!0},string:[{pattern:/"""[\s\S]*?"""/,greedy:!0},{pattern:/"(?:[^\\"\r\n]|\\(?:[abfnrtv\\"]|\d+|x[0-9a-fA-F]+))*"/,greedy:!0}],import_statement:{pattern:/^\s*import\s+[A-Z]\w*(?...
<vulnerable_code> 'comment': /^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m, // \z may be used to skip the following space 'string': { pattern: /(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[\s\S]))*\1|\[(=*)\[[\s\S]*?\]\2\]/, greedy: true }, 'number': /\b0x[a-f\d]+\.?[a-f\d]*(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|\.?\d*...
<vulnerable_code>Prism.languages.lua={comment:/^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m,string:{pattern:/(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[\s\S]))*\1|\[(=*)\[[\s\S]*?\]\2\]/,greedy:!0},number:/\b0x[a-f\d]+\.?[a-f\d]*(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|\.?\d*(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i,keyword:...
<vulnerable_code> } }, { pattern: /("|')(?:#\{[^}]+\}|\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, greedy: true, inside: { 'interpolation': interpolation<commit_title>[PATCH] Fixed more exp backtracking<commit_description><fixed_code> } }, { pattern: /("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])...
<vulnerable_code>!function(e){e.languages.ruby=e.languages.extend("clike",{comment:[/#.*/,{pattern:/^=begin\s[\s\S]*?^=end/m,greedy:!0}],"class-name":{pattern:/(\b(?:class)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:alias|and|BEGIN|begin|break|case|class|def|define_method|defin...
<vulnerable_code> var strings = [ // normal string // 1 capturing group /(["'])(?:\\[\s\S]|\$\([^)]+\)|`[^`]+`|(?!\1)[^\\])*\1/.source, // here doc // 2 capturing groups<commit_title>[PATCH] Fixed more exp backtracking<commit_description><fixed_code> var strings = [ // normal string // 1 capturing group...
<vulnerable_code>!function(s){var n=["([\"'])(?:\\\\[^]|\\$\\([^)]+\\)|`[^`]+`|(?!\\1)[^\\\\])*\\1","<<-?\\s*([\"']?)(\\w+)\\2\\s[^]*?[\r\n]\\3"].join("|");s.languages["shell-session"]={info:{pattern:/^[^\r\n$#*!]+(?=[$#])/m,alias:"punctuation",inside:{path:{pattern:/(:)[\s\S]+/,lookbehind:!0},user:/^[^\s@:$#*!/\\]+@[^...
<vulnerable_code> if (ptr[col] == NUL) break; vcol += chartabsize(ptr + col, (colnr_T)vcol); if (has_mbyte) col += (*mb_ptr2len)(ptr + col); else<commit_title>[PATCH] patch 8.2.4359: crash when repeatedly using :retab<commit_description>Problem: crash when repeatedly using :retab. Solution: ...
<vulnerable_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 4358, /**/<commit_title>[PATCH] patch 8.2.4359: crash when repeatedly using :retab<commit_description>Problem: crash when repeatedly using :retab. Solution: Bail out when the line is getting too long.<fixed_co...
<vulnerable_code> return host_details class HostAggregatesTable(tables.DataTable): name = tables.Column('name', verbose_name=_('Name')) availability_zone = tables.Column('availability_zone', hosts = tables.Column(get_aggregate_hosts, verbose_name=_("Hosts"), ...
<vulnerable_code> qf_winid = win->w_id; } if (old_last == NULL) // set curwin/curbuf to buf and save a few things aucmd_prepbuf(&aco, buf); // when the added lines are not visible. if ((win = qf_find_win(qi)) != NULL && old_line_count < win->w_botline) redraw_buf_later(buf, UPD_NOT_VALID); }...
<vulnerable_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 804, /**/<commit_title>[PATCH] patch 9.0.0805: filetype autocmd may cause freed memory<commit_description><fixed_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 805, /...
<vulnerable_code> public GraphqlAntlrToLanguage(CommonTokenStream tokens, MultiSourceReader multiSourceReader, ParserOptions parserOptions) { this.tokens = tokens; this.multiSourceReader = multiSourceReader; this.parserOptions = parserOptions == null ? ParserOptions.getDefaultParserOptions() ...
<vulnerable_code>import java.io.UncheckedIOException; import java.util.List; import java.util.function.BiFunction; /** * This can parse graphql syntax, both Query syntax and Schema Definition Language (SDL) syntax, into an } }); CommonTokenStream tokens = new CommonTokenStream(lexer); ...
<vulnerable_code> defaultJvmParserOptions = assertNotNull(options); } private final boolean captureIgnoredChars; private final boolean captureSourceLocation; private final boolean captureLineComments;<commit_title>[PATCH] This stops DOS attacks by making the lexer stop early.<commit_description>...
<vulnerable_code><commit_title>[PATCH] This stops DOS attacks by making the lexer stop early.<commit_description><fixed_code> package graphql.parser; import graphql.Internal; import org.antlr.v4.runtime.CharStream; import org.antlr.v4.runtime.Token; import org.antlr.v4.runtime.TokenFactory; import org.antlr.v4.runtime...
<vulnerable_code>import org.xwiki.component.annotation.Component; import org.xwiki.csrf.CSRFToken; import org.xwiki.model.reference.DocumentReference; import org.xwiki.model.reference.DocumentReferenceResolver; import org.xwiki.model.reference.EntityReferenceSerializer; import org.xwiki.model.reference.SpaceReference; ...
<vulnerable_code> @Inject protected Execution execution; @Inject protected ContextualAuthorizationManager autorization; @Inject @Named("currentmixed") protected DocumentReferenceResolver<String> currentmixedReferenceResolver; /** * Indicate if the action allow asynchronous display...
<vulnerable_code> return true // assumed to be truthy if something is in it } else if (value === undefined) { // Cannot escape on this value return false // undefined is falsey } else if (typeof value === 'boolean') { // Cannot escape on this value return value // it's already a boolean so just return th...
<vulnerable_code> sizeof(*clone_image->colormap)); if (clone_image->colormap == (PixelPacket *) NULL) { clone_image=DestroyImage(clone_image); ThrowImageException(ResourceLimitError,"MemoryAllocationFailed"); } (void) CopyMagickMemory(clone_image->colormap,image->c...
<vulnerable_code> def parse(self, content): raw = {} root = etree.fromstring(content) for child in root: raw[child.tag] = child.text <commit_title>[PATCH] =?UTF-8?q?=E5=AE=89=E5=85=A8=E4=BF=AE=E5=A4=8D=EF=BC=9A?=<commit_description><fixed_code> def parse(self, content): ...
<vulnerable_code> def to_dict(self, content): raw = {} root = etree.fromstring(content.encode("utf-8")) for child in root: raw[child.tag] = child.text return raw<commit_title>[PATCH] =?UTF-8?q?=E5=AE=89=E5=85=A8=E4=BF=AE=E5=A4=8D=EF=BC=9A?=<commit_description><fixed_code>...
<vulnerable_code>import os from abc import ABC from argparse import _ArgumentGroup, ArgumentParser, Namespace from contextlib import suppress from functools import wraps from typing import Any, Callable, cast, Dict, List, Tuple, Type, TypeVar, Union # todo: specify the possible exception with su...
<vulnerable_code>from tensorflow.python.framework import errors from tensorflow.python.framework import ops from tensorflow.python.framework import sparse_tensor from tensorflow.python.ops import bincount_ops from tensorflow.python.ops import sparse_ops from tensorflow.python.ops.ragged import ragged_factory_ops from t...
<vulnerable_code> units = "", parsed = parseInt(attrs.defaultattr, 10); if (!isNaN(parsed)) { size = attrs.defaultattr; if (size < 1) { size = 1; } else if (size > 50) {<commit_title>[PATCH] Fix Visual editor size code persistent XSS<commit_description><fixed_code> units = "", parsed ...
<vulnerable_code> void __ip_select_ident(struct net *net, struct iphdr *iph, int segs) { static u32 ip_idents_hashrnd __read_mostly; u32 hash, id; net_get_random_once(&ip_idents_hashrnd, sizeof(ip_idents_hashrnd)); hash = jhash_3words((__force u32)iph->daddr, (__force u32)iph->saddr, iph->protocol ^...
<vulnerable_code>#include <net/secure_seq.h> #include <linux/netfilter.h> static u32 __ipv6_select_ident(struct net *net, u32 hashrnd, const struct in6_addr *dst, const struct in6_addr *src) { u32 hash, id; hash = __ipv6_addr_jhash(dst, hashrnd); hash = __ipv6_addr_jhash(src, hash); hash ^= ne...
<vulnerable_code> ThrowReaderException(ResourceLimitError,"ImproperImageHeader"); } pixels_length=height*bytes_per_line; sun_pixels=(unsigned char *) AcquireQuantumMemory(pixels_length, sizeof(*sun_pixels)); if (sun_pixels == (unsigned char *) NULL) {<commit_title>[PATCH] https://gi...
<vulnerable_code> } ato32(data + lidx, &rSz); if (rSz > WOLFSSH_MAX_FILENAME || (int)(rSz + UINT32_SZ) > maxSz) { return WS_BUFFER_E; } lidx += UINT32_SZ; WLOG(WS_LOG_SFTP, "Receiving WOLFSSH_FTP_RMDIR"); ato32(data + idx, &sz); idx += UINT32_SZ; if (sz + idx > maxSz) { ...
<vulnerable_code> "use the -a directive for that. DO NOT INCLUDE the api/ " "instruction.") parser.add_option("-P", "--port", default=5693, type="int", help="Port to use to connect to the client.") parser.add_option("-w", "--warning", de...
<vulnerable_code># https://pythonhosted.org/Flask-Mail/ # https://github.com/mattupstate/flask-mail/blob/1709c70d839a7cc7b1f7eeb97333b71cd420fe32/flask_mail.py#L239 # tmp: this test cover RFS to any part of the message, but can be shortened to a specific part (body&html) once we decide the objective of the query. from...
<vulnerable_code> */ public class FileAssetAPIImpl implements FileAssetAPI { private SystemEventsAPI systemEventsAPI; ContentletAPI contAPI; PermissionAPI perAPI; if (UtilMethods.isSet(realPath) && !realPath.endsWith(java.io.File.separator)) realPath = realPath + java.io.File.separator; ...
<vulnerable_code> } logger[options.dryRun ? 'warn' : 'success']( `Run automated release from branch ${ciBranch} on repository ${options.repositoryUrl}${ options.dryRun ? ' in dry-run mode' : '' }` ); context.logger.log(`Running ${pkg.name} version ${pkg.version}`); try { const {plugins, opti...
<vulnerable_code> const config = { branches: [{name: 'master'}, {name: 'next'}], repositoryUrl, globalOpt: 'global', tagFormat: `v\${version}`, }; const error2 = new SemanticReleaseError('error 2', 'ERR2'); const error3 = new SemanticReleaseError('error 3', 'ERR3'); const fail = stub().resolves...
<vulnerable_code> elf_xtregs_t *xtregs = uregs; int ret = 0; #if XTENSA_HAVE_COPROCESSORS /* Flush all coprocessors before we overwrite them. */ coprocessor_flush_all(ti);<commit_title>[PATCH] xtensa: prevent arbitrary read in ptrace<commit_description>Prevent an arbitrary kernel read. Check the user pointer with ...
<vulnerable_code> Dwg_Object_STYLE *style = o ? o->tio.object->tio.STYLE : NULL; BITCODE_2DPOINT pt; if (dwg->header.version >= R_2007) escaped = htmlwescape ((BITCODE_TU)text->text_value); else<commit_title>[PATCH] dwg2SVG: skip NULL text_value<commit_description>Fixes Case 1 of GH #182<fixed_code> Dwg_O...
<vulnerable_code>char * ATTRIBUTE_MALLOC htmlescape (const char *restrict src, const int cp) { int len = strlen (src) + 10; char *dest, *d = malloc (len); unsigned char *s = (unsigned char *)src; dest = d; while (*s++) {<commit_title>[PATCH] dwg2SVG: skip NULL text_value<commit_description>Fixes Case 1 of...
<vulnerable_code> uint8_t *iphc_hdr) { gnrc_sixlowpan_ctx_t *src_ctx = NULL, *dst_ctx = NULL; ipv6_hdr_t *ipv6_hdr = pkt->next->data; bool addr_comp = false; uint16_t inline_pos = SIXLOWPAN_IPHC_HDR_LEN; assert(iface != NULL); /* set initial dispatch value*/ ...
<vulnerable_code> */ package org.xwiki.administration.test.ui; import org.junit.jupiter.api.Test; import org.xwiki.administration.test.po.ForgotUsernameCompletePage; import org.xwiki.administration.test.po.ForgotUsernamePage; import org.xwiki.test.docker.junit5.UITest; import org.xwiki.test.ui.TestUtils; import stati...
<vulnerable_code> import org.openqa.selenium.By; import org.openqa.selenium.NoSuchElementException; import org.xwiki.test.ui.po.ViewPage; /** */ public class ForgotUsernameCompletePage extends ViewPage { public boolean isUsernameRetrieved(String username) { try { } } public boolean is...
<vulnerable_code> package_name: str field: Any field_name: str T = TypeVar("T", bound=Callable) # In case of inherited hooks this might be happening several times continue self._connection_form_widgets[prefixed_field_name] = ConnectionFormWidgetInfo( ...
<vulnerable_code>from airflow.exceptions import ( AirflowConfigException, AirflowException, ParamValidationError, RemovedInAirflow3Warning, ) from airflow.executors.executor_loader import ExecutorLoader from airflow.jobs.job import Job from airflow.jobs.scheduler_job_runner import SchedulerJobRunner fro...
<vulnerable_code> mock_form.data = {"conn_id": "test", "extra": None, "conn_type": "test"} cmv = ConnectionModelView() cmv._iter_extra_field_names = mock.Mock(return_value=()) cmv.prefill_form(form=mock_form, pk=1) @pytest.mark.parametrize( "extras, expected", [ mock_form.data = {"conn_id"...
<vulnerable_code> return -EEXIST; } static struct page *follow_page_pte(struct vm_area_struct *vma, unsigned long address, pmd_t *pmd, unsigned int flags) { } if ((flags & FOLL_NUMA) && pte_protnone(pte)) goto no_page; if ((flags & FOLL_WRITE) && !pte_write(pte)) { pte_unmap_unlock(ptep, ptl); return NULL; ...
<vulnerable_code> 0x10000000, // ACCESS_ALLOWED_ACE:ACCESS_MASK: GENERIC_ALL 0x00000201, 0x05000000, 0x00000020, 0x00000220, // ACCESS_ALLOWED_ACE:SID (BUILTIN\Administrators) NOTE: GetAdminGrpSid() relies on this being the first SID in the ACL 0x00140300, // ACCESS_ALLOWED_ACE:ACE_HEADER (ACCESS_ALLOWED_ACE_TYPE,...
<vulnerable_code> } // Check for "++nr" and "--nr". if (p == eap->cmd && p[0] == p[1] && (*p == '+' || *p == '-')) { eap->cmdidx = *p == '+' ? CMD_increment : CMD_decrement; return eap->cmd + 2;<commit_title>[PATCH] patch 8.2.4009: reading one byte beyond the end of the line<commit_description>Problem: ...
<vulnerable_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 4008, /**/<commit_title>[PATCH] patch 8.2.4009: reading one byte beyond the end of the line<commit_description>Problem: Reading one byte beyond the end of the line. Solution: Check for NUL byte first.<fixed_co...