text
stringlengths
79
3.72M
<vulnerable_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 212, /**/<commit_title>[PATCH] patch 9.0.0213: using freed memory with error in assert<commit_description><fixed_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 213, /...
<vulnerable_code><commit_title>[PATCH] XWIKI-21200: Improve escaping in SearchAdmin<commit_description>* Add a page test<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 * ...
<vulnerable_code> """ Parse the first YAML document in a stream and produce the corresponding Python object. """ loader = Loader(stream) try: return loader.get_single_data() finally: loader.dispose() def load_all(stream, Loader=Loader): """ Parse all YAML documents in...
<vulnerable_code> __all__ = ['CBaseLoader', 'CSafeLoader', 'CLoader', 'CBaseDumper', 'CSafeDumper', 'CDumper'] from _yaml import CParser, CEmitter BaseConstructor.__init__(self) BaseResolver.__init__(self) class CSafeLoader(CParser, SafeConstructor, Resolver): def __init__(self, stream):...
<vulnerable_code> __all__ = ['BaseDumper', 'SafeDumper', 'Dumper'] from .emitter import * from .serializer import * default_flow_style=default_flow_style) Resolver.__init__(self) class SafeDumper(Emitter, Serializer, SafeRepresenter, Resolver): def __init__(self, stream, defau...
<vulnerable_code> __all__ = ['BaseLoader', 'SafeLoader', 'Loader'] from .reader import * from .scanner import * BaseConstructor.__init__(self) BaseResolver.__init__(self) class SafeLoader(Reader, Scanner, Parser, Composer, SafeConstructor, Resolver): def __init__(self, stream): Reader.__i...
<vulnerable_code> NewArgs, NewArgsWithState, Reduce, ReduceWithState, MyInt, MyList, MyDict, \ FixedOffset, today, execute class MyLoader(yaml.Loader): pass class MyDumper(yaml.Dumper): pass class MyTestClass1: sys.modules['test_constructor'] = sys.modules['__ma...
<vulnerable_code> value2 = None output2 = None try: output1 = yaml.dump(value1) value2 = yaml.load(output1) output2 = yaml.dump(value2) assert output1 == output2, (output1, output2) finally: if verbose: if __name__ == '__main__': import test_appliance test_...
<vulnerable_code> node = Node(organization=org, collaboration=col) node.save() results = self.app.patch(f"/api/node/{node.id}", headers=headers) self.assertEqual(results.status_code, HTTPStatus.UNAUTHORIZED) # test user with global permissions<commit_title>[PATCH] Fix unit test:...
<vulnerable_code> break; if (a->start.pos > pos) { a->start.pos += shift; if (hl->marks[a->hseq].line == line) hl->marks[a->hseq].pos = a->start.pos; } if (a->end.pos >= pos)<commit_title>[PATCH] Prevent deref null pointer in shiftAnchorPosition()<commit_description>Bug-Debian: https://github.com/tat...
<vulnerable_code>import itertools import re from typing import Any, Callable, Generator, Iterable, List, Optional from urllib.parse import urlparse from langchain.document_loaders.web_base import WebBaseLoader yield item def _extract_domain_and_scheme(url: str) -> str: """Extract the base URL (i.e., sche...
<vulnerable_code>import pytest from langchain.document_loaders import SitemapLoader from langchain.document_loaders.sitemap import _extract_domain_and_scheme def test_sitemap() -> None: def test_extract_domain() -> None: """Test domain extraction.""" assert ( _extract_domain_and_scheme("https://js.l...
<vulnerable_code> let recipient = result while (key2 !== undefined) { const type = Object.prototype.toString.call(recipient[key1]) const isobject = ( type === '[object Object]' ||<commit_title>[PATCH] Fix prototype pollution on unflatten<commit_description>Fixes #105.<fixed_code> let rec...
<vulnerable_code> result = result.replace(/\$/g, ""); result = result.replace(/#/g, ""); result = result.replace(/\\/g, ""); return result } <commit_title>[PATCH] improved shell sanitation<commit_description><fixed_code> result = result.replace(/\$/g, ""); result = result.replace(/#/g, ""); result = result...
<vulnerable_code> // ECDH KeyPair.prototype.derive = function derive(pub) { return pub.mul(this.priv).getX(); }; <commit_title>[PATCH] ec: validate that a point before deriving keys<commit_description>This update checks to make sure that the public key passed in to ECDH is a point that actually exists on the curve. T...
<vulnerable_code> test('ed25519'); test('secp256k1'); });<commit_title>[PATCH] ec: validate that a point before deriving keys<commit_description>This update checks to make sure that the public key passed in to ECDH is a point that actually exists on the curve. This is important to prevent a twist attack that can be ...
<vulnerable_code> * with response. */ ((_radio.conn_curr->llcp_length.req == _radio.conn_curr->llcp_length.ack) && (pdu_data_rx->llctrl.opcode == PDU_DATA_LLCTRL_TYPE_LENGTH_REQ)) || /* or Local has active... */ ((_radio.conn_curr->llcp_length.req != _radio.conn_curr...
<vulnerable_code> } auto insertPoint = op->template getParentOfType<func::FuncOp>(); SmallString<32> funcName; FuncGeneratorType funcGenerator; uint32_t nTrailingP = 0;<commit_title>[PATCH] [mlir][sparse] Add checking parent op of SortOp<commit_description>Fix crash with segmentation fault caused by setting a...
<vulnerable_code> char *szTheTableName; dk_set_t to_free = NULL; memcpy (parts_tmp, parts, box_length ((caddr_t) parts)); qr_rec_exec (find_primary_stmt, cli, &lc_keys, qi, NULL, 1,<commit_title>[PATCH] Fixed missing check for max number of key parts (fixes #1120)<commit_description><fixed_code> char *szTheT...
<vulnerable_code>sds sdsMakeRoomFor(sds s, size_t addlen) { void *sh, *newsh; size_t avail = sdsavail(s); size_t len, newlen; char type, oldtype = s[-1] & SDS_TYPE_MASK; int hdrlen; len = sdslen(s); sh = (char*)s-sdsHdrSize(oldtype); newlen = (len+addlen); assert(newlen > len); /...
<vulnerable_code> } @SuppressWarnings("unchecked") public int getCountAssetsAndPermissionsPerRoleAndConditionWithParent(String condition, Class assetsClass, String parentId, boolean showDeleted, User user) { return WebAssetFactory.getAssetsCountPerConditionWithPermissionWithParent(condition, assetsClass, 100000, 0...
<vulnerable_code> public class SQLUtil { public static List<String> tokenize(String schema) { List<String> ret=new ArrayList<String>(); if (schema!=null) { /** * Method to sanitize order by SQL injection * @param orderByRequest * @return */ public static String sanityOrderBy(String orderByRequest){ ...
<vulnerable_code>import com.dotmarketing.business.DotStateException; import com.dotmarketing.business.Permissionable; import com.dotmarketing.common.db.DotConnect; import com.dotmarketing.db.HibernateUtil; import com.dotmarketing.exception.DotDataException; import com.dotmarketing.exception.DotHibernateException; if(...
<vulnerable_code>import com.dotmarketing.cache.LiveCache; import com.dotmarketing.cache.WorkingCache; import com.dotmarketing.common.db.DotConnect; import com.dotmarketing.db.HibernateUtil; import com.dotmarketing.exception.DotDataException; import com.dotmarketing.exception.DotHibernateException; import com.dotmarketi...
<vulnerable_code> showDel = false; } String orderBy = SQLUtil.sanityOrderBy(req.getParameter("orderby")); <commit_title>[PATCH] sanitizing params<commit_description><fixed_code> showDel = false; } String orderBy = req.getParameter("orderby");
<vulnerable_code>import com.dotmarketing.business.DotCacheException; import com.dotmarketing.business.PermissionAPI; import com.dotmarketing.common.db.DotConnect; import com.dotmarketing.db.DbConnectionFactory; import com.dotmarketing.db.HibernateUtil; import com.dotmarketing.exception.DotDataException; @Override pro...
<vulnerable_code> try { String orderby = SQLUtil.sanityOrderBy(req.getParameter("orderby")); String direction = req.getParameter("direction"); if (!UtilMethods.isSet(orderby)){ orderby = "mod_date"; direction = "desc"; } if(orderby.equals("name")) { orderby = "upper(name)"; ...
<vulnerable_code> // condition.append(" status , "); } if (UtilMethods.isSet(searcher.getOrderBy())) { orderby=searcher.getOrderBy().replaceAll("[^\\w_\\. ]", ""); } else { DotConnect dc = getWorkflowSqlQuery(searcher, false); dc.setStartRow(searcher.getCount() * searcher.getPage()); dc.setMaxRow...
<vulnerable_code> int count = -1; String startStr = request.getParameter("start"); String countStr = request.getParameter("count"); String sort = SQLUtil.sanityOrderBy(request.getParameter("sort")); if(UtilMethods.isSet(startStr) && UtilMethods.isSet(countStr)) { start = Integer.parseInt(request.getP...
<vulnerable_code>import com.dotmarketing.beans.UserProxy; import com.dotmarketing.business.APILocator; import com.dotmarketing.business.PermissionAPI; import com.dotmarketing.db.HibernateUtil; import com.dotmarketing.exception.DotDataException; import com.dotmarketing.exception.DotHibernateException; public java.util....
<vulnerable_code>window.catalog=function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,g...
<vulnerable_code>window.catalog_product=function(e){function i(r){if(t[r])return t[r].exports;var c=t[r]={i:r,l:!1,exports:{}};return e[r].call(c.exports,c,c.exports,i),c.l=!0,c.exports}var t={};return i.m=e,i.c=t,i.i=function(e){return e},i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumera...
<vulnerable_code>window.cldr=function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:...
<vulnerable_code>window.cms_page_form=function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerabl...
<vulnerable_code>window.employee_form=function(e){function t(o){if(n[o])return n[o].exports;var s=n[o]={i:o,l:!1,exports:{}};return e[o].call(s.exports,s,s.exports,t),s.l=!0,s.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerabl...
<vulnerable_code>window.form_popover_error=function(r){function t(n){if(o[n])return o[n].exports;var e=o[n]={i:n,l:!1,exports:{}};return r[n].call(e.exports,e,e.exports,t),e.l=!0,e.exports}var o={};return t.m=r,t.c=o,t.i=function(r){return r},t.d=function(r,o,n){t.o(r,o)||Object.defineProperty(r,o,{configurable:!1,enum...
<vulnerable_code>window.geolocation=function(e){function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}var t={};return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:...
<vulnerable_code>window.imports=function(e){function t(i){if(o[i])return o[i].exports;var n=o[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var o={};return t.m=e,t.c=o,t.i=function(e){return e},t.d=function(e,o,i){t.o(e,o)||Object.defineProperty(e,o,{configurable:!1,enumerable:!0,g...
<vulnerable_code>window.improve_design_positions=function(o){function e(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return o[n].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var t={};return e.m=o,e.c=t,e.i=function(o){return o},e.d=function(o,t,n){e.o(o,t)||Object.defineProperty(o,t,{configurable:!...
<vulnerable_code>window.invoices=function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,...
<vulnerable_code>window.localization=function(n){function t(e){if(r[e])return r[e].exports;var o=r[e]={i:e,l:!1,exports:{}};return n[e].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};return t.m=n,t.c=r,t.i=function(n){return n},t.d=function(n,r,e){t.o(n,r)||Object.defineProperty(n,r,{configurable:!1,enumerable...
<vulnerable_code>window.logs=function(e){function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}var t={};return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:...
<vulnerable_code>window.main=function(e){function t(n){if(i[n])return i[n].exports;var s=i[n]={i:n,l:!1,exports:{}};return e[n].call(s.exports,s,s.exports,t),s.l=!0,s.exports}var i={};return t.m=e,t.c=i,t.i=function(e){return e},t.d=function(e,i,n){t.o(e,i)||Object.defineProperty(e,i,{configurable:!1,enumerable:!0,get:...
<vulnerable_code>window.maintenance=function(e){function i(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,i),a.l=!0,a.exports}var t={};return i.m=e,i.c=t,i.i=function(e){return e},i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:...
<vulnerable_code>window.module=function(e){function t(n){if(o[n])return o[n].exports;var i=o[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var o={};return t.m=e,t.c=o,t.i=function(e){return e},t.d=function(e,o,n){t.o(e,o)||Object.defineProperty(e,o,{configurable:!1,enumerable:!0,ge...
<vulnerable_code>window.module_card=function(t){function e(o){if(n[o])return n[o].exports;var i=n[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,o){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:...
<vulnerable_code>window.order_delivery=function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerab...
<vulnerable_code>window.order_preferences=function(e){function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}var t={};return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enume...
<vulnerable_code>window.payment_preferences=function(e){function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}var t={};return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enu...
<vulnerable_code>window.product_page=function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable...
<vulnerable_code>window.product_preferences=function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enu...
<vulnerable_code>window.stock=function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get...
<vulnerable_code>window.themes=function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,ge...
<vulnerable_code>window.translation_settings=function(e){function t(o){if(n[o])return n[o].exports;var i=n[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,en...
<vulnerable_code>window.translations=function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable...
<vulnerable_code> return(pixels); } static MagickPixelPacket **AcquirePixelThreadSet(const Image *image) { MagickPixelPacket **pixels; j; size_t number_threads; number_threads=(size_t) GetMagickResourceLimit(ThreadResource); if (pixels == (MagickPixelPacket **) NULL) return((MagickPixelPack...
<vulnerable_code> // if it's a type change, then we need to clobber or error. // if it's not a type change, then let the impl take care of it. if (currentType !== self.type) { return rimraf(self._path, function (er) { if (er) return self.error(er) self._old = null<commit_title>[PATCH] ...
<vulnerable_code> int32_t mz_path_has_slash(const char *path) { int32_t path_len = (int32_t)strlen(path); if (path[path_len - 1] != '\\' && path[path_len - 1] != '/') return MZ_EXIST_ERROR; return MZ_OK; }<commit_title>[PATCH] Check for zero length path in mz_path_has_slash<commit_description>Fix fo...
<vulnerable_code> config.setdefault("CACHE_TYPE", "null") config.setdefault("CACHE_NO_NULL_WARNING", False) config.setdefault("CACHE_SOURCE_CHECK", False) if ( config["CACHE_TYPE"] == "null" from . import backends cache_obj = load_module(import_me, lookup_obj=...
<vulnerable_code> return request.param.copy() @pytest.fixture def app(request, serialization_args): app = flask.Flask( request.module.__name__, template_folder=os.path.dirname(__file__) ) app.testing = True app.config["CACHE_TYPE"] = "simple" app.config["CACHE_OPTIONS"] = serialization_...
<vulnerable_code> result = result .replace(/\\/gu, "\\\\") .replace(/\n/gu, " ") .replace(/(^|\s)(~|#)/gu, "$1\\$2") .replace(/(\*|\?)/gu, "\\$1") .replace(/([$&;|])/gu, "\\$1") .replace(/([()<>])/gu, "\\$1") .replace(/(["'`])/gu, "\\$1") result = result .replace(/...
<vulnerable_code> * @returns {string} The escaped argument. */ function escapeArgCmd(arg, interpolation, quoted) { let result = arg.replace(/\0/gu, "").replace(/\n|\r/gu, " "); if (interpolation) { result = result .replace(/\^/gu, "^^") .replace(/(<|>)/gu, "^$1") .replace(/(")/gu, "^$1") ...
<vulnerable_code> for path in ('', '.', '/', '\\', '///foo/.//bar//'): self.assertIsInstance(self.pathmodule.normpath(path), str) def test_abspath_issue3426(self): # Check that abspath returns unicode when the arg is unicode # with both ASCII and non-ASCII cwds.<commit_title>[PAT...
<vulnerable_code> if (!buffer) { return NULL; } PyObject *result = PyUnicode_FromWideChar(_Py_normpath(buffer, len), -1); PyMem_Free(buffer); return result; }<commit_title>[PATCH] gh-106242: Fix path truncation in os.path.normpath<commit_description><fixed_code> if (!buffer) { ret...
<vulnerable_code> path, which will be within the original buffer. Guaranteed to not make the path longer, and will not fail. 'size' is the length of the path, if known. If -1, the first null character will be assumed to be the end of the path. */ wchar_t * _Py_normpath(wchar_t *path, Py_ssize_t size) { a...
<vulnerable_code> var csvSettings = Ext.encode(this.config.csvSettings); ImportForm.getForm().submit({ url: this.mergeUrl, params: {importFile: this.config.tmpFile, csvSettings: csvSettings, domain: th...
<vulnerable_code> if (res != TEE_SUCCESS) return res; params = malloc(sizeof(TEE_Attribute) * num_params); if (!params) return TEE_ERROR_OUT_OF_MEMORY; res = copy_in_attrs(utc, usr_params, num_params, params); if (res != TEE_SUCCESS) return res; params = malloc(sizeof(TEE_Attribute) * num_params); if (!pa...
<vulnerable_code>export function escape(arg, options = {}) { const helpers = getPlatformHelpers(); const { flagProtection, interpolation, shellName } = parseOptions( { options, process }, helpers, ); const argAsString = checkedToString(arg); export function quote(arg, options = {}) { const helpers = g...
<vulnerable_code> * Parses options provided to shescape. * * @param {object} args The arguments for this function. * @param {object} args.options The options for escaping. * @param {boolean} [args.options.flagProtection] Is flag protection enabled. * @param {boolean} [args.options.interpolation] Is interpolation e...
<vulnerable_code> .tuple(arbitrary.shescapeOptions(), arbitrary.env()) .map(([options, env]) => { options = options || {}; return { options, process: { env } }; }); test.beforeEach((t) => { t.context.deps.getShellName.resetHistory(); t.context.deps.getShellName.returns(shellName); c...
<vulnerable_code>import java.util.Optional; import java.util.stream.Stream; /** * Loads resources from the file system. * */ public class DefaultFileSystemResourceLoader implements FileSystemResourceLoader { private final Optional<Path> baseDirPath; /** * Default constructor. */ public Defau...
<vulnerable_code> private final ClassLoader classLoader; private final String basePath; private final Map<String, Boolean> isDirectoryCache = new ConcurrentLinkedHashMap.Builder<String, Boolean>() .maximumWeightedCapacity(50).build(); /** * Default constructor. public DefaultClassP...
<vulnerable_code> } order++; } else { throw new ConfigurationException("Unsupported properties file format: " + fileName); } } } * @param fileName ...
<vulnerable_code> (void) sample_size; image->columns = MATLAB_HDR.SizeX; image->rows = MATLAB_HDR.SizeY; quantum_info=AcquireQuantumInfo(clone_info,image); if (quantum_info == (QuantumInfo *) NULL) ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); one=1; image->colors =...
<vulnerable_code> (StreamConfig.streamingRemotely != STREAM_CFG_REMOTE || CHANNEL_COUNT_FROM_AUDIO_CONFIGURATION(StreamConfig.audioConfiguration) <= 2)) { // If we have an RTSP URL string and it was successfully parsed, use that string if (serverInfo->rtspSessionUrl != NULL && parseUrlAddrFro...
<vulnerable_code> if not current_user.role_edit_shelfs() and to_save.get("is_public") == "on": flash(_(u"Sorry you are not allowed to create a public shelf"), category="error") return redirect(url_for('web.index')) is_public = 1 if to_save.get("is_public") else 0 if config...
<vulnerable_code> ) self.assertContains(accept_version_post_response, "Secure") def test_accept_redirect_safe(self): # Pre-accept terms 2 and 3 UserTermsAndConditions.objects.create(user=self.user1, terms=self.terms2) UserTermsAndConditions.objects.create(user=self.user1, ter...
<vulnerable_code>from django.utils.translation import gettext as _ from django.views.generic import DetailView, CreateView, FormView from django.template.loader import get_template import logging from smtplib import SMTPException terms = TermsAndConditions.get_active_terms_not_agreed_to(self.request.user) ...
<vulnerable_code> const { toString } = Function.prototype; const functionNameMatch = /\s*function(?:\s|\s*\/\*[^(?:*/)]+\*\/\s*)*([^\s(/]+)/; function getFuncName(aFunc) { if (typeof aFunc !== 'function') { return null; if (typeof Function.prototype.name === 'undefined' && typeof aFunc.name === 'undefined') { ...
<vulnerable_code> assert(getFuncName(anonymousFunc) === ''); }); it('should return `null` when passed a String as argument', function () { assert(getFuncName('') === null); });<commit_title>[PATCH] Merge pull request from GHSA-4q6p-r6v2-jvc5<commit_description><fixed_code> assert(getFuncName(anonymous...
<vulnerable_code>} class User { &#064;BindInitializer({ obj -> new Contact(account:obj.account) }) Contact contact Account account<commit_title>[PATCH] Update SimpleDataBinder to prevent binding to specific types<commit_description><fixed_code> } class User { &#064;BindInitializer({ ...
<vulnerable_code> * When the annotation is applied to a field, the value assigned to the * annotation should be a Closure which accepts 2 parameters. The first * parameter is the object that data binding is being applied to. The second * parameter is a {@link org.grails.databinding.DataBindingSource} containing th...
<vulnerable_code> * into an object. Typically a structured editor will pull * several values out of the Map that are necessary to initialize * the state of the object. <pre> class Address { String state String city } class StructuredAddressBindingEditor implements StructuredBindingEditor { public Object...
<vulnerable_code> * @author Jeff Brown * @since 3.0 * @see grails.databinding.BindingFormat * @see org.grails.databinding.SimpleDataBinder * @see org.grails.databinding.SimpleDataBinder#registerFormattedValueConverter(FormattedValueConverter) */ public interface FormattedValueConverter { /**<commit_title>[PATC...
<vulnerable_code> } /** * Provides Groovy << left shift operator, but intercepts call to make sure * nulls are converted to "" strings * * @param obj The value<commit_title>[PATCH] Update SimpleDataBinder to prevent binding to specific types<commit_description><fixed_code> } /** ...
<vulnerable_code> * * <p> * StreamCharBuffer keeps the buffer in a linked list of "chunks". The main * difference compared to JDK in-memory buffers (StringBuffer, StringBuilder & * StringWriter) is that the buffer can be held in several smaller buffers * ("chunks" here). In JDK in-memory buffers, the buffer has to...
<vulnerable_code> * Thrown if an unrecoverable problem occurs creating a DataBindingSource. * * @since 2.3 * @see org.grails.databinding.DataBindingSource * @see DataBindingSourceCreator */ public class DataBindingSourceCreationException extends RuntimeException {<commit_title>[PATCH] Update SimpleDataBinder to pr...
<vulnerable_code> * <code>{ } [ ] / \ : , = ; #</code> and if they do not look like numbers * and if they are not the reserved words <code>true</code>, * <code>false</code>, or <code>null</code>.</li> * <li>Keys can be followed by <code>=</code> or <code>=></code> as well as * by <code>:</code>.</li> * <li>Values ...
<vulnerable_code> } /** * Reset params by re-reading & initializing parameters from request */ public void resetParams() { params = (GrailsParameterMap)getOriginalParams().clone();<commit_title>[PATCH] Update SimpleDataBinder to prevent binding to specific types<commit_description><fixed_c...
<vulnerable_code> /** * Renders a page with the specified TemplateEngine, mode and response. * @param model The model to use * @param request The HttpServletRequest * @param response The HttpServletResponse instance * @param engine The TemplateEngine to use * * @throws java.io.IOEx...
<vulnerable_code> return 0; } static int mpeg4_decode_profile_level(MpegEncContext *s, GetBitContext *gb) { s->avctx->profile = get_bits(gb, 4); s->avctx->level = get_bits(gb, 4); // for Simple profile, level 0 if (s->avctx->profile == 0 && s->avctx->level == 8) { s->avctx->level = 0; ...
<vulnerable_code> Mockito.when(lookup.lookup(ResourceProvider.class)) .thenReturn(resourceProvider); Mockito.when(context.getAttribute(Lookup.class.getName())) .thenReturn(lookup); getServlet().init(config);<commit_title>[PA...
<vulnerable_code>import com.vaadin.tests.util.TestUtil; import elemental.json.Json; import net.jcip.annotations.NotThreadSafe; @NotThreadSafe public class ComponentTest { private UI ui;<commit_title>[PATCH] refactor: use StaticFileHandler as a service (#10229)<commit_description>refactor: use StaticFileHandler a...
<vulnerable_code> private TestVaadinServlet servlet; private TestVaadinServletService service; private MockDeploymentConfiguration deploymentConfiguration = new MockDeploymentConfiguration(); public MockServletServiceSessionSetup() throws Exception { this(true); .thenReturn(looku...
<vulnerable_code> public void serviceContainsStreamRequestHandler() throws ServiceException, ServletException { ServletConfig servletConfig = new MockServletConfig(); servletConfig.getServletContext().setAttribute(Lookup.class.getName(), Mockito.mock(Lookup.class)); ...
<vulnerable_code> Assert.assertNull(servlet.getServletConfig()); } private ServletConfig mockConfig() { ServletConfig config = Mockito.mock(ServletConfig.class); ServletContext context = Mockito.mock(ServletContext.class);<commit_title>[PATCH] refactor: use StaticFileHandler as a service...
<vulnerable_code> return JtoA(PUBinJ) } function ecsign(d, z) { while (true) { const k = rnd(P) const R = mulG(k) } function ecrecover(recId, sigr, sigs, message) { // 1.0 For j from 0 to h (h == recId here and the loop is outside this function) ...
<vulnerable_code> Assert.ok(/^[0-9a-f]{64}$/.test(sig.s), 'sig.s is not a hex string') Assert.ok(sig.v===0 || sig.v===1, 'sig.v is not a 0 or 1') if (Secp256k1Node) { const success = Secp256k1Node.verify(B(z), Buffer.concat([B(sig.r), B(sig.s)]), Buffer.concat([Buffer('\04'), B(pubX),...
<vulnerable_code> ) try: assistant_reply_json = extract_json_from_response(assistant_reply) validate_json(assistant_reply_json, self.config) except json.JSONDecodeError as e: logger.error(f"Exception while validating assistant reply...
<vulnerable_code> if plugin_messages := plugin.pre_instruction(messages.raw()): messages.extend([Message(**raw_msg) for raw_msg in plugin_messages]) # Start GPT instance agent_reply = create_chat_completion(prompt=messages, config=self.config) messages.add("assistant"...