text
stringlengths
79
3.72M
<vulnerable_code> method='POST', body={'action': 'set_profile_info', 'email': 'test@test.com', 'username': 'test'}, ) self.assertStatus(200) self.assertInBody("Profile updated successfully.") # Then database is updated with fullname user = UserObject.query....
<vulnerable_code> * Not recognized on AMD in compat mode (but is recognized in legacy * mode). */ if ((ctxt->mode == X86EMUL_MODE_PROT32) && (efer & EFER_LMA) && !vendor_intel(ctxt)) return emulate_ud(ctxt); setup_syscalls_segments(ctxt, &cs, &ss); ops->get_msr(ctxt, MSR_IA32_SYSENTER_CS, &msr_data); ...
<vulnerable_code># under the License. from __future__ import annotations import re from contextlib import nullcontext from unittest import mock from unittest.mock import MagicMock, patch import pendulum import pytest from airflow.exceptions import AirflowException, TaskDeferred from airflow.kubernetes.secret import ...
<vulnerable_code> ap->last = FALSE; ap->last = TRUE; if (nesting == 1) // make sure cursor and topline are valid check_lnums(TRUE); save_did_emsg = did_emsg; <commit_title>[PATCH] patch 9.0.0061: ml_get error with nested autocommand<commit_description>Problem: ml_get error with nested autocommand....
<vulnerable_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 60, /**/<commit_title>[PATCH] patch 9.0.0061: ml_get error with nested autocommand<commit_description>Problem: ml_get error with nested autocommand. Solution: Also check line numbers for a nested autocommand. ...
<vulnerable_code>} /* * Correct the cursor line number in other windows. Used after changing the * current buffer, and before applying autocommands. * When "do_curwin" is TRUE, also check current window. */ void check_lnums(int do_curwin) { win_T *wp; tabpage_T *tp; FOR_ALL_TAB_WINDOWS(tp, wp) if...
<vulnerable_code> if (this._sessionManager) { if (typeof done != 'function') { throw new Error('req#logout requires a callback function'); } this._sessionManager.logOut(this, done); } else { done && done(); }<commit_title>[PATCH] Add option to keep session data on logout.<commit_description><fixed...
<vulnerable_code> if (req.session[this._key]) { delete req.session[this._key].user; } req.session.save(function(err) { if (err) { if (err) { return cb(err); } cb && cb(); }); });<commit_title>[PATCH] Add option to keep session data on logout.<commit_description><fixed_cod...
<vulnerable_code> else: ansible_role = None data = {} data['uuid'] = result._task._uuid data['session'] = self.session<commit_title>[PATCH] [2.9] Callback: removing args from task_fields from Sumologic<commit_description><fixed_code> else: ansible_role = N...
<vulnerable_code>package io.netty.handler.codec.http; import static io.netty.util.internal.ObjectUtil.checkPositive; import static io.netty.util.internal.StringUtil.COMMA; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; value = null; List<String> contentLengthFields = headers.getAll(...
<vulnerable_code>import java.util.Iterator; import java.util.List; import io.netty.util.AsciiString; import io.netty.util.CharsetUtil; import io.netty.util.NetUtil; import io.netty.util.internal.ObjectUtil; /** * Utility methods useful in the HTTP context. private static final AsciiString CHARSET_EQUALS = Ascii...
<vulnerable_code> import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandlerContext; import io.netty.handler.codec.http.HttpStatusClass; import io.netty.handler.codec.http2.Http2Connection.Endpoint; import io.netty.util.internal.UnstableApi; import io.netty.util.internal.logging.InternalLogger; import io.ne...
<vulnerable_code>import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelPromise; import io.netty.channel.DefaultChannelPromise; import io.netty.handler.codec.http.HttpResponseStatus; import junit.framework.AssertionFailedError; import org.junit.Before; import org.junit.Test; import org.mockito.Ar...
<vulnerable_code> assert_tx_failed(lambda: c.abi_decode(input_)) @pytest.mark.parametrize( "output_typ,input_", [<commit_title>[PATCH] add test for abi_decode clamper in nested expr<commit_description><fixed_code> assert_tx_failed(lambda: c.abi_decode(input_)) def test_clamper_nested_uint8(get_contra...
<vulnerable_code> next(); }; Server.prototype.checkHost = function (headers) { // allow user to opt-out this security check, at own risk if (this.disableHostCheck) return true; // get the Host header and extract hostname // we don't care about port not matching const hostHeader = headers.host; if (!hostH...
<vulnerable_code> } } GF_Err gf_isom_nalu_sample_rewrite(GF_MediaBox *mdia, GF_ISOSample *sample, u32 sampleNumber, GF_MPEGVisualSampleEntryBox *entry) { Bool is_hevc = GF_FALSE; GF_ISOFile *file = mdia->mediaTrack->moov->mov; GF_TrackReferenceTypeBox *scal = NULL; Track_FindRef(mdia->mediaTrack, GF_ISOM_REF_SCA...
<vulnerable_code> u32 size, nb_nalus=0, nb_nal_entries=0, last_tile_group=(u32) -1; GF_BitStream *bs=NULL; GF_ISOSample *sample = gf_isom_get_sample(file, track, i+1, &di); data = (u8 *) sample->data; size = sample->dataLength;<commit_title>[PATCH] fixed #2359<commit_description><fixed_code> u32 size, nb_na...
<vulnerable_code>#include <linux/capability.h> #include <linux/completion.h> #include <linux/cdrom.h> #include <linux/slab.h> #include <linux/times.h> #include <asm/uaccess.h> } EXPORT_SYMBOL(scsi_cmd_ioctl); int scsi_cmd_blk_ioctl(struct block_device *bd, fmode_t mode, unsigned int cmd, void __user *arg) { ...
<vulnerable_code> SCSI_LOG_IOCTL(1, sd_printk(KERN_INFO, sdkp, "sd_ioctl: disk=%s, " "cmd=0x%x\n", disk->disk_name, cmd)); /* * If we are in the middle of error recovery, don't let anyone * else try and use this device. Also, if error recovery fails, it unsigned int cmd, unsigned long arg) { struc...
<vulnerable_code> } } } gamma=1.0/count; mean_location.x=gamma*sum_location.x; mean_location.y=gamma*sum_location.y; mean_pixel.red=gamma*sum_pixel.red;<commit_title>[PATCH] https://github.com/ImageMagick/ImageMagick/issues/1552<commit_description><fixed_co...
<vulnerable_code> i = HEADERSIZE while i < filesize: sig, blocksize = nextheader(fobj) i += HEADERSIZE blocksize -= HEADERSIZE dct[sig] = (i, blocksize)<commit_title>[PATCH] Icns DOS fix -- CVE-2014-3589<commit_description>Found and reported by Andrew Drak...
<vulnerable_code><commit_title>[PATCH] Icns DOS fix -- CVE-2014-3589<commit_description>Found and reported by Andrew Drake of dropbox.com<fixed_code> # Tests potential DOS of IcnsImagePlugin with 0 length block. # Run from anywhere that PIL is importable. from PIL import Image from io import BytesIO if bytes is str...
<vulnerable_code> def test_http_valid_method_access(self): from frappe.client import delete from frappe.handler import execute_cmd frappe.local.request = frappe._dict() frappe.local.request.method = 'POST' frappe.form_dict = dict(doc=(dict(doctype='ToDo', description='Valid http method'))) todo = execute_...
<vulnerable_code> while (root.child) { lyxml_free(ctx, root.child); } lys_node_free(retval, NULL, 0); return NULL; } error: lyxml_free(ctx, dflt); lys_node_free(retval, NULL, 0); return NULL; } return retval; error: lys_node_free(retval, NULL, 0); return NULL; } r...
<vulnerable_code> fail: LY_TREE_FOR_SAFE(uses->child, next, iter) { lys_node_free(iter, NULL, 0); } free(refine_nodes); return -1;<commit_title>[PATCH] schema tree BUGFIX freeing nodes with no module set<commit_description>Context must be passed explicitly for these cases. Fixes #1452<fixed_code...
<vulnerable_code> iter->next = NULL; iter->prev = iter; iter->parent = NULL; lys_node_free(iter, NULL, 0); } else { if (shortcase) { /* create the implicit case to allow it to serve as a target of the augments, /* children from a resolved augment are freed unde...
<vulnerable_code> } } function uploadSizeError( up, file, over100mb ) { var message; if ( over100mb ) message = pluploadL10n.big_upload_queued.replace('%s', file.name) + ' ' + pluploadL10n.big_upload_failed.replace('%1$s', '<a class="uploader-html" href="#">').replace('%2$s', '</a>'); else message = pluploadL1...
<vulnerable_code>function fileQueued(a){jQuery(".media-blank").remove();var b=jQuery("#media-items").children(),c=post_id||0;1==b.length&&b.removeClass("open").find(".slidetoggle").slideUp(200),jQuery('<div class="media-item">').attr("id","media-item-"+a.id).addClass("child-of-"+c).append('<div class="progress"><div cl...
<vulnerable_code> pesize = ((size_comp + 7) & ~7) * repeat_count; // Divide pre encoded size by RS k-value (239) block_count = (pesize + 238) / 239; // Multiply with codeword size (255) and round to a multiple of 8 page_size = (block_count * 255 + 7) & ~7; <commit_title>[PATCH] decode: protect r2007 empty syst...
<vulnerable_code> parserInit(parser, encodingName); if (encodingName && ! parser->m_protocolEncodingName) { XML_ParserFree(parser); return NULL; }<commit_title>[PATCH 3/3] Changes: Document #649<commit_description><fixed_code> parserInit(parser, encodingName); if (encodingName && ! parser->m_protocol...
<vulnerable_code>} END_TEST static void nsalloc_setup(void) { XML_Memory_Handling_Suite memsuite = {duff_allocator, duff_reallocator, free}; tcase_add_test(tc_alloc, test_alloc_long_public_id); tcase_add_test(tc_alloc, test_alloc_long_entity_value); tcase_add_test(tc_alloc, test_alloc_long_notation); suite_...
<vulnerable_code> vec[0].ptr = bp; vec[0].len = len; if (in_cksum(vec, 1)) ND_PRINT((ndo, ", (bad vrrp cksum %x)", EXTRACT_16BITS(&bp[6]))); } if (version == 3 && ND_TTEST2(bp[0], len)) {<commit_title>[PATCH] (for 4.9.3) CVE-2018-14463/VRRP: Add a missing bounds check<commit_description>In vrrp_p...
<vulnerable_code> self._tf_ifft_for_rank(rank), re, im, result_is_complex=False, rtol=tol, atol=tol) @test_util.run_all_in_graph_and_eager_modes class FFTShiftTest(test.TestCase, parameterized.TestCase):<commit_title>[PATCH] Add test case for GitHub issue 55623 for tf.signal.rfft2d<commit_description><...
<vulnerable_code>import io.dropwizard.validation.selfvalidating.ViolationCollector; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; import uk.org.lidalia.slf4jext.Level; import uk.org.lidalia...
<vulnerable_code> public static final List<String> MIMETYPE_WHITELIST = Arrays.asList("audio/basic", "audio/L24", "audio/mp4", "audio/mpeg", "audio/ogg", "audio/vorbis", "audio/vnd.rn-realaudio", "audio/vnd.wave", "audio/webm", "image/gif", "image/jpeg", "image/pjpeg", "image/png", "i...
<vulnerable_code> # servers provided by user input. # # As of Synapse v1.24.0 this option also affects any outbound requests to push # servers provided by user input. # # (0.0.0.0 and :: are always blacklisted, whether or not they are explicitly # listed here, sinc...
<vulnerable_code> self._message_handler = hs.get_message_handler() self._server_notices_mxid = hs.config.server_notices_mxid self.config = hs.config self.http_client = hs.get_simple_http_client() self._instance_name = hs.get_instance_name() self._replication = hs.get_repli...
<vulnerable_code> XMLInputFactory inputFactory = XMLInputFactory.newInstance(); inputFactory.setProperty("javax.xml.stream.isCoalescing", true); inputFactory.setProperty(XMLInputFactory.IS_NAMESPACE_AWARE, true); XMLEventReader reader = inputFactory.createXMLEventReader(input); En...
<vulnerable_code>import static apoc.util.BinaryTestUtil.fileToBinary; import static apoc.util.MapUtil.map; import static apoc.util.TestUtil.isRunningInCI; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; assertXMLEquals(output...
<vulnerable_code> }) }) test('should not backtrack', function () { var parse = refImpl(regexes).parse var ua = Array(3200).fill('a').join('') var start = Date.now() parse(ua) var diff = Date.now() - start assert.ok(diff < 500, diff) }) })<commit_title>[PATCH 1/4] fix: redos SmartWatch<...
<vulnerable_code> } } test('should not backtrack', function () { var ua = Array(3200).fill('a').join('') var time = timer() parse(ua) parse(ua) assert.ok(time() < 300, time()) }) })<commit_title>[PATCH 1/4] fix: redos SmartWatch<commit_description><fixed_code> } } test('should not...
<vulnerable_code> } } test('should not backtrack aaaa..', function () { var ua = Array(3200).fill('a').join('') var time = timer() parse(ua) assert.ok(time() < 300, time()) }) test('should not backtrack Smartwatch', function () { var ua = 'SmartWatch(' + Array(3500).fill(' ').join('') +...
<vulnerable_code> test('should not backtrack HbbTV LGE', function () { testRedos('HbbTV/0.0.0 (;LGE;' + Array(3500).fill(' ').join('') + 'z') }) })<commit_title>[PATCH 1/4] fix: redos SmartWatch<commit_description><fixed_code> test('should not backtrack HbbTV LGE', function () { testRedos('HbbTV/0.0.0 (;LG...
<vulnerable_code> num_rows = 128 size = 1000 n_elems = 4096 inp_indices = np.random.randint(0, num_rows, (n_elems,)) inp_vals = np.random.randint(0, size, (n_elems,), dtype=dtype) np_out = np.bincount(inp_vals, minlength=size) num_rows = 128 size = 1000 n_elems = 4096 inp_indices...
<vulnerable_code> .contentType(MediaType.APPLICATION_JSON_UTF8_VALUE); return mockMvc.perform(requestBuilder).andReturn().getResponse(); } protected MockHttpServletResponse callMethod(String methodName) throws Exception { String endpointName = VaadinConnectTypeConversionEndpoints...
<vulnerable_code> bool runOnModule(Module *M); }; static bool inferUnaryArith(UnaryOperatorInst *UOI, Type numberResultType) { Value *op = UOI->getSingleOperand(); return true; } Type mayBeBigInt = op->getType().canBeBigInt() ? Type::createBigInt() : Type::createNoType(); // - ?? => Number|?BigIn...
<vulnerable_code> if (!arr->attached(runtime)) { \ return runtime.raiseTypeError("Underlying ArrayBuffer detached"); \ } \ return HermesValue::encodeNumberValue(arr->at(runtime, k)); ...
<vulnerable_code>// CHECK-NEXT: $Reg2 @5 [empty] %5 = StorePropertyInst %4 : closure, %2 : object, "select" : string // CHECK-NEXT: $Reg2 @6 [7...8) %6 = HBCCreateFunctionInst %build#0#1()#4 : object, %0 // CHECK-NEXT: $Reg2 @7 [empty] %7 = StorePropertyInst %6 : closure, %2 : object, "build" : string // CHECK-NEXT...
<vulnerable_code>// CHECK-NEXT: %18 = AllocObjectInst 0 : number, empty // CHECK-NEXT: %19 = AllocObjectInst 0 : number, empty // CHECK-NEXT: %20 = BinaryOperatorInst '+', %18 : object, %19 : object // CHECK-NEXT: %21 = CallInst %x, undefined : undefined, %20 : string|number // CHECK-NEXT: %22 = CallInst %x, undef...
<vulnerable_code><commit_title>[PATCH] Re-sync with internal repository (#960)<commit_description>Co-authored-by: Facebook Community Bot <6422482+facebook-github-bot@users.noreply.github.com><fixed_code> /** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license f...
<vulnerable_code><commit_title>[PATCH] Re-sync with internal repository (#960)<commit_description>Co-authored-by: Facebook Community Bot <6422482+facebook-github-bot@users.noreply.github.com><fixed_code> /** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license f...
<vulnerable_code> static char own_dir[256]; static const char *dll_dirs[] = { ".", own_dir, LIB_DIR, "/lib", while(l && argv0[l - 1] != '/') l--; if(l == 0) memcpy(own_dir, ".", 2); else { memcpy(own_dir, argv0, l - 1); own_dir[l] = 0;<commit_title>[PATCH] fix for CVE-2015-3887<commit_description>closes ...
<vulnerable_code><commit_title>[PATCH] test: add IT test<commit_description><fixed_code> /* * Copyright 2000-2020 Vaadin Ltd. * * 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:/...
<vulnerable_code> gf_bs_read_ue_log_idx(bs, "vps_max_latency_increase_plus1", i); } vps->max_layer_id = gf_bs_read_int_log(bs, 6, "max_layer_id"); if (vps->max_layer_id > MAX_LHVC_LAYERS) { GF_LOG(GF_LOG_ERROR, GF_LOG_CODING, ("[HEVC] VPS max layer ID %u but GPAC only supports %u\n", vps->max_layer_id, MAX_LHVC_L...
<vulnerable_code> goto error; } /* Read the blocks in this page. */ size_t blkoff; struct ntreg_hbin_block *block;<commit_title>[PATCH] handle: Check that pages do not extend beyond the end of the<commit_description><fixed_code> goto error; } if (off + page_size > h->size) { S...
<vulnerable_code>import mimetypes import os import re import traceback import types import warnings from http.client import responses else: reply["message"] = "Unhandled error" reply["reason"] = None reply["traceback"] = "".join(traceback.format_exception(*exc...
<vulnerable_code># Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. import json from traceback import format_tb try: from jupyter_client.jsonutil import json_default except Exception as e: message = "Exception restarting kernel" ...
<vulnerable_code> Apparently there's no html_message in send_mass_mail: https://github.com/django/django/blob/ca9872905559026af82000e46cde6f7dedc897b6/django/core/mail/__init__.py#L64 """ send_mail("Subject", "body", "from@example.com", ["to@example.com"], html_message=request.args("html")) @app.route("/internal...
<vulnerable_code> msg = Message(subject="Subject", sender="from@example.com", recipients=["to@example.com"], body="body", html=request.args["html"]) # The message can contain a body and/or HTML: msg.body = "body" msg.html = request.args["html"] ...
<vulnerable_code> testNormalizeSyntaxWithFailingMallocCallsFreeTimes("hTTp://example.org/path", URI_NORMALIZE_SCHEME); } TEST(FailingMemoryManagerSuite, ParseSingleUriExMm) { UriUriA uri; const char * const first = "k1=v1&k2=v2";<commit_title>[PATCH] tests: Cover non-OOM handling of empty URI elements in<commit_desc...
<vulnerable_code> static int get_registers(pegasus_t *pegasus, __u16 indx, __u16 size, void *data) { int ret; ret = usb_control_msg(pegasus->usb, usb_rcvctrlpipe(pegasus->usb, 0), PEGASUS_REQ_GET_REGS, PEGASUS_REQT_READ, 0, indx, data, size, 1000); if (ret < 0) netif_dbg(pegasus, drv, pegasus->n...
<vulnerable_code> pcmb.setValue(this.config.record.parent_pagetitle+' ('+this.config.record.parent+')'); } if (!Ext.isEmpty(this.config.record.pagetitle)) { Ext.getCmp('modx-resource-header').getEl().update('<h2>'+Ext.util.Format.stripTags(this.config.record.pageti...
<vulnerable_code> if not is_allowed_content_type(content_type): raise SynapseError( HTTPStatus.BAD_GATEWAY, ("Unsupported content type for URL previews: %r" % content_type), ) # TODO: if our Content-Type is HTML or something, ju...
<vulnerable_code> channel.json_body, { "errcode": "M_UNKNOWN", "error": "Unsupported content type for URL previews: b'video/mp4'", }, ) channel.json_body, { "errcode": "M_UNKNOWN", "error"...
<vulnerable_code> ret = anon_inode_getfd(ops->name, &kvm_device_fops, dev, O_RDWR | O_CLOEXEC); if (ret < 0) { ops->destroy(dev); mutex_lock(&kvm->lock); list_del(&dev->vm_node); mutex_unlock(&kvm->lock); return ret; } <commit_title>[PATCH] KVM: use after free in kvm_ioctl_create_device()<commit_descriptio...
<vulnerable_code> return true; } if (sa_is_loopback(psa) || sa_is_any(psa)) err = EPERM; else err = udp_send(al->rel_us, psa, &data->v.data); mb->end = mb->pos + len; if (sa_is_loopback(psa) || sa_is_any(psa)) err = EPERM; else err = udp_send(al->rel_us, psa, mb);<commit_title>[PATCH] turn: also don't...
<vulnerable_code>tcon_error_exit: if (rsp->hdr.Status == STATUS_BAD_NETWORK_NAME) { cifs_dbg(VFS, "BAD_NETWORK_NAME: %s\n", tree); tcon->bad_network_name = true; } goto tcon_exit; }<commit_title>[PATCH] [CIFS] Possible null ptr deref in SMB2_tcon<commit_description>As Raphael Geissert pointed out, tcon_error_exi...
<vulnerable_code> display.debug(u"WORKER TRACEBACK: %s" % to_text(traceback.format_exc())) finally: self._clean_up() finally: self._clean_up() display.debug("WORKER PROCESS EXITING") <commit_title>[PATCH] remove 2nd cleanuP<commit_descr...
<vulnerable_code> for (a=2;a<length;a++){ ch = Data[a]; if (ch == '\r' && Data[a+1] == '\n') continue; // Remove cr followed by lf. if (ch >= 32 || ch == '\n' || ch == '\t'){ Comment[nch++] = (char)ch;<commit_title>[PATCH] A 'fix' to satisfy pednatic debian fuzzers. This one re...
<vulnerable_code> except msgpack.UnpackException: continue if valid_archive(archive): archive = ArchiveItem(internal_dict=archive) name = archive.name logger.info("Found archive %s", name)<commit_title>[PATCH 01/10] check: rebuild_ma...
<vulnerable_code> traceback = False class TAMInvalid(IntegrityError): __doc__ = IntegrityError.__doc__ traceback = False super().__init__("Manifest authentication did not verify") class TAMUnsupportedSuiteError(IntegrityError): """Could not verify manifest: Unsupported suite {!r}; a newer ver...
<vulnerable_code> args = dict(use_list=False, max_buffer_size=3 * max(BUFSIZE, MAX_OBJECT_SIZE)) # return tuples, not lists if kind in ("server", "client"): pass # nothing special elif kind in ("manifest", "key"): args.update(dict(use_list=True, object_hook=StableDict)) # default value ...
<vulnerable_code>from ...archive import ChunkBuffer from ...constants import * # NOQA from ...helpers import bin_to_hex from ...helpers import msgpack from ...manifest import Manifest from ...repository import Repository from . import cmd, src_file, create_src_archive, open_archive, generate_archiver_tests, RK_ENCRYPT...
<vulnerable_code> unpacker = get_limited_unpacker("archive") unpacker.feed(data) unpacked = unpacker.unpack() if b"tam" not in unpacked: if tam_required: archive_name = unpacked.get(b"name", b"<unknown>").decode("ascii", "replace") raise Archive...
<vulnerable_code> setattr(metadata, key, value) if "items" in metadata: del metadata.items data = msgpack.packb(metadata.as_dict()) new_id = self.key.id_hash(data) self.cache.add_chunk(new_id, {}, data, stats=self.stats) self.manifest.archives[self.name] = (new...
<vulnerable_code> nonlocal processed_item_metadata_chunks csize, data = decrypted_repository.get(archive_id) chunk_idx.add(archive_id, 1, len(data)) archive = ArchiveItem(internal_dict=msgpack.unpackb(data)) if archive.version not in (1, 2): # legacy ...
<vulnerable_code> self.name = name # overwritten later with name from archive metadata self.name_in_manifest = name # can differ from .name later (if borg check fixed duplicate archive names) self.comment = None self.numeric_ids = numeric_ids self.noatime = noatime self....
<vulnerable_code> """Unpack msgpacked *data* and return (object, did_verify).""" tam_required = self.tam_required if force_tam_not_required and tam_required: logger.warning("Archive authentication DISABLED.") tam_required = False data = bytearray(data) unpa...
<vulnerable_code> "id": "internal ID of the archive", "hostname": "hostname of host on which this archive was created", "username": "username of user who created this archive", "size": "size of this archive (data plus metadata, not considering compression and deduplication)", "nfi...
<vulnerable_code> if tam_required: raise TAMRequiredError(self.repository._location.canonical_path()) else: logger.debug("TAM not found and not required") return unpacked, False tam = unpacked.pop("tam", None) if not isinstance(tam, ...
<vulnerable_code> cdata = self.repository.get(id) _, data = self.repo_objs.parse(id, cdata) # we do not require TAM for archives, otherwise we can not even borg list a repo with old archives. archive, self.tam_verified = self.key.unpack_and_verify_archive(data, force_tam_not_required=True...
<vulnerable_code> nonlocal processed_item_metadata_chunks csize, data = decrypted_repository.get(archive_id) chunk_idx.add(archive_id, 1, len(data)) archive, verified = self.key.unpack_and_verify_archive(data, force_tam_not_required=True) archive = ArchiveItem(...
<vulnerable_code> output_length=64, ) def pack_and_authenticate_metadata(self, metadata_dict, context=b"manifest"): metadata_dict = StableDict(metadata_dict) tam = metadata_dict["tam"] = StableDict({"type": "HKDF_HMAC_SHA512", "hmac": bytes(64), "salt": os.urandom(64)}) p...
<vulnerable_code>from ...cache import Cache, LocalCache from ...constants import * # NOQA from ...crypto.key import TAMRequiredError from ...helpers import Location, get_security_dir, bin_to_hex from ...helpers import EXIT_ERROR from ...helpers import msgpack from ...manifest import Manifest, MandatoryFeatureUnsupport...
<vulnerable_code>from ..crypto.key import AESOCBRepoKey, AESOCBKeyfileKey, CHPORepoKey, CHPOKeyfileKey from ..crypto.key import Blake2AESOCBRepoKey, Blake2AESOCBKeyfileKey, Blake2CHPORepoKey, Blake2CHPOKeyfileKey from ..crypto.key import ID_HMAC_SHA_256, ID_BLAKE2b_256 from ..crypto.key import ( TAMRequiredError, ...
<vulnerable_code> Retrieve the logfile name ''' if salt.utils.is_windows(): logfile_tmp = tempfile.NamedTemporaryFile(dir=os.environ['TMP'], prefix=exe_name, suffix='.log', ...
<vulnerable_code>/* ASC string */ int Xasc(int modifier, char* label, char* mnemo, char* oper) { register char* s; register char r; register char delimiter;<commit_title>[PATCH] Prevent NULL pointer dereference.<commit_description>Specific test cases could cause the `oper` character pointer to be NULL, leading ...
<vulnerable_code> const auto certificatePem = _certificate.toPem(); BIO_write(certificateBio, certificatePem.constData(), certificatePem.size()); const auto x509Certificate = X509Certificate::readCertificate(certificateBio); if (const auto certificateCheckResult = X509_che...
<vulnerable_code> while (ze != null) { String fileName = ze.getName(); File newFile = new File(outputFolder + File.separator + fileName); // System.out.println("file unzip : "+ newFile.getAbsoluteFile()); if (ze.isDirectory()) { String temp = newFile.getAbsolutePath();<commit_title>[PATCH] vuln-...
<vulnerable_code> var longitude = req.headers.longitude; var pic_path = req.files.fileUpload.path; if(!challenger_id || !challenged_id || !latitude || !longitude) { res.json({error: "Must specify challenger_id, challenged_id, latitude, and longitude."}); return; challenged_id = mysql.escape(challenged_i...
<vulnerable_code> "false", "Use SPNEGO in SSPI authentication requests"), ; private final String name;<commit_title>[PATCH] Merge pull request from GHSA-37xm-4h3m-5w3v<commit_description>* refactor: Clean up whitespace in existing PgSQLXMLTest * fix: Fix XXE vulnerability in PgSQLXML by disabling external...
<vulnerable_code>import org.postgresql.jdbc.FieldMetadata; import org.postgresql.jdbc.TimestampUtils; import org.postgresql.util.LruCache; import java.sql.Connection; import java.sql.ResultSet; * @see PGProperty#READ_ONLY_MODE */ boolean hintReadOnly(); }<commit_title>[PATCH] Merge pull request from GHSA-37xm-...
<vulnerable_code> return Logger.getLogger("org.postgresql"); } /* * Alias methods below, these are to help with ease-of-use with other database tools / frameworks * which expect normal java bean getters / setters to exist for the property names.<commit_title>[PATCH] Merge pull request from GHSA-37xm-4h3m-...
<vulnerable_code>import org.postgresql.util.PGobject; import org.postgresql.util.PSQLException; import org.postgresql.util.PSQLState; import java.io.IOException; import java.sql.Array; private final LruCache<FieldMetadata.Key, FieldMetadata> fieldMetadataCache; final CachedQuery borrowQuery(String sql) throws SQ...
<vulnerable_code>import org.postgresql.util.GT; import org.postgresql.util.PSQLException; import org.postgresql.util.PSQLState; import org.xml.sax.ErrorHandler; import org.xml.sax.InputSource; import org.xml.sax.SAXParseException; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java....
<vulnerable_code><commit_title>[PATCH] Merge pull request from GHSA-37xm-4h3m-5w3v<commit_description>* refactor: Clean up whitespace in existing PgSQLXMLTest * fix: Fix XXE vulnerability in PgSQLXML by disabling external access and doctypes Fixes XXE vulnerability by defaulting to disabling external access and doc t...
<vulnerable_code><commit_title>[PATCH] Merge pull request from GHSA-37xm-4h3m-5w3v<commit_description>* refactor: Clean up whitespace in existing PgSQLXMLTest * fix: Fix XXE vulnerability in PgSQLXML by disabling external access and doctypes Fixes XXE vulnerability by defaulting to disabling external access and doc t...
<vulnerable_code><commit_title>[PATCH] Merge pull request from GHSA-37xm-4h3m-5w3v<commit_description>* refactor: Clean up whitespace in existing PgSQLXMLTest * fix: Fix XXE vulnerability in PgSQLXML by disabling external access and doctypes Fixes XXE vulnerability by defaulting to disabling external access and doc t...
<vulnerable_code><commit_title>[PATCH] Merge pull request from GHSA-37xm-4h3m-5w3v<commit_description>* refactor: Clean up whitespace in existing PgSQLXMLTest * fix: Fix XXE vulnerability in PgSQLXML by disabling external access and doctypes Fixes XXE vulnerability by defaulting to disabling external access and doc t...
<vulnerable_code><commit_title>[PATCH] Merge pull request from GHSA-37xm-4h3m-5w3v<commit_description>* refactor: Clean up whitespace in existing PgSQLXMLTest * fix: Fix XXE vulnerability in PgSQLXML by disabling external access and doctypes Fixes XXE vulnerability by defaulting to disabling external access and doc t...