text
stringlengths
79
3.72M
<vulnerable_code> }); }); it('locks down session', done => { let currentUser; Parse.User.signUp('foo', 'bar')<commit_title>[PATCH 3/9] chore(release): 6.2.1 [skip ci]<commit_description>## [6.2.1](https://github.com/parse-community/parse-server/compare/6.2.0...6.2.1) (2023-06-28) ### Bug Fixes * Rem...
<vulnerable_code> // Force filtering on only valid device tokens const updateWhere = applyDeviceTokenExists(where); badgeUpdate = () => { // Build a real RestQuery so we can use it in RestWrite const restQuery = new RestQuery(config, master(config), '_Installation', updateWhere); ...
<vulnerable_code> } } verifyEmail(username, token) { if (!this.shouldVerifyEmails) { // Trying to verify email when not enabled // TODO: Better error here. updateFields._email_verify_token_expires_at = { __op: 'Delete' }; } const maintenanceAuth = Auth.maintenance(this.config); ...
<vulnerable_code>}; // The non-third-party parts of User transformation RestWrite.prototype.transformUser = function () { var promise = Promise.resolve(); if (this.className !== '_User') { return promise; if (this.query && this.objectId()) { // If we're updating a _User object, we need to clear out the c...
<vulnerable_code><commit_title>[PATCH 3/9] chore(release): 6.2.1 [skip ci]<commit_description>## [6.2.1](https://github.com/parse-community/parse-server/compare/6.2.0...6.2.1) (2023-06-28) ### Bug Fixes * Remote code execution via MongoDB BSON parser through prototype pollution; fixes security vulnerability [GHSA-462...
<vulnerable_code> throttle[sessionToken] = setTimeout(async () => { try { if (!session) { const { results } = await new RestQuery( config, master(config), '_Session', { sessionToken }, { limit: 1 } ).execute(); session = results[0]; ...
<vulnerable_code>import org.apache.xerces.xni.XMLLocator; import org.eclipse.lsp4j.Range; import org.eclipse.lsp4xml.dom.DOMDocument; import org.eclipse.lsp4xml.extensions.contentmodel.participants.codeactions.ElementUnterminatedCodeAction; import org.eclipse.lsp4xml.extensions.contentmodel.participants.codeactions.EqR...
<vulnerable_code>import org.apache.xerces.xni.XNIException; import org.apache.xerces.xni.parser.XMLComponentManager; import org.apache.xerces.xni.parser.XMLConfigurationException; /** * Custom Xerces XML parser configuration to : private final boolean disableDTDValidation; public LSPXMLParserConfiguration(boolean...
<vulnerable_code> public static void doDiagnostics(DOMDocument document, XMLEntityResolver entityResolver, List<Diagnostic> diagnostics, ContentModelSettings contentModelSettings, CancelChecker monitor) { try { // It should be better to cache XML Schema with XMLGrammarCachingConfiguration, // but we cannot u...
<vulnerable_code> private Boolean enabled; /** * This severity preference to mark the root element of XML document which is * not bound to a XML Schema/DTD. private String noGrammar; public XMLValidationSettings() { //set defaults schema = true; enabled = true; } /** return noGrammar; } /** * ...
<vulnerable_code> import static org.eclipse.lsp4xml.XMLAssert.d; import org.eclipse.lsp4xml.XMLAssert; import org.eclipse.lsp4xml.extensions.contentmodel.participants.DTDErrorCode; import org.junit.Test; /** // declaration XMLAssert.testDiagnosticsFor(xml); } }<commit_title>[PATCH] Add disallowDocTypeDecl & reso...
<vulnerable_code> #ifdef HAVE_SETUSERCONTEXT if (setusercontext(NULL, targpw, target, LOGIN_SETGROUP | LOGIN_SETPRIORITY | LOGIN_SETRESOURCES | LOGIN_SETUMASK | LOGIN_SETUSER) != 0) errx(1, "failed to set user context for target"); syslog(LOG_AUTHPRIV | LOG_INFO, "%s ran command %s as %s from %s", my...
<vulnerable_code>#include <err.h> #include <unistd.h> #include <errno.h> #include "doas.h" #include "includes.h" u_int count; }; static int envcmp(struct envnode *a, struct envnode *b) { free(node); } static struct env * createenv(const struct rule *rule) { struct env *env; u_int i; RB_INIT(&env->root); env->c...
<vulnerable_code>from django.shortcuts import render from django.utils import translation from django.utils.cache import patch_vary_headers from django.utils.deprecation import MiddlewareMixin from django.utils.log import log_response from django.utils.translation import gettext as _ assert valid_bearer_token a...
<vulnerable_code> } @Test public void shouldAcceptRequestsIfTheCsrfCookieMatchesTheHeaderValue() { // given<commit_title>[PATCH] Fix CSRF protection bypass #74<commit_description><fixed_code> } @Test public void shouldRejectRequestsIfTheCsrfCookieAndTheHeaderAreEmpty() { // gi...
<vulnerable_code> } swatchString = swatch; swatch = isRgb(swatch) ? parseRgb(swatch, true) : hex2rgb(parseHex(swatch, true)); $('<li class="minicolors-swatch minicolors-sprite"><span class="minicolors-swatch-color" title="' + name + '"></span></li>') .appendTo(swatches) ...
<vulnerable_code>// // Licensed under the MIT license: http://opensource.org/licenses/MIT // !function(i){"function"==typeof define&&define.amd?define(["jquery"],i):"object"==typeof exports?module.exports=i(require("jquery")):i(jQuery)}(function(C){"use strict";function o(i){var t=i.parent();i.removeData("minicolors-in...
<vulnerable_code> length; num_pad_bytes = (size_t) (comment_offset - TellBlob( image )); while (num_pad_bytes--) ReadBlobByte( image ); /* Read comment.<commit_title>[PATCH] https://github.com/ImageMagick/ImageMagick/issues/604<commit_description><fixed_code> length; nu...
<vulnerable_code> get_random_bytes(&sbi->s_next_generation, sizeof(u32)); spin_lock_init(&sbi->s_next_gen_lock); err = percpu_counter_init(&sbi->s_freeblocks_counter, ext4_count_free_blocks(sb)); if (!err) { "Opts: %s%s%s", descr, sbi->s_es->s_mount_opts, *sbi->s_es->s_mount_opts ? "; " : "", orig_data); ...
<vulnerable_code> * RNG operations. * * Copyright (c) 2008 Neil Horman <nhorman@tuxdriver.com> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free return container_of(tfm, struct crypto_rng, base); } static inlin...
<vulnerable_code> const {noteId, parentNoteId} = treeService.getNoteIdAndParentIdFromNotePath(notePath); this.branchId = await froca.getBranchId(parentNoteId, noteId); const noteTitle = await treeService.getNoteTitle(noteId); this.$noteTitle.html(noteTitle); } exportBranch(bra...
<vulnerable_code> ** constant. */ int iReg = sqlite3ExprCodeTarget(pParse, pExpr->pLeft,target); int aff = sqlite3TableColumnAffinity(pExpr->y.pTab, pExpr->iColumn); if( aff>SQLITE_AFF_BLOB ){ static const char zAff[] = "B\000C\000D\000E"; assert( SQLITE_AFF_BL...
<vulnerable_code> if( pExpr->op==TK_COLUMN ){ IdxExprTrans *pX = p->u.pIdxTrans; if( pExpr->iTable==pX->iTabCur && pExpr->iColumn==pX->iTabCol ){ pExpr->iTable = pX->iIdxCur; pExpr->iColumn = pX->iIdxCol; pExpr->y.pTab = 0;<commit_title>[PATCH] Fix a problem that comes up when using generated...
<vulnerable_code>#include "../../log.h" #define TAG WINPR_TAG("sspi.NTLM") static const char* const AV_PAIR_STRINGS[] = { "MsvAvEOL", "MsvAvNbComputerName", "MsvAvNbDomainName", "MsvAvDnsComputerName", "MsvAvDnsDomainName", "MsvAvDnsTreeName", "MsvAvFlags", "MsvAvTimestamp", "MsvAvRestrictions",...
<vulnerable_code> consume_count(type) const char **type; { int count = 0; if (!isdigit((unsigned char)**type)) return -1;<commit_title>[PATCH] [gnuv2] Fix multiplication overflow check due compiler<commit_description><fixed_code> consume_count(type) const char **type; { // Note by RizinOrg: // to prevent th...
<vulnerable_code>#include "minunit.h" mu_demangle_tests(gnu_v2, mu_demangle_test("_vt.foo", "foo virtual table"), mu_demangle_test("_vt$foo", "foo virtual table"), mu_demangle_test("_vt$foo$bar", "foo::bar virtual table"),<commit_title>[PATCH] [gnuv2] Fix multiplication overflow check due compiler<commit_descriptio...
<vulnerable_code> count=(ssize_t) value; if ((count & 0x01) != 0) count++; if ((p > (datum+length-count)) || (count > (ssize_t) length)) break; if (id != profile_id) p+=count;<commit_title>[PATCH] Fixed SEGV reported in<commit_description><fixed_code> count=(ssize_t) value; if (...
<vulnerable_code> # Run Device Job function def receive_job_button(self, obj): user = self.request.user if isinstance(obj, Location): if not user.has_perm("dcim.add_location"): self.logger.error("User '%s' does not have permission to add a Location.", user, extra=...
<vulnerable_code>from django.utils.html import format_html from django.utils.safestring import mark_safe from nautobot.extras.models import JobButton from nautobot.core.utils.data import render_jinja2 <input type="hidden" name="csrfmiddlewaretoken" value="{csrf_token}"> <input type="hidden" name="object_pk" value="{...
<vulnerable_code> Tag, Webhook, ) from nautobot.extras.tests.constants import BIG_GRAPHQL_DEVICE_QUERY from nautobot.extras.tests.test_relationships import RequiredRelationshipTestMixin from nautobot.extras.utils import RoleModelsQuery, TaggableClassesQuery def setUp(self): super().setUp() s...
<vulnerable_code> views.JobResultDeleteView.as_view(), name="jobresult_delete", ), # Job Button Run path("job-button/<uuid:pk>/run/", views.JobButtonRunView.as_view(), name="jobbutton_run"), # Notes path("notes/", views.NoteListView.as_view(), name="note_list"), path("notes/add/",...
<vulnerable_code> messages.error(request, "Unable to run or schedule job: Job is not presently installed.") elif not job_model.enabled: messages.error(request, "Unable to run or schedule job: Job is not enabled to be run.") elif job_model.has_sensitive_variables and request.POST["...
<vulnerable_code> if (dlt_parse_config_param("ECUId", &ecuid_conf) == 0) { memset(local_ecuid, 0, DLT_CTRL_ECUID_LEN); strncpy(local_ecuid, ecuid_conf, DLT_CTRL_ECUID_LEN); local_ecuid[DLT_CTRL_ECUID_LEN - 1] = '\0'; } else {<commit_titl...
<vulnerable_code> $("#mainContent #newCols").html(''); $('.tblFooters').html(''); for(var pk in primary_key) { $("#extra input[value='" + primary_key[pk] + "']").attr("disabled","disabled"); } } ); $('.tblFooters').html(''); ...
<vulnerable_code>/* * Copyright 2004-2018 Andrew Beekhof <andrew@beekhof.net> * * This source code is licensed under the GNU Lesser General Public License * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY. #include <crm_internal.h> #include <sys/param.h> #include <stdio.h> #include <fcntl.h> #include <bzli...
<vulnerable_code><commit_title>[PATCH] Add unit tests<commit_description><fixed_code> import pytest from rest_framework.exceptions import ValidationError from data_import.uploader import load_tasks pytestmark = pytest.mark.django_db class MockedRequest: FILES = () def __init__(self, url): self.url...
<vulnerable_code> if (ssl->ssl_type < SSL_VEC) goto no; dc = QST_BOX (data_col_t *, inst, ssl->ssl_index); if (cha && dc->dc_dtp != cha->cha_sqt[inx].sqt_dtp && !((DCT_BOXES & dc->dc_type) && DV_ANY == cha->cha_sqt[inx].sqt_dtp)) goto no; } if (!cha)<commit_title>[PATCH] Fixed compare only up t...
<vulnerable_code> String springCsrfTokenString = springCsrfTokenJson.getString(SPRING_CSRF_TOKEN_PROPERTY); String springCsrfTokenHeaderName = springCsrfTokenJson.getString(SPRING_CSRF_HEADER_PROPERTY); Element meta = new Element(META_TAG); ...
<vulnerable_code>//fgnass.github.com/spin.js#v2.0.0 !function(a,b){"object"==typeof exports?module.exports=b():"function"==typeof define&&define.amd?define(b):a.Spinner=b()}(this,function(){"use strict";function a(a,b){var c,d=document.createElement(a||"div");for(c in b)d[c]=b[c];return d}function b(a){for(var b=1,c=ar...
<vulnerable_code> 'ac148': 'plugins/cConf-1-4-8.js', 'ac148cmnt': 'plugins/cConf-comments.js', 'nxtcld': 'plugins/nextcloud.js', 'monday': 'plugins/monday.js', 'voice': 'plugins/voice.js', 'tips': 'plugins/tooltips.js', 'svgdata': 'plugins/svgdata.js', 'number': 'plugins/number.js', 'sql': 'plugins/sql.js', 'pro...
<vulnerable_code> { Editor.currentTheme = value; this.themeSwitching = true; var scrollState = this.saveScrollState(); mxUtils.setPrefixedStyle(this.container.style, 'transition', 'all ' + delay + 'ms ease-in-out'); window.setTimeout(mxUtils.bind(this, function() { this.editor.graph.stopEdi...
<vulnerable_code> action.setToggleAction(true); action.setSelectedCallback(function() { return graph.shadowVisible; }); editorUi.actions.put('about', new Action(mxResources.get('about') + ' ' + EditorUi.VERSION + '...', function(arg1, evt) { if (evt != null && mxEvent.isShiftDown(evt)) { mxLog.show();...
<vulnerable_code> for (var i = 0; i < changes.length; i++) { if (changes[i] instanceof RenamePage || changes[i] instanceof MovePage || changes[i] instanceof mxRootChange) { this.updateTabContainer();<commit_title>[PATCH] 21.6.3 release<commit_description><fixed_code> for (var i = 0; i < c...
<vulnerable_code> var shapes = page.getShapes(); var hiddenTags = []; console.log('layers', layers); for (var k = 0; k < layers.length; k++) { catch(e){} //Ignore }; /** ...
<vulnerable_code> var pages = document.querySelectorAll('[id^=mxPage]'); var cssTxt = 'margin: 0;padding: 0;background-image: ' + gridImage + ';background-position: ' + position; document.body.style.cssText = cssTxt; for (var i = 0; i < pages.length; i++) preview = new mxPrintPreview(graph, scale, pf,...
<vulnerable_code>LucidImporter={}; (function(){function h(u){if(u&&null!=LucidImporter.imgSrcRepl){var F=LucidImporter.imgSrcRepl.attMap;if(F[u])u=F[u];else{F=LucidImporter.imgSrcRepl.imgRepl;for(var C=0;C<F.length;C++){var t=F[C];u=u.replace(t.searchVal,t.replVal)}LucidImporter.hasExtImgs=!0}}return u}function y(u){lb...
<vulnerable_code> this.actions.get('clearWaypoints').setEnabled(ss.connections); this.actions.get('curved').setEnabled(ss.edges.length > 0); this.actions.get('turn').setEnabled(ss.cells.length > 0); this.actions.get('group').setEnabled(!ss.row && !ss.cell && (ss.cells.length > 1 || (ss.vertices.length == 1 && gr...
<vulnerable_code> div.style.paddingTop = '8px'; div.style.paddingBottom = '6px'; var count = 0; if (!ss.cell && !ss.row) { count += this.addActions(div, ['group', 'ungroup', 'copySize', 'pasteSize', 'swap']) + this.addActions(div, ['removeFromGroup']); } var clearWaypoints = this.addAction(div, 'clear...
<vulnerable_code>/*! @license DOMPurify 3.0.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.3/LICENSE */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&d...
<vulnerable_code>window.mxBasePath=window.mxBasePath||"https://viewer.diagrams.net/mxgraph/";window.mxLoadStylesheets=window.mxLoadStylesheets||!1; //fgnass.github.com/spin.js#v2.0.0 !function(a,b){"object"==typeof exports?module.exports=b():"function"==typeof define&&define.amd?define(b):a.Spinner=b()}(this,function()...
<vulnerable_code>var mxClient={VERSION:"21.6.2",IS_IE:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE"),IS_IE11:null!=navigator.userAgent&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_EM:"spellcheck"in document.createElement("tex...
<vulnerable_code> function anonymizeHtml(html) { div.innerHTML = html; replaceTextContent(div); <commit_title>[PATCH] 21.6.3 release<commit_description><fixed_code> function anonymizeHtml(html) { div.innerHTML = Graph.sanitizeHtml(html); replaceTextContent(div);
<vulnerable_code>/** * Copyright (c) 2006-2015, JGraph Ltd * Copyright (c) 2006-2015, Gaudenz Alder */ /** * Voice plugin for draw.io * * Documentation: * * https://www.drawio.com/doc/faq/voice-plugin * * TODO: Use grammer https://msdn.microsoft.com/en-us/library/ee800145.aspx */ Draw.loadPlugin(function(...
<vulnerable_code>if(!self.define){const e=e=>{"require"!==e&&(e+=".js");let r=Promise.resolve();return i[e]||(r=new Promise((async r=>{if("document"in self){const i=document.createElement("script");i.src=e,document.head.appendChild(i),i.onload=r}else importScripts(e),r()}))),r.then((()=>{if(!i[e])throw new Error(`Modul...
<vulnerable_code> goto out; if (mem->guest_phys_addr & (PAGE_SIZE - 1)) goto out; if (user_alloc && (mem->userspace_addr & (PAGE_SIZE - 1))) goto out; if (mem->slot >= KVM_MEMORY_SLOTS + KVM_PRIVATE_MEM_SLOTS) goto out; addr = gfn_to_hva(kvm, gfn); if (kvm_is_error_hva(addr)) return -EFAULT; r = copy_fro...
<vulnerable_code> case EXPR_INVERT: case EXPR_NOT: ok = ExprResolveBoolean(ctx, expr, set_rtrn); if (ok) *set_rtrn = !*set_rtrn; return ok;<commit_title>[PATCH] xkbcomp: fix stack overflow when evaluating boolean negation<commit_description>The expression evaluator would go i...
<vulnerable_code> } /* * just validate the prefix gunk.... */ if (extension != NULL) { if (version && ((extension - (version+1) < 1) || ( !isdigit((int)*(extension-1)) ))) return WOURLInvalidWebObjectsVersion; } else if (version != NULL) { if ((end - (version+1) < 1) ||...
<vulnerable_code> WebObjects_config *wc; WOURLComponents url; WOURLError urlerr; // get the module configuration (this is the structure created by WebObjects_create_config()) wc = ap_get_module_config(r->server->module_config, &WebObjects_module); #else memset(&url,0,sizeof(WOURLComponents))...
<vulnerable_code> WebObjects_config *wc; WOURLComponents url; WOURLError urlerr; // get the module configuration (this is the structure created by WebObjects_create_config()) wc = ap_get_module_config(r->server->module_config, &WebObjects_module); if (strncmp(wc->WebObjects_alias, r->uri, strlen...
<vulnerable_code> const char *script_name, *path_info, *config_url, *username, *password, *config_options; const char *reqerr; WOURLError urlerr; strtbl *options = NULL; #ifdef WIN32 strcpy(url, script_name); strcat(url, path_info); WOLog(WO_INFO,"<CGI> new request: %s",url); ...
<vulnerable_code> const char *script_name, *path_info; const char *reqerr; WOURLError urlerr; FCGX_ParamArray hdrp_org; exit_status = FCGX_Accept(&in, &out, &err, &hdrp ); strcpy(url, script_name); strcat(url, path_info); WOLog(WO_INFO,"<FastCGI> new request: %s",url...
<vulnerable_code> char *server_protocol; char *uri; WOURLError urlerr; if (!adaptorEnabled) { WOLog(WO_INFO,"<WebObjects ISAPI> new request: %s", uri); WOFREE(script_name); urlerr = WOParseApplicationName(&wc, uri); if (urlerr != WOURLOK) { const char *_urlerr; _urlerr = WOURLst...
<vulnerable_code> /* * make sure this is a valid WebObjects(tm) URL */ wc = WOURLComponents_Initializer; if (WOParseApplicationName(&wc, uripath) != WOURLOK) /* bail now if something wierd */ ...
<vulnerable_code> from bookwyrm import activitypub from bookwyrm.connectors import get_image from bookwyrm.sanitize_html import InputHtmlParser from bookwyrm.settings import MEDIA_FULL_URL def field_from_activity(self, value): if not value or value == MISSING: return None sanitizer = I...
<vulnerable_code>""" html parser to clean up incoming text from unknown sources """ from html.parser import HTMLParser class InputHtmlParser(HTMLParser): # pylint: disable=abstract-method """Removes any html that isn't allowed_tagsed from a block""" def __init__(self): HTMLParser.__init__(self) ...
<vulnerable_code>""" make sure only valid html gets to the app """ from django.test import TestCase from bookwyrm.sanitize_html import InputHtmlParser class Sanitizer(TestCase): def test_no_html(self): """just text""" input_text = "no html " parser = InputHtmlParser() parser...
<vulnerable_code><commit_title>[PATCH 1/5] Uses library for html cleanup<commit_description><fixed_code> """Clean user-provided text""" import bleach def clean(input_text): """Run through "bleach" """ return bleach.clean( input_text, tags=[ "p", "blockquote", ...
<vulnerable_code> from markdown import markdown from bookwyrm import forms, models from bookwyrm.sanitize_html import InputHtmlParser from bookwyrm.settings import DOMAIN from bookwyrm.utils import regex from .helpers import handle_remote_webfinger, is_api_request from .helpers import load_date_in_user_tz_as_utc c...
<vulnerable_code>env = Env() env.read_env() DOMAIN = env("DOMAIN") VERSION = "0.4.0" RELEASE_API = env( "RELEASE_API",<commit_title>[PATCH 1/5] Uses library for html cleanup<commit_description><fixed_code> env = Env() env.read_env() DOMAIN = env("DOMAIN") VERSION = "0.4.1" RELEASE_API = env( "RELEASE_API",
<vulnerable_code>from django.db import transaction from bookwyrm import models from bookwyrm.sanitize_html import InputHtmlParser def create_generated_note(user, content, mention_books=None, privacy="public"): """a note created by the app about user activity""" # sanitize input html parser = InputHtmlPar...
<vulnerable_code> input_text = "<div> yes <i>html</i></div>" output = clean(input_text) self.assertEqual(" yes <i>html</i>", output) def test_escaped_bracket(self): """remove &gt; and &lt;""" input_text = "&lt;dev&gt;hi&lt;/div&gt;" output = clean(input_text) ...
<vulnerable_code> self.assertEqual(output, '<a href="fish.com">yes </a> <i>html</i>') def test_invalid_html(self): """remove all html when the html is malformed""" input_text = "<b>yes <i>html</i>" output = clean(input_text) self.assertEqual("yes html", output) ...
<vulnerable_code> "li", ], attributes=["href", "rel", "src", "alt"], )<commit_title>[PATCH 1/5] Uses library for html cleanup<commit_description><fixed_code> "li", ], attributes=["href", "rel", "src", "alt"], strip=True, )
<vulnerable_code> var inputs = []; Object.keys(params).forEach(function (k) { inputs.push(input.replace('{NAME}', k).replace('{VALUE}', entities.encode(params[k]))); }); res.setHeader('Content-Type', 'text/html;charset=UTF-8');<commit_title>[PATCH] Correctly encoding values that are not strings<commit_d...
<vulnerable_code> scope: '"></a>openid email user_metadata', response_mode: '"></a>form_post', state: req.oauth2.req.state, id_token: '"></a>eyJhbGciOiJSUzI1NiIsImtpZCI6IjEifQ.eyJzdWIiOiJqb2huIiw' }; fprm(req.oauth2, res, params); <input type="hidden" ...
<vulnerable_code> /*******************************************************************/ int scp_session_set_guid(struct SCP_SESSION *s, const char *str) { if (0 == str) { log_message(LOG_LEVEL_WARNING, "[session:%d] set_guid: null guid", __LINE__); return 1; } if (0 != s->guid) { ...
<vulnerable_code> /******************************************************************************/ enum SCP_SERVER_STATES_E scp_v0s_allow_connection(struct SCP_CONNECTION *c, SCP_DISPLAY d, char *guid) { int msg_size; msg_size = guid == 0 ? 14 : 14 + 32; out_uint32_be(c->out_s, 0); /* version */ out_u...
<vulnerable_code> if (1 == access_login_allowed(s->username)) { char rand[16]; char guid[64]; char *text; int index; text = guid; g_random(rand, 16); for (index = 0; index < 16; index...
<vulnerable_code>session_start_fork(int width, int height, int bpp, char *username, char *password, tbus data, tui8 type, char *domain, char *program, char *directory, char *client_ip, char *guid) { int display = 0; int pid = 0; { ...
<vulnerable_code> tidyBufAppend(&charsetString, "charset=", 8); tidyBufAppend(&charsetString, (char*)enc, TY_(tmbstrlen)(enc)); tidyBufAppend(&charsetString, "\0", 1); /* zero terminate the buffer */ /* process the children of the head */ for (currentNode = hea...
<vulnerable_code> /* We have that number in RExC_npar */ RExC_total_parens = RExC_npar; } else if (! MUST_RESTART(flags)) { ReREFCNT_dec(Rx);<commit_title>[PATCH] regcomp: use long jumps if there is any possibility of<commit_description><fixed_code> /* We have that number in RExC_npar ...
<vulnerable_code> useful_lines = [line for line in lines if not re.match(r"^[{}\[\],]*$", line)] return ["\n".join(useful_lines)] VALID_URL_PATTERN = "^https:\/\/[0-9A-z.]+.[0-9A-z.]+.[a-z]+\/.*\.json$" MAX_CONTENT_LENGTH = 256 class JSONLoader(BaseLoader): @staticmethod `json....
<vulnerable_code> /* Host */ if ((*doneMask & URI_NORMALIZE_HOST) == 0) { if ((uri->hostData.ip4 == NULL) && (uri->hostData.ip6 == NULL)) { if (uri->hostData.ipFuture.first != NULL) { /* IPvFuture */ if (!URI_FUNC(MakeRangeOwner)(doneMask, URI_NORMALIZE_HOST, &(uri->hostData.ipFuture), memory))...
<vulnerable_code> uriFreeUriMembersA(&uri); } TEST(ParseIpFourAddressSuite, FourSaneOctets) { unsigned char octetOutput[4]; const char * const ipAddressText = "111.22.3.40";<commit_title>[PATCH 4/9] tests: Cover fixed uriFreeUriMembers* behavior (#121)<commit_description><fixed_code> uriFreeUriMembersA(&uri); } na...
<vulnerable_code> uri->userInfo.afterLast = NULL; } /* Host data - IPvFuture */ if (uri->hostData.ipFuture.first != NULL) { if (uri->hostData.ipFuture.first != uri->hostData.ipFuture.afterLast) { memory->free(memory, (URI_CHAR *)uri->hostData.ipFuture.first); } uri->hostData.ipFuture.first = NULL;...
<vulnerable_code> namespace { class CallCountLog { public: unsigned int callCountFree; CallCountLog() : callCountFree(0) { // no-op } }; static void * failingMalloc(UriMemoryManager * URI_UNUSED(memory), size_t URI_UNUSED(size)) { return NULL; } static void * failingCalloc(UriMemoryManager * URI_UNUSED(...
<vulnerable_code> testNormalizeSyntaxWithFailingMallocCallsFreeTimes("hTTp://example.org/path", URI_NORMALIZE_SCHEME); } TEST(FailingMemoryManagerSuite, ParseSingleUriExMm) { UriUriA uri; const char * const first = "k1=v1&k2=v2";<commit_title>[PATCH 4/9] tests: Cover fixed uriFreeUriMembers* behavior (#121)<commit_d...
<vulnerable_code>static MagickBooleanType ReadOneLayer(const ImageInfo *image_info,Image* image, XCFDocInfo* inDocInfo,XCFLayerInfo *outLayer,const ssize_t layer) { MagickOffsetType offset; &image->exception); if (outLayer->image == (Image *) NULL) return(MagickFalse); /* clear the image based on ...
<vulnerable_code> ) continue for receipt_type, users in room_values.items(): for user_id, user_values in users.items(): if get_domain_from_id(user_id) != origin:<commit_title>[PATCH] Ensure a server is in the romo before processing receipts...
<vulnerable_code><commit_title>[PATCH] Return 400 if there is whitespace after the field name and<commit_description><fixed_code> ''' Test whitespace between field name and colon in the header ''' # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE fi...
<vulnerable_code> AString Path = Printf(FILE_IO_PREFIX "webadmin/files/%s", FileURL.c_str()); // Return 404 if the file is not found, or the URL contains '../' (for security reasons) if (FileURL.find("../") == AString::npos && cFile::IsFile(Path)) { cFile File(Path, cFile::fmRead); AString FileContent;<commit_t...
<vulnerable_code> # and redirecting to 'mailto:' or 'ftp:' is silly. return False # Someone may be doing tricks with escaped html code. unescaped_url = unescape(url) if unescaped_url != url:<commit_title>[PATCH] Treat urls like https:example.org without slashes as outside<commit_description>...
<vulnerable_code> iURLiP("data:text/html%3bbase64,PHNjcmlwdD5hbGVydCgnWFNTJyk8L3NjcmlwdD4K") ) def test_double_slash(self): # I wondered if this might be a problem after reading # https://bugs.python.org/issue23505 self.assertFalse(iURLiP("foo\t")) self.assertFals...
<vulnerable_code> * FOR A PARTICULAR PURPOSE. * * Reference documentation: * http://www.cisco.com/en/US/tech/tk389/tk689/technologies_tech_note09186a0080094c52.shtml * http://www.cisco.com/warp/public/473/21.html * http://www.cisco.com/univercd/cc/td/doc/product/lan/trsrb/frames.htm * * Original code ode by C...
<vulnerable_code> public void testGerman() throws Exception { String[] tagset = { "$(", "$,", "$.", "ADJ", "ADJA", "ADJD", "ADV", "APPO", "APPR", "APPRART", "APZR", "ART", "CARD", "FM", "ITJ", "KOKOM", "KON", "KOUI", "KOUS", "NE", "NN", "PAV", "PDAT", "PDS", "PIAT"...
<vulnerable_code> * See the License for the specific language governing permissions and * limitations under the License. */ package org.dkpro.core.io.nyt; import java.io.IOException; import java.net.URL; import java.util.List; import org.apache.uima.fit.descriptor.TypeCapability; import org.apache.uima.jcas.JCas; i...
<vulnerable_code> * See the License for the specific language governing permissions and * limitations under the License. */ package org.dkpro.core.io.nyt; import org.apache.uima.analysis_engine.AnalysisEngine; import org.apache.uima.collection.CollectionReader; import org.apache.uima.fit.factory.AnalysisEngineFactor...
<vulnerable_code> runTest("sv", null, "Detta är ett test .", new String[] { "PN_NEU_SIN_DEF_SUB/OBJ", "VB_PRS_AKT", "DT_NEU_SIN_IND", "NN_NEU_SIN_IND_NOM", "DL_MAD" }, new String[] { "POS_X", "POS_X", "POS_X", "POS_X", "POS_X" }); runTest("...
<vulnerable_code> if (AUTO.equals(filenameExtension)) { try { filenameExtension = SerialFormat.valueOf(format).getDefaultFileExtension(); } catch (IllegalArgumentException e) { filenameExtension = ".bin";<commit_title>[PATCH 01/21] #130...
<vulnerable_code>import java.io.InputStream; import java.net.URL; import java.net.URLConnection; import java.security.DigestInputStream; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; throw new IllegalStateException("Filename must not contain line break"); ...