text
stringlengths
79
3.72M
<vulnerable_code> // If there is no file name then we can't do anything with it. if (!qfile_name.isEmpty()) { // We use the dir object to create the path in the temporary directory. // Unfortunately, we need a dir ojbect to do this as it's not a static function. ...
<vulnerable_code> def check_mounted(secdir): whatsmounted = cmd_exec.run("mount")['retout'] whatsmounted_converted = config.convert(whatsmounted) for line in whatsmounted_converted: tokens = line.split() tmpfs = False if len(tokens) < 3: continue if tokens[0] == ...
<vulnerable_code><commit_title>[PATCH] secure_mount: use /proc/self/mountinfo<commit_description>The function `check_mounted()` is parsing the output of the `mount` command. This command can have an unknown number of spaces, that can break the parsing logic (and produces security issues) This commit take the mount in...
<vulnerable_code> ND_TCHECK2(*tptr, 1); alen = *tptr++; while (tmp && alen < tmp) { ND_PRINT((ndo, "\n\t Area address (length: %u): %s", alen, isonsap_string(ndo, tptr, alen)));<commit_title>[PATCH] CVE-2017-12999/IS-IS: Add a missing length check.<comm...
<vulnerable_code> return True def sql_execute(self, sentence): self.cursor.execute(sentence) return self.cursor.fetchall() def sql_one_row(self, sentence, column): self.cursor.execute(sentence) return self.cursor.fetchone()[column] def sql_insert(self, sentence): ...
<vulnerable_code> d = db.sentences_stats('get_data') n = db.sentences_stats('all_networks') ('clean_online') rows = db.sentences_stats('get_clicks') c = rows[0][0] rows = db.sentences_stats('get_sessions') s = rows[0][0] rows = db.sentences_stats('get_online') o = rows[0][0] ret...
<vulnerable_code> @app.route("/tping", methods=["POST"]) def receivePing(): vrequest = request.form['id'] db.sentences_victim('report_online', [vrequest]) return json.dumps({'status' : 'OK', 'vId' : vrequest});<commit_title>[PATCH] SQL Insert error for some region [FIXED]<commit_descripti...
<vulnerable_code>var router = express.Router(); var mysql = require('mysql'); var fs = require('fs'); var conn_params = { host : "ec2-52-1-159-248.compute-1.amazonaws.com", user : "root", if(Object.keys(req.files).length !== 0){ pic_path = req.files.fileUpload.path; }else{ var file = fs.create...
<vulnerable_code> ret = (*rctx->iodescr->read_fn)(rctx->ctx,rctx->iodescr, rctx->buffer,rctx->buffer_len,&bytesread); if(!ret) return FALSE; rctx->pub.next_input_byte = rctx->buffer; rctx->pub.bytes_in_buffer = bytesread; if(bytesread<1) return FALSE; return TRUE; } static void my_skip_input_data_fn(j_decomp...
<vulnerable_code> template <class M, class Size> void collect_symbols(const void *p, Size size, std::vector<typename M::symbol> &symbols) { Q_UNUSED(size) using elf_addr = typename M::elf_addr; using elf_header = typename M::elf_header; // collect special section addresses for (const elf_shdr *section = sectio...
<vulnerable_code> def _prepare_log_folder(self, directory: Path): """ Prepare the log folder and ensure its mode is 777. To handle log writing when tasks are impersonated, the log files need to be writable by the user that runs the Airflow command and the user via the UI (or...
<vulnerable_code><commit_title>[PATCH] =?UTF-8?q?fix=20#107=20=20=E4=BF=AE=E5=A4=8D=E5=8F=8D?=<commit_description><fixed_code> package org.hswebframework.web.workflow.enums; /** * @author zhouhao * @since 3.0.5 */ public enum ModelType { bpmn, json }
<vulnerable_code>import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import lombok.extern.slf4j.Slf4j; import org.activiti.bpmn.converter.BpmnXMLConverter; import org.activiti.bpmn.model.BpmnModel; import org.hswebframework.web.commons.entity.PagerResul...
<vulnerable_code> return wrapper REL = re.compile(r"""<([^>]*\srel\s*=\s*['"]?([^'">]+)[^>]*)>""", re.I) """ Regex for an HTML tag with 'rel="val"' attributes. """<commit_title>[PATCH] Limit the amount of whitespace to search/backtrack. Fixes<commit_description><fixed_code> return wrapper REL = re.compile(r"...
<vulnerable_code> assert cred.password == 'pity%' @pytest.mark.xfail(reason="#3659") @pytest.mark.timeout(1) def test_REL_DoS(): """<commit_title>[PATCH] Limit the amount of whitespace to search/backtrack. Fixes<commit_description><fixed_code> assert cred.password == 'pity%' @pytest.mark.timeout(...
<vulnerable_code> raise AttributeError("Attribute not defined: %s" % name) def _hkey(s): return s.title().replace('_', '-') class HeaderProperty(object): def __init__(self, name, reader=None, writer=str, default=''): return super(FormsDict, self).__getattr__(name) return self....
<vulnerable_code> import unittest import sys import bottle from bottle import request, tob, touni, tonat, json_dumps, HTTPError, parse_date from test import tools response['x-test'] = None self.assertEqual('None', response['x-test']) def test_expires_header(self): import datetime re...
<vulnerable_code> for (i = 0; i < hdr->n_sections && cursor < end; i++) { ut8 *sect_start = cursor; RCoreSymCacheElementSection *sect = &result->sections[i]; sect->vaddr = sect->paddr = r_read_ble (cursor, false, bits); if (sect->vaddr < page_zero_size) { sect->vaddr += page_zero_size; continue; ...
<vulnerable_code>} static RList *symbols(RBinFile *bf) { RList *res = r_list_newf ((RListFree)r_bin_symbol_free); r_return_val_if_fail (res && bf->o && bf->o->bin_obj, res); RCoreSymCacheElement *element = bf->o->bin_obj; size_t i; HtUU *hash = ht_uu_new0 (); if (!hash) { return res; } bool found = false; f...
<vulnerable_code> var token = extract(request, options); if (!token && request.auth.mode !== 'required') { return reply.continue({ credentials: {} }); } if (!token) {<commit_title>[PATCH] testing try mode for:<commit_description><fixed_code> var token = extract(request, options); ...
<vulnerable_code><commit_title>[PATCH] testing try mode for:<commit_description><fixed_code> var test = require('tape'); var Hapi = require('hapi'); var JWT = require('jsonwebtoken'); var secret = 'NeverShareYourSecret'; test('Auth mode \'try\' should not set isAuthenticated to true when no token sent', functio...
<vulnerable_code> if (length != 0) { chunk=(unsigned char *) AcquireQuantumMemory(length+MagickPathExtent, sizeof(*chunk)); if (length != 0) { chunk=(unsigned char *) AcquireQuantumMemory(length+ MagickPathExtent,sizeof(*chunk)); if (...
<vulnerable_code> $("#mainContent #extra").html(data.extra); $("#mainContent #newCols").html(''); if (data.subText !== '') { $('.tblFooters').html('<input type="submit" value="' + PMA_messages.strDone + '" onclick="processDependencies(\'' + data.primary_key + '\');">')...
<vulnerable_code> self.assertAllEqual(e, 1.0) self.assertAllEqual(list_ops.tensor_list_length(l), 0) @test_util.run_gpu_only def testFromTensorGPU(self): with context.device("gpu:0"):<commit_title>[PATCH] Check for element_shape in TensorListFromTensor<commit_description>PiperOrigin-RevId: 462468167<fix...
<vulnerable_code> printf("Sending SIGTERM to %u\n", pid); kill(pid, SIGTERM); // wait for not more than 10 seconds sleep(2); int monsec = 8; char *monfile; if (asprintf(&monfile, "/proc/%d/cmdline", pid) == -1) errExit("asprintf"); int killdone = 0; while (monsec) { FILE *fp = fopen(monfile, "r"); if (!...
<vulnerable_code> }); async function _alertFromGet(type) { if (urlParams.has(type)) { var msg = urlParams.get(type); var div = document.createElement("div"); div.innerHTML = msg; var text = div.textContent || div.innerText || ""; if (!empty(text)) { switch (type)...
<vulnerable_code> */ private static final long serialVersionUID = -1676145651108866745L; private final String userName; private final String password; // scrambled by base64 public PasswordCredential(String userName, String password) { this.us...
<vulnerable_code># Sorry for using pytest, these tests are mostly just for me. # Use pytest -vv for best results. import tempfile import generate_cases from parser import StackEffect def test_effect_sizes(): input_effects = [ x := StackEffect("x", "", "", ""), y := StackEffect("y", "", "", "opar...
<vulnerable_code> self.emit_line_directives = emit_line_directives self.comment = comment self.lineno = 1 filename = os.path.relpath(self.stream.name, ROOT) # Make filename more user-friendly and less platform-specific filename = filename.replace("\\", "/") if file...
<vulnerable_code> for (i = 1; (i < (ssize_t) dds_info->mipmapcount) && w && h; i++) { offset = (MagickOffsetType) ((w + 3) / 4) * ((h + 3) / 4) * texel_size; (void) SeekBlob(image, offset, SEEK_CUR); w = DIV2(w); h = DIV2(h); }<commit_title>[PATCH]<commit_description><f...
<vulnerable_code>namespace Exiv2 { using namespace Exiv2::Internal; WebPImage::WebPImage(BasicIo::AutoPtr io) : Image(ImageType::webp, mdNone, io) { /* =========================================== */ void WebPImage::readMetadata() { if (io_->open() != 0) throw Error(kerDataSourceOp...
<vulnerable_code><commit_title>[PATCH] Avoid negative integer overflow when `filesize <<commit_description><fixed_code> import system_tests class IntegerOverflowInWebpImageReadMetadata( metaclass=system_tests.CaseMeta): """ Regression test for the bug described in: https://github.com/Exiv2/exiv2/i...
<vulnerable_code> // Don't adjust tight list status til we've started the list. // Otherwise we loose the blank line between a paragraph and // a following list. if (!(node->type == CMARK_NODE_ITEM && node->prev == NULL && entering)) { tmp = get_containing_block(node); renderer->in_tight_list_item = ...
<vulnerable_code> break; case CMARK_NODE_STRONG: if (entering) { cmark_strbuf_puts(html, "<strong>"); } else { cmark_strbuf_puts(html, "</strong>"); } break; <commit_title>[PATCH 1/6] Ignore nested STRONGs during rendering<commit_description>STRONG, in most rendering engines, becomes b...
<vulnerable_code>#include "syntax_extension.h" #define BUFFER_SIZE 100 // Functions to convert cmark_nodes to XML strings. static CMARK_INLINE void indent(struct render_state *state) { int i; for (i = 0; i < state->indent; i++) { cmark_strbuf_putc(state->xml, ' '); } }<commit_title>[PATCH 1/6] Ignore nest...
<vulnerable_code> LIT("<!-- end list -->"); BLANKLINE(); } break; case CMARK_NODE_ITEM: if (cmark_node_get_list_type(node->parent) == CMARK_BULLET_LIST) { marker_width = 4; } else { list_number = cmark_node_get_list_start(node->parent); list_delim = cmark_node_get_list_de...
<vulnerable_code> break; case CMARK_NODE_LIST: break; case CMARK_NODE_ITEM: if (cmark_node_get_list_type(node->parent) == CMARK_BULLET_LIST) { LIT("\\[bu] 2"); } else { list_number = cmark_node_get_list_start(node->parent); tmp = node; while (tmp->prev) { ...
<vulnerable_code> while ((zipEntry = zipInputStream.getNextEntry()) != null) { foundEntry = true; final File destFile = new File(importSandboxDirectory, zipEntry.getName()); if (!zipEntry.isDirectory()) { ServiceUtilities.ensureFileCreated(d...
<vulnerable_code> Optional<URL> issuerOptional = openIdClientConfiguration.getIssuer(); if (issuerOptional.isPresent()) { String issuer = issuerOptional.get().toString(); return issuer.equalsIgnoreCase(iss) || audiences.contains(clientId) &&...
<vulnerable_code> return false; suppress_route: ip6_rt_put(rt); return true; } <commit_title>[PATCH] ipv6: do not free rt if FIB_LOOKUP_NOREF is set on suppress<commit_description><fixed_code> return false; suppress_route: if (!(arg->flags & FIB_LOOKUP_NOREF)) ip6_rt_put(rt); return true; }
<vulnerable_code> break; case OP_EXACT1: MOP_IN(OP_EXACT1); #if 0 DATA_ENSURE(1); if (*p != *s) goto fail; p++; s++; #endif if (*p != *s++) goto fail; DATA_ENSURE(0); p++; MOP_OUT; break; <commit_title>[PATCH] fix #57 : DATA_ENSURE() check must be before data a...
<vulnerable_code>package ca.uhn.fhir.jpa.api.config; import ca.uhn.fhir.jpa.api.model.WarmCacheEntry; import ca.uhn.fhir.jpa.model.entity.ModelConfig; import ca.uhn.fhir.jpa.model.entity.ResourceEncodingEnum; ))); // update setter javadoc if default changes public static final int DEFAULT_MAX_EXPANSION_SIZE = 1000;...
<vulnerable_code><commit_title>[PATCH] Address DOS issue in History operation<commit_description><fixed_code> package ca.uhn.fhir.jpa.api.model; public enum HistoryCountModeEnum { /** * Always include an accurate count in the response */ COUNT_ACCURATE, /** * Always include a count in the response, but cach...
<vulnerable_code>import ca.uhn.fhir.interceptor.api.IInterceptorBroadcaster; import ca.uhn.fhir.interceptor.api.Pointcut; import ca.uhn.fhir.interceptor.model.RequestPartitionId; import ca.uhn.fhir.jpa.api.dao.DaoRegistry; import ca.uhn.fhir.jpa.api.dao.IFhirResourceDao; import ca.uhn.fhir.jpa.api.svc.ISearchCoordinato...
<vulnerable_code>import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; /** * Log all captured SELECT queries * @return */ public String logSelectQueriesForCurrentThread(int... theIndexes) { * Log all captured SELECT querie...
<vulnerable_code>import com.github.benmanes.caffeine.cache.Caffeine; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.tuple.Pair; import org.hl7.fhir.instance.model.api.IIdType; import org.springframework.beans.factory.annota...
<vulnerable_code>import ca.uhn.fhir.jpa.model.entity.ResourceTable; import ca.uhn.fhir.jpa.model.entity.ResourceTag; import ca.uhn.fhir.jpa.model.entity.TagTypeEnum; import ca.uhn.fhir.jpa.provider.SystemProviderDstu2Test; import ca.uhn.fhir.jpa.searchparam.SearchParameterMap; import ca.uhn.fhir.model.api.ResourceMetad...
<vulnerable_code><commit_title>[PATCH] Address DOS issue in History operation<commit_description><fixed_code> package ca.uhn.fhir.jpa.dao.r4; import ca.uhn.fhir.jpa.partition.SystemRequestDetails; import ca.uhn.fhir.rest.api.server.IBundleProvider; import ca.uhn.fhir.util.BundleBuilder; import ca.uhn.fhir.util.StopWat...
<vulnerable_code>package ca.uhn.fhirtest.config; import ca.uhn.fhir.jpa.api.config.DaoConfig; import ca.uhn.fhir.jpa.config.BaseJavaConfigDstu2; import ca.uhn.fhir.jpa.model.entity.ModelConfig; import ca.uhn.fhir.jpa.search.HapiLuceneAnalysisConfigurer; retVal.setFilterParameterEnabled(true); retVal.setDefaultSear...
<vulnerable_code>package com.fasterxml.jackson.datatype.jsr310; import java.time.Duration; import java.time.temporal.TemporalAmount; assertEquals("The value is not correct.", Duration.ofSeconds(13498L, 8374), value); } @Test public void testDeserializationAsInt01() throws Exception {<commit_t...
<vulnerable_code>import com.fasterxml.jackson.databind.SerializationFeature; import org.junit.Test; import java.time.Instant; import java.time.LocalDate; import java.time.ZoneId; assertEquals("The value is not correct.", date, value); } @Test public void testDeserializationAsInt01Nanoseconds() thr...
<vulnerable_code> let element = await addon.tab.waitForElement(".project-description", { markAsSeen: true }); // Need to convert #[numbers] to solve conflict between tags and external Scratch player links. document.querySelectorAll(".project-description a").forEach((element) => { ...
<vulnerable_code> glfwSetClipboardString(CORE.Window.handle, text); #endif #if defined(PLATFORM_WEB) emscripten_run_script(TextFormat("navigator.clipboard.writeText('%s')", text)); #endif } return glfwGetClipboardString(CORE.Window.handle); #endif #if defined(PLATFORM_WEB) // Accessing clipboard data fr...
<vulnerable_code>import com.google.cloud.tools.jib.json.JsonTemplateMapper; import com.google.common.collect.ImmutableMap; import com.google.common.io.ByteStreams; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStre...
<vulnerable_code> for (i = c, o = datao; i; --i, o += 12) { size_t s; if (CHECKOVERFLOW(o,buf_size,12)) { exif_log (ne->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifMnoteCanon", "Short MakerNote");<commit_title>[PATCH] Ensure the MakerNote data pointers are initialized with NULL.<commit_description>This ensures th...
<vulnerable_code> for (i = c, o = datao; i; --i, o += 12) { size_t s; if (CHECKOVERFLOW(o, buf_size, 12)) { exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifMnoteDataFuji", "Short MakerNote");<commit_title>[PATCH] Ensure the MakerNote data pointers are initialized with NULL.<commit_description>This ens...
<vulnerable_code> tcount = 0; for (i = c, o = o2; i; --i, o += 12) { size_t s; if (CHECKOVERFLOW(o, buf_size, 12)) { exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifMnoteOlympus", "Short MakerNote");<commit_title>[PATCH] Ensure the MakerNote data pointers are initialized with NULL.<commit_description>...
<vulnerable_code> if (has_arguments) { literal_pool_p->status_flags |= (SCANNER_LITERAL_POOL_ARGUMENTS_IN_ARGS | SCANNER_LITERAL_POOL_NO_ARGUMENTS); } } literal_p->type = type; } if (type & (SCANNER_LITERAL_IS_DESTRUCTURED_ARG | SCANNER_LITERAL_IS_ARROW_DESTRUCTURED_ARG)) ...
<vulnerable_code> assert(arguments === -12.5) } f19(undefined, "A");<commit_title>[PATCH] Prevent arguments object creation if 'arguments' function<commit_description><fixed_code> assert(arguments === -12.5) } f19(undefined, "A"); function f20 (arguments, a = eval('arguments')) { assert(a === 3.1); assert(argum...
<vulnerable_code> goto err; } if (len != ALIGN(size, 4) + hdrlen) goto err; if (cb->dst_port != QRTR_PORT_CTRL && cb->type != QRTR_TYPE_DATA &&<commit_title>[PATCH] net: qrtr: fix another OOB Read in qrtr_endpoint_post<commit_description>This check was incomplete, did not consider size is 0: if (len != ALIGN(...
<vulnerable_code> if (sixel_decode(image,(unsigned char *) sixel_buffer,&sixel_pixels,&image->columns,&image->rows,&sixel_palette,&image->colors,exception) == MagickFalse) { sixel_buffer=(char *) RelinquishMagickMemory(sixel_buffer); ThrowReaderException(CorruptImageError,"CorruptImage"); } sixel...
<vulnerable_code>bool QHstsHeaderParser::parse(const QList<QPair<QByteArray, QByteArray>> &headers) { for (const auto &h : headers) { // We use '==' since header name was already 'trimmed' for us: if (h.first == "Strict-Transport-Security") { header = h.second; // RFC6797, 8....
<vulnerable_code> QVERIFY(parser.expirationDate() > QDateTime::currentDateTimeUtc()); QVERIFY(parser.includeSubDomains()); list.pop_back(); // Invalid (includeSubDomains twice): list << Header("Strict-Transport-Security", "max-age = 1000 ; includeSubDomains;includeSubDomains");<commit_title>[PATCH] ...
<vulnerable_code> def _fileopen(path, mode, basedir, pathinfo, basename=None): name = os.path.normpath(os.path.join(basedir, path)) if basename is None: basename = name<commit_title>[PATCH] [FIX] tools: verify path before opening<commit_description><fixed_code> def _fileopen(path, mode, basedir, pat...
<vulnerable_code> pass elif manifest_url: response = requests.get(manifest_url).text manifest = yaml.load(response, Loader=yaml.Loader) else: raise ValueError("You must provide either a manifest or a manifest_url") <commit_title>[PATCH] use safe_load for ya...
<vulnerable_code> pass elif url: response = requests.get(url).text spec = yaml.load(response, Loader=yaml.Loader) else: raise ValueError("You must provide a url or OpenAPI spec as a dict") <commit_title>[PATCH] use safe_load for yaml<commit_description><fix...
<vulnerable_code> regs = mrb->c->ci->stack+1; if (n == 0) { mrb_argnum_error(mrb, 0, 1, -1); } else if (n == 15) { name = mrb_obj_to_sym(mrb, RARRAY_PTR(regs[0])[0]); } else {<commit_title>[PATCH] vm.c: packed arguments length may be zero for `send` method.<commit_description><fixed_code> regs = m...
<vulnerable_code> # type=int, # kwargs={'recursive_max_size': 0}, # description="Limit the total size of all extracted files"), Option(short='r', long='rm', kwargs={'remove_after_execute': True}, Kwarg(name='recursive_max_size', defa...
<vulnerable_code> /* Set PCL render geometry. */ width=(size_t) floor(bounds.x2-bounds.x1+0.5); height=(size_t) floor(bounds.y2-bounds.y1+0.5); if (width > page.width) page.width=width; if (height > page.height)<commit_title>[PATCH] Fixes #4985: 4e+26 is outside the range of represent...
<vulnerable_code> pkp.eventBus.$on('selected:reviewer', function(reviewer) { $('#reviewerId').val(reviewer.id); $('[id^="selectedReviewerName"]').html(reviewer.fullName); $('#searchGridAndButton').hide(); $('#regularReviewerForm').show(); });<commit_title>[PATCH] pkp/pkp-lib#9411 Reviewer name is not es...
<vulnerable_code> _UNESCAPER_TEXT = re.compile( r'&lt;(/?)(h1|h2|b|tt|i|u|br(?: /)?|nobr(?: /)?|pre|a|sup|p|li|ul|ol)&gt;') _QUOTE = re.compile(r"(?:&quot;|&#x27;)") _A_HREF = re.compile(r'&lt;a href=((?:&quot;|&#x27;).*?(?:&quot;|&#x27;))&gt;') # TODO: Cleanup the accepted types! text = escape_attribute(text...
<vulnerable_code> ("<ol></ol>", None), ("<a href=\"xyz\">abc</a>", None), ("<a href=\"xyz\" target=\"123\">abc</a>", None), ("blah<a href=\"link0\">aaa</a>blah<a href=\"link1\" target=\"ttt\">bbb</a>", None), ("\"I am not a link\" target=\"still not a link\"", "&quot;I am...
<vulnerable_code> if (hdr->substreamid == info->num_ind_sub + 1) { //info->num_ind_sub++; avpriv_request_sample(track->par, "Multiple independent substreams"); ret = AVERROR_PATCHWELCOME; goto end; } else if (hdr->substreamid < info...
<vulnerable_code> oBatchMode, oCheckHostIP, oStrictHostKeyChecking, oCompression, oTCPKeepAlive, oNumberOfPasswordPrompts, oLogFacility, oLogLevel, oLogVerbose, oCiphers, oMacs, oPubkeyAuthentication, oKbdInteractiveAuthentication, oKbdInteractiveDevices, oHostKeyAlias, oDynamicForward, oPreferredAuthentications, ...
<vulnerable_code> * encrypted keys we cannot do this and have to load the * private key instead */ if (id->key != NULL && !options.identities_only) { if (try_identity(ssh, id)) { ident = format_identity(id); debug("Offering public key: %s", ident);<commit_title>[PATCH] added new client config optio...
<vulnerable_code> mock_ecdf.assert_called_once() mock_box.assert_called_once() mock_scatter.assert_called_once() # we're writing both report.csv and legend.csv self.assertEqual(mock...
<vulnerable_code> if output: analysis = Analysis(output) analysis.generate_report() else: raise ValueError("Missing -o option!") bbox_to_anchor=(0.5, -0.15) ) def generate_report(self): """ Compiles a report consisting of statis...
<vulnerable_code> (image->columns == 0) || (image->rows == 0)) { if (image->previous == (Image *) NULL) ThrowReaderException(CorruptImageError,"ImproperImageHeader"); DeleteImageFromList(&image); (void) ThrowMagickException(exception,GetMagickModule(), CorruptIma...
<vulnerable_code> import appdirs from . import errors SAFE_EXTENSION = "-safe.pdf" ARCHIVE_SUBDIR = "unsafe" return f"{os.path.splitext(self.input_filename)[0]}{self.suffix}" def announce_id(self) -> None: log.info(f"Assigning ID '{self.id}' to doc '{self.input_filename}'") def set_output_di...
<vulnerable_code>from ..isolation_provider.base import IsolationProvider from ..logic import DangerzoneCore from ..settings import Settings from ..util import get_resource_path log = logging.getLogger(__name__) args = ["open", "-a", "Preview.app", filename] # Run args_str = " ".jo...
<vulnerable_code> s.add("org.apache.shiro.realm.jndi.JndiRealmFactory"); s.add("org.apache.shiro.jndi.JndiObjectFactory"); DEFAULT_NO_DESER_CLASS_NAMES = Collections.unmodifiableSet(s); } <commit_title>[PATCH] Fix #2658<commit_description><fixed_code> s.add("org.apache.shiro.realm.jn...
<vulnerable_code> of_fdt_unflatten_tree(unittest_data, NULL, &unittest_data_node); if (!unittest_data_node) { pr_warn("%s: No tree to attach; not running tests\n", __func__); return -ENODATA; } <commit_title>[PATCH] of: unittest: fix memory leak in unittest_data_add<commit_description>In unittest_data_add, a copy...
<vulnerable_code># Pack function arguments for a call @type_check_wrapper def pack_arguments(signature, args, context, stmt_expr, is_external_call): pos = getpos(stmt_expr) setters = [] staticarray_offset = 0 maxlen = sum([get_size_of_type(arg.typ) for arg in signature.args]) * 32 if is_external_ca...
<vulnerable_code> type_definition = get_type_from_annotation( arg.annotation, location=DataLocation.CALLDATA, is_immutable=True ) if isinstance(type_definition, StructDefinition) and type_definition.is_dynamic_size: # this is a temporary restriction and...
<vulnerable_code> prefix = filename.substring(0, pos) + "-"; suffix = filename.substring(pos); } // File.createTempFile requires the prefix to be at least three characters long if (prefix.length() < 3) prefix = "download-"; } if (tempFolderPath == null) return Fil...
<vulnerable_code>import java.net.URI; import java.net.URLConnection; import java.net.URLEncoder; import java.security.GeneralSecurityException; import java.security.KeyStore; import java.security.SecureRandom; * with file response. The default value is <code>null</code>, i.e. using * the system's default temp...
<vulnerable_code>import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.nio.file.Files; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.ArrayList; * the system's default tempopary folder. * * @return the temporary folder path * @see <a href="htt...
<vulnerable_code>import java.lang.reflect.Type; import java.nio.file.Files; import java.nio.file.Paths; import java.util.*; import com.fasterxml.jackson.databind.ObjectMapper; @Override public File convert(ResponseBody value) throws IOException { File file = File.cr...
<vulnerable_code>/******************************************************************************* * Copyright (c) 2000, 2021 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this backEdge = TR::CFGEdge...
<vulnerable_code> new (comp()->trHeapMemory()) TR_VirtualGuardSelection( kind, testType, thisClass); addTarget( comp()->trMemory(), inliner,<commit_title>[PATCH] Be more confident about single interface implementer profiled<commit_description><fixed_code> ...
<vulnerable_code> self.current_mtime = 0 self.current_mtime_usec = 0 if op.existing: for name in op.top_dir_basenames: try: path = os.path.join(self.save_path, name) if os.path.isdir(path): # file not found is ok ...
<vulnerable_code> name = name.substring(i + 1); } ig.createProjectFromXML(name, stdin); return 0; }<commit_title>[PATCH] [FIXED SECURITY-108] Check job name created via CLI<commit_description><fixed_code> name = name.substring(i + 1); } Jenkins.checkG...
<vulnerable_code>#include <asm/thread_notify.h> #include <asm/stacktrace.h> #include <asm/mach/time.h> #ifdef CONFIG_CC_STACKPROTECTOR #include <linux/stackprotector.h> clear_ptrace_hw_breakpoint(p); if (clone_flags & CLONE_SETTLS) thread->tp_value = childregs->ARM_r3; thread_notify(THREAD_NOTIFY_COPY, thread);...
<vulnerable_code>#endif case PTRACE_GET_THREAD_AREA: ret = put_user(task_thread_info(child)->tp_value, datap); break; <commit_title>[PATCH] ARM: 7735/2: Preserve the user r/w register TPIDRURW on<commit_description><fixed_code> #endif case PTRACE_GET_THREAD_AREA: ret = put_user(task_thread_inf...
<vulnerable_code> return regs->ARM_r0; case NR(set_tls): thread->tp_value = regs->ARM_r0; if (tls_emu) return 0; if (has_tls_reg) { int reg = (instr >> 12) & 15; if (reg == 15) return 1; regs->uregs[reg] = current_thread_info()->tp_value; regs->ARM_pc += 4; return 0; }<commit_title>[PATCH] ARM: 7735/...
<vulnerable_code> Prism.plugins.toolbar.registerButton('copy-to-clipboard', function (env) { var linkCopy = document.createElement('button'); linkCopy.textContent = 'Copy'; var element = env.element; <commit_title>[PATCH 2/5] PHP: Added support for PHP 8.0 features (#2591)<commit_description><fixed_code> Prism....
<vulnerable_code>!function(){if("undefined"!=typeof self&&self.Prism&&self.document)if(Prism.plugins.toolbar){var i=window.ClipboardJS||void 0;i||"function"!=typeof require||(i=require("clipboard"));var c=[];if(!i){var o=document.createElement("script"),t=document.querySelector("head");o.onload=function(){if(i=window.C...
<vulnerable_code> * Modified by Miles Johnson: http://milesj.me * Rewritten by Tom Pavelec * * Supports PHP 5.3 - 7.4 */ (function (Prism) { Prism.languages.php = { 'delimiter': { pattern: /\?>$|^<\?(?:php(?=\s)|=)?/i, alias: 'important' }, 'comment': [ /\/\*[\s\S]*?\*\/|\/\/.*|#.*/ ], 'variable...
<vulnerable_code>!function(a){a.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:[/\/\*[\s\S]*?\*\/|\/\/.*|#.*/],variable:/\$+(?:\w+\b|(?={))/i,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},keyword:[...
<vulnerable_code> 'operator': /&&|\|\||[-+*^%÷⊻&$\\]=?|\/[\/=]?|!=?=?|\|[=>]?|<(?:<=?|[=:|])?|>(?:=|>>?=?)?|==?=?|[~≠≤≥'√∛]/, 'punctuation': /::?|[{}[\]();,.?]/, // https://docs.julialang.org/en/v1/base/numbers/#Base.im 'constant': /\b(?:(?:NaN|Inf)(?:16|32|64)?|im|pi|e|catalan|eulergamma|golden)\b|[πℯγφ]/ };<commit...