text
stringlengths
79
3.72M
<vulnerable_code> html_validation_service.fix_incorrectly_encoded_chars) return question_state_dict @classmethod def update_state_from_model( cls, versioned_question_state, current_state_schema_version):<commit_title>[PATCH 2/9] Stop printing backend test errors twice (#13886)<co...
<vulnerable_code> linked_skill_id = question.question_state_data.linked_skill_id self.assertEqual( linked_skill_id, None)<commit_title>[PATCH 2/9] Stop printing backend test errors twice (#13886)<commit_description><fixed_code> linked_skill_id = question.question_state_data.linked_ski...
<vulnerable_code> 'question_state_data_schema_version'] < 38), state_uses_old_rule_template_schema=( self.change.question_dict[ 'question_state_data_schema_version'] < 43) ) ) <commit_title>[PATCH 2/9] Stop printing b...
<vulnerable_code> await explorationEditorMainTab.setContent( await forms.toRichText('some content')); // Numeric input does not have any customization arguments. Therefore the // customization modal and the save interaction button does not appear. await explorationEditorMainTab.setInteraction('Num...
<vulnerable_code> await explorationEditorMainTab.setStateName('first'); explorationEditorMainTab.setContent(await forms.toRichText( 'enter 6 to continue')); await explorationEditorMainTab.setInteraction('NumericInput'); await explorationEditorMainTab.addResponse( 'NumericInput', null, 'second...
<vulnerable_code> can_have_solution = True show_generic_submit_button = True _customization_arg_specs = [] _answer_visualization_specs = [{ # Table with answer counts for top N answers.<commit_title>[PATCH 2/9] Stop printing backend test errors twice (#13886)<commit_description><fixed_code> ...
<vulnerable_code> * interaction. */ var customizeInteraction = function() { // There are no customizations. }; var expectInteractionDetailsToMatch = async function(elem) { var answerObjectType = 'Real'; var testSuite = [{ interactionArguments: [], ruleArguments: ['IsWithinTolerance', 2, 143], expectedIntera...
<vulnerable_code># incompatible changes are made to the states blob schema in the data store, # this version number must be changed and the exploration migration job # executed. CURRENT_STATE_SCHEMA_VERSION = 48 # The current version of the all collection blob schemas (such as the nodes # structure within the Collecti...
<vulnerable_code> import base64 import datetime import hmac import json import logging import python_utils import utils import backports.functools_lru_cache import webapp2 from typing import Any, Dict, Optional # isort: skip ) @backports.functools_lru_cache.lru_cache(maxsize=128) def load_template(filename): ""...
<vulnerable_code> @acl_decorators.can_access_learner_dashboard def get(self): """Handles GET requests.""" ( learner_progress, number_of_nonexistent_activities) = ( learner_progress_services.get_activity_progress(self.user_id)) completed_exp_summary_dicts = ( ...
<vulnerable_code> ('TopicSummaryModel', topic_ids_to_learn), ('ExpSummaryModel', exploration_playlist_ids), ('CollectionSummaryModel', collection_playlist_ids), ('TopicSummaryModel', all_topic_ids), ('TopicSummaryModel', untracked_topic_ids)...
<vulnerable_code> task: Dict[str, Any] = { # Specify the type of request. 'app_engine_http_request': { 'http_method': tasks_v2.types.target_pb2.HttpMethod.POST, 'relative_uri': url, } } # Note: retry=retry.Retry() means that the default retry arguments # ar...
<vulnerable_code> task, { 'app_engine_http_request': { 'http_method': ( tasks_v2.types.target_pb2.HttpMethod.POST), 'relative_uri': dummy_url, 'headers': { ...
<vulnerable_code>var request = require('request'); var path = require('path'); const FABRIC_VERSION = '4.5.1'; const SVGTAGS = { rectangle: ( '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/' +<commit_title>[PATCH 2/9] Stop printing backend test errors twice (#13886)<commit_description><f...
<vulnerable_code>general functionality on Android. """ from __future__ import unicode_literals # These are the valid interactions that are allowed in an exploration # that is to be viewed on the Android app. If, in the future, this is # changed, just this array has to be modified to include the new MAX_CHARS_IN_EXPLO...
<vulnerable_code>import logging import re from constants import constants from core.controllers import base from core.domain import blog_services test_can_update_suggestion.__wrapped__ = True return test_can_update_suggestion<commit_title>[PATCH 2/9] Stop printing backend test errors twice (#13886)<commit_des...
<vulnerable_code>from __future__ import unicode_literals import json from constants import constants from core.controllers import acl_decorators from core.controllers import base from core.domain import blog_services from core.domain import classifier_domain from core.domain import classifier_services self.as...
<vulnerable_code> from core.controllers import acl_decorators from core.controllers import base from core.domain import config_domain from core.domain import cron_services from core.domain import email_manager info_about_suggestions_waiting_too_long_for_review) ) return self.rend...
<vulnerable_code>import webtest ( exp_models, job_models, suggestion_models, user_models ) = models.Registry.import_models([ models.NAMES.exploration, models.NAMES.job, models.NAMES.suggestion, models.NAMES.user ]) FIVE_WEEKS = datetime.timedelta(weeks=5) NINE_WEEKS = datetime.timedelta(week...
<vulnerable_code><commit_title>[PATCH 2/9] Stop printing backend test errors twice (#13886)<commit_description><fixed_code> # Copyright 2021 The Oppia Authors. 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. # Yo...
<vulnerable_code><commit_title>[PATCH 2/9] Stop printing backend test errors twice (#13886)<commit_description><fixed_code> # coding: utf-8 # # Copyright 2021 The Oppia Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with...
<vulnerable_code><commit_title>[PATCH 2/9] Stop printing backend test errors twice (#13886)<commit_description><fixed_code> # coding: utf-8 # # Copyright 2021 The Oppia Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with...
<vulnerable_code><commit_title>[PATCH 2/9] Stop printing backend test errors twice (#13886)<commit_description><fixed_code> # coding: utf-8 # # Copyright 2021 The Oppia Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with...
<vulnerable_code><commit_title>[PATCH 2/9] Stop printing backend test errors twice (#13886)<commit_description><fixed_code> # coding: utf-8 # # Copyright 2021 The Oppia Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with...
<vulnerable_code><commit_title>[PATCH 2/9] Stop printing backend test errors twice (#13886)<commit_description><fixed_code> # coding: utf-8 # # Copyright 2021 The Oppia Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with...
<vulnerable_code><commit_title>[PATCH 2/9] Stop printing backend test errors twice (#13886)<commit_description><fixed_code> # coding: utf-8 # # Copyright 2021 The Oppia Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with...
<vulnerable_code> 'entry_point_name': 'crash', }, 'text_size': 'MEDIUM_TEXT_SIZE', 'download_and_update_only_on_wifi': True, 'automatically_update_topics': False, 'is_curriculum_admin': False } 'random_hash', self.TICKET_CREATION_TIMESTAMP.second, ...
<vulnerable_code> 'entry_point_name': 'crash', }, 'text_size': 'MEDIUM_TEXT_SIZE', 'download_and_update_only_on_wifi': True, 'automatically_update_topics': False, 'is_curriculum_admin': False } 'random_hash', self.TICKET_CREATION_TIMESTAMP.second, ...
<vulnerable_code>import python_utils import utils from typing import Any, Dict, List, Optional, Sequence MYPY = False if MYPY: # pragma: no cover PLATFORM_CHOICES = [PLATFORM_CHOICE_ANDROID, PLATFORM_CHOICE_WEB] GITHUB_REPO_CHOICES = PLATFORM_CHOICES REPORT_INFO_TO_REDACT = ( 'user_feedback_other_text_input', 'e...
<vulnerable_code>from core.platform import models from core.tests import test_utils import feconf import utils MYPY = False if MYPY: # pragma: no cover from mypy_imports import app_feedback_report_models from mypy_imports import base_models (base_models, app_feedback_report_models) = models.Registry.import_mo...
<vulnerable_code> return self._parse_json_response(json_response, expect_errors) def post_json( self, url, data, csrf_token=None, expected_status_int=200, upload_files=None, use_payload=True, source=None): """Post an object to the server by JSON; return the received object. ...
<vulnerable_code> # The maximum number of days a feedback report can be saved in storage before it # must be scrubbed. APP_FEEDBACK_REPORT_MAXIMUM_DAYS = datetime.timedelta(days=90) # The minimum version of the Android feedback report info blob schema. MINIMUM_ANDROID_REPORT_SCHEMA_VERSION = 1 # the existing storage m...
<vulnerable_code> import logging from constants import constants from core.controllers import access_validators from core.controllers import acl_decorators from core.controllers import features from core.controllers import feedback from core.controllers import improvements from core.controllers import learner_dashboar...
<vulnerable_code> def testLargeStarts(self): # Test case for GitHub issue 46899. with self.session(): with self.assertRaises(errors_impl.InvalidArgumentError): v = math_ops.range(start=-1e+38, limit=1) self.evaluate(v) <commit_title>[PATCH] Test for case that would lead to undefined behav...
<vulnerable_code>package org.xwiki.web; import java.util.List; import javax.inject.Inject; import org.jsoup.nodes.Element; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.xwiki.template.TemplateManager; import org.xwiki.test.page.PageTest; import org.xwiki.velocity.VelocityMana...
<vulnerable_code> } var currentPath = path[0]; var currentValue = getShallowProperty(obj, currentPath); if (path.length === 1) { if (currentValue === void 0 || !doNotReplace) { obj[currentPath] = value;<commit_title>[PATCH] Fix prototype pollution in set()<commit_description><fi...
<vulnerable_code>'use strict'; var expect = require('chai').expect, objectPath = require('./index.js'); function getTestObj() { return { a: 'b', b: { c: [], d: ['a', 'b'], e: [{},{f: 'g'}], f: 'i' } }; } describe('get', function() { it('should return the value using unicode ...
<vulnerable_code> } for (i = 0; i < index->item_count; i++) { int64_t time, offset; if (version == 1) { time = avio_rb64(f); offset = avio_rb64(f);<commit_title>[PATCH] avformat/mov: Fix DoS in read_tfra()<commit_description>Fixes: Missing EOF check in loop No testcase ...
<vulnerable_code> if(i==EOF) break; Rd_WP_DWORD(image,&Rec.RecordLength); if(EOFBlob(image)) break; <commit_title>[PATCH] https://github.com/ImageMagick/ImageMagick/issues/654<commit_description><fixed_code> if(i==EOF) break; Rd_WP_DWO...
<vulnerable_code> image->endian=(magick[0] == 0x80) && (magick[1] == 0x2a) && (magick[2] == 0x5f) && (magick[3] == 0xd7) ? MSBEndian : LSBEndian; cin.file.image_offset=ReadBlobLong(image); offset+=4; cin.file.generic_length=ReadBlobLong(image); offset+=4;<commit_title>[PATCH] https://github.com/ImageMagick...
<vulnerable_code> return quote; } bool QODBCDriverPrivate::setConnectionOptions(const QString& connOpts) { v = val.toUInt(); r = SQLSetConnectAttr(hDbc, SQL_ATTR_LOGIN_TIMEOUT, (SQLPOINTER) size_t(v), 0); } else if (opt.toUpper() == "SQL_ATTR_CURRENT_CATALOG"_L1) { val.u...
<vulnerable_code><commit_title>[PATCH] Regression test for<commit_description><fixed_code> # -*- coding: utf-8 -*- from system_tests import CaseMeta, path class MinoltaDivZero(metaclass=CaseMeta): """ Regression test for the bug described in: https://github.com/Exiv2/exiv2/security/advisories/GHSA-pvjp-m...
<vulnerable_code>const fsAsync = require('./helpers/fs-async'); const errors = require('./errors'); class FileSystem { constructor(connection, {root, cwd} = {}) { this.connection = connection; this.cwd = nodePath.normalize(cwd ? nodePath.join(nodePath.sep, cwd) : nodePath.sep); this._root = nodePath.reso...
<vulnerable_code>const FileSystem = require('../src/fs'); const errors = require('../src/errors'); describe.only('FileSystem', function () { let fs; before(function () { nodePath.resolve('/tmp/ftp-srv/other')); }); it('cannot escape root', function () { // try { // let res = fs._res...
<vulnerable_code> const doc = document.cloneNode(false) const dom = doc.createElement('div') if (shiftKey) { // Treat single newlines as linebreaks and double newlines as paragraph breaks when pasting as plaintext dom.innerHTML = '<p>' + str.replaceAll('\n', '<br />').replaceAll('<br /><b...
<vulnerable_code> return ERR_PTR(-ENOMEM); } d_instantiate(dentry, inode); dentry->d_fsdata = (void *)ns->ops; d = atomic_long_cmpxchg(&ns->stashed, 0, (unsigned long)dentry); if (d) {<commit_title>[PATCH] nsfs: mark dentry with DCACHE_RCUACCESS<commit_description>Andrey reported a use-after-free in __ns_get_path...
<vulnerable_code>import six.moves.urllib.error # pylint: disable=import-error import six.moves.urllib.parse # pylint: disable=import-error import six.moves.urllib.request # pylint: disable=import-error import pkg_resources import six import webob from django.utils import translation<commit_title>[PATCH] test: fix l...
<vulnerable_code>import copy import re from collections import namedtuple from bleach.sanitizer import Cleaner <commit_title>[PATCH] test: fix linting<commit_description><fixed_code> import copy import re from collections import namedtuple from bleach.sanitizer import Cleaner
<vulnerable_code> self.assertEqual(submit_button.is_enabled(), enabled) def assert_reader_feedback_messages(self, expected_message_lines): expected_paragraphs = ['<p>{}</p>'.format(l) for l in expected_message_lines] expected_html = ''.join(expected_paragraphs) feedback_area = self._...
<vulnerable_code> // https://gist.github.com/dperini/729294 // see also https://mathiasbynens.be/demo/url-regex // modified to allow protocol-relative URLs return this.optional( element ) || /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3})...
<vulnerable_code> bee_t *bee = ic->bee; bee_user_t *bu = bee_user_by_handle(bee, ic, handle); if (bee->ui->ft_in_start) { return bee->ui->ft_in_start(bee, bu, file_name, file_size); } else { return NULL;<commit_title>[PATCH] imcb_file_send_start: handle ft attempts from non-existing<commit_description><fixed_co...
<vulnerable_code>{ const char *ptr=str+1,*end_ptr=str+1;char *ptr2;char *out;int len=0;unsigned uc,uc2; if (*str!='\"') {*ep=str;return 0;} /* not a string! */ while (*end_ptr!='\"' && *end_ptr && ++len) if (*end_ptr++ == '\\') end_ptr++; /* Skip escaped quotes. */ out=(char*)cJSON_malloc(len+1); /* This is how...
<vulnerable_code> with self.assertRaises(errors.InvalidArgumentError): sess.run(init_op, feed_dict={st: sparse_feed}) @combinations.generate(combinations.combine(tf_api_version=2, mode=["eager"])) def testFromSparseTensorSlicesError(self): with self.assertRaises(AttributeError):<commit_title>[PATC...
<vulnerable_code> var string = ""; var bitsNeeded = this.bitsNeeded; var codePoint = this.codePoint; for (var i2 = 0; i2 < octets.length; i2 += 1) { var octet = octets[i2]; if (bitsNeeded !== 0) { if (octet < 128 || octet > 191 || !valid(codeP...
<vulnerable_code> def updated(): nonpayable def updated_protected(): nonpayable interface Self: def protected_function2(val: String[100], do_callback: bool) -> uint256: nonpayable special_value: public(String[100]) def protected_function2(val: String[100], do_callback: bool) -> uint256: self.special_val...
<vulnerable_code> } } #endif smsg_attr_keep(0, _("%ld %s; %s #%ld %s"), u_oldcount < 0 ? -u_oldcount : u_oldcount,<commit_title>[PATCH] patch 8.2.4217: illegal memory access when undo makes Visual<commit_description><fixed_code> } } #endif if (VIsual_active) check_pos(curbuf, &VIsual); sms...
<vulnerable_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 4216, /**/<commit_title>[PATCH] patch 8.2.4217: illegal memory access when undo makes Visual<commit_description><fixed_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ ...
<vulnerable_code> "as you would call from the command line. Example: -a '-w 10 -c 20 -f /usr/local'") parser.add_option("-t", "--token", default='', help="The token for connecting.") parser.add_option("-T", "--timeout", default=60, type="int", ...
<vulnerable_code> }, edit: function() { if($(this).find("input").length == 0) { var rep = $(this).html().trim(); var newRep = $(this).html("<input type='text' class='newRep' value='" + rep + "' style='width: 830px;' /> <input type='button' value='Save' style='padding: 4px;' class='saveR...
<vulnerable_code> container.find('.rep-error').remove(); container.append("<br/><div class='rep-error' style='color: red'><br/>" + json['ErrorString'] + " at \"" + near + "\"</div>"); } else { container.html(newValue); } }; }, resplitCallback: function(con...
<vulnerable_code> */ load: function() { $.ajax({ type: "POST", url: NeoX.Modules.InterpreterTrainIndex.getConfig().moduleScript, }, save: function(sentenceID, newValue, approved) { $.ajax({ type: "POST", url: NeoX.Modules.InterpreterTrainIndex.getConf...
<vulnerable_code> NeoX.Modules.SplitterReviewIndex.hookEvent('click', NeoX.Modules.SplitterReviewIndex.getConfig().Buttons.approve, NeoX.Modules.SplitterReviewIndex.approve); NeoX.Modules.SplitterReviewIndex.hookEvent('click', NeoX.Modules.SplitterReviewIndex.getConfig().Buttons.dismiss, NeoX.Modules.Split...
<vulnerable_code>function Class() { this.extend = function(parent) { this.prototype = parent.prototype; }; return this; } function TClassName(){ var Object = new Class(); Object.A = ''; Object.B = function(){ console.log('parent'); }; return Object; } function TChildClass() { var O...
<vulnerable_code>$(document).ready(function() { /*$(document).on('click', '.saveTrainerName', function() { $.cookie("trainername", $('#trainername').val(), { expires : 7 }); }); */ var ajaxLoading = false; /* if($.cookie("trainername") == null) { $.cookie("trainername", '', { expires : 7 }); }*/ ...
<vulnerable_code>$(document).ready(function() { NeoX.Modules.MainControl.init(); NeoX.Modules.EntityControl.init(); NeoX.Modules.WordControl.init(); });<commit_title>[PATCH] Fixed XSS security holes in JS/PHP. Fixed some loading/query<commit_description><fixed_code>
<vulnerable_code> #define TAG FREERDP_TAG("gdi") static DWORD gfx_align_scanline(DWORD widthInBytes, DWORD alignment) { const UINT32 align = alignment; BOOL sameSurface; UINT32 nWidth, nHeight; const RECTANGLE_16* rectSrc; RDPGFX_POINT16* destPt; RECTANGLE_16 invalidRect; gdiGfxSurface* surfaceSrc; gdiGfxSurfa...
<vulnerable_code>import subprocess import syslog from jadi import component, service, interface import aj from aj.api.http import BaseHttpHandler def authenticate(self, username, password): child = None try: child = pexpect.spawn('/bin/sh', ['-c', '/bin/su -c "/bin/echo SUCCESS" - %s' ...
<vulnerable_code></div> """ SAFE_EMPTY = mark_safe("") # noqa: S308 def _render_job_button_for_obj(job_button, obj, context, content_type): exc, job_button.name, ), SAFE_EMPTY, ) if not text_rendered: return (SAFE_EMPTY, SAFE_EMPTY) #...
<vulnerable_code> } // b: variables ht = #ifdef FEAT_CMDWIN // In cmdwin, the alternative buffer should be used. is_in_cmdwin() ? &prevwin->w_buffer->b_vars->dv_hashtab : #endif &curbuf->b_vars->dv_hashtab; if (bdone < ht->ht_used) { if (bdone++ == 0) } // w: variables ht = #ifdef F...
<vulnerable_code> /* * Look for buffer-local user commands first, then global ones. */ gap = #ifdef FEAT_CMDWIN is_in_cmdwin() ? &prevwin->w_buffer->b_ucmds : #endif &curbuf->b_ucmds; for (;;) { for (j = 0; j < gap->ga_len; ++j) get_user_commands(expand_T *xp UNUSED, int idx) { // In cmd...
<vulnerable_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 4427, /**/<commit_title>[PATCH] patch 8.2.4428: crash when switching tabpage while in the<commit_description><fixed_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 442...
<vulnerable_code>} #endif /* * All CTRL-W window commands are handled here, called from normal_cmd(). */ tabpage_T *newtp; int n; newtp = alloc_tabpage(); if (newtp == NULL) return FAIL; text_locked_msg(); return; } // If there is only one it can't work. if (first_tabpage->tp_next =...
<vulnerable_code> name: "group", value: this.data.group, fieldLabel: t("group"), width: 450 }); <commit_title>[PATCH] [Thumbnails] Escape group text properly<commit_description><fixed_code> name: "group", value: this.data.group, ...
<vulnerable_code> trb = xdev->opregs.cr_p; ccs = xdev->opregs.crcr & XHCI_CRCR_LO_RCS; crcr = xdev->opregs.crcr & ~0xF; while (1) { xdev->opregs.cr_p = trb; } } xdev->opregs.crcr = crcr | (xdev->opregs.crcr & XHCI_CRCR_LO_CA) | ccs; xdev->opregs.crcr &= ~XHCI_CRCR_LO_CRR; return 0;<commit_title>[PATCH] DM:...
<vulnerable_code>{ size_t olen; if (!winpr_Cipher_Update(rdp->fips_decrypt, data, length, data, &olen)) return FALSE; <commit_title>[PATCH] Fixed GHSL-2020-101 missing NULL check<commit_description>(cherry picked from commit b207dbba35c505bbc3ad5aadc10b34980c6b7e8e)<fixed_code> { size_t olen; if (!rdp || !rdp->...
<vulnerable_code> */ static int nntp_hcache_namer(const char *path, char *dest, size_t destlen) { return snprintf(dest, destlen, "%s.hcache", path); } /**<commit_title>[PATCH] sanitise cache paths<commit_description>Co-authored-by: JerikoOne <jeriko.one@gmx.us><fixed_code> */ static int nntp_hcache_namer(const char...
<vulnerable_code>#define HC_FEXT "hcache" /* extension for hcache as POP lacks paths */ #endif /** * fetch_message - write line to file * @param line String to write /* message not found in context -> remove it from cache * return the result of bcache, so we stop upon its first error */ return mutt_bcach...
<vulnerable_code>const fs = require('fs') const piexifjs = require('piexifjs') module.exports.sanitizeFieldPlainText = function (text) { return xss(text, { whileList: {},<commit_title>[PATCH] fix(account): security fix<commit_description><fixed_code> const fs = require('fs') const piexifjs = require('piexifjs') ...
<vulnerable_code>userSchema.pre('save', function (next) { var user = this user.username = utils.sanitizeFieldPlainText(user.username.toLowerCase().trim()) user.email = utils.sanitizeFieldPlainText(user.email.trim()) if (user.fullname) user.fullname = utils.sanitizeFieldPlainText(user.fullname.trim()) if (us...
<vulnerable_code> else: raise InvalidType("Invalid global type specified", item) def parse_type(self, ast_node, location): return parse_type(ast_node, location, sigs=self._contracts, custom_structs=self._structs,)<commit_title>[PATCH] wip: add notes on parse_type<commit_description><fixe...
<vulnerable_code> raise InvalidType(f"Invalid or unsupported type: {repr(t)}") def make_struct_type(name, location, sigs, members, custom_structs): o = OrderedDict() # Parses an expression representing a type. Annotation refers to whether # the type is to be located in memory or storage def parse_type(item, ...
<vulnerable_code> obj_flush_hdlstream (obj, dat, &dat1); /* special accumulated */ \ bit_chain_free (&dat1); \ bit_chain_free (&dat2); \ hdl_dat = dat; ...
<vulnerable_code> unsigned long long hard, soft; int soft_seconds; if (class == -1) { err = "Unrecognized client limit class"; goto loaderr; } hard = memtoll(argv[2],NULL); long val; if ((j % 4) == 0) { ...
<vulnerable_code> */ package com.google.gson.internal; import java.io.ObjectStreamException; import java.math.BigDecimal; return new BigDecimal(value); } @Override public int hashCode() { return value.hashCode();<commit_title>[PATCH] Prevent Java deserialization of internal classes<commit_description>A...
<vulnerable_code> package com.google.gson.internal; import java.io.ObjectStreamException; import java.io.Serializable; import java.util.AbstractMap; private Object writeReplace() throws ObjectStreamException { return new LinkedHashMap<K, V>(this); } }<commit_title>[PATCH] Prevent Java deserialization of intern...
<vulnerable_code> */ package com.google.gson.internal; import junit.framework.TestCase; public class LazilyParsedNumberTest extends TestCase { LazilyParsedNumber n1Another = new LazilyParsedNumber("1"); assertTrue(n1.equals(n1Another)); } }<commit_title>[PATCH] Prevent Java deserialization of internal class...
<vulnerable_code>import com.google.gson.internal.LinkedHashTreeMap.AvlBuilder; import com.google.gson.internal.LinkedHashTreeMap.AvlIterator; import com.google.gson.internal.LinkedHashTreeMap.Node; import java.util.ArrayList; import java.util.Arrays; import java.util.Iterator; import java.util.Map; import java.util.Ran...
<vulnerable_code> package com.google.gson.internal; import java.util.ArrayList; import java.util.Arrays; import java.util.Iterator; import java.util.Map; import java.util.Random; MoreAsserts.assertEqualsAndHashCode(map1, map2); } @SafeVarargs private <T> void assertIterationOrder(Iterable<T> actual, T... ex...
<vulnerable_code> import com.floreysoft.jmte.Engine; import org.togglz.core.util.Services; public class EditPageHandler extends RequestHandlerBase { FeatureManager featureManager = event.getFeatureManager(); HttpServletRequest request = event.getRequest(); HttpServletResponse response = event....
<vulnerable_code><commit_title>[PATCH] Added CSRF protection to the togglz console via a CSRF token<commit_description><fixed_code> package org.togglz.console.security; import java.util.HashMap; import java.util.concurrent.TimeUnit; import org.apache.commons.collections4.map.PassiveExpiringMap; import org.togglz.serv...
<vulnerable_code><commit_title>[PATCH] Added CSRF protection to the togglz console via a CSRF token<commit_description><fixed_code> package org.togglz.console.security; import java.util.UUID; import javax.servlet.http.HttpServletRequest; import org.togglz.servlet.spi.CSRFToken; import org.togglz.servlet.spi.CSRFToke...
<vulnerable_code><commit_title>[PATCH] Added CSRF protection to the togglz console via a CSRF token<commit_description><fixed_code> package org.togglz.console.security; import javax.servlet.http.HttpServletRequest; import org.togglz.servlet.spi.CSRFToken; import org.togglz.servlet.spi.CSRFTokenValidator; public clas...
<vulnerable_code><commit_title>[PATCH] Added CSRF protection to the togglz console via a CSRF token<commit_description><fixed_code> package org.togglz.servlet.spi; import javax.servlet.http.HttpServletRequest; public interface CSRFTokenValidator { boolean isTokenValid(HttpServletRequest request); }
<vulnerable_code><commit_title>[PATCH] XWIKI-19558: Only load vm templates in xpart.vm<commit_description>* Add a page test for xpart.vm.<fixed_code> /* * See the NOTICE file distributed with this work for additional * information regarding copyright ownership. * * This is free software; you can redistribute it and...
<vulnerable_code> return i === 0 ? a.localeCompare(b) : i; }); return items; }, highlighter: function (item) { return $("<div>" + self.fuzzyResult.map[item].string + "</div>"); }, }); // This needs to happen after attaching the typeahead plugin, as it // otherwise breaks the ...
<vulnerable_code>import org.dom4j.DocumentException; import org.dom4j.Element; import org.dom4j.io.SAXReader; import org.yaml.snakeyaml.DumperOptions; import org.yaml.snakeyaml.DumperOptions.FlowStyle; import org.yaml.snakeyaml.emitter.Emitter; public static String migrate(String xml) { Document xmlDoc; try { x...
<vulnerable_code> @dbus.service.method ("org.fedoraproject.SetroubleshootFixit", in_signature='ss', out_signature='s') def run_fix(self, local_id, analysis_id): import commands command = "sealert -f %s -P %s" % ( local_id, analysis_id) return commands.getoutput(command) if __nam...
<vulnerable_code> if (resource >= RLIM_NLIMITS) return -EINVAL; if (new_rlim) { if (new_rlim->rlim_cur > new_rlim->rlim_max) return -EINVAL;<commit_title>[PATCH] prlimit: do_prlimit needs to have a speculation check<commit_description>do_prlimit() adds the user-controlled resource value to a pointer that will ...
<vulnerable_code>{ int index_e = 0, index_f = 0; if (expr->expr) { return resolve_iffeature_recursive(expr, &index_e, &index_f); } return 0;<commit_title>[PATCH] resolve BUGFIX handle yet unresolved if-features<commit_description>Fixes #772<fixed_code> { int index_e = 0, index_f = 0; i...
<vulnerable_code>@click.argument("query") def search(engine, query, open, copy): try: url = eval( f"Engine.{engine}.search('{query}', copy_url={copy}, open_web={open})" ) click.echo(url) searchor.history.update(engine, query, url) if open:<commit_title>[PATCH] rem...