text
stringlengths
79
3.72M
<vulnerable_code>{ const u8 *in = inbuf; u8 *out = (u8 *) outbuf; int zero_bits = *in & 0x07; size_t octets_left = inlen - 1; int i, count = 0; memset(outbuf, 0, outlen); in++; if (outlen < octets_left) return SC_ERROR_BUFFER_TOO_SMALL; if (inlen < 1) return SC_ERROR_INVALID_ASN1_OBJECT; while (octets_le...
<vulnerable_code> "<body>The request contained invalid UTF-8 in " location ".</body>" \ "</html>" /** * @brief The handle on the embedded HTTP daemon. */ switch (validate_host_header (host)) { case 0: // header is valid break; case 1: // Invalid UTF-8 case 2: ...
<vulnerable_code> max_poas_ = (avail_mem * fraction_for_metadata) / device_size_per_poa; // Update final sizes for block based on calculated maximum POAs. output_size_ = max_poas_ * CUDAPOA_MAX_CONSENSUS_SIZE; input_size_ = max_poas_ * max_sequences_per_poa_ * CUDAPOA_MAX_SEQUEN...
<vulnerable_code>import claragenomics.bindings.cuda as cuda pytestmark = pytest.mark.skip("tests are fragile, could be related to memory usage") @pytest.mark.gpu def test_cudapoa_simple_batch(): free, total = cuda.cuda_get_mem_info(cuda.cuda_get_device())<commit_title>[PATCH] [cudapoa] fix integer overflow<comm...
<vulnerable_code><commit_title>[PATCH] revert babel name refactor<commit_description><fixed_code>
<vulnerable_code>import os from flask import has_request_context, request, session from flask_appbuilder.babels.views import LocaleView from flask_appbuilder.basemanager import BaseManager from flask_babel import Babel appbuilder_parent_dir = os.path.join( os.path.dirname(os.path.abspath(__file__)...
<vulnerable_code> from . import __version__ from .api.manager import OpenApiManager from .babels.manager import BabelManager from .const import ( LOGMSG_ERR_FAB_ADD_PERMISSION_MENU, LOGMSG_ERR_FAB_ADD_PERMISSION_VIEW, self.base_template = app.config.get("FAB_BASE_TEMPLATE", self.base_template) ...
<vulnerable_code> (r'(?![_A-ZÀ-Ü])-?(\d+(\.\d*)|\.\d+)(?![_A-ZÀ-Ü])', tokens.Number.Float), (r'(?![_A-ZÀ-Ü])-?\d+(?![_A-ZÀ-Ü])', tokens.Number.Integer), (r"'(''|\\\\|\\'|[^'])*'", tokens.String.Single), # not a real string literal in ANSI SQL: (r'"(""|\\\\|\\"|[^"])*"', tokens.String.Symbol), ...
<vulnerable_code> def test_split_backslash(): stmts = sqlparse.parse(r"select '\\'; select '\''; select '\\\'';") assert len(stmts) == 3 @pytest.mark.parametrize('fn', ['function.sql',<commit_title>[PATCH] Remove unnecessary parts in regex for bad escaping.<commit_description>The regex tried to deal with sit...
<vulnerable_code> ) padding = [" " * (len(h) - len(f)) for h, f in zip(headers, fields)] fields = tuple(f + padding[i] for i, f in enumerate(fields)) lines.append(" | ".join(fields).format(member=member, **m_data)) if rank == top: break ...
<vulnerable_code>static char **get_txt_records(struct hesiod_p *ctx, const char *name); static int cistrcmp(const char *s1, const char *s2); /* This function is called to initialize a hesiod_p. */ int hesiod_init(void **context) { if (ctx) { *context = ctx; configname = ((getuid() == geteuid()) && (g...
<vulnerable_code> import numpy as np from tensorflow.python.framework import dtypes from tensorflow.python.framework import errors from tensorflow.python.framework import ops from tensorflow.python.framework import sparse_tensor from tensorflow.python.framework import test_util from tensorflow.python.ops import sparse...
<vulnerable_code> name = kasprintf(GFP_KERNEL, "%s-%u", type, index); if (!name) { of_node_put(ports); return ERR_PTR(-ENOMEM); } np = of_get_child_by_name(ports, name); kfree(name);<commit_title>[PATCH] phy: tegra: xusb: Fix return value of<commit_description><fixed_code> name = kasprintf(GFP_KERNEL, "%s-%u",...
<vulnerable_code> object = object || {} var key = path[index] if (key === '-') { key = object.length } var next = recursivelySetIn(object[key], path, value, ++index) return set(object, key, next)<commit_title>[PATCH] fix prototype pollution vulnerability<commit_description>cheers Daniel Elkabes of W...
<vulnerable_code>const setIn = require('../') test('non-Array path', function (t) { t.throws(() => setIn({ 'a': { 'b': 'c' }}, undefined)) t.throws(() => setIn({ 'a': { 'b': 'c' }}, 'a.b')) t.throws(() => setIn({ 'a': { 'b': 'c' }}, { 'a': 'b'})) t.end() }) t.end() }) */<commit_title>[PATCH] fix prototype p...
<vulnerable_code>module.exports = function (packageName, { registry = '', timeout = null } = {}) { try { let version; const config = {<commit_title>[PATCH] feat: add defence to Command Injection<commit_description>add defence to Command Injection<fixed_code> module.exports = function (packageName, ...
<vulnerable_code><commit_title>[PATCH] XWIKI-20456: Improved escaping of XWiki.ClassSheet<commit_description><fixed_code> /* * See the NOTICE file distributed with this work for additional * information regarding copyright ownership. * * This is free software; you can redistribute it and/or modify it * under the t...
<vulnerable_code> } private String getOrMaskValue(String value) { return maskSensitiveFields ? MASK_FOR_SENSITIVE_DATA : value; } .close(); } private static void ldapAuthenticationGenerator(XmlGenerator gen, LdapAuthenticationConfig c) { if (c == null) { ...
<vulnerable_code> cfg.getNetworkConfig().setSymmetricEncryptionConfig(symmetricEncryptionConfig); cfg.setLicenseKey("HazelcastLicenseKey"); Config newConfigViaXMLGenerator = getNewConfigViaXMLGenerator(cfg); SSLConfig generatedSSLConfig = newConfigViaXMLGenerator.getNetworkConfig().getSS...
<vulnerable_code> dst1 = IRnode.from_list(buf + 64, typ=UINT256_T, location=MEMORY) ret.append(make_setter(dst1, args[1])) ret.append(["assert", ["staticcall", ["gas"], 7, buf, 128, buf, 64]]) ret.append(buf) return IRnode.from_list(ret, typ=SArrayT(UINT256_T, 2), location=MEMOR...
<vulnerable_code> import com.enonic.xp.context.Context; import com.enonic.xp.context.ContextBuilder; import com.enonic.xp.portal.PortalRequest; import com.enonic.xp.script.bean.BeanContext; import com.enonic.xp.script.bean.ScriptBean; public final class LoginHandler implements ScriptBean { private enum Scope ...
<vulnerable_code> import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; public class LoginHandlerTest extends ScriptTestSupport assertEquals( "idprovider3", matcher.loginIdProviderAttempts.get( 2 ).toString() ); } private static cla...
<vulnerable_code>from wagtail.admin.admin_url_finder import AdminURLFinder from wagtail.admin.panels import FieldPanel, TabbedInterface from wagtail.contrib.modeladmin.helpers.search import DjangoORMSearchHandler from wagtail.images.models import Image from wagtail.images.tests.utils import get_test_image_file from wag...
<vulnerable_code>from django.utils.decorators import method_decorator from django.utils.encoding import force_str from django.utils.functional import cached_property from django.utils.http import urlencode from django.utils.safestring import mark_safe from django.utils.text import capfirst from django.utils.translation...
<vulnerable_code> int subtype, hexdump = FALSE; u_int sublen; u_int tval; uint8_t i; if (tlv_len < 4) { return hexdump; ND_PRINT((ndo, "\n\t Application Priority Table")); while(i<sublen) { tval=*(tptr+i+5); ND_PRINT((ndo, "\n\t Priority: %d, RES: %d...
<vulnerable_code>import org.springframework.web.server.ResponseStatusException; import java.io.File; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; private static File getTmpFolder() { try { File outputFolder = File.createTempFile("codegen-", "-tmp"); ...
<vulnerable_code> return hash; } function selectAdult(username, connection) { var strQuery = "SELECT * FROM adult WHERE username= '" +connection.escape(username)+"'"; connection.query( strQuery, function(err, rows) {if(err) { throw err; }else{ temp= rows[0]; temp.password=""; if(debug) {co...
<vulnerable_code> fslib_duplicate(buf); } fclose(fp); } <commit_title>[PATCH] mount runtime seccomp files read-only (#2602)<commit_description>avoid creating locations in the file system that are both writable and executable (in this case for processes with euid of the user). for the same reason also remove user o...
<vulnerable_code> fs_logger2("tmpfs", RUN_MNT_DIR); #ifdef HAVE_SECCOMP if (arg_seccomp_block_secondary) copy_file(PATH_SECCOMP_BLOCK_SECONDARY, RUN_SECCOMP_BLOCK_SECONDARY, getuid(), getgid(), 0644); // root needed else {<commit_title>[PATCH] mount runtime seccomp files read-only (#2602)<commit_description>av...
<vulnerable_code> // save state of nonewprivs save_nonewprivs(); // set capabilities set_caps(); // save cpu affinity mask to CPU_CFG file save_cpu(); int rv = unlink(RUN_SECCOMP_MDWX); (void) rv; } #endif //**************************************** // communicate progress of sandbox set up // to --join...
<vulnerable_code> goto theend; } /* * End Visual mode before switching to another buffer, so the text can be * copied into the GUI selection buffer. */ reset_VIsual(); #if defined(FEAT_EVAL) if ((command != NULL || newlnum > (linenr_T)0) && *get_vim_var_str(VV_SWAPCOMMAND) == NUL)<...
<vulnerable_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 1839, /**/<commit_title>[PATCH] patch 9.0.1840: [security] use-after-free in do_ecmd<commit_description>Problem: use-after-free in do_ecmd Solution: Verify oldwin pointer after reset_VIsual() Signed-off-by: Chris...
<vulnerable_code> args->count = ntohl(*p++); args->stable = ntohl(*p++); len = args->len = ntohl(*p++); /* * The count must equal the amount of data passed. */ /* first copy and check from the first page */ old = (char*)p; vec = &rqstp->rq_arg.head[0]; avail = vec->iov_len - (old - (char*)vec->iov_base); wh...
<vulnerable_code> * bytes. */ hdr = (void*)p - head->iov_base; dlen = head->iov_len + rqstp->rq_arg.page_len - hdr; /*<commit_title>[PATCH] nfsd: stricter decoding of write-like NFSv2/v3 ops<commit_description><fixed_code> * bytes. */ hdr = (void*)p - head->iov_base; if (hdr > head->iov_len) return 0; d...
<vulnerable_code> for (k in t) { if (deep && type.object(t[k]) && !(t[k] instanceof Monkey)) { o[k] = merger(true, o[k] || {}, t[k]); } else { })(); export {uniqid};<commit_title>[PATCH] Security fix for Prototype Pollution<commit_description><fixed_code> for (k in ...
<vulnerable_code> break; case GF_SG_VRML_SFSCRIPT: #ifdef GPAC_HAS_QJS codec->LastError = SFScript_Parse(codec, (SFScript*)field->far_ptr, bs, node); #else return GF_NOT_SUPPORTED; #endif<commit_title>[PATCH] fixed #1961<commit_description><fixed_code> break; case GF_SG_VRML_SFSCRIPT: #ifdef GPAC_HAS_QJS cod...
<vulnerable_code> write_vga(12, (c->vc_visible_origin - vga_vram_base) / 2); } #ifdef CONFIG_VGACON_SOFT_SCROLLBACK /* software scrollback */ struct vgacon_scrollback_info { void *data; int tail; int size; int rows; int cnt; int cur; int save; int restore; }; static struct vgacon_scrollback_info *vgacon_scrol...
<vulnerable_code>import logging from flask import request, g from flask_restful import reqparse, Api from http import HTTPStatus from vantage6.server import db from vantage6.server.resource.common.pagination import Pagination from vantage6.server.permission import ( Scope as S, Operation as P, tasks_schema = ...
<vulnerable_code> runs = fields.Nested('TaskRunSchema', many=True) # /task/{id}/run class TaskRunSchema(ResultSchema): node = fields.Function( serialize=lambda obj: RunNodeSchema().dump(obj.node, many=False) ) ports = fields.Function( serialize=lambda obj: RunPortSchema().dump(obj.ports...
<vulnerable_code><commit_title>[PATCH] Improved POST request validation by using marshmallow for<commit_description><fixed_code> from marshmallow import ( Schema, fields, ValidationError, validates, validates_schema ) from marshmallow.validate import Length, Range class _OnlyIdSchema(Schema): """ Schema for v...
<vulnerable_code> }, "organizations": { "type": "array", "items": {"type": "integer"}, "description": ( "Organization ids in collaboration to create task " ...
<vulnerable_code> Operation, PermissionManager ) module_name = logger_name(__name__) log = logging.getLogger(module_name) description="send websocket events to all collaborations") # ------------------------------------------------------------------------------ # Resources / API's # ------------------...
<vulnerable_code> from http import HTTPStatus from flask import g, request from flask_restful import reqparse, Api from vantage6.server.resource import with_user_or_node, with_user from vantage6.server.resource import ServicesResources Operation as P, PermissionManager) from va...
<vulnerable_code> Operation as P, PermissionManager ) from vantage6.server.resource import ( with_user_or_node, only_for, with_user, ServicesResources ) # Resources / API's # ------------------------------------------------------------------------------ org_schema = OrganizationSchema() class OrganizationB...
<vulnerable_code>from vantage6.server import db from vantage6.server.resource.common.pagination import Pagination from vantage6.server.resource.common._schema import PortSchema from vantage6.server.model import ( Run, AlgorithmPort, # Schemas port_schema = PortSchema() # -------------------------------------...
<vulnerable_code>from vantage6.server.resource.common.auth_helper import ( create_qr_uri, user_login ) module_name = logger_name(__name__) log = logging.getLogger(module_name) ) # ------------------------------------------------------------------------------ # Resources / API's # ----------------------------...
<vulnerable_code> TaskSchema, TaskIncludedSchema, ) from vantage6.server.resource.common.pagination import Pagination from vantage6.server.resource.event import kill_task # ------------------------------------------------------------------------------ task_schema = TaskSchema() task_result_schema = TaskIncluded...
<vulnerable_code> from vantage6.common import logger_name from vantage6.server.resource import with_node, ServicesResources from vantage6.server.exceptions import ( VPNConfigException, VPNPortalAuthException ) ) # ------------------------------------------------------------------------------ # Resources / API...
<vulnerable_code> if (dir_.isDirectory()) { final File fl = new File(dir_, file.getPath()); if (fl.isFile()) { if (fl.getCanonicalPath().startsWith(dir_.getCanonicalPath())) { // Prevent accessing files outside the load-path. // E.g....
<vulnerable_code>// THE SOFTWARE. // 'use strict' var INDENT = ' ' function inlineRule (objRule) { var str = '' objRule && Object.keys(objRule).forEach(function (rule) { str += rule + ':' + objRule[rule] + ';' }) return str } function Stylize (styleFile) { function styleClass (cssClass) { return...
<vulnerable_code>// 控制标签宽高成比例的指令 import proportion from 'vue-proportion-directive' Vue.config.productionTip = false Vue.use(VueClipboard) Vue.use(widgets)<commit_title>[PATCH] =?UTF-8?q?refactor:=20=E4=BB=AA=E8=A1=A8=E6=9D=BF?=<commit_description><fixed_code> // 控制标签宽高成比例的指令 import proportion from 'vue-proportion-dire...
<vulnerable_code> case TIOCINQ: { struct sk_buff *skb; long amount = 0L; /* These two are safe on a single CPU system as only user tasks fiddle here */ if ((skb = skb_peek(&sk->sk_receive_queue)) != NULL) amount = skb->len; return put_user(amount, (unsigned int __user *) argp); } <commit_title>[PATCH] net...
<vulnerable_code> if not parts.path.endswith('/'): # redirect browser - doing basically what apache does self.send_response(HTTPStatus.MOVED_PERMANENTLY) # scheme[0] and netloc[1] are intentionally blanked out as we # are only processing a path....
<vulnerable_code> self.check_status_and_reason(response, HTTPStatus.MOVED_PERMANENTLY) self.assertEqual(response.getheader('Location'), expected_location) def test_get(self): #constructs the path relative to the root directory of the HTTPServer response = self.request(self.base_url +...
<vulnerable_code> rcu_read_unlock(); spin_lock_init(&sta->lock); INIT_WORK(&sta->drv_unblock_wk, sta_unblock); INIT_WORK(&sta->ampdu_mlme.work, ieee80211_ba_session_work); mutex_init(&sta->ampdu_mlme.mtx); skb_queue_head_init(&pending); /* Send all buffered frames to the station */ for (ac = 0; ac < IEEE80211...
<vulnerable_code> sta->sta.addr, sta->sta.aid, ac); if (tx->local->total_ps_buffered >= TOTAL_MAX_TX_BUFFER) purge_old_ps_buffers(tx->local); if (skb_queue_len(&sta->ps_tx_buf[ac]) >= STA_MAX_TX_BUFFER) { struct sk_buff *old = skb_dequeue(&sta->ps_tx_buf[ac]); ps_dbg(tx->sdata, info->flags |= IEE...
<vulnerable_code>from ._codecs import adobe_glyphs, charset_encoding from ._utils import logger_warning from .errors import PdfReadWarning from .generic import DecodedStreamObject, DictionaryObject # code freely inspired from @twiggy ; see #711 enc: Union(str, DictionaryObject) = ft["/Encoding"].get_object() # t...
<vulnerable_code> buf = bytes(self.stream.getbuffer()) # type: ignore else: p = self.stream.tell() buf = self.stream.read(-1) self.stream.seek(p, 0) m = re.search( buf = bytes(self.stream.getb...
<vulnerable_code> deprecate_with_replacement("writeToStream", "write_to_stream") self.write_to_stream(stream, encryption_key) @staticmethod def read_from_stream(stream: StreamType, pdf: Any) -> "NameObject": # PdfReader name = stream.read(1) ret = name.decode("utf-8") ...
<vulnerable_code>from ._utils import read_hex_string_from_stream, read_string_from_stream logger = logging.getLogger(__name__) ObjectPrefix = b"/<[tf(n%" NumberSigns = b"+-" IndirectPattern = re.compile(rb"[+-]?(\d+)\s+(\d+)\s+R[^a-zA-Z]") stream.read(1) break stream.seek(-...
<vulnerable_code> with pytest.raises(PdfReadError) as exc: NameObject.read_from_stream(stream, None) assert exc.value.args[0] == "name read error" def test_destination_fit_r():<commit_title>[PATCH] ROB : fix infinite loop due to Invalid object<commit_description>fixes #1329 *prevent loop within diction...
<vulnerable_code> function _setDeep(obj, keyElems, depth, valueCreator) { var key = keyElems.shift(); if (!keyElems.length) { var value = valueCreator(obj, key, depth); if (value === undefined) { function isObject(v) { return Object.prototype.toString.call(v) === '[object Object]'; }<commit_title>[PATCH] ...
<vulnerable_code> }); });<commit_title>[PATCH] Fix: Avoids prototype pollution<commit_description><fixed_code> }); describe('Avoid a prototype pollution vulnerability', function() { describe('The critical property key is in a src object', function() { it('should ignore a property key: __proto__', f...
<vulnerable_code> function _setDeep(obj, keyElems, depth, valueCreator) { var key = keyElems.shift(); if (!keyElems.length) { var value = valueCreator(obj, key, depth); if (value === undefined) { return Object.prototype.toString.call(v) === '[object Object]'; } },{"each-props":4,"is-plain-object":8}],2:[...
<vulnerable_code>!function(t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).copyProps=t()}(function(){return function i(u,a,c){function f(...
<vulnerable_code> function copy(target, current) { lazy.forOwn(current, function (value, key) { var val = target[key]; // add the missing property, or allow a null property to be updated if (val == null) {<commit_title>[PATCH] exclude __proto__<commit_description><fixed_code> function copy(ta...
<vulnerable_code> uint8_t *data = pnt; uint8_t tlv_type; uint16_t tlv_length; if (length < 3) { zlog_err("Bad AIGP attribute length (MUST be minimum 3): %u", } while (length) { tlv_type = *data; ptr_get_be16(data + 1, &tlv_length); (void)data; <commit_title>[PATCH] bgpd: Make sure we have enough data to ...
<vulnerable_code> attribution: '<a href="https://mapbox.com/about/maps/">Terms &amp; Conditions</a>' }).addTo(overview_map); var lineGroup = L.featureGroup().addTo(map); var changeset_info = document.getElementById('changeset_info'); var changeset_tmpl = _.template(document.getElementById('changeset-template').inn...
<vulnerable_code> __iotc_free(ptr); }) #if 0 IOTC_TT_TESTCASE( utest__iotc_memory_calloc_max_num_one_size, { void* ptr = __iotc_calloc( /*num=*/SIZE_MAX, /*size=*/1); tt_want_ptr_op(NULL, ==, ptr); __iotc_free(ptr); }) IOTC_TT_TESTCASE( utest__iotc_memory_calloc_one_num_max_...
<vulnerable_code>/** @brief Read index entry label from buffer pointing at index record data @param[in,out] output Output string @param[in,out] buf MOBIBuffer structure, offset pointing at index entry label @param[in] length Number of bytes to be read @param[in] has_ligatures Decode ligatures if true @return Si...
<vulnerable_code>require('dotenv').config() const { exec } = require("child_process"); const { RichEmbed, Message } = require("discord.js"); module.exports = { name: "npm", args: true, )}...`, { disableEveryone: true } ); exec( `npm search ${args.join(" ").replace(/\n/g, " ")} -json -l`,...
<vulnerable_code> ) .on("collect", msg => { const choice = parseInt(msg.content) - 1; if (!JSON.parse(so)[choice]) return message.reply("out of range."); const result = JSON.parse(so)[choice]; cons...
<vulnerable_code>require('dotenv').config() const { exec } = require("child_process"); const { RichEmbed, Message } = require("discord.js"); const { encode } = require("querystring") const fetch = require("node-fetch") module.exports = { name: "npm", )}...`, { disableEveryone: true } ); const re...
<vulnerable_code> uint64_t size; njs_value_t *start, *old; free_before = array->start - array->data; free_after = array->size - array->length - free_before; njs_set_invalid(&retval); } ret = njs_array_add(vm, array, &retval); ...
<vulnerable_code> "njs.dump([a[0], a[33],a.length])"), njs_str("[1,1,65]") }, { njs_str("var re = /abc/; re[Symbol.isConcatSpreadable] = true;" "re[0] = 1, re[1] = 2, re[2] = 3, re.length = 3;" "[].concat(re)"),<commit_title>[PATCH] Fixed Array.prototype.concat() when...
<vulnerable_code>void fxPushSubstitutionString(txMachine* the, txSlot* string, txInteger size, txInteger offset, txSlot* match, txInteger length, txInteger count, txSlot* captures, txSlot* groups, txSlot* replace) { txString r; txInteger l; txBoolean flag; txByte c, d; txSlot* capture; txString s; r = replace->v...
<vulnerable_code> applied to that arg @keyparam inputform deprecated. A form object that generates the input to this method @keyparam exclude_from_memory_profiling allows to exclude individual end points from memory profiling. Can be used for performance or in case profiling ...
<vulnerable_code> http://svn.turbogears.org/trunk#egg=turbogears-dev """ version = "1.0.11.8" description = "Front-to-back, open-source, rapid web development framework" long_description = __doc__ author = "Kevin Dangoor"<commit_title>[PATCH] SWAT-20: Remove header injection vulnerability on redirect<commit_descrip...
<vulnerable_code> def redirect_to_path_tuple(self, path): raise redirect((path, 'index')) class TestRoot(unittest.TestCase): assert (cherrypy.response.headers['Location'] == 'http://localhost/subthing/index'), url def test_multi_values(self): testutil.creat...
<vulnerable_code> """Standalone functions to accompany the index implementation and make it more versatile.""" from io import BytesIO import os import os.path as osp traverse_trees_recursive, tree_to_stream, ) from git.util import IndexFileSHA1Writer, finalize_process from gitdb.base import IStream from gitdb....
<vulnerable_code> # to be sent. basehost = options.get("system.base-hostname") if basehost and origin: if origin.endswith(basehost): response["Access-Control-Allow-Credentials"] = "true" return response<commit_title>[PATCH] Fix GHSA-4xqm-4p72-87h6 (#52276)<com...
<vulnerable_code> * @returns {string} */ function entities(text) { return text.replace(/&/g, "&amp;") .replace(/</g, "&lt;") .replace(/>/g, "&gt;") .replace(/"/g, "&quot;"); } /** let linktext = `(${t("mention")})`; if (c.name) { linkclass = "name"; ...
<vulnerable_code>// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt !function(){"use strict";window.i18next=window.i18next||{t:function(n){return n}};const n=window.i18next.t.bind(window.i18next);function e(n,e){return document.currentScript.getAttribute("data-"+n)||e}const t=e("page-...
<vulnerable_code>import java.util.HashMap; import java.util.Map; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.transform.OutputKeys; import javax.xml.transform.Result; final TransformerFactory transformerFactory = TransformerFactory.newInstance(); final SgmlPage page = sou...
<vulnerable_code> // Quercus Pattern.compile(".*com.caucho.quercus.servlet.QuercusServlet initImpl\r?\n"), Pattern.compile(".*QuercusServlet starting as QuercusServletImpl\r?\n"), Pattern.compile(".*Quercus finished initialization in \\d*ms\r?\n") }; /**<commit_ti...
<vulnerable_code>import com.gargoylesoftware.htmlunit.WebDriverTestCase; import com.gargoylesoftware.htmlunit.junit.BrowserRunner; import com.gargoylesoftware.htmlunit.junit.BrowserRunner.Alerts; import com.gargoylesoftware.htmlunit.util.MimeType; /** * @throws Exception if the test fails */ @Test @A...
<vulnerable_code> } //merge objects else { original[name] = objectMerge(original[name], patch[name], removeMode); } }<commit_title>[PATCH] don't inadvertantly modify Object.prototype<commit_description><fixed_code> } //merge objects else { //Don't implicitly mutate Object.protot...
<vulnerable_code><commit_title>[PATCH] don't inadvertantly modify Object.prototype<commit_description><fixed_code> patchMerge = require('./index.js'); var obj = {} console.log("Before : " + obj.isAdmin); console.log(patchMerge(obj, JSON.parse('{ "__proto__": { "isAdmin": true }}'))); console.log("After : " + obj.isAdmi...
<vulnerable_code>/* * ***** BEGIN LICENSE BLOCK ***** * Zimbra Collaboration Suite Server * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2013, 2014, 2016 Synacor, Inc. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published ...
<vulnerable_code> module_name = (const char *)data1; /* identity must always have a prefix */ if (!strchr(*value, ':')) { sprintf(buf, "%s:%s", module_name, *value); } else { strcpy(buf, *value); } break;<commit_title>[PATCH] parser BUGFIX long iden...
<vulnerable_code> void js_RegExp_prototype_exec(js_State *J, js_Regexp *re, const char *text) { int i; int opts; Resub m; } } if (!js_regexec(re->prog, text, &m, opts)) { js_newarray(J); js_pushstring(J, text); js_setproperty(J, -2, "input"); { js_Regexp *re; const char *text; int opts; Resub m; } ...
<vulnerable_code>#include "utf.h" #include "regexp.h" static const char *checkstring(js_State *J, int idx) { if (!js_iscoercible(J, idx)) a = text; e = text + strlen(text); while (a <= e) { if (js_regexec(re->prog, a, &m, a > text ? REG_NOTBOL : 0)) break; b = m.sub[0].sp; re = js_toregexp(J, -1); if (...
<vulnerable_code>#define REPINF 255 #define MAXSUB REG_MAXSUB #define MAXPROG (32 << 10) typedef struct Reclass Reclass; typedef struct Renode Renode; return 0; } static int match(Reinst *pc, const char *sp, const char *bol, int flags, Resub *out) { Resub scratch; int i; Rune c; for (;;) { switch (pc->opcode)...
<vulnerable_code> Read MATLAB image. */ quantum_info=(QuantumInfo *) NULL; clone_info=CloneImageInfo(image_info); if (ReadBlob(image,124,(unsigned char *) &MATLAB_HDR.identific) != 124) ThrowReaderException(CorruptImageError,"ImproperImageHeader"); if (strncmp(MATLAB_HDR.identific,"MATLAB",6) != 0) ...
<vulnerable_code> if((channel->rx_buffer.sdu_length > 0) && (channel->rx_buffer.sdu_length == channel->rx_buffer.current_index)) { /* do not use packetbuf_copyfrom here because the packetbuf_attr * must not be cleared */ memcpy(packetbuf_dataptr(), channel->rx_buffer.sdu, channel->rx_buffer.sdu_leng...
<vulnerable_code> while (ftell(ifp)+7 < end) { save = ftell(ifp); if ((size = get4()) < 8) return; fread (tag, 4, 1, ifp); if (!memcmp(tag,"moov",4) || !memcmp(tag,"udta",4) ||<commit_title>[PATCH] parse_qt: possible integer overflow<commit_description><fixed_code> while (ftell(ifp)+7 < end) { s...
<vulnerable_code> for (i = 0; i < tbl->ntable; i++) { t = tbl->tables[i].ptr; col = tbl->tables[i].col; row = tbl->tables[i].row; indent = tbl->tables[i].indent;<commit_title>[PATCH] Prevent deref null pointer in renderCoTable()<commit_description>Bug-Debian: https://github.com/tats/w3m/issues/20#issuecomment-2...
<vulnerable_code> void CLASS nikon_yuv_load_raw() { int row, col, yuv[4], rgb[3], b, c; UINT64 bitbuf = 0; float cmul[4]; unpacked_load_raw(); return; } pixel = (ushort *)calloc(raw_width, sizeof *pixel); merror(pixel, "sinar_4shot_load_raw()"); #ifdef LIBRAW_LIBRARY_BUILD { int row, col; if (!...
<vulnerable_code> // sRAW and old Foveon decoders only, so extra buffer size is just 1/4 // allocate image as temporary buffer, size imgdata.rawdata.raw_alloc = 0; imgdata.image = (ushort(*)[4])calloc(unsigned(S.raw_width) * unsigned(S.raw_height), sizeof(*imgdata.image)); if (!(d...
<vulnerable_code> from hashlib import sha1 from twisted.internet import defer, ssl from twisted.python.compat import unicode from twisted.trial import unittest from twisted.words.protocols.jabber import client, error, jid, xmlstream from twisted.words.protocols.jabber.sasl import SASLInitiatingInitializer from twisted...