text
stringlengths
79
3.72M
<vulnerable_code> long expires = Long.parseLong(parts[1]); String signature = parts[2]; String signatureToMatch = computeSignature(userDetails, expires); return expires >= System.currentTimeMillis() && signature.equals(signatureToMatch); } }<commit_title>[PATCH] fixed timing attack vu...
<vulnerable_code> st->codecpar->codec_id = ff_codec_get_id(ff_codec_bmp_tags, tag); size_bmp = FFMAX(size_asf, size_bmp); if (size_bmp > BMP_HEADER_SIZE) { int ret; st->codecpar->extradata_size = size_bmp - BMP_HEADER_SIZE; if (!(st->codecpar->extradata = av_malloc(st->codecpar->ex...
<vulnerable_code> public ASN1Enumerated( byte[] bytes) { this.bytes = Arrays.clone(bytes); } <commit_title>[PATCH] Added header validation for INTEGER/ENUMERATED Added<commit_description><fixed_code> public ASN1Enumerated( byte[] bytes) { if (bytes.length > 1) ...
<vulnerable_code> ASN1Integer(byte[] bytes, boolean clone) { this.bytes = (clone) ? Arrays.clone(bytes) : bytes; } <commit_title>[PATCH] Added header validation for INTEGER/ENUMERATED Added<commit_description><fixed_code> ASN1Integer(byte[] bytes, boolean clone) { if (bytes.length >...
<vulnerable_code>import java.io.IOException; import org.bouncycastle.asn1.ASN1Encodable; import org.bouncycastle.asn1.ASN1InputStream; import org.bouncycastle.asn1.ASN1OutputStream; import org.bouncycastle.asn1.ASN1Primitive; import org.bouncycastle.asn1.BERSequence; } } public void performTest() ...
<vulnerable_code>import org.bouncycastle.crypto.digests.SHA512Digest; import org.bouncycastle.crypto.params.ParametersWithRandom; import org.bouncycastle.crypto.signers.HMacDSAKCalculator; public class DSASigner extends SignatureSpi { throw new IOException("malformed signature"); } ...
<vulnerable_code>import org.bouncycastle.crypto.digests.SHA384Digest; import org.bouncycastle.crypto.digests.SHA3Digest; import org.bouncycastle.crypto.digests.SHA512Digest; import org.bouncycastle.crypto.params.ECPublicKeyParameters; import org.bouncycastle.crypto.params.ParametersWithRandom; import org.bouncycastle.c...
<vulnerable_code> + "9ef41dd424a4e1c8f16967cf3365813fe8786236", "303d021c1e41b479ad576905b960fe14eadb91b0ccf34843dab916173bb8c9cd021d00ade65988d237d30f9ef4" + "1dd424a4e1c8f16967cf3365813fe87862360000", "3040021c57b10411b54ab248af03d8f2456676ebc6d3db5f1081492ac87e9ca8021d00942b117051d7d9d...
<vulnerable_code>import org.bouncycastle.asn1.pkcs.PrivateKeyInfo; import org.bouncycastle.asn1.sec.SECObjectIdentifiers; import org.bouncycastle.asn1.teletrust.TeleTrusTObjectIdentifiers; import org.bouncycastle.asn1.x509.SubjectPublicKeyInfo; import org.bouncycastle.asn1.x9.X962Parameters; import org.bouncycastle.asn...
<vulnerable_code> } } /* If this edge of the facet is connected: */ if(stl->neighbors_start[facet_num].neighbor[j] != -1) { /* If we haven't fixed this facet yet, add it to the list: */ if(norm_sw[stl->neighbors_start[facet_num].neighbor[j]] != 1) { /* Add node to begi...
<vulnerable_code> /* POST create user */ router.post('/new', function(req, res, next) { console.log(req.body); var username = req.body.username; var password = req.body.password; return; } var conn = mysql.createConnection({ host : "ec2-52-1-159-248.compute-1.amazonaws.com", user : "root",...
<vulnerable_code> } processed++; } else if (afi == AF_INET6) { if (!ND_TTEST2(*tptr, 1)) /* fetch status & prefix_len byte */ return (0); status_byte=*(tptr++); bit_length=*(tptr++);<commit_title>[PATCH] CVE-2017-12998/IS-IS: Check for 2 bytes if we're going to<com...
<vulnerable_code> }) } function determine_nic_type(str) { return str.match(/Ethernet/) */ exports.mac_address_for = function(nic_name, cb) { var cmd = "networksetup -getmacaddress " + nic_name + " | awk '{print $3}'"; trim_exec(cmd, cb); }; exports.gateway_ip_for = function(nic_name, cb) { var cmd = "ipcon...
<vulnerable_code> return new ParameterizedSQL(columnName + regexOperator, [operatorValue.source]); case 'contains': return new ParameterizedSQL(columnName + ' @> array[' + operatorValue.map((v) => `'${v}'`) + ']::' + propertyDefinition.postgresql.dataType); case 'match': return ...
<vulnerable_code> let contracts = [ [artifacts.require('ENSRegistry.sol'), 'Solidity'], [artifacts.require('ENS.lll'), 'LLL'] ]; contracts.forEach(function ([ENS, lang]) {<commit_title>[PATCH 01/28] started expermimenting<commit_description><fixed_code> let contracts = [ [artifacts.require('ENSRegistry.so...
<vulnerable_code><commit_title>[PATCH 01/28] started expermimenting<commit_description><fixed_code> const namehash = require('eth-ens-namehash'); const sha3 = require('web3-utils').sha3; const { exceptions } = require("@ensdomains/test-utils") const ENS = artifacts.require('ENSRegistryWithFallback.sol'); const ENSWi...
<vulnerable_code> }); it('should allow setting the record', async () => { let result = await ens.setRecord('0x0', accounts[0], accounts[1], 3600, {from: accounts[0]}); assert.equal(result.logs.length, 3); assert.equal((await ens.ttl('0x0')).toNumber(), 3600); assert.equal((await...
<vulnerable_code> assert.equal((await ens.resolver('0x0')), accounts[2]); }); it('should use fallback ttl if owner not set', async () => { await ens.setOwner('0x0', '0x0000000000000000000000000000000000000000'); await old.setTTL('0x0', 3600, {from: accounts[0]}); assert.equal((a...
<vulnerable_code> it('should allow the creation of subnodes', async () => { let result = await ens.setSubnodeOwner('0x0', sha3('eth'), accounts[1], {from: accounts[0]}); assert.equal(await ens.owner(namehash('eth')), accounts[1]); assert.equal(result.logs.length, 1); ...
<vulnerable_code> let result = await ens.setRecord('0x0', accounts[1], accounts[2], 3600, {from: accounts[0]}); assert.equal(result.logs.length, 3); assert.equal((await ens.ttl('0x0')).toNumber(), 3600); assert.equal((await ens.owner('0x0')), accounts[1]); assert.equal((await ens...
<vulnerable_code> it('should allow registration of names', async () => { await registrar.register(sha3('eth'), accounts[0], {from: accounts[0]}); assert.equal(await ens.owner('0x0'), registrar.address); assert.equal(await ens.owner(namehash('eth')), accounts[0]); }); describe('transf...
<vulnerable_code> let registrar, resolver, ens; beforeEach(async () => { node = namehash(accounts[0].slice(2).toLowerCase() + ".addr.reverse"); ens = await ENS.new(); resolver = await DummyResolver.new(); registrar = await ReverseRegistrar.new(ens.address, resolver.address); ...
<vulnerable_code> let registrar, ens; beforeEach(async () => { node = namehash('eth'); ens = await ENS.new(); registrar = await TestRegistrar.new(ens.address, '0x0');<commit_title>[PATCH 01/28] started expermimenting<commit_description><fixed_code> let registrar, ens; beforeEac...
<vulnerable_code> assert.equal(await ens.owner(hash), accounts[1]); assert.equal(await ens.resolver(hash), accounts[2]); assert.equal((await ens.ttl(hash)).toNumber(), 3600); }) describe('fallback', async () => { <commit_title>[PATCH 01/28] started expermimenting<commit_description><fixe...
<vulnerable_code>const { exceptions } = require("@ensdomains/test-utils") let contracts = [ [artifacts.require('ENSRegistry.sol'), 'Solidity'], [artifacts.require('ENS.lll'), 'LLL'], ]; contracts.forEach(function ([ENS, lang]) {<commit_title>[PATCH 01/28] started expermimenting<commit_description><fixed_code>...
<vulnerable_code> number_planes, number_planes_filled, one, offset, pixel_info_length; ssize_t count, y; unsigned char offset=((image->rows-y-1)*image->columns*number_planes)+x* number_planes+plane; operand++; if (offset+((size_t) operand*number...
<vulnerable_code> status, headers, body = e.to_response() self.status = status self.response_headers.extend(headers) if self.version == "1.1": connection = self.request.headers.get("CONNECTION", "").lower() if connection == "close": self.response_he...
<vulnerable_code> cl = int(headers["content-length"]) self.assertEqual(cl, len(response_body)) self.assertEqual( sorted(headers.keys()), ["content-length", "content-type", "date", "server"] ) self.assertEqual(headers["content-type"], "text/plain") # connection ...
<vulnerable_code> inst.version = "1.1" inst.execute() lines = filter_lines(inst.channel.written) self.assertEqual(len(lines), 8) self.assertEqual(lines[0], b"HTTP/1.1 432 Too Ugly") self.assertEqual(lines[1], b"Content-Length: 43") self.assertEqual(lines[2], b"Cont...
<vulnerable_code> class Error(object): def __init__(self, body): self.body = body tag = "\r\n\r\n(generated by waitress)" body = body + tag headers = [("Content-Type", "text/plain")] return status, headers, body def wsgi_response(self, environ, start_response):<commit_...
<vulnerable_code>import re from io import BytesIO from waitress.compat import ( tostr, urlparse, unquote_bytes_to_wsgi, ) from waitress.buffers import OverflowableBuffer from waitress.receiver import ( FixedStreamReceiver, ChunkedReceiver, ) from waitress.utilities import ( find_double_newli...
<vulnerable_code>"""Data Chunk Receiver """ from waitress.utilities import find_double_newline from waitress.utilities import BadRequest class FixedStreamReceiver(object): def received(self, data): "See IStreamConsumer" rm = self.remain if rm < 1: self.completed = True # Avo...
<vulnerable_code> def test_received(self): inst, sock, map = self._makeOneWithMap() inst.server = DummyServer() inst.received(b"GET / HTTP/1.1\n\n") self.assertEqual(inst.server.tasks, [inst]) self.assertTrue(inst.requests) inst.request = preq preq.completed =...
<vulnerable_code> return line, headers, echo.parse_response(body) def test_date_and_server(self): to_send = "GET / HTTP/1.0\n" "Content-Length: 0\n\n" to_send = tobytes(to_send) self.connect() self.sock.send(to_send) def test_bad_host_header(self): # https://cort...
<vulnerable_code>""" import unittest from waitress.compat import ( text_, tobytes, ) class TestHTTPRequestParser(unittest.TestCase): result = self.parser.get_body_stream() self.assertEqual(result, body_rcv) def test_received_nonsense_with_double_cr(self): data = b"""\ HTTP/1.0 GE...
<vulnerable_code> def test_received_control_line_finished_garbage_in_input(self): buf = DummyBuffer() inst = self._makeOne(buf) result = inst.received(b"garbage\n") self.assertEqual(result, 8) self.assertTrue(inst.error) def test_received_control_line_finished_all_chunks_...
<vulnerable_code> self.assertEqual(self._callFUT(b"\n"), -1) def test_double_linefeed(self): self.assertEqual(self._callFUT(b"\n\n"), 2) def test_one_crlf(self): self.assertEqual(self._callFUT(b"\r\n"), -1) self.assertEqual(self._callFUT(b"\r\n\r\n"), 4) def test_mixed(self...
<vulnerable_code> def find_double_newline(s): """Returns the position just after a double newline in the given string.""" pos1 = s.find(b"\n\r\n") # One kind of double newline if pos1 >= 0: pos1 += 3 pos2 = s.find(b"\n\n") # Another kind of double newline if pos2 >= 0: pos2 += 2 ...
<vulnerable_code> """ if self.completed: return 0 # Can't consume any more. datalen = len(data) br = self.body_rcv if br is None: # In header. s = self.header_plus + data index = find_double_newline(s) if index >= 0: ...
<vulnerable_code> index = line.find(b":") if index > 0: key = line[:index] if b"_" in key: continue value = line[index + 1 :].strip()<commit_title>[PATCH 01/10] Upon processing errors, set Connection: close header<commit_descript...
<vulnerable_code> else: # pragma: nocover self.assertTrue(False) class Test_split_uri(unittest.TestCase): def _callFUT(self, uri): from waitress.parser import split_uri<commit_title>[PATCH 01/10] Upon processing errors, set Connection: close header<commit_description>When we start sendi...
<vulnerable_code> try: cl = int(headers.get("CONTENT_LENGTH", 0)) except ValueError: cl = 0 self.content_length = cl if cl > 0: buf = OverflowableBuffer(self.adj.inbuf_overflow)<commit_title>[PATCH 01/10] Upon processing erro...
<vulnerable_code> self.assertTrue(False) def test_parse_header_bad_content_length(self): data = b"GET /foobar HTTP/8.4\r\ncontent-length: abc\r\n" self.parser.parse_header(data) self.assertEqual(self.parser.body_rcv, None) def test_parse_header_11_te_chunked(self): #...
<vulnerable_code> BadRequest, RequestEntityTooLarge, RequestHeaderFieldsTooLarge, find_double_newline, ) pass class HTTPRequestParser(object): """A structure that collects the HTTP request. except ParsingError as e: self.error = BadRequest(e.args[0]...
<vulnerable_code> self.assertTrue(self.parser.completed) self.assertEqual(self.parser.error.__class__, BadRequest) def test_received_nonsense_nothing(self): data = b"\r\n\r\n" result = self.parser.received(data) self.parser.parse_header(data) self.assertEqual(self.par...
<vulnerable_code>class InternalServerError(Error): code = 500 reason = "Internal Server Error"<commit_title>[PATCH 01/10] Upon processing errors, set Connection: close header<commit_description>When we start sending out an exception that has happened we want to drop any further pipelined requests that may be wa...
<vulnerable_code> chunk_remainder = 0 validate_chunk_end = False control_line = b"" all_chunks_received = False trailer = b"" completed = False if self.chunk_remainder == 0: self.validate_chunk_end = True elif self.validate_chunk_end: ...
<vulnerable_code> self.assertEqual(b"".join(buf.data), b"Wikipedia in\r\n\r\nchunks.") self.assertEqual(inst.error, None) class DummyBuffer(object): def __init__(self, data=None):<commit_title>[PATCH 01/10] Upon processing errors, set Connection: close header<commit_description>When we start sendin...
<vulnerable_code>const commentReactionSchema = new SimpleSchema({ reactionCodepoint: { type: String, optional: false }, userIds: { type: [String], defaultValue: [] } }); <commit_title>[PATCH] Security fix to ReactionBleed in WeKan. It is XSS in feature<commit_description><fixed_code> const commentReactionSchema = n...
<vulnerable_code>jQuery(document).ready(function ( ) { "use strict"; //Append the inline content to the body jQuery(woo_popup['popup_content']).appendTo('body'); //Open that content on load with prettyPhoto jQuery.prettyPhoto.open('#woopopup'); });<commit_title>[PATCH] New version 1.3 fixing prettyPhoto XSS issu...
<vulnerable_code> (serial->num_interrupt_in == 0)) return 0; /* * It appears that Treos and Kyoceras want to use the * 1st bulk in endpoint to communicate with the 2nd bulk out endpoint,<commit_title>[PATCH] USB: visor: fix null-deref at probe<commit_description>Fix null-pointer dereference at probe should a (ma...
<vulnerable_code> length = le32_to_cpu(req->Length); id = req->VolatileFileId; if (le16_to_cpu(req->DataOffset) == offsetof(struct smb2_write_req, Buffer)) { data_buf = (char *)&req->Buffer[0]; } else { if ((u64)le16_to_cpu(req->DataOffset) + length > get_rfc1002_len(work->request_buf)) { pr_err("...
<vulnerable_code>""" import argparse import os import re import sys return input_dict def preprocess_input_exprs_arg_string(input_exprs_str): """Parses input arg into dictionary that maps input key to python expression. Parses input string in the format of 'input_key=<python expression>' into a Args: i...
<vulnerable_code> input_expr_str = 'input3=np.zeros([2,2]);input4=[4,5]' input_dict = saved_model_cli.preprocess_inputs_arg_string(input_str) input_expr_dict = saved_model_cli.preprocess_input_exprs_arg_string( input_expr_str) self.assertTrue(input_dict['input1'] == ('/path/file.txt', 'ab3')) ...
<vulnerable_code> testEnv=AcquireMagickCLEnv(); testEnv->library=openCL_library; testEnv->devices=(MagickCLDevice *) AcquireMagickMemory( sizeof(MagickCLDevice)); testEnv->number_devices=1; testEnv->benchmark_thread_id=GetMagickThreadId();<commit_title>[PATCH] https://github.com/ImageMagick/ImageMagick/is...
<vulnerable_code> /* Called from RCU critical section */ MemoryRegionSection * address_space_translate_for_iotlb(CPUState *cpu, int asidx, hwaddr addr, hwaddr *xlat, hwaddr *plen, MemTxAttrs attrs, int *prot) { IOMMUMemoryRegionClass *imrc; IOM...
<vulnerable_code> :license: BSD. """ from os import path, listdir import sys import marshal import tempfile import fnmatch two arguments: The directory where the cache items are stored and a pattern string that is used to build the filename. If no directory is specified the system temporary items folder...
<vulnerable_code># # We would appreciate acknowledgement if the software is used. __version__ = "0.5.1" from . import local_uuid<commit_title>[PATCH 01/13] Backport<commit_description>References: https://github.com/Cyber-Domain-Ontology/CDO-Utility-Local-UUID/pull/3 Signed-off-by: Alex Nelson <alexander.nelson@nist.g...
<vulnerable_code> await writer.wait_closed() await client.close() async def test_follow_symlink_directory_transversal_after_normalization( tmp_path: pathlib.Path, aiohttp_client: AiohttpClient ) -> None:<commit_title>[PATCH] add another test<commit_description><fixed_code> await writer.wait_closed() ...
<vulnerable_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 741, /**/<commit_title>[PATCH] patch 9.0.0742: reading past end of the line when compiling a<commit_description><fixed_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ ...
<vulnerable_code> { if (STRNCMP(arg, "END", 3) == 0) { if (lhs->lhs_append) { // First load the current variable value. if (compile_load_lhs_with_index(lhs, lhs->lhs_whole, cctx) == FAIL) return NULL; } // Gets the redirected text and put it on the stack, then store it ...
<vulnerable_code> semsg(_(e_cannot_declare_a_scope_variable), scope, name); } /* * For one assignment figure out the type of destination. Return it in "dest". * When not recognized "dest" is not set. } else if (*name == '@') { if (name[1] != '@' && (!valid_yank_reg(name[1], FALSE) || name[1] == '...
<vulnerable_code>package org.dspace.app.webui.servlet; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // Get the ...
<vulnerable_code> } function formatDataSelection (datalist) { return datalist.text; } // This handles the radio button selectors for the checkout-to-foo options<commit_title>[PATCH] Janky fix for Select2 bug<commit_description><fixed_code> } function formatDataSelection (datalist) { ...
<vulnerable_code>exports['alphanumeric'] = /^[a-zA-Z0-9]+$/ exports['style'] = /\s*(.+?):\s*([^;]+);?/g exports['phone'] = /^\+(?:[0-9] ?){6,14}[0-9]$/ exports['utc-millisec'] = /^[0-9]+(\.?[0-9]+)?$/<commit_title>[PATCH] fix utc-millisec regex to avoid a ddos attack<commit_description><fixed_code> exports['alphanumeri...
<vulnerable_code> package org.apache.submarine.server.rest.provider; import org.yaml.snakeyaml.Yaml; import javax.ws.rs.Consumes; import javax.ws.rs.Produces; import java.io.OutputStreamWriter; import java.lang.annotation.Annotation; import java.lang.reflect.Type; import java.util.Scanner; @Provider MediaType ...
<vulnerable_code> url.push(""); } return '<a href="' + path_to_root + url[0] + '?' + URL_MARK_PARAM + '=' + searchterms + '#' + url[1] + '" aria-details="teaser_' + teaser_count + '">' + result.doc.breadcrumbs + '</a>' + '<span class="teaser" id="teaser_' + teaser_cou...
<vulnerable_code> size_t body = 0; // start of body if (bSearching) { // search for the body for (size_t b = 0; bSearching && b < lengthof(blankLines); b++) { if (strstr(buffer, blankLines[b])) { bSearching = false; ...
<vulnerable_code> /******************************************************************************/ enum SCP_SERVER_STATES_E scp_v0s_allow_connection(struct SCP_CONNECTION *c, SCP_DISPLAY d, tui8 *guid) { int msg_size; <commit_title>[PATCH] sesman, xrdp: const, spacing changes<commit_description><fixed_code> /*****...
<vulnerable_code> tbus data; struct session_item *s_item; int errorcode = 0; data = auth_userpass(s->username, s->password, &errorcode); if (1 == access_login_allowed(s->username)) { tui8 guid[16]; g_random((char*)guid, 16); scp_...
<vulnerable_code> char ip[256]; char port[256]; tui8 guid[16]; tui8* pguid; rv = 0; in_uint16_be(s, ok);<commit_title>[PATCH] sesman, xrdp: const, spacing changes<commit_description><fixed_code> char ip[256]; char port[256]; tui8 guid[16]; tui8 *pguid; rv = 0; in_uint16_...
<vulnerable_code> (void) sql_error(sql, 02, SQLSTATE(42000) "CONSTRAINT FOREIGN KEY: cannot create foreign key between temporary and non temporary tables"); return SQL_ERR; } if (isUnloggedTable(t) != isUnloggedTable(ft)) { /* disable foreign key between logged and unlogged */ (void) sql_error(sql, 02, SQLS...
<vulnerable_code> string current_time(buffer); string stderrFilename = pathPrefix + "_stderr_" + current_time; FILE *stderr_stream = freopen(stderrFilename.c_str(), "w", stderr); if (!stderr_stream) { STFATAL << "Invalid filename " << stderrFilename; }<commit_title>[PATCH] red fixes (#468)<commit_descripti...
<vulnerable_code> FATAL_FAIL(sockFd); initSocket(sockFd); remote.sun_family = AF_UNIX; strcpy(remote.sun_path, pipePath.c_str()); VLOG(3) << "Connecting to " << endpoint << " with fd " << sockFd; int result = FATAL_FAIL(fd); initServerSocket(fd); local.sun_family = AF_UNIX; /* local is declared before...
<vulnerable_code> sourceDestination[1].find_first_not_of("0123456789-") != string::npos) { PortForwardSourceRequest pfsr; pfsr.mutable_source()->set_name(sourceDestination[0]); pfsr.mutable_destination()->set_name(sourceDestination[1]); pfsrs.push_back(pfsr); ...
<vulnerable_code>} IdKeyPair UserTerminalRouter::acceptNewConnection() { LOG(INFO) << "Listening to id/key FIFO"; int terminalFd = socketHandler->accept(serverFd); if (terminalFd < 0) { } TerminalUserInfo UserTerminalRouter::getInfoForId(const string &id) { auto it = idInfoMap.find(id); if (it == idInfoMap....
<vulnerable_code> SocketEndpoint source; if (pfsr.has_source()) { source = pfsr.source(); } else { // Make a random file to forward the pipe string sourcePattern =<commit_title>[PATCH] red fixes (#468)<commit_description>* red fixes * remove magic number<fixed_code> SocketEndpoint sour...
<vulnerable_code> self._test_extra_groups_impl(gid=os.getegid(), group_list=[]) def _test_extra_groups_impl(self, *, gid, group_list): gid = os.getegid() group_list = [65534 if gid != 65534 else 65533] name_group = _get_test_grp_name() if grp is not None:<commit_title>[PATCH...
<vulnerable_code> /* We want sigchild in the child */ unblock_sigchild (); if (label_exec (opt_exec_label) == -1) die_with_error ("label_exec %s", argv[0]); <commit_title>[PATCH] Call setsid() before executing sandboxed code (CVE-2017-5226)<commit_description>This prevents the sandboxed code from getting a co...
<vulnerable_code> '{}', 'It should not copy __proto__' ); t.end(); });<commit_title>[PATCH] f<commit_description><fixed_code> '{}', 'It should not copy __proto__' ); t.deepEqual( ''.polluted, undefined, 'It should not affect object prototype' ); t.end(); });
<vulnerable_code>MG_INTERNAL int parse_mqtt(struct mbuf *io, struct mg_mqtt_message *mm) { uint8_t header; size_t len = 0, len_len = 0; const char *p, *end; unsigned char lc = 0; int cmd; /* decode mqtt variable length */ len = len_len = 0; p = io->buf + 1; while ((size_t)(p - io->buf) < io->len) { ...
<vulnerable_code> // Check the maximum score, if we go over it we won't try this change. #define TRY_DEEPER(su, stack, depth, add) \ (stack[depth].ts_score + (add) < su->su_maxscore) /* * Try finding suggestions by adding/removing/swapping letters. char_u changename[MAXWLEN][80]; #endif int breakcheckcount...
<vulnerable_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 4246, /**/<commit_title>[PATCH] patch 8.2.4247: stack corruption when looking for spell<commit_description><fixed_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 4247,...
<vulnerable_code>''' Copyright (C) 2012-2015 Karsten-Kai König <grayfox@outerhaven.de> This file is part of keepassc. keepassc is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or ...
<vulnerable_code> * @param[in] data2 If \p type is #LY_TYPE_BITS: (int *) type bit field length, * #LY_TYPE_DEC64: (uint8_t *) number of fraction digits (position of the floating point), * otherwise ignored. * @return 1 if a conversion took place, 0 if th...
<vulnerable_code>function delete_organization(id, organization_name) { const delAPI = "../delete/organization/"+id; swal.queue([{ title: 'Are you sure you want to delete '+ organization_name +'?', text: "You won't be able to revert this!", type: 'warning', showCancelButton: true,...
<vulnerable_code>import org.jruby.RubyClass; import org.jruby.anno.JRubyClass; import org.jruby.runtime.ThreadContext; import org.w3c.dom.Document; import org.xml.sax.ErrorHandler; import org.xml.sax.SAXException; this.verifier = verifier; } static XmlSchema createSchemaInstance(ThreadContext conte...
<vulnerable_code> this.validator = validator; } static XmlSchema createSchemaInstance(ThreadContext context, RubyClass klazz, Source source) { Ruby runtime = context.getRuntime(); XmlSchema xmlSchema = (XmlSchema) NokogiriService.XML_SCHEMA_ALLOCATOR.allocate(runtime, klazz); xml...
<vulnerable_code> * * Create a new RelaxNG from the contents of +string+ */ static VALUE read_memory(VALUE klass, VALUE content) { xmlRelaxNGParserCtxtPtr ctx = xmlRelaxNGNewMemParserCtxt( (const char *)StringValuePtr(content), (int)RSTRING_LEN(content) ); xmlRelaxNGPtr schema; VALUE errors = rb_a...
<vulnerable_code> * * Create a new Schema from the contents of +string+ */ static VALUE read_memory(VALUE klass, VALUE content) { xmlSchemaPtr schema; xmlSchemaParserCtxtPtr ctx = xmlSchemaNewMemParserCtxt( (const char *)StringValuePtr(content), (int)RSTRING_LEN(content) ); VALUE rb_schema; VALU...
<vulnerable_code><commit_title>[PATCH] ARTEMIS-3593 Defense against OME on parsing XID<commit_description>Co-authored-by: Viktor Kolomeyko <Viktor.Kolomeyko@r3.com><fixed_code> /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed wit...
<vulnerable_code>package org.apache.activemq.artemis.utils; import org.apache.activemq.artemis.api.core.ActiveMQBuffer; import org.apache.activemq.artemis.api.core.SimpleString; import org.apache.activemq.artemis.logs.ActiveMQUtilBundle; // perhaps we could optimize it and remove it, but that would break compat...
<vulnerable_code>import org.apache.activemq.artemis.api.core.ActiveMQBuffer; import org.apache.activemq.artemis.core.transaction.impl.XidImpl; public class XidCodecSupport { public static void encodeXid(final Xid xid, final ActiveMQBuffer out) { out.writeInt(xid.getFormatId()); public static Xid decodeX...
<vulnerable_code><commit_title>[PATCH] ARTEMIS-3593 Defense against OME on parsing XID<commit_description>Co-authored-by: Viktor Kolomeyko <Viktor.Kolomeyko@r3.com><fixed_code> /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed wit...
<vulnerable_code><commit_title>[PATCH] ARTEMIS-3593 Defense against OME on parsing XID<commit_description>Co-authored-by: Viktor Kolomeyko <Viktor.Kolomeyko@r3.com><fixed_code> /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed wit...
<vulnerable_code> return FALSE; def_mess = scanned_member->field->default_value; if (len > pref_len) subm = protobuf_c_message_unpack(scanned_member->field->descriptor, allocator, len - pref_len,<commit_title>[PATCH] Fix regression with zero-length messages introduced in<commit_description><fi...
<vulnerable_code> } @Test public void synchAfterClusterRestart() throws Throwable { setUpMultiNode(); String factoryLink = ExampleService.FACTORY_LINK;<commit_title>[PATCH] Add auth to UtilityService<commit_description>Extend auth check to UtiliyService endpoints: stats, config, subscriptio...
<vulnerable_code> options.cert = opts.cert; options.ca = opts.ca; options.ciphers = opts.ciphers; options.rejectUnauthorized = opts.rejectUnauthorized; } // Reset error flag newOptions.cert = opts.cert; newOptions.ca = opts.ca; newOptions.ciphers = opt...
<vulnerable_code> target = os.readlink(r'C:\Users\All Users') self.assertTrue(os.path.samefile(target, r'C:\ProgramData')) @unittest.skipUnless(sys.platform == "win32", "Win32 specific tests") class Win32JunctionTests(unittest.TestCase):<commit_title>[PATCH] Minimal fix to prevent buffer overrun in os....
<vulnerable_code>#if defined(MS_WINDOWS) /* Grab CreateSymbolicLinkW dynamically from kernel32 */ static DWORD (CALLBACK *Py_CreateSymbolicLinkW)(LPCWSTR, LPCWSTR, DWORD) = NULL; static int check_CreateSymbolicLink(void) return Py_CreateSymbolicLinkW != NULL; } /* Remove the last portion of the path */ static vo...