text
stringlengths
79
3.72M
<vulnerable_code> }); } function initDashboard () { // Populate naming-scheme based datastructures fieldLabel: 'Show the past', width: 90, allowBlank: false, regex: /\d+/, regexText: 'Please enter a number', value: TimeRange.relativeStartQuantity }); fieldLabel: 'Until', width: 90...
<vulnerable_code> yield index def load_module(module_path, member=None): module_name = splitext(basename(module_path))[0] try: # 'U' is default from Python 3.0 and deprecated since 3.9<commit_title>[PATCH] Fix XSS in some dashboards queries (#2785)<commit_description>* prevent xss on time range text fields...
<vulnerable_code>from graphite.worker_pool.pool import stop_pools class TestCase(OriginalTestCase): def tearDown(self): stop_pools() " (expected %d)" % (response.status_code, status_code) ) xss = response.content.find(b"<") != -1 or response.content.find(b">") != -1 ...
<vulnerable_code> avpriv_request_sample(pb, "Primer pack item length %d", item_len); return AVERROR_PATCHWELCOME; } if (item_num > 65536) { av_log(mxf->fc, AV_LOG_ERROR, "item_num %d is too large\n", item_num); return AVERROR_INVALIDDATA; }<commit_title>[PATCH] avformat/mxfdec...
<vulnerable_code> }; RoomElement.prototype.render = function () { this.$el.html(this.template(this.options)); this.$el.find('.tooltip-top').tooltipster({<commit_title>[PATCH] Remove XSS vulnerability on the main page<commit_description>Before there was no protection stopping users from submitting their own...
<vulnerable_code>import io.dropwizard.validation.selfvalidating.ViolationCollector; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; import uk.org.lidalia.slf4jext.Level; import uk.org.lidalia.slf4jtest.LoggingEvent; import uk.org.lidalia.slf4jtest.TestLoggerFactory; import static org.assertj....
<vulnerable_code> RETURN_FALSE; } if (ncolors <= 0) { php_error_docref(NULL, E_WARNING, "Number of colors has to be greater than zero"); RETURN_FALSE; } gdImageTrueColorToPalette(im, dither, ncolors); RETURN_TRUE; }<commit_title>[PATCH] Fix bug#72697 - select_colors write out-of-bounds<commit_description>(c...
<vulnerable_code> if (rv < 0) goto out; if (is_auth_req()) { rv = read_authkey(); if (rv < 0) goto out;<commit_title>[PATCH] Revert "Refactor: main: substitute is_auth_req macro"<commit_description>This reverts commit da79b8ba28ad4837a0fee13e5f8fb6f89fe0e24c. authfile != authkey Signed-off-by: Jan Friesse ...
<vulnerable_code>*/ static int get_registers(rtl8150_t * dev, u16 indx, u16 size, void *data) { return usb_control_msg(dev->udev, usb_rcvctrlpipe(dev->udev, 0), RTL8150_REQ_GET_REGS, RTL8150_REQT_READ, indx, 0, data, size, 500); } static int set_registers(rtl8150_t * dev, u16 indx, u16 size, void ...
<vulnerable_code> do_blankline(h_env, obuf, indent, 0, h_env->limit); } save_fonteffect(h_env, obuf); renderTable(tbl, tbl_width, h_env); restore_fonteffect(h_env, obuf); obuf->flag &= ~RB_IGNORE_P;<commit_title>[PATCH] Prevent infinite recursion with nested table and textarea<commit_description>Bug-Debi...
<vulnerable_code>#define fixed_table_width(t)\ (get_table_width(t,t->fixed_width,t->cell.fixed_width,CHECK_MINIMUM)) void renderCoTable(struct table *tbl, int maxlimit) { int i, col, row; int indent, maxwidth; for (i = 0; i < tbl->ntable; i++) { t = tbl->tables[i].ptr; col = tbl->tables[i].col;<commit...
<vulnerable_code> if (!dev) return -ENOMEM; err = dev_get_valid_name(net, dev, name); if (err) goto err_free_dev; dev_net_set(dev, net);<commit_title>[PATCH] tun: allow positive return values on dev_get_valid_name()<commit_description><fixed_code> if (!dev) return -ENOMEM; err = dev_get_valid_name(...
<vulnerable_code> if (this.layout == null) { var iframeOnLoad = "pimcore.globalmanager.get('document_" + this.page.id + "').preview.iFrameLoaded()"; // preview switcher only for pages not for emails var tbar = []; if(this.page.getType() == "page") { ...
<vulnerable_code> } /* Encryption key present ? */ iPinCount = iACLen - 1; if (buf[iOffset] & 0x20) { int iSC;<commit_title>[PATCH] fixed UNKNOWN READ<commit_description>Reported by OSS-Fuzz https://oss-fuzz.com/testcase-detail/5681169970757632<fixed_code> } /* Encryption key present ? */ ...
<vulnerable_code> return cmd; } /* Check for Skylake-like CPUs (for RSB handling) */ static bool __init is_skylake_era(void) { if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL && boot_cpu_data.x86 == 6) { switch (boot_cpu_data.x86_model) { case INTEL_FAM6_SKYLAKE_MOBILE: case INTEL_FAM6_SKYLAKE_DESKTOP: ...
<vulnerable_code> const index = fs.readFileSync(indexFile).toString(); const newIndex = index.replace( / \* @version \d+\.\d+\.\d+/, ` * @version ${version}` ); <commit_title>[PATCH] refactor: fix non-trivial regular expression linting errors<commit_description>- Ungroup unused capturing groups (`no-unused-capturin...
<vulnerable_code> * @returns {string} The escaped argument. */ function escapeArgBash(arg, interpolation, quoted) { let result = arg.replace(/\0/g, ""); if (interpolation) { result = result .replace(/\\/g, "\\\\") .replace(/\n/g, " ") .replace(/(^|\s)(~|#)/g, "$1\\$2") .replace(/(\*|\?...
<vulnerable_code> * @returns {string} The escaped argument. */ function escapeArgCmd(arg, interpolation, quoted) { let result = arg.replace(/\0/g, "").replace(/\n|\r/g, " "); if (interpolation) { result = result .replace(/\^/g, "^^") .replace(/(<|>)/g, "^$1") .replace(/(")/g, "^$1") .r...
<vulnerable_code>export const windowsPath = () => fc .tuple( fc.char().filter((v) => /[A-Z]/.test(v)), fc.string() ) .map(([driveLetter, path]) => `${driveLetter}:\\${path}`);<commit_title>[PATCH] refactor: fix non-trivial regular expression linting errors<commit_description>- Ungroup unused c...
<vulnerable_code> const result = quoteAll(args, options); for (const entry of result) { t.is(typeof entry, "string"); t.regex(entry, /^(?<q>"|').*(\k<q>)$/); } t.pass(); // in case `result.length === 0` const entry = result[0]; t.is(typeof entry, "string"); t.regex(entry, /^(?<q...
<vulnerable_code> }, title(_, { input, interpolation, quoted, shellName }) { input = input .replace(/\0/g, "\\u{0000}") .replace(/\t/g, "\\t") .replace(/\n/g, "\\n") .replace(/\v/g, "\\v") .replace(/\f/g, "\\f") .replace(/\r/g, "\\r") .replace(/\u0085/g, "\\u{0085}") ...
<vulnerable_code> */ public static boolean verifyResponse(Response response, String requestUrl, HttpServletRequest request) { if (!response.isSignatureValid()) { debug.message("verifyResponse: Response's signature is invalid."); return false;<commit_title>[PATCH] deny unsigne...
<vulnerable_code> #define INIT_ATTR(a,t,l) (a)->hdr.type=(pj_uint16_t)(t), \ (a)->hdr.length=(pj_uint16_t)(l) #define ATTR_HDR_LEN 4 static pj_uint16_t GETVAL16H(const pj_uint8_t *buf, unsigned pos) { status = pj_stun_msg_check(pdu, pdu_len, options); if (status !=...
<vulnerable_code> this.states = new Statehood.Definitions(this.settings.state); this.auth = new Auth(this); this._router = new Call.Router(this.settings.router); this._corsPaths = {}; this._defaultRoutes(); this.plugins = {}; // Registered plugin APIs by plugin name meth...
<vulnerable_code>// Load modules var Hoek = require('hoek'); var Defaults = require('./defaults'); // Declare internals return false; } settings._headers = settings.headers.concat(settings.additionalHeaders).join(','); settings._methods = settings.methods.concat(settings.additionalMethods).join(...
<vulnerable_code> 'If-None-Match' ], additionalHeaders: [], methods: [ 'GET', 'HEAD', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS' ], additionalMethods: [], exposedHeaders: [ 'WWW-Authenticate', 'Server-Authorization'<...
<vulnerable_code> // Apply settings in order: {connection} <- {handler} <- {realm} <- {route} var handlerDefaults = Handler.defaults(method, handler, connection.server); var base = Hoek.applyToDefaultsWithShallow(connection.settings.routes, handlerDefaults, ['bind']); base = Hoek.applyToDefaultsWithShal...
<vulnerable_code> maxAge: Joi.number(), headers: Joi.array(), additionalHeaders: Joi.array(), methods: Joi.array(), additionalMethods: Joi.array(), exposedHeaders: Joi.array(), additionalExposedHeaders: Joi.array(), credentials: Joi.boolean(),<commit_title>...
<vulnerable_code> server.connection({ routes: { cors: false } }); server.route({ method: 'GET', path: '/', handler: handler }); server.inject({ method: 'OPTIONS', url: '/' }, function (res) { expect(res.statusCode).to.equal(404); done(); server.connection({ route...
<vulnerable_code> server.inject('/', function (res) { expect(res.statusCode).to.equal(299); expect(res.result).to.equal(null); done(); });<commit_title>[PATCH] Partial implementation for #2840<commit_description><fixed_code> server.inje...
<vulnerable_code> expect(res.headers['content-type']).to.equal('text/plain; something=something, charset=ISO-8859-1'); expect(res.headers['access-control-allow-origin']).to.equal('*'); expect(res.headers['access-control-allow-credentials']).to.not.exist(); expect(res.heade...
<vulnerable_code> if (gf_bs_available(bs) <= 2) { var = gf_bs_read_int(bs, 8); if (var != 0x80) { GF_LOG(GF_LOG_WARNING, GF_LOG_CODING, ("[avc-h264] SEI user message has less than 2 bytes remaining but no end of sei found\n")); } if (bs_dest) gf_bs_write_int(bs_dest, 0x80, 8); break;<commit_title>[P...
<vulnerable_code> * to be intended in a v3 query. */ max_delay = IGMPV3_MRC(ih3->code)*(HZ/IGMP_TIMER_SCALE); } else { /* v3 */ if (!pskb_may_pull(skb, sizeof(struct igmpv3_query))) return;<commit_title>[PATCH] igmp: Avoid zero delay when receiving odd mixture of IGMP<commit_description><fixed_code> * t...
<vulnerable_code>import re import logging import uuid import pypandoc import knowledge_graph import random app.logger.info(f"Converting to HTML with pandoc >>> '{md_file_path}' ...") html = pypandoc.convert_file(md_file_path, "html5", format='...
<vulnerable_code><commit_title>[PATCH] Upgraded Google lib<commit_description><fixed_code> /** * Copyright 2019 Google Inc. All Rights Reserved. * * 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 Lice...
<vulnerable_code><commit_title>[PATCH] Upgraded Google lib<commit_description><fixed_code> /** * Copyright 2019 Google Inc. All Rights Reserved. * * 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 Lice...
<vulnerable_code> return AVERROR(ENOMEM); hdr = *phdr; init_get_bits8(&gb, buf, size); err = ff_ac3_parse_header(&gb, hdr); if (err < 0) return AVERROR_INVALIDDATA;<commit_title>[PATCH] avcodec/ac3_parser: Check init_get_bits8() for failure<commit_description><fixed_code> return ...
<vulnerable_code>import _ from 'lodash'; import vCard from 'vcf'; import { arrayToBinaryString, binaryStringToArray, decodeBase64, decryptMessageLegacy, getFingerprint, getMatchingKey, keyInfo } from 'pmcrypto'; import { VERIFICATION_STATUS, EMAIL_FORMATING, KEY_FLAGS, LARGE_KEY_SIZE, SEND_...
<vulnerable_code><commit_title>[PATCH] Improve autocrypt parsing<commit_description><fixed_code> import { binaryStringToArray, decodeBase64 } from 'pmcrypto'; const MANDATORY_FIELDS = ['keydata', 'addr']; const OPTIONAL_FIELDS = ['prefer-encrypt']; const CRITICAL_FIELDS = OPTIONAL_FIELDS.concat(MANDATORY_FIELDS); // ...
<vulnerable_code><commit_title>[PATCH] Improve autocrypt parsing<commit_description><fixed_code> import { getParsedAutocryptHeader } from '../../../../src/app/message/services/autocryptHelper'; const validKeyData = { base64: ` xjMEYAffqRYJKwYBBAHaRw8BAQdAFKaMT9wf5w6gMeW6X+6CSKCwTw5ohqESZQXzNfHG+CrN FDxwcm90b25xYUB...
<vulnerable_code> const param = part.split('='); const key = param[0]; if (!key || blacklist.includes(key.split('.')[0])) { return; } <commit_title>[PATCH] fix: Checks all parts while parsing config params.<commit_description><fixed_code> const param = part.split('=')...
<vulnerable_code> dropdown: '&&dropdown&&', correct: '&&correct&&', wrong: '&&wrong&&', empty: '&&empty&&' }, GENDER: { }, getTextVoiceArrayFromElement: function($element, presenterLangTag) { var $clone = $element.clone(); ...
<vulnerable_code>import com.google.gwt.dom.client.Element; import com.google.gwt.dom.client.Node; import com.google.gwt.dom.client.NodeList; import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.ui.HTML; import com.lorepo.icf.utils.TextToSpeechVoice; public final static String BREAK_TEXT = "&&break&...
<vulnerable_code> @Test public void properHTMLTest() { String html = "<div> test-string <b>test-string2</b> <br/> </div>"; String expected = "test-string test-string2"; String result = WCAGUtils.getCleanText(html); assertEquals(expected, result); @Test public void testWithLessThanSign() { String html = ...
<vulnerable_code> }); }; presenter.saveSentences = function(texts) { if (!presenter.saveNextSentences) return; presenter.saveNextSentences = false; let textVoices = []; for (let i = 0; i < texts.length; i++) { return; } presenter.savedSentences...
<vulnerable_code> }; function splitByPunctuationSigns(text) { return text.split(/[.,:;!?\/\\()]/); } // creates an array of utterances from a single text that exceeds max utterance length and has no natural break points function splitLongSentence (sentence, lang) { var newTexts = []...
<vulnerable_code> }; }, 'test given speech text with multiple sentences and saveSentence == true when saveSentences is called then correctly split the speech text into sentences and save it': function () { function getTextVoiceObject (text, lang) { return {text: text, lang: lang}; } var...
<vulnerable_code> } }, 'test given speech text within length limit when called splitLongTexts then return unchanged speech text': function () { function getTextVoiceObject (text, lang) { return {text: text, lang: lang}; } var textVoices = []; textVoices.push(getTextVoiceObject('t...
<vulnerable_code><commit_title>[PATCH 12/13] feat(addons) adding GSA to the Graph re #8577 (#882)<commit_description>* feat(addons) adding GSA to the Graph re #8577 * refactore the code Co-authored-by: maciej-zawlocki-solwit <34648176+maciej-zawlocki-solwit@users.noreply.github.com><fixed_code> /** * @module commons...
<vulnerable_code><commit_title>[PATCH 12/13] feat(addons) adding GSA to the Graph re #8577 (#882)<commit_description>* feat(addons) adding GSA to the Graph re #8577 * refactore the code Co-authored-by: maciej-zawlocki-solwit <34648176+maciej-zawlocki-solwit@users.noreply.github.com><fixed_code> TestCase("[Commons - X...
<vulnerable_code> xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == XMLHttpRequest.DONE) { if (xmlhttp.status === 200) { $(presenter.wrapper).html(xmlhttp.response); } else { $(presenter.wrapper).html(presenter....
<vulnerable_code> for (ScriptAsset libraryAsset : attachedLibraries.values()) { DOMInjector.injectLibrary( libraryAsset.getHref(), libraryAsset.getFileName() ); } }<commit_title>[PATCH 12/13] feat(addons) adding GSA to the Graph re #8577 (#882)<commit_description>* feat(addons) adding GSA to the Graph...
<vulnerable_code> Map<String, ScriptAsset> attachedLibraries = new HashMap<String, ScriptAsset>(); for (IAsset asset : assets) { String type = asset.getType(); if (type.equals("script")) { String fileName = asset.getFileName().isEmpty() ? asset.getHref() : asset.getFileName(); ScriptAsset fileAsset = n...
<vulnerable_code> IAsset a = assets.get(i); if(a.getHref().compareTo(asset.getHref()) == 0){ foundURL = true; if (a.getType() != "script") { asset.setContentType(a.getContentType()); asset.setFileName(a.getFileName()); asset.setTitle(a.getTitle());<commit_title>[PATCH 12/13] feat(addons) add...
<vulnerable_code> private int orderNumber = 0; public IAsset createAsset(String type, String url) { IAsset asset = null; else if(type.compareTo("script") == 0){ asset = new ScriptAsset(url); } else { asset = new FileAsset(url); }<commit_title>[PATCH 12/13] feat(addons) adding GSA to the Graph r...
<vulnerable_code>package com.lorepo.icplayer.client.model.asset; public class ScriptAsset extends BasicAsset { public ScriptAsset(String url){ super("script", url); } }<commit_title>[PATCH 12/13] feat(addons) adding GSA to the Graph re #8577 (#882)<commit_description>* feat(addons) adding GSA to the Gr...
<vulnerable_code> return new FileAddonParam(parent, type); } else if (lowerCaseType.compareTo("script") == 0) { return new ScriptAddonParam(parent, type); } else if(lowerCaseType.compareTo("html") == 0) { return new HTMLAddonParam(parent, type); } else if(lowerCaseType.compareTo("image") == 0) {<commit_ti...
<vulnerable_code><commit_title>[PATCH 12/13] feat(addons) adding GSA to the Graph re #8577 (#882)<commit_description>* feat(addons) adding GSA to the Graph re #8577 * refactore the code Co-authored-by: maciej-zawlocki-solwit <34648176+maciej-zawlocki-solwit@users.noreply.github.com><fixed_code> package com.lorepo.icp...
<vulnerable_code> private void loadAttachedLibraries() { Map<String, ScriptAsset> attachedLibraries = playerController.getAssetsService().getAttachedLibraries(); for (ScriptAsset libraryAsset : attachedLibraries.values()) { DOMInjector.injectLibrary( libraryAsset.getHref(), libraryAsset.getFileName(), ...
<vulnerable_code> presenter.parseDefinitionLinks = function () { $.each($(presenter.view).find('.innerWrapper'), function (index, element) { $(element).html(presenter.textParser.parse($(element).html())); }); presenter.textParser.connectLinks($(presenter.view));<commit_title>[PA...
<vulnerable_code> function createTextElement(element) { var textElement = document.createElement('span'); $(textElement).addClass('doublestate-button-text'); $(textElement).html(presenter.isSelected() ? presenter.configuration.selected.text : presenter.configuration.deselected.text); ...
<vulnerable_code> presenter.showReport = function addonPrint_Report_showReport () { var data = presenter.getPagesData(), reportHtml = presenter.prepareReportHtml(data), reportWindow = window.open(); $(reportWindow.document).ready(function addonPrint_Report_onReportWindowRead...
<vulnerable_code> presenter.parseDefinitionLinks = function () { $.each(presenter.$view.find('.table_cell'), function (index, element) { $(element).html(presenter.textParser.parse($(element).html())); }); presenter.textParser.connectLinks(presenter.$view);<commit_title>[PATCH 12...
<vulnerable_code> var filesToLoad,dlContent,preContent,doDelayLoad,signaledLoading,loadingEvt,requiresSVG,htLookup={},aLoader,aEffectors;function loadResources(a,d){AdobeEdge.preload=AdobeEdge.preload||[];AdobeEdge.preload.q=AdobeEdge.preload.q||[];d||!isCapable()?filesToLoad=a:AdobeEdge.preload.busy?AdobeEd...
<vulnerable_code> cell.addClass('cell_word_begin_vertical'); if(!presenter.disableAutomaticWordNumbering) { var wordNumber = $('<div class="word_number"></div>').html(wordNumberCounter++); cell.append(wordNumber...
<vulnerable_code> }; function getTextVoiceArrayFromText(text) { var el = document.createElement('div'); el.innerHTML = text; var $el = $(el); return window.TTSUtils.getTextVoiceArrayFromElement($el,presenter.configuration.langTag); } <commit_title>[PATCH 12/13] feat(addons) a...
<vulnerable_code> * @return reference do newly created element */ function createCaptionElement(caption, isAudioDescription) { var captionElement = document.createElement('div'); $(captionElement).addClass('captions'); if(isAudioDescription) { $(captionElement).addClass...
<vulnerable_code> var breakText = this.statics.breakText; $clone.find('img[alt]').each(function(){ var altText = $(this).attr('alt'); $('<span>' + breakText + '</span>').insertBefore($(this)); $('<span>' + breakText + '</span>').insertAfter($(this)...
<vulnerable_code> $(presenter.$view).find('input').each(function () { $(this).replaceWith( generateMathGap( $(this).attr('id'), presenter.configuration.gapWidth.value ) );<commit_title>[PAT...
<vulnerable_code> var availableWidth = presenter.getAvailableWidth(); var scrollY = presenter.temporaryState.scrollTop; var topOffset = scrollY + 25; var leftOffset = (availableWidth - width) / 2;<commit_title>[PATCH 12/13] feat(addons) adding GSA to the Graph re #8577 (#882)<commit_des...
<vulnerable_code> } private native int getScrollTop() /*-{ return $wnd.window.top.pageYOffset; }-*/; public void setIframeScroll (int scroll) {<commit_title>[PATCH 12/13] feat(addons) adding GSA to the Graph re #8577 (#882)<commit_description>* feat(addons) adding GSA to the Graph re #8577 * refactore the code...
<vulnerable_code> presenter.playerController = null; presenter.errorMode = false; presenter.isStarted = false; presenter.$view = null; presenter.configuration = {}; }; presenter.setShowErrorsMode = function() { if(presenter.isShowAnswersActive){ ...
<vulnerable_code><commit_title>[PATCH 12/13] feat(addons) adding GSA to the Graph re #8577 (#882)<commit_description>* feat(addons) adding GSA to the Graph re #8577 * refactore the code Co-authored-by: maciej-zawlocki-solwit <34648176+maciej-zawlocki-solwit@users.noreply.github.com><fixed_code> TestCase("[Graph] Answ...
<vulnerable_code> presenter.highlightSelectionAll(textWrapper, slide_data.selection_id); } } }; presenter.changeSlideFromData = function AddonTextAudio_changeSlideFromData (slide_data) { presenter.highlightSelection(textWrapper, slide_data.selection_id); ...
<vulnerable_code>import java.io.File; import java.io.IOException; import java.nio.file.FileSystems; import java.nio.file.FileVisitResult; import java.nio.file.FileVisitor; import java.nio.file.Files; import java.nio.file.SimpleFileVisitor; import java.nio.file.StandardCopyOption; import java.nio.file.attribute.BasicFil...
<vulnerable_code>import java.nio.charset.Charset; import java.nio.file.FileSystem; import java.nio.file.FileSystems; import java.nio.file.FileVisitResult; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.SimpleFileVisitor; import java.nio.file.attribute.BasicFileAttributes; import java.nio.fi...
<vulnerable_code> import java.io.File; import java.io.IOException; import java.nio.file.FileVisitResult; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.SimpleFileVisitor; import java.nio.file.attribute.BasicFileAttributes; import java.util.HashMap; import java.util.Iterator; import java.uti...
<vulnerable_code>import java.io.IOException; import java.io.InputStream; import java.net.URI; import java.nio.file.FileVisitResult; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.SimpleFileVisitor; import java.nio.file.attribute.BasicFileAttributes; import org.apache.logging.log4j.Logger; ...
<vulnerable_code>import java.io.InputStream; import java.io.OutputStream; import java.io.UnsupportedEncodingException; import java.nio.file.FileVisitResult; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.SimpleFileVisitor; import java.nio.file.StandardCopyOption; import java.nio.file.attrib...
<vulnerable_code><commit_title>[PATCH] OO-5549: fix the wiki import and add some unit tests<commit_description><fixed_code> package org.olat.modules.ims.cp; import java.io.File; import java.net.URISyntaxException; import java.net.URL; import java.util.Locale; import org.junit.Assert; import org.junit.Test; import org...
<vulnerable_code><commit_title>[PATCH] OO-5549: fix the wiki import and add some unit tests<commit_description><fixed_code> package org.olat.modules.wiki; import java.io.File; import java.net.URISyntaxException; import java.net.URL; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.ol...
<vulnerable_code> org.olat.modules.iq.IQManagerTest.class, org.olat.modules.fo.ForumManagerTest.class,//fail org.olat.modules.wiki.WikiUnitTest.class, org.olat.modules.wiki.versioning.diff.CookbookDiffTest.class, org.olat.modules.wiki.gui.components.wikiToHtml.FilterUtilTest.class, org.olat.modules.coach.manager.C...
<vulnerable_code> free (s); } sdb_num_set (sdb_version, "cnt", entry->vn_cnt, 0); vstart += entry->vn_aux; for (j = 0, isum = i + entry->vn_aux; j < entry->vn_cnt && vstart + sizeof (Elf_(Vernaux)) <= end; ++j) { int k; Elf_(Vernaux) * aux = NULL;<commit_title>[PATCH] Fix #8731 - Crash in ELF parser wit...
<vulnerable_code> assert(ifdId != ifdIdNotSet); std::string groupName(Internal::groupName(ifdId)); uint16_t c = 1; while (uint32_t(c)*2 < ciffComponent.size()) { uint16_t n = 1; ExifKey key(c, groupName); UShortValue value; if (ifdId == can...
<vulnerable_code> { if (s1 == s2) return true; if (s1 == null || s2 == null || s1.length() != s2.length()) return false; boolean result = true; for (int i = 0; i < s1.length(); i++) result &= s1.charAt(i) == s2.charAt(i); return result; ...
<vulnerable_code> /* How many consecutive GC/expansion failures? */ /* Reset by GC_allochblk. */ /* Collect or expand heap in an attempt make the indicated number of */ /* free blocks available. Should be called until the blocks are */ /*...
<vulnerable_code> struct oz_app_hdr *app_hdr; struct oz_serial_ctx *ctx; spin_lock_bh(&g_cdev.lock); pd = g_cdev.active_pd; if (pd)<commit_title>[PATCH] staging: ozwpan: prevent overflow in oz_cdev_write()<commit_description>We need to check "count" so we don't overflow the ei->data buffer. Reported-by: Nico Gold...
<vulnerable_code> "get_logger", "logger", "logging_config", "on_shutdown", "on_startup", "openapi_config", initial_state: Optional["InitialStateType"] = None, logging_config: Union["BaseLoggingConfig", "EmptyType", None] = Empty, middleware: Optiona...
<vulnerable_code> """A mapping of types to callables that transform them into types supported for serialization.""" websocket_class: Optional[Type[WebSocket]] """An optional subclass of :class:`WebSocket <starlite.connection.websocket.WebSocket>` to use for websocket connections.""" @validator("allowed_...
<vulnerable_code> content_type, options = self.content_type if content_type == RequestEncodingType.MULTI_PART: self._form = self.scope["_form"] = form_values = parse_multipart_form( # type: ignore[typeddict-item] body=await self.body(), boundary=options.get("b...
<vulnerable_code>from starlite.enums import ParamType, RequestEncodingType from starlite.exceptions import ValidationException from starlite.multipart import parse_multipart_form from starlite.parsers import ( parse_headers, parse_query_string, Returns: An extractor function. """ async def ...
<vulnerable_code>from urllib.parse import unquote from starlite.datastructures.upload_file import UploadFile from starlite.exceptions import SerializationException from starlite.utils.serialization import decode_json _token, _quoted = r"([\w!#$%&'*+\-.^_`|~]+)", r'"([^"]*)"' _param = re.compile(rf";\s*{_token}=(?:{_t...
<vulnerable_code> Equivalent to pattern in the OpenAPI specification. """ def __hash__(self) -> int: # pragma: no cover """Hash the dataclass in a safe way. max_items: Optional[int] = None, min_length: Optional[int] = None, max_length: Optional[int] = None, regex: Optional[str] = N...
<vulnerable_code> initial_state: Optional[Union["ImmutableState", Dict[str, Any], Iterable[Tuple[str, Any]]]] = None, logging_config: Optional["BaseLoggingConfig"] = None, middleware: Optional[List["Middleware"]] = None, on_app_init: Optional[List["OnAppInitHandler"]] = None, on_shutdown: Optional[Li...
<vulnerable_code> initial_state={}, logging_config=None, middleware=[], on_shutdown=[], on_startup=[], openapi_config=None,<commit_title>[PATCH] Merge pull request from GHSA-p24m-863f-fm6q<commit_description>* implement limitation to form multipart parts * Adds multipart_...
<vulnerable_code> from starlite import Body, Request, RequestEncodingType, post from starlite.datastructures import UploadFile from starlite.status_codes import HTTP_201_CREATED from starlite.testing import create_test_client from tests import Person, PersonFactory from tests.kwargs import Form with create_test_cli...
<vulnerable_code>from django.urls import get_script_prefix, reverse from prometheus_client.parser import text_string_to_metric_families from nautobot.core.testing import TestCase, User from nautobot.core.utils.permissions import get_permission_for_model from nautobot.core.views.mixins import GetReturnURLMixin from nau...
<vulnerable_code>from django.contrib.auth.decorators import permission_required from django.contrib.auth.mixins import AccessMixin from django.http import HttpResponseServerError, JsonResponse, HttpResponseForbidden, HttpResponse from django.shortcuts import redirect, render from django.template import loader, RequestC...
<vulnerable_code> if ((flags & DOBUF_NOPOPUP) && bt_popup(buf) && !bt_terminal(buf)) return OK; #endif #ifdef FEAT_GUI need_mouse_correct = TRUE;<commit_title>[PATCH] patch 9.0.0789: dummy buffer ends up in a window<commit_description>Problem: Dummy buffer ends up in a window. Solution: Disallow navigatin...
<vulnerable_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 788, /**/<commit_title>[PATCH] patch 9.0.0789: dummy buffer ends up in a window<commit_description>Problem: Dummy buffer ends up in a window. Solution: Disallow navigating to a dummy buffer.<fixed_code> stati...