text
stringlengths
79
3.72M
<vulnerable_code><commit_title>[PATCH 3/3] extracted majority of caching implementation to<commit_description><fixed_code> package com.pugh.sockso.cache; import java.io.IOException; public interface Cache<T> { /** * checks if the key exists in the cache * * @param key unique key * *...
<vulnerable_code> package com.pugh.sockso; import java.util.Date; <commit_title>[PATCH 3/3] extracted majority of caching implementation to<commit_description><fixed_code> package com.pugh.sockso.cache; import java.util.Date;
<vulnerable_code> package com.pugh.sockso; import com.google.inject.Singleton; import org.apache.log4j.Logger; @Singleton public class ObjectCache { private static final Logger log = Logger.getLogger( ObjectCache.class ); <commit_title>[PATCH 3/3] extracted majority of caching implementation to<commit_descripti...
<vulnerable_code> package com.pugh.sockso; import com.google.inject.Inject; <commit_title>[PATCH 3/3] extracted majority of caching implementation to<commit_description><fixed_code> package com.pugh.sockso.cache; import com.google.inject.Inject;
<vulnerable_code>package com.pugh.sockso.web.action; import com.pugh.sockso.Constants; import com.pugh.sockso.ObjectCache; import com.pugh.sockso.Properties; import com.pugh.sockso.templates.api.TException; import com.pugh.sockso.web.BadRequestException;<commit_title>[PATCH 3/3] extracted majority of caching implement...
<vulnerable_code> package com.pugh.sockso.web.action; import com.pugh.sockso.ObjectCache; import com.pugh.sockso.Utils; import com.pugh.sockso.db.Database; import com.pugh.sockso.web.BadRequestException;<commit_title>[PATCH 3/3] extracted majority of caching implementation to<commit_description><fixed_code> package c...
<vulnerable_code> package com.pugh.sockso.web.action; import com.pugh.sockso.ObjectCache; import com.pugh.sockso.Constants; import com.pugh.sockso.web.*; import com.pugh.sockso.Utils;<commit_title>[PATCH 3/3] extracted majority of caching implementation to<commit_description><fixed_code> package com.pugh.sockso.web.a...
<vulnerable_code> package com.pugh.sockso; import com.pugh.sockso.tests.SocksoTestCase; <commit_title>[PATCH 3/3] extracted majority of caching implementation to<commit_description><fixed_code> package com.pugh.sockso.cache; import com.pugh.sockso.tests.SocksoTestCase;
<vulnerable_code> package com.pugh.sockso.tests; import com.pugh.sockso.ObjectCache; import com.pugh.sockso.db.Database; import com.pugh.sockso.tests.MyHttpURLConnection; import com.pugh.sockso.tests.SocksoTestCase;<commit_title>[PATCH 3/3] extracted majority of caching implementation to<commit_description><fixed_code...
<vulnerable_code>package com.pugh.sockso.web.action; import com.pugh.sockso.Constants; import com.pugh.sockso.ObjectCache; import com.pugh.sockso.StringProperties; import com.pugh.sockso.inject.SocksoModule; import com.pugh.sockso.tests.SocksoTestCase;<commit_title>[PATCH 3/3] extracted majority of caching implementat...
<vulnerable_code> package com.pugh.sockso.web.action; import com.pugh.sockso.ObjectCache; import com.pugh.sockso.db.Database; import com.pugh.sockso.tests.MyHttpURLConnection; import com.pugh.sockso.tests.SocksoTestCase;<commit_title>[PATCH 3/3] extracted majority of caching implementation to<commit_description><fixed...
<vulnerable_code> import org.apache.log4j.Logger; @Singleton public class ObjectCache implements Cache { private static final Logger log = Logger.getLogger( ObjectCache.class ); } /** * Indicates if the key is cached * * @param key * * @return * */ public boole...
<vulnerable_code> # We need to use a raw socket to test this, as the client will normalize # the path before sending it to the server. reader, writer = await asyncio.open_connection(client.host, client.port) writer.write( "GET /../private_file HTTP/1.1\r\n\r\n".encode() ) response = await...
<vulnerable_code> escaped = htmlwescape ((BITCODE_TU)text->text_value); else escaped = htmlescape (text->text_value, (int)dwg->header.codepage); if (style && style->font_name && *style->font_name #ifdef HAVE_STRCASESTR && strcasestr (style->font_name, ".ttf") #else && (strstr (style->font_name, "...
<vulnerable_code> datetime(). """ if isinstance(node.func, ast.Name): expr = None if node.func.id == 'ObjectId': expr = "('" + node.args[0].s + "')" elif node.func.id == 'datetime': values = [] for arg in node.arg...
<vulnerable_code> tabpage_T *old_curtab, *last_curtab; win_T *new_curwin = NULL; tabpage_T *new_curtab = NULL; #ifdef FEAT_CMDWIN if (cmdwin_type != 0) // watch out for its size to be changed. alist = curwin->w_alist; ++alist->al_refcount; old_curwin = curwin; old_curtab = curtab; ...
<vulnerable_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 3883, /**/<commit_title>[PATCH] patch 8.2.3884: crash when clearing the argument list while<commit_description><fixed_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 3...
<vulnerable_code> } // FIXME: 8. If IsDetachedBuffer(buffer) is true, throw a TypeError exception. auto buffer_byte_length = array_buffer.byte_length(); size_t new_byte_length; if (length.is_undefined()) { if (buffer_byte_length % element_size != 0) { vm.throw_exception<RangeError...
<vulnerable_code><commit_title>[PATCH] LibJS: Add overflow checks when creating TypedArray from<commit_description><fixed_code> test("construct Uint32Array with zero-length ArrayBuffer and overflowing offset", () => { expect(() => new Uint32Array(new ArrayBuffer(0), 4, 1024 * 1024 * 1024 - 1)).toThrow( Rang...
<vulnerable_code> return -1; } gdGetBuf(conversion_buffer, image_block_size, ctx); while (buffer_caret < image_block_size) { tga->bitmap[buffer_caret] = (int) conversion_buffer[buffer_caret]; } conversion_buffer = (unsigned char *) gdMalloc(image_block_size * sizeof(unsigned char)); if (conversion_bu...
<vulnerable_code>import { emojiUnescape } from "discourse/lib/text"; import { htmlSafe } from "@ember/template"; import { registerUnbound } from "discourse-common/lib/helpers"; registerUnbound("replace-emoji", (text, options) => { return htmlSafe(emojiUnescape(text, options)); });<commit_title>[PATCH] SECURITY: XSS ...
<vulnerable_code><commit_title>[PATCH] SECURITY: XSS on chat excerpts<commit_description>Non-markdown tags weren't being escaped in chat excerpts. This could be triggered by editing a chat message containing a tag (self XSS), or by replying to a chat message with a tag (XSS). Co-authored-by: Jan Cernik <jancernik12@gm...
<vulnerable_code> String queryToFormat = isCountQuery ? MAIN_COUNT_QUERY : MAIN_QUERY; String whereClausePart = secure(toClauses(criteria), metadata); String sortDirectionPart = metadata.getSortDirection().orElse(SORT_ASCENDING).toUpperCase(); String queryString = String...
<vulnerable_code><commit_title>[PATCH] refactored to prevent sql injection introducing an enum<commit_description><fixed_code> package uk.gov.hmcts.ccd.data.casedetails.search; import java.util.Optional; public enum SortDirection { ASC, DESC; public static SortDirection fromOptionalString(Optional<String> di...
<vulnerable_code><commit_title>[PATCH] refactored to prevent sql injection introducing an enum<commit_description><fixed_code> package uk.gov.hmcts.ccd.data.casedetails.search; import java.util.Optional; import org.junit.Test; import org.junit.Assert; public class SearchDirectionTest { @Test public void te...
<vulnerable_code>/* Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license */ var CKEDITOR_LANGS=function(){var c={af:"Afrikaans",ar:"Arabic",bg:"Bulgarian",bn:"Bengali/Bangla",bs:"Bosnian",ca:"Catalan",cs:"Czech",cy:"Welsh",da:"Danish...
<vulnerable_code>/** * Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.dialog.add( 'myDialog', function( editor ) { return { title: 'My Dialog', minWidth: 400, minHeight: 200, contents: [ { id: 't...
<vulnerable_code>var swfobject=function(){function u(){if(!s){try{var a=d.getElementsByTagName("body")[0].appendChild(d.createElement("span"));a.parentNode.removeChild(a)}catch(b){return}s=!0;for(var a=x.length,c=0;c<a;c++)x[c]()}}function L(a){s?a():x[x.length]=a}function M(a){if(typeof m.addEventListener!=i)m.addEve...
<vulnerable_code>/** * Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or http://ckeditor.com/license */ // Tool scripts for the sample pages. // This file can be ignored and is not required to make use of CKEditor. (function() { // Check for sample com...
<vulnerable_code>// Copyright 2006 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law o...
<vulnerable_code> opt.errorAfterField ? '' : errorHTML, field.widget.toHTML(name, field), opt.errorAfterField ? errorHTML : '' ].join('')); wrappedContent.push(fieldset); } else { var fieldHTMLs = [field.labelHTML(name, field.id)...
<vulnerable_code> return Object.prototype.hasOwnProperty.call(selfClosingTags, tagName); }; var tag = function tag(tagName, attrsMap, content) { var safeTagName = htmlEscape(tagName); var attrsHTML = !is.array(attrsMap) ? attrs(attrsMap) : attrsMap.reduce(function (html, map) { return html + attrs(m...
<vulnerable_code> var choices = unifyChoices(f.choices, 1); var optionsHTML = renderChoices(choices, function render(choice) { if (choice.isNested) { return tag('optgroup', { label: choice.label }, renderChoices(choice.choices, render)); } else ...
<vulnerable_code> '<textarea name="name" id="someid" rows="20" cols="80" class="one two" placeholder="hi!">value</textarea>' ); t.equal(forms.widgets.textarea().type, 'textarea'); t.end(); }); <commit_title>[PATCH] [New] [Fix] ensure that all content in `tag` is properly<commit_description><fixed_cod...
<vulnerable_code> return parse_boolean(b); } int vt_reset_keyboard(int fd) { int kb; <commit_title>[PATCH 2/2] Add check to switch VTs only between K_XLATE or K_UNICODE<commit_description>Switching to K_UNICODE from other than L_XLATE can make the keyboard unusable and possibly leak keypresses from X. ...
<vulnerable_code> return verify_vc_allocation(vcs.v_active); } static int verify_vc_kbmode(int fd) { int curr_mode; /* * Make sure we only adjust consoles in K_XLATE or K_UNICODE mode. * Otherwise we would (likely) interfere with X11's processing of the * key events. ...
<vulnerable_code>} int vt_reset_keyboard(int fd) { int kb; /* If we can't read the default, then default to unicode. It's 2017 after all. */ kb = vt_default_utf8() != 0 ? K_UNICODE : K_XLATE; if (ioctl(fd, KDSKBMODE, kb) < 0) return -errno; <commit_title>[PATCH 2/2] Ad...
<vulnerable_code> assert(name); r = ioctl(fd, KDSKBMODE, utf8 ? K_UNICODE : K_XLATE); if (r < 0) return log_warning_errno(errno, "Failed to %s UTF-8 kbdmode on %s: %m", enable_disable(utf8), name);<commit_title>[PATCH 2/2] Add check to switch VTs only between K_XLATE or K_UNICOD...
<vulnerable_code>import getopt from subprocess import Popen, PIPE import Bcfg2.Server.Admin class Viz(Bcfg2.Server.Admin.MetadataCore): data = self.Visualize(self.get_repo_path(), hset, bset, kset, outputfile) print data raise SystemExit, 0 def Visualize(self...
<vulnerable_code>import os import re import tempfile import Bcfg2.Server.Plugin basefile.write(data) basefile.close() os.close(basehandle) dhandle, dname = tempfile.mkstemp() dfile = open(dname, 'w') dfile.write(delta.data) dfile.close() os.close(dhandle...
<vulnerable_code>import os from mercurial import ui, hg from subprocess import Popen, PIPE import Bcfg2.Server.Plugin # for debugging output only<commit_title>[PATCH] Backported unescaped shell command fixes from master branch<commit_description><fixed_code> import os from mercurial import ui, hg import Bcfg2.Server.P...
<vulnerable_code> import binascii import os import socket import shutil import tempfile self.ipcache[client] = (ipaddr, client) return (ipaddr, client) except socket.gaierror: cmd = "getent hosts %s" % client ipaddr = Popen(cmd, shell=True, \ ...
<vulnerable_code>import os from subprocess import Popen, PIPE import Bcfg2.Server.Plugin """Read svn revision information for the Bcfg2 repository.""" try: data = Popen(("env LC_ALL=C svn info %s" % (self.datastore)), shell=True, stdout=PIPE...
<vulnerable_code>import org.openmrs.BaseOpenmrsData; import org.openmrs.Patient; import org.openmrs.Provider; import java.util.Date; } public String sanitizeNotes(String note) { return StringEscapeUtils.escapeHtml(note); } public String getNotes() { return this.notes; } publ...
<vulnerable_code> assertEquals(TimeFrameUnits.WEEKS, appointmentRequest.getMinTimeFrameUnits()); assertEquals(new Integer(2), appointmentRequest.getMaxTimeFrameValue()); assertEquals(TimeFrameUnits.MONTHS, appointmentRequest.getMaxTimeFrameUnits()); assertNull(appointmentRequest.getNotes(...
<vulnerable_code> private static File getTmpFolder() { try { File outputFolder = Files.createTempFile("codegen-", "-tmp").toFile(); outputFolder.delete(); outputFolder.mkdir(); outputFolder.deleteOnExit(); return outputFolder; } catch (Exce...
<vulnerable_code> }); t.equal(res, 101); });<commit_title>[PATCH] Modified FunctionExpression and CallExpression to be a bit<commit_description><fixed_code> }); t.equal(res, 101); }); test('FunctionExpression unresolved', function(t) { t.plan(1); var src = '(function(){console.log("Not Good")})...
<vulnerable_code> return(SetStreamBuffering(image_info,blob_info)); } #if defined(MAGICKCORE_HAVE_POPEN) && defined(MAGICKCORE_PIPES_SUPPORT) if (*filename == '|') { char fileMode[MagickPathExtent],<commit_title>[PATCH] possible RCE vulnerability<commit_description><fixed_code> return...
<vulnerable_code> apdu.data = sbuf; apdu.lc = apdu.datalen = crgram_len+1; sbuf[0] = tcos3 ? 0x00 : ((data->pad_flags & SC_ALGORITHM_RSA_PAD_PKCS1) ? 0x81 : 0x02); memcpy(sbuf+1, crgram, crgram_len); r = sc_transmit_apdu(card, &apdu);<commit_title>[PATCH] prevent out of bounds write<commit_description>fixes https:...
<vulnerable_code> if (pData->action == ACTION_BIND) { /* bind asserts, so no need to test return val here which isn't the greatest api -- oh well */ if(-1 == zsocket_bind(pData->socket, (char*)pData->description)) { errmsg.LogError(0, RS_RET_NO_ERRCODE, "omzmq3: bind failed for...
<vulnerable_code> void rose_start_heartbeat(struct sock *sk) { del_timer(&sk->sk_timer); sk->sk_timer.function = rose_heartbeat_expiry; sk->sk_timer.expires = jiffies + 5 * HZ; add_timer(&sk->sk_timer); } void rose_start_t1timer(struct sock *sk) { struct rose_sock *rose = rose_sk(sk); del_timer(&rose->timer)...
<vulnerable_code> input->vb = NULL; spin_unlock_irqrestore(&input->slock, flags); v4l2_buf = to_vb2_v4l2_buffer(&vb->vb.vb2_buf); if (!vb) { /* Gone because of disabling */ dev_dbg(&dev->pci->dev, "vb is empty, dropping frame\n"); return; } /* * Check for space. * Mind the overhead of startcode emulatio...
<vulnerable_code>} let random = bytes => { fillPool(bytes) return pool.subarray(poolOffset - bytes, poolOffset) } let customAlphabet = (alphabet, size) => customRandom(alphabet, size, random) let nanoid = (size = 21) => { fillPool(size) let id = '' // We are reading directly from the random pool to avoid c...
<vulnerable_code> } }) }) }) }<commit_title>[PATCH] fix collision by proxy number<commit_description><fixed_code> } }) }) if (type === 'node') { describe('proxy number', () => { it('prevent collision', () => { let makeProxyNumberToReproducePreviousID = (...
<vulnerable_code> s_alRolloff = Cvar_Get( "s_alRolloff", "2", CVAR_CHEAT); s_alGraceDistance = Cvar_Get("s_alGraceDistance", "512", CVAR_CHEAT); s_alDriver = Cvar_Get( "s_alDriver", ALDRIVER_DEFAULT, CVAR_ARCHIVE | CVAR_LATCH ); s_alInputDevice = Cvar_Get( "s_alInputDevice", "", CVAR_ARCHIVE | CVAR_LATCH ); s_alD...
<vulnerable_code> import static com.google.common.collect.ImmutableList.toImmutableList; import static org.assertj.core.api.Assertions.assertThat; import java.util.List; import java.util.concurrent.CompletableFuture; } }; @RegisterExtension static final ServerExtension unlimitedServer = new Server...
<vulnerable_code>import java.io.PrintStream; import java.time.Duration; import java.util.List; import static graphql.schema.idl.RuntimeWiring.newRuntimeWiring; System.setErr(toDevNull()); for (int runNumber = 1; runNumber <=2; runNumber++) { // on the second run - have unlimited tokens ...
<vulnerable_code> String name = mapper.map(zipEntry.getName()); if (name != null) { File file = new File(outputDir, name); if (zipEntry.isDirectory()) { FileUtils.forceMkdir(file); } parentDirectory = file; } File destFile = new File(parentDir...
<vulnerable_code><commit_title>[PATCH] Fixed potential security vulnerability reported by Snyk<commit_description><fixed_code> package org.zeroturnaround.zip; /** * Copyright (C) 2012 ZeroTurnaround LLC <support@zeroturnaround.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you ...
<vulnerable_code> // Reuse the very generic async rendering framework (even if we don't do async and caching) since it's taking // care of many other things BlockAsyncRendererConfiguration configuration = createBlockAsyncRendererConfiguration(null, xdom, context); Map<String, Object> bac...
<vulnerable_code>import java.util.Arrays; import java.util.Collections; import javax.inject.Inject; import javax.inject.Named; import org.junit.jupiter.api.BeforeEach; import org.xwiki.test.TestEnvironment; import org.xwiki.test.annotation.ComponentList; import org.xwiki.test.junit5.mockito.ComponentTest; import org....
<vulnerable_code> "Multi-factor authentication is enabled for your account, but your account does not have a valid email address to send the verification code to. Check your account settings with your administrator." ) ) else: code = cherrypy.tools.auth...
<vulnerable_code> return code = cherrypy.tools.auth_mfa.generate_code() body = self.app.templates.compile_template( "email_mfa.html", **{"header_name": self.app.cfg.header_name, 'user': userobj, 'code': code} ) cherrypy.engine.publish('queue_mail', to=userobj.email...
<vulnerable_code># You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. from unittest.mock import MagicMock import cherrypy from parameterized import parameterized userobj = UserObject.get_user(self.USERNAME) userobj....
<vulnerable_code> '--emailsendchangednotification', help='True to send notification when sensitive information get change in user profile.', action='store_true', default=False, ) parser.add_argument(<commit_title>[PATCH] Send email notification when enabling or disabling MFA<comm...
<vulnerable_code>from sqlalchemy import Column, Integer, SmallInteger, String, and_, event, inspect, or_ from sqlalchemy.exc import IntegrityError from sqlalchemy.ext.hybrid import hybrid_property from sqlalchemy.orm import deferred, relationship from zxcvbn import zxcvbn import rdiffweb.tools.db # noqa PATTERN_U...
<vulnerable_code> class UserObjectTest(rdiffweb.test.WebCase): default_config = { 'email-send-changed-notification': True, } def _read_ssh_key(self): """Readthe pub key from test packages""" filename = pkg_resources.resource_filename('rdiffweb.core.tests', 'test_publickey_ssh_rsa....
<vulnerable_code> return # Leave if the mail was not changed. if 'email' not in attrs: return old_email = attrs['email'][0] if not old_email: logger.info("can't sent mail to user [%s] without an email", userobj.username) return # ...
<vulnerable_code> # Given a user with an email address user = UserObject.get_user(self.USERNAME) user.email = 'original_email@test.com' self.listener.queue_email.reset_mock() # When updating the user's email user.email = 'email_changed@test.com' # Then a email is...
<vulnerable_code> publishDiagnostics.accept(new PublishDiagnosticsParams(uri, diagnostics)); return null; } catch (CacheResourceDownloadingException e) { // An XML Schema or DTD is being downloaded by the cache manager, but it takes // too long. // In this case: // - 1) we add an information message ...
<vulnerable_code> private static final String RESOURCE_LOADING_MSG = "The resource ''{0}'' is downloading."; private final String resourceURI; private final CompletableFuture<Path> future; public CacheResourceDownloadingException(String resourceURI, CompletableFuture<Path> future) { super(MessageFormat.format...
<vulnerable_code>import java.util.logging.Level; import java.util.logging.Logger; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; import org.eclipse.lsp4xml.utils.FilesUtils; import org.eclipse.lsp4xml.utils.URIUtils; /** * Cache resources manager. * if (Files.exists(resourceC...
<vulnerable_code>import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.regex.Matcher; import java.util.regex.Pattern; */ public class FilesUtils { public static final String FILE_SCHEME = "file://"; public static final String LSP4XML_WORKDIR_KEY = "lsp4xml.workdir"; p...
<vulnerable_code>import static org.junit.Assert.assertNull; import static org.junit.Assert.fail; import java.util.concurrent.TimeUnit; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; import org.eclipse.lsp4xml.AbstractCacheBasedTest; import org.junit.After; import org.junit.Before;...
<vulnerable_code> autoinstall_config = "#cloud-config\n" + yaml.dump( {"autoinstall": self.app.make_autoinstall()} ) write_file(autoinstall_path, autoinstall_config) try: if self.supports_apt(): packages = await self.get_target_packages(context=cont...
<vulnerable_code> return event # This function is copyrighted under the Apache 2.0 license Zil0 def _handle_forwarded_room_key_event( self, sender, # type: str sender_key, # type: str payload, # type: Dict[Any, Any] ): # type: (...) -> Union[ForwardedRoomK...
<vulnerable_code> const isChatLocked = (receiverID) => { const isPublic = receiverID === PUBLIC_CHAT_ID; const meeting = Meetings.findOne({ meetingId: Auth.meetingID }, { fields: { 'lockSettingsProps.disablePublicChat': 1 } }); const user = Users.findOne({ meetingId: Auth.meetingID, userId: Auth.userID }, ...
<vulnerable_code> auto index = exportIndexes[curr]; switch (curr->kind) { case ExternalKind::Function: { curr->value = getFunctionIndexName(index); break; }<commit_title>[PATCH] More misc ASAN fixes (#1882)<commit_description>* fix buffer overflow in simple_ast.h printing. * check was...
<vulnerable_code> } if (importModule.is()) { // this is an import, actually if (!preParseImport) throw ParseException("!preParseImport in func"); auto im = make_unique<Function>(); im->name = name; auto module = s[i++]->str(); if (!s[i]->isStr()) throw ParseException("no name for import"); auto...
<vulnerable_code> goto done; } len = sizeof(state->cli_feat) - offset; value = len ? &state->cli_feat[offset] : NULL; <commit_title>[PATCH] gatt: Fix potential buffer out-of-bound<commit_description>When client features is read check if the offset is within the cli_feat bounds. Fixes: https://github.com/bluez/blu...
<vulnerable_code> // [databind#2478]: comons-dbcp, p6spy s.add("org.apache.commons.dbcp.datasources.SharedPoolDataSource"); s.add("com.p6spy.engine.spy.P6DataSource"); DEFAULT_NO_DESER_CLASS_NAMES = Collections.unmodifiableSet(s); }<commit_title>[PATCH] Block one more gadget type (ap...
<vulnerable_code> /* Both sector and sector_count are in terms of qemu 512 byte blocks. */ uint64_t sector; uint32_t sector_count; struct iovec iov; QEMUIOVector qiov; uint32_t status; }; static int scsi_handle_rw_error(SCSIDiskReq *r, int error, int type); static int scsi_disk_emulate_command(...
<vulnerable_code> GC_REFCOUNT(ht) = 1; GC_TYPE_INFO(ht) = IS_ARRAY; ht->u.flags = (persistent ? HASH_FLAG_PERSISTENT : 0) | HASH_FLAG_APPLY_PROTECTION | HASH_FLAG_STATIC_KEYS; ht->nTableSize = zend_hash_check_size(nSize); ht->nTableMask = HT_MIN_MASK; HT_SET_DATA_ADDR(ht, &uninitialized_bucket); ht->nNumUsed = 0;...
<vulnerable_code>'use strict'; /* eslint-disable no-continue */ const isObject = (val) => typeof val === 'object' || typeof val === 'function'; const isProto = (val, obj) => val === '__proto__' || (val === 'constructor' && typeof obj.constructor === 'function'); const set = (obj, parts, length, val) => { let tmp = ...
<vulnerable_code> set(o, ['constructor', 'b'], 1); should(o.constructor.b).be.eql(undefined); }); it('should not indirectly set Object properties', () => { set(o, ['__proto__', 'b'], 1); should(o.b).be.eql(undefined); }); it('should not indirectly set Object properties', () => { set(o, [...
<vulnerable_code> key = (line[0] + key_tail).strip() value = value.strip().encode('ascii') if args.huff: from hpack.huffman_constants import REQUEST_CODES, REQUEST_CODES_LENGTH from hpack.huffman import HuffmanEncoder value = HuffmanEncoder(REQUEST_CODES, REQUEST_CODES_LENGTH).encode(...
<vulnerable_code> login(request, user) next_url = request.POST.get('next', '') if (next_url and url_has_allowed_host_and_scheme(next_url, settings.ALLOWED_HOSTS)): print("Good People") return HttpResponseRedirect(next_url) ...
<vulnerable_code> while (NULL != readdir(d)) count++; names = malloc(sizeof (struct dirent *) * count); closedir(d); d = opendir(dir); if (NULL == d) return -1; while (NULL != (current = readdir(d))) { if (NULL == select || select(current)) { struct dirent ...
<vulnerable_code> if (*s2 == '\0') /* everything matches empty string */ return s1; for (p = s1; (p = strchr(p, *s2)) != NULL; p = strchr(p + 1, *s2)) { if (strncmp(p, s2, len) == 0) return (p); }<commit_title>[PATCH] misc oom and possible memory leak fix<commit_descri...
<vulnerable_code> timeptr = gmtime(&timep); #endif now = strdup(asctime(timeptr)); now[strlen(now) - 1] = '\0'; #ifdef USE_LOCALTIME printf("</table>\n<hr noshade>\nIndex generated %s %s\n" "<!-- This program is part of the Boa Webserver Copyright (C) 1991-2002 http://www.boa.org -->\n" ...
<vulnerable_code> } escaped = malloc (4 * strlen(inp) + 1); if (!escaped) { perror("malloc"); return NULL; } for (d = escaped, s = (const unsigned char *)inp; *s; s++) { if (needs_escape (*s)) {<commit_title>[PATCH] misc oom and possible memory leak fix<commit_description><fixed_code> ...
<vulnerable_code> exit(EXIT_FAILURE); } } return 0; } #endif<commit_title>[PATCH] misc oom and possible memory leak fix<commit_description><fixed_code> exit(EXIT_FAILURE); } } close(fd); return 0; } #endif
<vulnerable_code><commit_title>[PATCH] Add api-utils helper for testing (#34078)<commit_description><fixed_code> export default async function handler(req, res) { // WARNING: don't use user input in production // make sure to use trusted value for revalidating const revalidateRes = await res.unstable_revalidate(r...
<vulnerable_code> return ( <> <p>Post: {post}</p> <span>time: {time}</span> <div id="params">{JSON.stringify(params)}</div> <div id="query">{JSON.stringify(useRouter().query)}</div> <Link href="/"><commit_title>[PATCH] Add api-utils helper for testing (#34078)<commit_description><fixe...
<vulnerable_code> return { props: { slug, }, revalidate: 1, } } } export default function Page({ slug }) { // Important to not check for `slug` existence (testing that build does not // render fallback version and error) return ( <> <p id="catchall">Hi {slug.join(' ')}</p>{' '} ...
<vulnerable_code> @RequestParam(required = false, defaultValue = "FILENAME") SortBy sortBy, @RequestParam(required = false, defaultValue = "false") boolean desc, @RequestParam(required = false) String base) throws IOException, TemplateException { ...
<vulnerable_code> public void shouldNotAllowToListFileOutsideRoot() throws Exception { // given expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage(containsString("this String argument must not contain the substring [..]")); // when logVi...
<vulnerable_code> # TensorListScatter should return a list with size num_elements. self.assertAllEqual(list_ops.tensor_list_length(l), 5) def testScatterFailsWhenIndexLargerThanNumElements(self): c0 = constant_op.constant([1.0, 2.0]) with self.assertRaisesRegex(<commit_title>[PATCH] Check for element_...
<vulnerable_code> static { Set<String> s = new HashSet<String>(); // Courtesy of [https://github.com/kantega/notsoserial]: // (and wrt [databind#1599] s.add("org.apache.commons.collections.functors.InvokerTransformer"); s.add("org.apache.commons.collections.functors.Instantiat...
<vulnerable_code>package com.fasterxml.jackson.databind.interop; import com.fasterxml.jackson.databind.*; /** public int id; public Object obj; } public void testIssue1599() throws Exception { final String JSON = aposToQuotes( "{'id': 124,\n" +" 'obj':[ 'com.sun.org.apache.xa...