text
stringlengths
79
3.72M
<vulnerable_code> */ _configure: function() { var me = this; me._config = helpers.merge({}, [ me.chart.options.datasets[me._type], me.getDataset(), ], {<commit_title>[PATCH] Use Object.create(null) as `merge` target<commit_description><fixed_code> */ _configure: function() { var me = this; me._conf...
<vulnerable_code> }, getScaleDefaults: function(type) { // Return the scale defaults merged with the global settings so that we always use the latest ones return this.defaults.hasOwnProperty(type) ? helpers.merge({}, [defaults.scale, this.defaults[type]]) : {}; }, updateScaleDefaults: function(type, additions) {...
<vulnerable_code> }); describe('clone', function() { it('should clone primitive values', function() { expect(helpers.clone()).toBe(undefined); expect(helpers.clone(null)).toBe(null);<commit_title>[PATCH] Use Object.create(null) as `merge` target<commit_description><fixed_code> }); describe('clone', functio...
<vulnerable_code> switch (type) { case kEmptyStream: h->emptyStreamBools = calloc((size_t)zip->numFiles, sizeof(*h->emptyStreamBools)); if (h->emptyStreamBools == NULL) return (-1); break; } h->emptyFileBools = calloc(empty_streams, sizeof(*h->emptyFileBools)); if (h->emptyFile...
<vulnerable_code> inst.append.remove(); } if ( appendText ) { inst.append = $( "<span></span>" ) .attr( "class", this._appendClass ) .text( appendText ); input[ isRTL ? "before" : "after" ]( inst.append ); } buttonImage = this._get( inst, "buttonImage" ); if ( this._get( inst, "buttonImageO...
<vulnerable_code><commit_title>[PATCH] Drop privileges by default when opening user-related files<commit_description>The module is typically executed as root and would sometimes open files or follow symlinks that could be controlled from the outside. Drop privileges to the target user before opening any files. Fixes ...
<vulnerable_code>#include <errno.h> #include "util.h" /* If secure_getenv is not defined, define it here */ #ifndef HAVE_SECURE_GETENV int retval = PAM_IGNORE; device_t *devices = NULL; unsigned n_devices = 0; int openasuser; int should_free_origin = 0; int should_free_appid = 0; int should_free_auth_fi...
<vulnerable_code> { var r = jsonData.records[i]; result += '<tr>'; result += '<td><input type="text" value="'+r.name.replace(name, '')+'" id="name['+i+']"><input type="hidden" value="'+r.id+'" id="id['+i+']"></td>'; result += '<td><input type="text" size="6" class="type" value="'+r.type+'" id="type['+...
<vulnerable_code> }, escapeHTML: function() { var div = document.createElement('div'); var text = document.createTextNode(this); div.appendChild(text); return div.innerHTML; }, unescapeHTML: function() {<commit_title>[PATCH] protect against persistent XSS by other users<commit_description><fixe...
<vulnerable_code> @staticmethod def create_dependency_tree(source_dir, url=None, options=None, update=False): root = Subproject.create("root", url, source_dir, {}, {}, toplevel = True) if url and update: root.checkout() if uri is None: # options add only, ...
<vulnerable_code> colormap=(unsigned char *) AcquireQuantumMemory(768UL,sizeof(*colormap)); if ((global_colormap == (unsigned char *) NULL) || (colormap == (unsigned char *) NULL)) ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed"); for (i=0; i < 768; i++) colormap[i]=(unsigned char) 0...
<vulnerable_code> number: 42, date: new Date('1995-12-17T03:24:00'), null: null, }; const data = [ { key: 'span.kind', value: 'client', expected: 'client' },<commit_title>[PATCH] remove unused code, add more tests<commit_description>Signed-off-by: Yuri Shkuro <ysh@meta.com><fixed_code> number: 42...
<vulnerable_code> const INDENT = ' '; function inlineRule(objRule) { let str = ''; if (objRule) { Object.keys(objRule).forEach(function add(rule) { str += rule + ':' + objRule[rule] + ';'; }); } return str; } function Stylize(styleFile) { function styleClass(cssClass) { return 'class="'...
<vulnerable_code> /* eslint-disable no-redeclare */ const utils = { generateUUID: function () { /* eslint-disable no-bitwise */ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { const r = Math.random() * 16 | 0; const v = c === 'x' ? r : ((r & 0x3) | 0x8); return v.toString(16)...
<vulnerable_code> } }; module.exports = utils;<commit_title>[PATCH] fix: get rid of math.random in utils.generateUUID<commit_description><fixed_code> } }; utils.generateUUID = function () { // from https://github.com/tracker1/node-uuid4/blob/master/browser.js const temp_url = URL.createObjectURL(new Blob()); cons...
<vulnerable_code>'use strict'; process.profile = function (operation, start) { console.log('%s took %d milliseconds', operation, process.elapsedTimeSince(start)); }; const meta = require('./meta'); return meta.config && meta.config.defaultLang ? meta.config.defaultLang : 'en-GB'; }; module.exports = utils;<commit_t...
<vulnerable_code> ptr += yanklen; // insert block's trailing spaces only if there's text behind if ((j < count - 1 || !shortline) && spaces) { vim_memset(ptr, ' ', (size_t)spaces); ptr += spaces; msgmore(nr_lines); curwin->w_set_curswant = TRUE; end: if (cmdmod.cmod_flags & CMOD_LOCKMAR...
<vulnerable_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 1375, /**/<commit_title>[PATCH] patch 9.0.1376: accessing invalid memory with put in Visual<commit_description><fixed_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 1...
<vulnerable_code> char *_equal; if(strncmp(tok, "csrf", strlen("csrf")) /* Do not put csrf into the params table */ && (_equal = strchr(tok, '='))) { char *decoded_buf; int len; <commit_title>[PATCH] Security fix: prevents empty host from being used<commit_description><fixed_code> char *_eq...
<vulnerable_code> struct in6_addr a6; Host *h = NULL; /* Check if address is invalid */ if((inet_pton(AF_INET, (const char*)host_ip, &a4) == 0) && (inet_pton(AF_INET6, (const char*)host_ip, &a6) == 0)) {<commit_title>[PATCH] Security fix: prevents empty host from being used<commit_description><fixed_code> ...
<vulnerable_code> rv = sc_read_binary(card, 0, *out, sz, 0); } else { int rec; int offs = 0; int rec_len = file->record_length; for (rec = 1; ; rec++) { rv = sc_read_record(card, rec, *out + offs + 2, rec_len, SC_RECORD_BY_REC_NR); if (rv == SC_ERROR_RECORD_NOT_FOUND) { rv = 0;<commit_title>[P...
<vulnerable_code> } else if (root == null) { String contractName = ctx.getExternalContext().getRequestParameterMap() .get("con"); if (null != contractName && 0 < contractName.length()) { contracts = new ArrayList<>(); contracts.add(contrac...
<vulnerable_code> } } private static boolean nameContainsForbiddenSequence(String name) { boolean result = false; if (name != null) { name = name.toLowerCase(); if(localePrefix != null && !nameContainsForbiddenSequence(localePrefix)){ return l...
<vulnerable_code>if (min > max) \ min = max; \ if (max - min < steps) \ max = Min(min + steps, 255); \ if (max - min < steps) \ min = Max(min - steps, 0) #define Dot(left, right) (left.x*right.x) + (left.y*right.y) + (left.z*right.z) Forward declarations */ static MagickBooleanType ConstructOrdering(const s...
<vulnerable_code> */ set_bit(MMF_UNSTABLE, &mm->flags); tlb_gather_mmu(&tlb, mm, 0, -1); for (vma = mm->mmap ; vma; vma = vma->vm_next) { if (!can_madv_dontneed_vma(vma)) continue; * we do not want to block exit_mmap by keeping mm ref * count elevated without a good reason. */ if (vma_is_anonymous(...
<vulnerable_code>#endif /* MENU_SELECT */ p = form->value->ptr; l = buf->currentLine; if (form->type == FORM_TEXTAREA) { int n = a->y - buf->currentLine->linenumber; if (n > 0)<commit_title>[PATCH] Prevent segfault for formUpdateBuffer<commit_description>Bug-Debian: https://github.com/tats/w3m/issue...
<vulnerable_code>% % % % % % + G e t I m a g e P i x e l C a c h e T y p e ...
<vulnerable_code> Create image colormap. */ packet_size=(size_t) (3UL*depth/8UL); if ((packet_size*image->colors) > GetBlobSize(image)) ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile"); image->colormap=(PixelInfo *) AcquireQuantumMemory(image->colo...
<vulnerable_code> } /* Delete the tempory new association. */ sctp_add_cmd_sf(commands, SCTP_CMD_NEW_ASOC, SCTP_ASOC(new_asoc)); sctp_add_cmd_sf(commands, SCTP_CMD_DELETE_TCB, SCTP_NULL()); /* Restore association pointer to provide SCTP command interpeter<commit_title>[PATCH] sctp: Use correct sideffect command i...
<vulnerable_code> #include "gd_ctx.c" /* as it is not really public, duplicate declaration here to avoid pointless warnings */ int overflow2(int a, int b); REGISTER_LONG_CONSTANT("IMG_CROP_SIDES", GD_CROP_SIDES, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("IMG_CROP_THRESHOLD", GD_CROP_THRESHOLD, CONST_...
<vulnerable_code> op->layers_info[j].layer_id = gf_bs_read_int(bs, 6); op->layers_info[j].is_outputlayer = gf_bs_read_int(bs, 1) ? GF_TRUE : GF_FALSE; op->layers_info[j].is_alternate_outputlayer = gf_bs_read_int(bs, 1) ? GF_TRUE : GF_FALSE; } op->minPicWidth = gf_bs_read_u16(bs); op->minPicHeight = gf_bs_...
<vulnerable_code> bs_flush_write_cache(bs); is_eos = gf_feof(bs->stream); /*we are in FILE mode, test for end of file*/ if (!is_eos || bs->cache_read) { u8 res; Bool loc_eos=GF_FALSE; assert(bs->position<=bs->size); bs->EndOfStream(bs->par); if (!bs->overflow_state) bs->overflow_state = 1; } else { G...
<vulnerable_code>package io.onedev.server.git.hook; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.nio.charset.Charset; import java.util.HashMap; import java.util.Map; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.RandomStringUtils; import com.google....
<vulnerable_code>import io.onedev.server.markdown.MarkdownManager; import io.onedev.server.markdown.MentionParser; import io.onedev.server.model.*; import io.onedev.server.util.Pair; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.tuple.Triple; im...
<vulnerable_code>package io.onedev.server.model; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.Index; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; import org.apache.commons.lang...
<vulnerable_code>package io.onedev.server.model; import static io.onedev.server.model.User.PROP_ACCESS_TOKEN; import static io.onedev.server.model.User.PROP_FULL_NAME; import static io.onedev.server.model.User.PROP_NAME; import static io.onedev.server.model.User.PROP_SSO_CONNECTOR; import java.util.ArrayList; import ...
<vulnerable_code>package io.onedev.server.model.support; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.Size; import org.apache.commons.lang3.RandomStringUtils; import io.onedev.server.event.project.Re...
<vulnerable_code>package io.onedev.server.util; import java.security.NoSuchAlgorithmException; import java.security.spec.InvalidKeySpecException; import java.security.spec.KeySpec; import javax.crypto.SecretKeyFactory; import javax.crypto.spec.PBEKeySpec; import org.apache.commons.codec.binary.Base64; import org.apa...
<vulnerable_code>package io.onedev.server.web.component.user.accesstoken; import org.apache.commons.lang3.RandomStringUtils; import org.apache.wicket.Session; import org.apache.wicket.markup.html.form.TextField; import org.apache.wicket.markup.html.link.Link; import org.apache.wicket.model.AbstractReadOnlyModel; impor...
<vulnerable_code>package io.onedev.server.web.component.user.twofactorauthentication; import java.io.IOException; import java.security.SecureRandom; import java.util.ArrayList; import java.util.List; import org.apache.commons.codec.binary.Base32; import org.apache.commons.lang3.RandomStringUtils; import org.apache.ti...
<vulnerable_code>package io.onedev.server.web.page.simple.security; import java.util.Arrays; import org.apache.commons.lang3.RandomStringUtils; import org.apache.shiro.authc.credential.PasswordService; import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.feedback.FencedFeedbackPanel; import org.a...
<vulnerable_code> if (node_tx) { u8_t pdu_data_tx_len; pdu_data_tx = (void *)(node_tx->pdu_data + _radio.conn_curr->packet_tx_head_offset); } } _radio.conn_curr->packet_tx_head_offset += pdu_data_tx_len; if (_radio.conn_curr->packet_tx_head_offset == _radio.conn_curr->packet_tx_hea...
<vulnerable_code>} const SegmentCommand* Binary::segment_from_offset(uint64_t offset) const { const auto it_begin = std::begin(offset_seg_); if (offset < it_begin->first) { return nullptr; range_t va_ranges = this->va_ranges(); if (new_segment.file_size() == 0) { const uint64_t new_size = segment.c...
<vulnerable_code>/* $OpenBSD: compat.c,v 1.119 2021/09/10 05:46:09 djm Exp $ */ /* * Copyright (c) 1999, 2000, 2001, 2002 Markus Friedl. All rights reserved. * debug_f("no match: %s", version); } char * compat_cipher_proposal(struct ssh *ssh, char *cipher_prop) { if (!(ssh->compat & SSH_BUG_BIGENDIANAES)) retur...
<vulnerable_code> * The number of characters in corresponding but escaped string. * * You can handle a part of URL with reserved characters like this: * @code * if (url_reserved_p(s)) { * n = malloc(url_esclen(s, NULL) + 1); * if (n) url_escape(n, s); continue; } h1 = s[i + 1], h2 = s[i + 2]; ...
<vulnerable_code> byte *space = NULL; do { #if (CRYPTOPP_MSC_VERSION >= 1400) // http://msdn.microsoft.com/en-us/library/5471dc8s.aspx space = (byte *)_malloca(255+sizeof(Locals)); space += (256-(size_t)space%256)%256; #else space = (byte *)alloca(255+sizeof(Locals)); space += (256-(size_t)space%256)...
<vulnerable_code> XMLConstants.FEATURE_SECURE_PROCESSING, "Secure processing feature of XMLConstants", true); /** * Parser setting specifying whether DOCTYPE declaration should be allowed. * <p> * Defaults to false. * * @see <a href="http://xerces.apache.org/xerces2-j/features.html">Apache XML Project - ...
<vulnerable_code>import logging import os import smtplib import warnings from email.mime.application import MIMEApplication from email.mime.multipart import MIMEMultipart :param with_ssl: Whether to use SSL encryption for the connection. :return: An SMTP connection to the specified host and port. """ re...
<vulnerable_code> @mock.patch("smtplib.SMTP_SSL") @mock.patch("smtplib.SMTP") def test_send_mime_ssl(self, mock_smtp, mock_smtp_ssl): mock_smtp_ssl.return_value = mock.Mock() with conf_vars({("smtp", "smtp_ssl"): "True"}): email.send_mime_email("from", "to", MIMEMultipart(), dryr...
<vulnerable_code> return -ENOMEM; transaction->aid_len = skb->data[1]; memcpy(transaction->aid, &skb->data[2], transaction->aid_len); return -EPROTO; transaction->params_len = skb->data[transaction->aid_len + 3]; memcpy(transaction->params, skb->data + transaction->aid_len + 4, transac...
<vulnerable_code> tag->frameList("TDAT").size() == 1) { TextIdentificationFrame *tdrc = static_cast<TextIdentificationFrame *>(tag->frameList("TDRC").front()); UnknownFrame *tdat = static_cast<UnknownFrame *>(tag->frameList("TDAT").front()); if(tdrc->fieldList().size() == 1 && tdrc->fiel...
<vulnerable_code> (curwin, curwin->w_topline, FALSE); int skip_lines = 0; int width1 = curwin->w_width - curwin_col_off(); int width2 = width1 + curwin_col_off2(); // similar formula is used in curs_columns() if (curwin->w_skipcol > width1) skip_lines += (curwin->w_skipcol - width1) / wid...
<vulnerable_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 1663, /**/<commit_title>[PATCH] patch 9.0.1664: divide by zero when scrolling with<commit_description><fixed_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 1664, /**/...
<vulnerable_code> if not os.path.exists(binary_path): current_app.logger.warning('Invalid binary path.') raise Exception() # Get the output of the '--version' command version_string = \ subprocess.getoutput('"{0}"...
<vulnerable_code> try: os.rename(oldpath_sys, newpath_sys) except Exception as e: return internal_server_error("{0} {1}".format( gettext('There was an error renaming the file:'), e)) return { 'Old Path': old, os.rmdir(orig_path...
<vulnerable_code> if (!strcmp((char *)name, EL_BINARY)) { zend_string *new_str = NULL; if (ZSTR_EMPTY_ALLOC() != Z_STR(ent1->data)) { new_str = php_base64_decode( (unsigned char *)Z_STRVAL(ent1->data), Z_STRLEN(ent1->data)); php_error_docref(NULL, E_WARNING, "Class %s can not be unserialized...
<vulnerable_code> struct f2fs_super_block *raw_super = F2FS_RAW_SUPER(sbi); struct f2fs_checkpoint *ckpt = F2FS_CKPT(sbi); unsigned int ovp_segments, reserved_segments; total = le32_to_cpu(raw_super->segment_count); fsmeta = le32_to_cpu(raw_super->segment_count_ckpt); return 1; } if (unlikely(f2fs_cp_error(sb...
<vulnerable_code> } } if (this.__isInt(field) === true) { return [undefined, parseInt(field)]; } else if (this.__isFloat(field)) { return [undefined, parseFloat(field)]; } else if (this.options.cast_date !== false) { return [undefined, this.options.cast_date.call(...
<vulnerable_code> return [err] } } if(this.__isInt(field) === true){ return [undefined, parseInt(field)] }else if(this.__isFloat(field)){ return [undefined, parseFloat(field)] }else if(this.options.cast_date !== false){ return [undefined, this.options.cast_date.call(null, ...
<vulnerable_code> expect(req.session.id).to.equal('2'); }); it('should keep session data', function() { expect(req.session.cart).to.be.undefined; }); }); }); describe('existing session and clearing custom user property', function() { var passport =...
<vulnerable_code> if max_depth > scalar_depth: raise ValueError("Invalid pylist=%r: empty list nesting is greater " "than scalar value nesting" % pylist) # If both inner_shape and ragged_rank were specified, then check that # they are compatible with pylist.<commit_title>[PATCH] Pre...
<vulnerable_code>#include <QMessageBox> #include <QDesktopServices> #include <QGuiApplication> class QSocket; // for a sample URL "nc://open/admin@nextcloud.lan:8080/Photos/lovely.jpg", QUrl::path would return "admin@nextcloud.lan:8080/Photos/lovely.jpg" const auto accountDisplayName = pathSplit.takeFirst(); ...
<vulnerable_code> } } void FolderMan::editFileLocally(const QString &accountDisplayName, const QString &relPath) { const auto showError = [this](const OCC::AccountStatePtr accountState, const QString &errorMessage, const QString &subject) { if (accountState && accountState->account()) { messageB...
<vulnerable_code>import org.slf4j.LoggerFactory; import java.io.File; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; protected static File getTmpFolder() { try { File outputFolder = File.createTempFile("codegen-", "-tmp"); outputFolder.delete(); ...
<vulnerable_code> unsigned const *const bitmask = (unsigned const *)(void const *)&gashtab[4]; unsigned const *const buckets = (unsigned const *)&bitmask[n_bitmask]; unsigned const *const hasharr = &buckets[n_bucket]; (void)hasharr; //unsigned const *const gashend = &hasharr[n_b...
<vulnerable_code> } WebPFreeDecBuffer(webp_image); stream=(unsigned char*) RelinquishMagickMemory(stream); return(image); } #endif<commit_title>[PATCH] Fixed fd leak for webp coder (patch from #382)<commit_description><fixed_code> } WebPFreeDecBuffer(webp_image); stream=(unsigned char*) RelinquishMagickMem...
<vulnerable_code> out += !/^\s*(function|\([^)]*\)\s*=>)/m.test(tmp) ? 'function ' + tmp : tmp } else if (util.isObject(source)) { if (util.isRegExp(source)) { out += source.toString() } else if (util.isDate(source)) { out += 'new Date("' + source.toJSON() + '")' } else if (util.isError(sou...
<vulnerable_code> ], 'regex': [ /test(?:it)?/ig, '/test(?:it)?/gi' ], 'object': [ { a: 1, b: 2 }, new Float64Array([1e12, 2000000, 3.1415, -4.9e2, 5]), 'new Float64Array([1000000000000, 2000000, 3.1415, -490, 5])', 'toString' ] } <commit_title>[PATCH] fix: for ghsa-3fjq-93xj-3f3f<commit...
<vulnerable_code>#include <soc.h> #include "arm_core_mpu_dev.h" #include <sys/__assert.h> #include <linker/linker-defs.h> #define LOG_LEVEL CONFIG_MPU_LOG_LEVEL { u32_t r_addr_start; u32_t r_addr_end; r_addr_start = SYSMPU->WORD[r_index][0]; r_addr_end = SYSMPU->WORD[r_index][1]; if (start >= r_addr_start && (s...
<vulnerable_code> { imageSrc = new URL(null, src.toASCIIString(), new Handler()); } else { if (!diagram.getUniverse().isImageDataInlineOnly()) { try ...
<vulnerable_code> def test_oom(self, test_file): with pytest.raises(UnidentifiedImageError): with Image.open(test_file) as im: im.load() <commit_title>[PATCH 1/5] Prevent DOS with large SAMPLESPERPIXEL in Tiff IFD<commit_description>A large value in the SAMPLESPERPIXEL tag could...
<vulnerable_code> @pytest.mark.timeout(2) def test_oom(self, test_file): with pytest.raises(UnidentifiedImageError): with Image.open(test_file) as im: pass <commit_title>[PATCH 1/5] Prevent DOS with large SAMPLESPERPIXEL in Tiff IFD<commit_description>A large value in the SA...
<vulnerable_code> def test_oom(self, test_file): with pytest.raises(UnidentifiedImageError): with pytest.warns(UserWarning): with Image.open(test_file) as im: pass @pytest.mark.skipif(not is_win32(), reason="Windows only") class TestFileTiffW32: def test...
<vulnerable_code> if samples_per_pixel > MAX_SAMPLESPERPIXEL: # DOS check, samples_per_pixel can be a Long, and we extend the tuple below logger.error("More samples per pixel than can be decoded: %s", samples_per_pixel) raise SyntaxError("Invalid value for samples per pixel")...
<vulnerable_code> } } Var JavascriptArray::EntryReverse(RecyclableObject* function, CallInfo callInfo, ...) { // Note : since we are reversing the whole segment below - the functionality is not spec compliant already. length = pArr->length; SparseArraySegmentBas...
<vulnerable_code> if (interpolation) { result = result .replace(/^((?:\*|[1-6])?)(>)/g, "$1`$2") .replace(/^(<|@|#|-|\:|\])/g, "`$1") .replace(/(,|\;|\&|\|)/g, "`$1") .replace(/(\(|\)|\{|\})/g, "`$1") .replace(/('|’|‘|‛|‚)/g, "`$1")<commit_title>[PATCH 2/2] Escaping for PowerShell af...
<vulnerable_code> t.is(actual, expected); }, title(_, { input, interpolation, quoted, shellName }) { input = input.replace(/\u{0}/gu, "\\x00"); interpolation = interpolation ? "interpolation" : "no interpolation"; quoted = quoted ? "quoted" : "not quoted"; <commit_title>[PATCH 2/2] Escaping for Power...
<vulnerable_code> ksmbd_close_tree_conn_fds(work); ksmbd_tree_conn_disconnect(sess, tcon); return 0; } <commit_title>[PATCH] ksmbd: fix use-after-free bug in smb2_tree_disconect<commit_description>smb2_tree_disconnect() freed the struct ksmbd_tree_connect, but it left the dangling pointer. It can be accessed again u...
<vulnerable_code> pos = (qpos + i) % 8; npx = px + xpostab[pos]; npy = py + ypostab[pos]; line = data + npy * wpl; val = GET_DATA_BIT(line, npx); if (val) {<commit_title>[PATCH] Issue 23433 in oss-fuzz: Heap-buffer-overflow in<commit_description><fixed_code> pos = ...
<vulnerable_code> u_char *ptr; if ((ptr = malloc(len)) == NULL) { fprintf(stderr, "ERROR in %s:%s() line %d: Unable to malloc() %zu bytes", file, funcname, line, len); exit(-1); } ptr = NULL; } /** * Print various packet statistics */<commit_title>[PATCH] Bug #484 CVE-2018-17582 Chec...
<vulnerable_code> /* * We should read the pcap file, and cache the results */ pktdata = (u_char *)pcap_next(pcap, pkthdr); if (pktdata != NULL) { if (*prev_packet == NULL) { /* /* * Read pcap file as normal...
<vulnerable_code> } /*Before sending any packet, setup the schedule with the proper parameters*/ while((packet = pcap_next(local_handle,&header))) { pkt_counter++; /*increment number of packets seen*/ memcpy(&sched[i].pkthdr, &header, sizeof(struct pcap_pkthdr)); } /*Modify each pa...
<vulnerable_code> assert(pcap); while ((pktdata = pcap_next(pcap, &pkthdr)) != NULL) { packetnum++; dbgx(1, "Packet " COUNTER_SPEC, packetnum);<commit_title>[PATCH] Bug #484 CVE-2018-17582 Check for corrupt PCAP files<commit_description>* Check for packets that are larger than 262144 bytes...
<vulnerable_code> * Keep sending while we have packets or until * we've sent enough packets */ while ((pktconst = pcap_next(pin, pkthdr_ptr)) != NULL) { packetnum++; dbgx(2, "packet " COUNTER_SPEC " caplen %d", packetnum, pkthdr.caplen); <commit_title>[PATCH] Bug #484 CVE-2018-17582 Ch...
<vulnerable_code># by the Apache License, Version 2.0 from collections import defaultdict from rptest.services.cluster import cluster from rptest.util import wait_until_result from rptest.clients.types import TopicSpec from time import sleep, time from os.path import join import uuid import random from ducktape.util...
<vulnerable_code>#include "ll_filter.h" #define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HCI_DRIVER) #define LOG_MODULE_NAME bt_ctlr_llsw_ctrl #include "common/log.h" #if defined(CONFIG_BT_CTLR_CONN_RSSI)<commit_title>[PATCH] Bluetooth: controller: legacy: Add missing BT_DEBUG_ENABLED<commit_description><fixed_code>...
<vulnerable_code>#include <bluetooth/hci.h> #define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HCI_DRIVER) #define LOG_MODULE_NAME bt_ctlr_llsw_ll #include "common/log.h" #include "hal/cpu.h"<commit_title>[PATCH] Bluetooth: controller: legacy: Add missing BT_DEBUG_ENABLED<commit_description><fixed_code> #include <blue...
<vulnerable_code>#define ADDR_TYPE_ANON 0xFF #define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HCI_DRIVER) #define LOG_MODULE_NAME bt_ctlr_llsw_llfilter #include "common/log.h" #include "hal/debug.h"<commit_title>[PATCH] Bluetooth: controller: legacy: Add missing BT_DEBUG_ENABLED<commit_description><fixed_code> #defi...
<vulnerable_code> "sPaginationType": "full_numbers", language: $.DataTableLanguage }); $("#scenecontent #devicename").val(unescape(name)); $("#scenecontent #devicedescription").val(unescape(description)); $("#scenecontent #combodevice").html(""); var bigtext = TranslateStatusShort(item.Statu...
<vulnerable_code> (void) SetImageType(huffman_image,BilevelType); write_info=CloneImageInfo((ImageInfo *) NULL); SetImageInfoFile(write_info,file); (void) SetImageType(image,BilevelType); (void) SetImageDepth(image,1); write_info->compression=Group4Compression; write_info->type=BilevelType; (void) SetIma...
<vulnerable_code>import javax.servlet.http.HttpServletResponse; import org.apache.commons.io.IOUtils; import org.jsoup.nodes.Element; import org.slf4j.LoggerFactory; import com.vaadin.flow.component.Component; if (parameter.hasCustomMessage()) { additionalInfo = "Reason: " + parameter.getCustomMes...
<vulnerable_code> return False parsed_uri = urllib.parse.urlparse(uri) if parsed_uri.hostname and not ( parsed_uri.hostname == "." or parsed_uri.hostname.startswith("localhost") ): return False scheme = parsed_uri.scheme if scheme == "" or scheme == "file": r...
<vulnerable_code> assert is_local_uri("file://localhost:5000/mlruns") assert is_local_uri("file://127.0.0.1/mlruns") assert is_local_uri("file://127.0.0.1:5000/mlruns") assert not is_local_uri("file://myhostname/path/to/file") assert not is_local_uri("https://whatever")<commit_title>[PATCH] Improve ...
<vulnerable_code> bz3_state->cm_state = malloc(sizeof(state)); bz3_state->swap_buffer = malloc(bz3_bound(block_size)); bz3_state->sais_array = malloc((block_size + 128) * sizeof(s32)); memset(bz3_state->sais_array, 0, sizeof(s32) * (block_size + 128)); bz3_state->lzp_lut = calloc(1 << LZP_DICTIONAR...
<vulnerable_code> ): """Initialize an PALValidation instance Args: solution_expression_name (str): Name of the expected solution expressions. If passed, solution_expression_type must be passed as well solution_expression_type (str): ast type of the expected solution expression...
<vulnerable_code>import multiprocessing import sys from io import StringIO from multiprocessing import Pool from typing import Dict, Optional from pydantic import BaseModel, Field queue.put(repr(e)) def run(self, command: str, timeout: Optional[int] = None) -> str: """Run command with own glob...
<vulnerable_code>"""Test LLM PAL functionality.""" import ast import sys import pytest from langchain.chains.pal.base import PALChain, PALValidation _MATH_SOLUTION_1 = """ def solution(): \"\"\"Olivia has $23. She bought five bagels for $3 each. How much money does she have left?\"\"\" money_initial = 23 ...
<vulnerable_code> retHTML += '<div class="tooDamnBig" doc_id="' + encodeURIComponent(JSON.stringify(input._id)) + '" ' + 'doc_prop="' + input.attribu + '" title="Max prop size: ' + input.maxSize + '">'; retHTML += input.display + '<br>~' + input.humanSz; retHTML += '<br>Preview:' + input.preview; r...
<vulnerable_code> input._id ) { retHTML += '<div class="tooDamnBig" doc_id="' + encodeURIComponent(JSON.stringify(input._id)) + '" ' + 'doc_prop="' + input.attribu + '" title="Max prop size: ' + input.maxSize + '">'; retHTML += input.display + '<br>~' + input.humanSz; retHTML += '<br>Preview:' + ...
<vulnerable_code>import $ from 'jquery'; import renderjson from 'renderjson'; import CodeMirror from './codeMirrorLoader'; function getParameterByName(name) { name = name.replace(/\[/, '\\[').replace(/[\]]/, '\\]'); // Set the element with spinner for now target.html(spinner); $.get(`${makeCollectionUrl...