text
stringlengths
79
3.72M
<vulnerable_code> } catch (Exception e) { Errors er = new Errors(); er.addError(new org.w3c.css.parser.CssError(Messages.escapeString(url.toString()), -1, e)); notifyErrors(er); } finally { if (doneref) {<commit_title>[PATCH] escape also...
<vulnerable_code> u32 bits = 0; for (code=0; !code; nb_lead++) { if (nb_lead>=32) { //gf_bs_read_int keeps returning 0 on EOS, so if no more bits available, rbsp was truncated otherwise code is broken in rbsp) //we only test once nb_lead>=32 to avoid testing at each bit read if (!gf_bs_available(bs)) { ...
<vulnerable_code> unsigned c_adler = upx_adler32(NULL, 0); unsigned u_adler = upx_adler32(NULL, 0); #define MAX_ELF_HDR 1024 if ((MAX_ELF_HDR - sizeof(Elf64_Ehdr))/sizeof(Elf64_Phdr) < u_phnum) { throwCantUnpack("bad compressed e_phnum"); } #undef MAX_ELF_HDR unsigned c_adler = upx_adler32(NU...
<vulnerable_code> }); }; /** * Find the user record for the given username. * return callback("empty username"); } var searchFilter = self.opts.searchFilter.replace(/{{username}}/g, username); var opts = {filter: searchFilter, scope: self.opts.searchScope}; if (self.opts.searchAttributes) { opts.at...
<vulnerable_code> "Decoding transited encoding"); return ret; } if(strcmp(client_realm, tgt_realm) && strcmp(server_realm, tgt_realm)) { /* not us, so add the previous realm to transited set */ if (num_realms + 1 > UINT_MAX/sizeof(*realms)) { ret = ERANGE; goto free_realms; const char *s...
<vulnerable_code> response['operation'] = response['operation'].name if response['origin']: response['origin'] = response['origin'].name yield response object_type = resolve_rpsl_object_type(row) for key, value in row.get('parsed_data', dict()).items(): i...
<vulnerable_code> if not input: return input # If there are no hashes, skip the RE for performance. if not any([pw_hash in input for pw_hash in PASSWORD_HASHERS_ALL.keys()]): return input return re_remove_passwords.sub(r'\1 %s # Filtered for security' % PASSWORD_HASH_DUMMY_VALUE, input) ...
<vulnerable_code> return rc; } static apr_byte_t oidc_validate_redirect_url(request_rec *r, oidc_cfg *c, const char *url, apr_byte_t restrict_to_host, char **err_str, char **err_desc) { apr_uri_t uri; const char *c_host = NULL; apr_hash_index_t *hi = NULL; if (apr_uri_parse(r->pool, url, &uri) != APR_SUCCESS)...
<vulnerable_code> String oAuth2Location = provider.getAuthLocation(); String oAuth2ClientId = provider.getClientId(); String scopes = Utils.toCsv(provider.getPermissionScopes()); try { OAuthClientRequest oAuthRequest = OAuthClientRequest .authorizationLocation(oAuth2Location)<commit_title>[PATCH] update...
<vulnerable_code> } } } while(z-- >= 2); ExitLoop: <commit_title>[PATCH] https://github.com/ImageMagick/ImageMagick/issues/131<commit_description><fixed_code> } } } while(z-- >= 2); quantum_info=DestroyQuantumInfo(quantum_info); ExitLoop:
<vulnerable_code> const pjmedia_rtcp_xr_rb_voip_mtc *rb_voip_mtc = NULL; const pjmedia_rtcp_xr_rb_header *rb_hdr = (pjmedia_rtcp_xr_rb_header*) rtcp_xr->buf; unsigned pkt_len, rb_len, ck_len; if (rtcp_xr->common.pt != RTCP_XR) return; if ((pkt_len + 1) > (size / 4)) return; ck_len = ...
<vulnerable_code> char *ch; char *ch2; char *str; str = xmalloc(strlen(path)); ch = path; ch2 = str; while (true) {<commit_title>[PATCH] checkpath: fix allocation size of path buffer<commit_description>strlen's return value isn't enough to be used directly for (x)malloc; it doesn't include the null byte at the en...
<vulnerable_code>from __future__ import division, absolute_import __metaclass__ = type from zope.interface import implementer from twisted.python.compat import networkString @implementer(IClientRequest) class Request: """ connection, defaults to C{False}. @type persistent: L{bool} "...
<vulnerable_code>from twisted.web.http_headers import Headers from twisted.logger import Logger class PartialDownloadError(error.Error): """ _completelyDone = True _specialHeaders = set((b'host', b'user-agent', b'cookie', b'content-length')) def connectionMade(self): method = getattr(self.f...
<vulnerable_code><commit_title>[PATCH] Prevent CRLF injections described in CVE-2019-12387<commit_description>Author: markrwilliams Reviewers: glyph Fixes: ticket:9647 Twisted's HTTP client APIs were vulnerable to maliciously constructed HTTP methods, hosts, and/or paths, URI components such as paths and query param...
<vulnerable_code> from zope.interface.verify import verifyObject from twisted.trial.unittest import TestCase from twisted.web import client, error, http_headers from twisted.web._newclient import RequestNotSent, RequestTransmissionFailed from twisted.web._newclient import ResponseNeverReceived, ResponseFailed from twi...
<vulnerable_code> from __future__ import division, absolute_import import os from errno import ENOSPC from twisted.web import server, client, error, resource from twisted.web.static import Data from twisted.web.util import Redirect from twisted.internet import reactor, defer, interfaces from twisted.python.filepath i...
<vulnerable_code> case '9': { const char *pad = " "; if (fmtChar=='0') { pad = "0"; fmtChar = *fmt++; } int digits = fmtChar - '0'; // of the form '%02d'<commit_title>[PATCH] Fix for buffer overflow on malformed printf format string<commit_descript...
<vulnerable_code> { curwin->w_cursor = saved_cursor; saved_cursor.lnum = 0; } if (oap->is_VIsual)<commit_title>[PATCH] patch 8.2.5013: after text formatting cursor may be in an<commit_description><fixed_code> { curwin->w_cursor = saved_cursor; saved_cursor.lnum = 0; // formatting may have made the...
<vulnerable_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 5012, /**/<commit_title>[PATCH] patch 8.2.5013: after text formatting cursor may be in an<commit_description><fixed_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 501...
<vulnerable_code> List assertions = null; SAMLServiceManager.SOAPEntry partnerdest = null; Subject assertionSubject = null; if (samlResponse.isSigned()) { // verify the signature boolean isSignedandValid = verifySignature(samlResponse); if (!isSigne...
<vulnerable_code> } if (!fs.existsSync(object.filePath)) return res.status(400).send('File failed to save to disk') settingUtil.setSetting('gen:customfavicon', true, function (err) { if (err) return res.status(400).send('Failed to save setting to database') } if (!fs.existsSync(object.filePa...
<vulnerable_code> * Only works when cursor is in the line that changes. */ void display_dollar(colnr_T col) { colnr_T save_col; if (!redrawing())<commit_title>[PATCH] patch 9.0.0218: reading before the start of the line<commit_description>Problem: Reading before the start of the line. Solution: When ...
<vulnerable_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 217, /**/<commit_title>[PATCH] patch 9.0.0218: reading before the start of the line<commit_description>Problem: Reading before the start of the line. Solution: When displaying "$" check the column is not negat...
<vulnerable_code> pt = buffer; do { ch = getc(ttf); if ( pt<buffer+44 || (ch&0xf)==0xf || (ch&0xf0)==0xf0 ) { pt = addnibble(pt,ch>>4); pt = addnibble(pt,ch&0xf); /* Multiple master fonts can have Type2 operators here, particularly */ /* blend operators. We're ignoring that */ while ( ftell...
<vulnerable_code>describe('<KeyValuesTable>', () => { let wrapper; const jsonkeyValue = { hello: 'world' }; const data = [ { key: 'span.kind', value: 'client', expected: 'client' }, { key: 'omg', value: 'mos-def', expected: 'mos-def' }, { key: 'numericString', value: '12345678901234567890', expected:...
<vulnerable_code>function type(doc) { if (doc === null) return 'null'; if (Array.isArray(doc)) return 'array'; if (typeof doc === 'string' && /^https?:/.test(doc)) return 'link'; if (typeof doc === 'object' && typeof doc.toISOString === 'function') return 'date'; return typeof doc; '"</span>' ...
<vulnerable_code>if (!this.uuid) { // node.js uuid = require('../uuid'); } //<commit_title>[PATCH] v1.4.4: close #122 #118 #108<commit_description><fixed_code> if (!this.uuid) { // node.js uuid = require('../uuid'); if (!/_rb/.test(uuid._rng.toString())) { throw new Error("should use crypto for node.js")...
<vulnerable_code> // Moderately fast, high quality if ('function' === typeof require) { try { var _rb = _global.require('crypto').randomBytes; _rng = _rb && function() {return _rb(16);}; } catch(e) {} } uuid.parse = parse; uuid.unparse = unparse; uuid.BufferClass = BufferClass; if (typ...
<vulnerable_code><commit_title>[PATCH] - fix option WEBP - make option WEBP default PR:<commit_description><fixed_code> LibGD Issue: https://github.com/libgd/libgd/issues/308 Commit: https://github.com/libgd/libgd/commit/40bec0f38f50e8510f5bb71a82f516d46facde03 Fix integer overflow in gdImageWebpCtx Integer overflow ...
<vulnerable_code>static int tiffcp(TIFF* in, TIFF* out) { uint16 bitspersample, samplesperpixel; uint16 input_compression, input_photometric; copyFunc cf; uint32 width, length; struct cpTag* p;<commit_title>[PATCH] * tools/tiffcp.c: fix read of undefined variable in case of<commit_description><fixed_code> static i...
<vulnerable_code>{ uint8* bufp = buf; int32 bytes_read = 0; uint16 strip, nstrips = TIFFNumberOfStrips(in); uint32 stripsize = TIFFStripSize(in); uint32 rows = 0; uint32 rps = TIFFGetFieldDefaulted(in, TIFFTAG_ROWSPERSTRIP, &rps); ...
<vulnerable_code> ret_value = ecma_op_create_typedarray_with_type_and_length (obj_p, pass_num); if (!ECMA_IS_VALUE_ERROR (ret_value)) {<commit_title>[PATCH] Fix for null pointer dereference in jmem_heap_free_block<commit_description>Fixes #2435. JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf....
<vulnerable_code> raise TokenError("invalid_grant") # Validate PKCE parameters. if self.code_verifier: if self.authorization_code.code_challenge_method == PKCE_METHOD_S256: new_code_challenge = ( urlsafe_b64encode(sha256(self.code_verifier.enco...
<vulnerable_code> }, items: [ "security/policy", "security/GHSA-rjvp-29xq-f62w", "security/CVE-2023-39522", "security/CVE-2023-36456",<commit_title>[PATCH] security: fix CVE-2023-48228 (cherry-pick #7666) (#7669)<commit_description>s...
<vulnerable_code> { if (LOG.isDebugEnabled()) LOG.debug("auth revoked {}", authentication); synchronized (session) { session.removeAttribute(SessionAuthentication.__J_AUTHENTICATED); ...
<vulnerable_code> with Image.open(TEST_FILE): pass def test_exception_ico(self): with pytest.raises(Image.DecompressionBombError): with Image.open("Tests/images/decompression_bomb.ico"):<commit_title>[PATCH] Fix DOS in PSDImagePlugin -- CVE-2021-28675<commit_descripti...
<vulnerable_code> exception = e assert exception is None with pytest.raises(SyntaxError): with Image.open("Tests/images/apng/syntax_num_frames_high.png") as im: im.seek(im.n_frames - 1) im.load()<commit_title>[PATCH] Fix DOS in PSDImagePlugin -- CVE-2021-28675<com...
<vulnerable_code>from PIL import Image from .helper import assert_image_equal_tofile <commit_title>[PATCH] Fix DOS in PSDImagePlugin -- CVE-2021-28675<commit_description>* PSDImagePlugin did not sanity check the number of input layers and vs the size of the data block, this could lead to a DOS on Image.open prior ...
<vulnerable_code> with pytest.raises(OSError): with Image.open("Tests/images/combined_larger_than_size.psd"): pass<commit_title>[PATCH] Fix DOS in PSDImagePlugin -- CVE-2021-28675<commit_description>* PSDImagePlugin did not sanity check the number of input layers and vs the size of the data blo...
<vulnerable_code> ) def test_string_dimension(self): # Assert that an error is raised if one of the dimensions is a string with pytest.raises(ValueError): with Image.open("Tests/images/string_dimension.tiff"): pass @pytest.mark.skipif(not is_win32(), reason="Windows ...
<vulnerable_code> :param fp: File handle. Must implement a <b>read</b> method. :param size: Number of bytes to read. :returns: A string containing up to <i>size</i> bytes of data. """ if size <= 0: return b"" if size <= SAFEBLOCK: return fp.read(size) data = [] while siz...
<vulnerable_code> end = self.fp.tell() + size size = i32(read(4)) if size: self.layers = _layerinfo(self.fp) self.fp.seek(end) self.n_frames = len(self.layers) self.is_animated = self.n_frames > 1 finally: self.__fp = Non...
<vulnerable_code>"use strict"; const { assert } = require('chai'); const PrismLoader = require('./helper/prism-loader'); const { BFS, parseRegex } = require('./helper/util'); const { languages } = require('../components.json'); const { visitRegExpAST } = require('regexpp'); const { JS, Words, NFA } = require('refa'); ...
<vulnerable_code> /* filename and extension */ if (hdr->headers & (MSKWAJ_HDR_HASFILENAME | MSKWAJ_HDR_HASFILEEXT)) { off_t pos = sys->tell(fh); char *fn = (char *) sys->alloc(sys, (size_t) 13); /* allocate memory for maximum length filename */ if (! fn) return MSPACK_ERR_NOMEMORY; hdr->filename = fn; /...
<vulnerable_code><commit_title>[PATCH] kwaj_read_headers(): fix handling of non-terminated strings<commit_description><fixed_code> /* KWAJ regression test suite */ #ifdef HAVE_CONFIG_H #include <config.h> #endif #include <stdio.h> #include <stdlib.h> #include <string.h> #include <mspack.h> unsigned int test_count = ...
<vulnerable_code> '[': ']' }, numberRx: /^(?:[0-9]*\.?[0-9]*){1}$/, tokenRx: /^[\w\$\#\.\@\:\{\}]+$/, symbol: Symbol('formula'),<commit_title>[PATCH] chore: better number regex<commit_description><fixed_code> '[': ']' }, numberRx: /^(?:[0-9]*(\.[0-9]*)?){1}$/, tokenRx: /^[\...
<vulnerable_code>#include "hexagon_anal.h" static int hexagon_v6_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *buf, int len, RAnalOpMask mask) { HexInsn hi = {0};; ut32 data = 0; data = r_read_le32 (buf); int size = hexagon_disasm_instruction (data, &hi, (ut32) addr); op->size = size;<commit_title>[PATCH] Fi...
<vulnerable_code> __iotc_free(ptr); }) IOTC_TT_TESTCASE( utest__iotc_memory_calloc__num_size_max_minus_1__size_1, { __iotc_free(ptr); }) /* Overflow cases. */ IOTC_TT_TESTCASE( utest__iotc_memory_calloc__overflow__num_3__size_half_max,<commit_title>[PATCH] do not run SIZE_MAX tests on F...
<vulnerable_code> struct flow_dissector_key_tags *key_tags; struct flow_dissector_key_keyid *key_keyid; u8 ip_proto = 0; if (!data) { data = skb->data; ip: iph = __skb_header_pointer(skb, nhoff, sizeof(_iph), data, hlen, &_iph); if (!iph || iph->ihl < 5) return false; nhoff += iph->ihl * 4; ip_proto =...
<vulnerable_code> '-e EZMASTER_PUBLIC_URL="' + publicUrl + '" ' + "--net=ezmaster_eznetwork --link ezmaster_db --link ezmaster-api --ulimit core=0 --privileged=true --cap-add SYS_ADMIN --device /dev/fuse " + "-v " + process.env.EZMASTER_...
<vulnerable_code><commit_title>[PATCH] Cover `django.core.mail`<commit_description><fixed_code> # https://data-flair.training/blogs/django-send-email/ # Using flask for RFS and django.core.mail as email library from flask import request, Flask from django.core.mail import send_mail, mail_admins, mail_managers app = F...
<vulnerable_code>/* * Copyright (c) 1997-8 Andrew G. Morgan <morgan@linux.kernel.org> * * This is a file to make the capability <-> string mappings for * libcap. */ struct { int index; const char *name; } const list[] = { #include "cap_names.sed" {-1, NULL} }; /* this should be more than big enough (...
<vulnerable_code>/* * Copyright (c) 1997-8 Andrew G Morgan <morgan@linux.kernel.org> * * See end of file for Log. * * This file deals with allocation and deallocation of internal * capability sets as specified by POSIX.1e (formerlly, POSIX 6). #include "libcap.h" /* * This function duplicates an internal capabi...
<vulnerable_code>/* * Copyright (c) 1997-8 Andrew G Morgan <morgan@linux.kernel.org> * * See end of file for Log. * * This file deals with exchanging internal and external * representations of capability sets. /* * External representation for capabilities. (exported as a fixed * length (void *)) */ #define CA...
<vulnerable_code>/* * Copyright (c) 1997 Andrew G Morgan <morgan@linux.kernel.org> * * See end of file for Log. * * This file deals with setting capabilities on files. */ #include "libcap.h" /* * Get the capabilities of an open file, as specified by its file * descriptor. /* allocate a new capability set ...
<vulnerable_code>/* * Copyright (c) 1997-8 Andrew G. Morgan <morgan@linux.kernel.org> * * See end of file for Log. * * This file deals with flipping of capabilities on internal * capability sets as specified by POSIX.1e (formerlly, POSIX 6). if (raised && good_cap_t(cap_d) && value >= 0 && value < __CAP_BITS...
<vulnerable_code>/* * Copyright (c) 1997-8 Andrew G Morgan <morgan@linux.kernel.org> * * See end of file for Log. * * This file deals with setting capabilities on processes. */ #include "libcap.h" cap_t cap_get_proc(void) _cap_debug("getting current process' capabilities"); /* fill the capability sets via a ...
<vulnerable_code>/* * Copyright (c) 1997-8 Andrew G. Morgan <morgan@linux.kernel.org> * * This file contains the system calls for getting and setting * capabilities */ #include "libcap.h" #define __LIBRARY__ #include <linux/unistd.h> /* * $Log: cap_sys.c,v $ * Revision 1.2 2005-01-25 19:30:55 castaglia * ...
<vulnerable_code>/* * Copyright (c) 1997-8 Andrew G Morgan <morgan@linux.kernel.org> * Copyright (c) 1997 Andrew Main <zefram@dcs.warwick.ac.uk> * * See end of file for Log. * * This file deals with exchanging internal and textual * representations of capability sets. */ #define LIBCAP_PLEASE_INCLUDE_ARRAY #in...
<vulnerable_code> } /* If our output buffer is full, dump it and keep going. */ if (i > (sizeof(outbuff) - 20)) { outbuff[i] = '\0'; fprintf(f, "%s", outbuff); i = 0;<commit_title>[PATCH] Issue #767: Buffer overflow printing a filename<commit_description>The safe_fprintf function attempts to ensure clea...
<vulnerable_code>/* radare - LGPL - Copyright 2018 - pancake */ #include <r_types.h> #include <r_util.h> bool found = false; for (i = 0; i < element->hdr->n_lined_symbols; i++) { RCoreSymCacheElementSymbol *sym = (RCoreSymCacheElementSymbol *)&element->lined_symbols[i]; ht_uu_find (hash, sym->paddr, &found); i...
<vulnerable_code> p = NameBuff; len = (int)STRLEN(p); if (bt_help(wp->w_buffer) #ifdef FEAT_QUICKFIX || wp->w_p_pvw #endif || bufIsChanged(wp->w_buffer) || wp->w_buffer->b_p_ro) *(p + len++) = ' '; if (bt_help(wp->w_buffer)) {<commit_title>[PATCH] patch 8.2.4074: going over the end of NameBuff<commit_de...
<vulnerable_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 4073, /**/<commit_title>[PATCH] patch 8.2.4074: going over the end of NameBuff<commit_description>Problem: Going over the end of NameBuff. Solution: Check length when appending a space.<fixed_code> static int...
<vulnerable_code> uint8_t type; uint16_t length; ND_TCHECK2(tptr[0], 3); tlen = len; while (tlen >= 3) { type = *tptr; length = EXTRACT_16BITS(tptr+1); ND_PRINT((ndo, "\n\t %s TLV (%u), length %u", tok2str(bgp_aigp_values, "Unknown", type), type, length)); /* ...
<vulnerable_code>enum updatehub_response updatehub_probe(void) { struct probe request; struct resp_probe_some_boards metadata_some_boards; struct resp_probe_any_boards metadata_any_boards; char *metadata = k_malloc(MAX_DOWNLOAD_DATA); char *metadata_copy = k_malloc(MAX_DOWNLOAD_DATA); goto cleanup; } sha2...
<vulnerable_code> return dns_packet_read_rr(p, ret, NULL, NULL); } static const char* const dnssec_algorithm_table[_DNSSEC_ALGORITHM_MAX_DEFINED] = { /* Mnemonics as listed on https://www.iana.org/assignments/dns-sec-alg-numbers/dns-sec-alg-numbers.xhtml */ [DNSSEC_ALGORITHM_RSAMD5] ...
<vulnerable_code>{ struct ofpact_encap *encap; const struct ofp_ed_prop_header *ofp_prop; size_t props_len; uint16_t n_props = 0; int err; } n_props++; } encap->n_props = n_props; out->header = &encap->ofpact; ofpact_finish_ENCAP(out, &encap);<commit_title>[PATCH] ofp...
<vulnerable_code> var evil_array = new Array(0x38/*dataview type id*/,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); g_lo = 0; g_hi = 0; var b = [1.1,2.2];<commit_title>[PATCH] Fix CI<commit_description><fixed_code> //------------------------------------------------------------------------------------------------------- // Copyrig...
<vulnerable_code> Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */ !function(){"use strict";var a={}.hasOwnProperty;function c(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var o=typeof n;if("string"==o||"number"==o)e.push(n);else if(Array.isArray(n)&&n.length)...
<vulnerable_code> header->biBitCount = (OPJ_UINT16)getc(IN); header->biBitCount |= (OPJ_UINT16)((OPJ_UINT32)getc(IN) << 8); if (header->biSize >= 40U) { header->biCompression = (OPJ_UINT32)getc(IN);<commit_title>[PATCH] bmp_read_info_header(): reject bmp files with biBitCount == 0<commit_descript...
<vulnerable_code> /** * A CookieCompliance mode that enforces <a href="https://tools.ietf.org/html/rfc6265">RFC 6265</a> compliance. */ public static final CookieCompliance RFC6265_STRICT = new CookieCompliance("RFC6265", noneOf(Violation.class)); /** * A CookieCompliance mode that enforces <...
<vulnerable_code> import static org.eclipse.jetty.http.CookieCompliance.Violation.BAD_QUOTES; import static org.eclipse.jetty.http.CookieCompliance.Violation.COMMA_NOT_VALID_OCTET; import static org.eclipse.jetty.http.CookieCompliance.Violation.RESERVED_NAMES_NOT_DOLLAR_PREFIXED; /** * Cookie parser ...
<vulnerable_code> String rawCookie = "$Version=\"1\"; session_id=\"1234\", " + "$Version=\"1\"; session_id=\"1111\"; $Domain=\".cracker.edu\""; Cookie[] cookies = parseCookieHeaders(CookieCompliance.RFC2965_LEGACY, rawCookie); assertThat("Cookies.length", cookies.length, is(2)); ...
<vulnerable_code> pData = (const char *)Unpacker.GetRaw(PartSize); if(Unpacker.Error()) return; if(GameTick >= m_CurrentRecvTick)<commit_title>[PATCH] added some checks to snap handling<commit_description><fixed_code> pData = (const char *)Unpacker.GetRaw(PartSize); if(Unpacker.Error() || NumPart...
<vulnerable_code> ENSURE(mFormatID == M4AF_FOURCC('l','p','c','m')); ENSURE(mSampleRate && mBytesPerPacket && mChannelsPerFrame >= 1 && mChannelsPerFrame <= 8 && mBitsPerChannel && mFramesPerPacket == 1 && mBytesPerPacket % mChannelsPerFrame == 0 && mBytesPerPacket >= ...
<vulnerable_code> wValidBitsPerSample = wBitsPerSample; ENSURE(wFormatTag == 1 || wFormatTag == 3 || wFormatTag == 0xfffe); ENSURE(nChannels && nSamplesPerSec && nAvgBytesPerSec && nBlockAlign && wBitsPerSample && !(wBitsPerSample & 7) && nBlockAlign == nChannels * wBitsPerSample / 8);...
<vulnerable_code> {SCMP_SYS (unshare), EPERM}, {SCMP_SYS (setns), EPERM}, {SCMP_SYS (mount), EPERM}, {SCMP_SYS (pivot_root), EPERM}, #if defined(__s390__) || defined(__s390x__) || defined(__CRIS__) /* Architectures with CONFIG_CLONE_BACKWARDS2: the child stack<commit_title>[PATCH] run: Don't allow un...
<vulnerable_code> if (option != (char *) NULL) { char passphrase[MagickPathExtent], *sanitize_passphrase; sanitize_passphrase=SanitizeDelegateString(option); #if defined(MAGICKCORE_WINDOWS_SUPPORT) (void) FormatLocaleString(passphrase,MagickPathExtent, "\"-sPDFPassword=%s...
<vulnerable_code> message[MagickPathExtent]; char *options, *sanitized_option; const char *intermediate_format, option=GetImageOption(image_info,"video:vsync"); if (option != (const char *) NULL) { sanitized_option=SanitizeDelegateString(option)...
<vulnerable_code> click: isReadonlyView ? null : removeKey, 'data-key': pubkey.src }, [ E('strong', pubkey.comment || _('Unnamed key')), E('br'), E('small', [ '%s, %s'.format(pubkey.type, pubkey.curve || _('%d Bit').format(pubkey.bits)), pubkey.options ? E([], [<commit_title>[PATCH] luci-mod-system: sshke...
<vulnerable_code> @RequestParam("action") String action, @SpringBean("appFrameworkService") AppFrameworkService service, HttpSession session, UiUtils ui) { String htmlSafeAppId = StringEscapeUtils.escapeHtml(userApp.getAppId()); try { AppDescriptor descriptor = mapper.read...
<vulnerable_code><commit_title>[PATCH] XWIKI-20682: Introduce an icon macro<commit_description>* Introduce the displayIcon macro that safely parses and executes the icon theme's wiki syntax in the context of its source document. * Add tests.<fixed_code> /* * See the NOTICE file distributed with this work for additio...
<vulnerable_code><commit_title>[PATCH] XWIKI-20682: Introduce an icon macro<commit_description>* Introduce the displayIcon macro that safely parses and executes the icon theme's wiki syntax in the context of its source document. * Add tests.<fixed_code> /* * See the NOTICE file distributed with this work for additio...
<vulnerable_code><commit_title>[PATCH] XWIKI-20682: Introduce an icon macro<commit_description>* Introduce the displayIcon macro that safely parses and executes the icon theme's wiki syntax in the context of its source document. * Add tests.<fixed_code> /* * See the NOTICE file distributed with this work for additio...
<vulnerable_code><commit_title>[PATCH] XWIKI-20682: Introduce an icon macro<commit_description>* Introduce the displayIcon macro that safely parses and executes the icon theme's wiki syntax in the context of its source document. * Add tests.<fixed_code> /* * See the NOTICE file distributed with this work for additio...
<vulnerable_code> *ret_page = phys_to_page(phys); ptr = (void *)val; if (flags & __GFP_ZERO) memset(ptr, 0, size); } return ptr; *dma_handle = phys_to_dma(dev, page_to_phys(page)); addr = page_address(page); if (flags & __GFP_ZERO) memset(addr, 0, size); return addr; } else { return swiotlb_a...
<vulnerable_code> goto exit_mf; } char *fname = talloc_size(mf, strlen(filename) + 32); #if HAVE_GLOB if (!strchr(filename, '%')) { } #endif mp_info(log, "search expr: %s\n", filename); while (error_count < 5) { sprintf(fname, filename, count++); if (!mp_path_exists(fn...
<vulnerable_code> def validate_sql(sql_cmd: str, dialect: str, sql_validation: SQLValidation) -> None: try: parse_result = sqlfluff.parse(sql=sql_cmd, dialect=dialect) print(parse_result)<commit_title>[PATCH] add comments<commit_description><fixed_code> def validate_sql(sql_cmd: str, dialect: str...
<vulnerable_code> td = createElement("td"); row.appendChild(td); td.observe("mousedown", listRowMouseDownHandler, true); td.appendChild(document.createTextNode(data[i][21])); // start date td = createElement("td"); row.appen...
<vulnerable_code> } *tail = vp; while (*tail) tail = &vp->next; p += alen; } /* loop over array entries */ } /* loop over the entire packet */<commit_title>[PATCH] Fix endless loop when there are multiple DHCP options<commit_description><fixed_code> } *tail = vp; while (*tail) tail = &(*tail)->...
<vulnerable_code> return(NULL); dwSize=GetFileSize(hFile,NULL); pBits=(LPBYTE) AcquireQuantumMemory(dwSize,sizeof(*pBits)); ReadFile(hFile,pBits,dwSize,&dwSize,NULL); CloseHandle(hFile); if (((PAPMHEADER) pBits)->dwKey != 0x9ac6cdd7l)<commit_title>[PATCH] https://github.com/ImageMagick/ImageMagick/issues/7...
<vulnerable_code> def test_oom(self, test_file): with pytest.raises(UnidentifiedImageError): with Image.open(test_file) as im: im.load() <commit_title>[PATCH] Tighter test case<commit_description><fixed_code> def test_oom(self, test_file): with pytest.raises(Unidenti...
<vulnerable_code> return 'not_permitted' # make sure nobody tries to escape from basedir for f in filelist: if '/../' in f: return 'invalid_file' # make sure all files are smaller than maximum download size size_limit = cherry.config['media.maxi...
<vulnerable_code> isunsaved += ' <em>(unsaved)</em>'; } pltabs += '<a href="#" onclick="playlistManager.showPlaylist('+pl.id+')">'+isplaying+' '+pl.name+ isunsaved; if(pl.closable){ pltabs += '<span class="playlist-tab-closer pointer" href="#" onclick...
<vulnerable_code> schedule_form = forms.JobScheduleForm(request.POST) task_queue = request.POST.get("_task_queue") # Allow execution only if a worker process is running and the job is runnable. if not get_worker_count(queue=task_queue): messages.error(request, "Unable to run ...
<vulnerable_code> if (nPrefixes) { int j; /* hash table index */ unsigned long version = parser->m_nsAttsVersion; int nsAttsSize = (int)1 << parser->m_nsAttsPower; unsigned char oldNsAttsPower = parser->m_nsAttsPower; /* size of hash table must be at least 2 * (# of prefixed attributes) */ if (...
<vulnerable_code> dims = constant_op.constant([3, 0], dtype=dtype) self.evaluate(array_ops.unravel_index(indices=indices, dims=dims)) class GuaranteeConstOpTest(test_util.TensorFlowTestCase): <commit_title>[PATCH] Fix integer overflow leading to divide by zero error in<commit_description><fixed_cod...
<vulnerable_code> ConversionContext DEFAULT = new ConversionContext() { }; /** * In the case where the type to be converted contains generic type arguments this map will return * the concrete types of those arguments. For example for the {@link Map} type two keys will be present<commit_title>[PATC...
<vulnerable_code>import io.micronaut.core.type.Argument; import java.nio.charset.Charset; import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Optional; /** * Default implementation of the {@link Co...