text
stringlengths
79
3.72M
<vulnerable_code> DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); documentBuilderFactory.setNamespaceAware(true); documentBuilderFactory.setIgnoringElementContentWhitespace(true); DocumentBuilder documentBuilder = documentBuilderFactor...
<vulnerable_code>package apoc.load; import apoc.util.TestUtil; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.neo4j.graphdb.GraphDatabaseService; import org.neo4j.helpers.collection.Iterators; import org.neo4j.test.TestGraphDatabaseFactory; import java.util.Collections; import java...
<vulnerable_code> if ((!error || error == GIT_ECERTIFICATE) && t->owner->certificate_check_cb != NULL && git_stream_is_encrypted(t->io)) { git_cert *cert; int is_valid; if ((error = git_stream_certificate(&cert, t->io)) < 0) return error; giterr_clear(); is_valid = error != GIT_ECERTIFICATE; error...
<vulnerable_code> color; length=(size_t) header.ncolors; colors=(XColor *) AcquireQuantumMemory(length,sizeof(*colors)); if (colors == (XColor *) NULL) {<commit_title>[PATCH] https://github.com/ImageMagick/ImageMagick/issues/471<commit_description><fixed_code> color; len...
<vulnerable_code> struct Pair { COMPS_HSList * subnodes; char * key; char added; } *pair, *parent_pair; pair = malloc(sizeof(struct Pair)); parent_pair = (struct Pair*) it->data; free(it); pair->added = 0; for (it = tmp_subnodes->first; it != NULL; it...
<vulnerable_code> struct Pair { COMPS_HSList * subnodes; char * key; char added; } *pair, *parent_pair; pair = malloc(sizeof(struct Pair));<commit_title>[PATCH] Fix UAF in comps_objmrtree_unite function<commit_description>The added field is not used at all in many places and it is pr...
<vulnerable_code> } else { internal_decoder_data->decode_to_value->value.binary_value.bytes = (unsigned char*)malloc((size_t)internal_decoder_data->decode_to_value->value.binary_value.length + 1); ...
<vulnerable_code>'use strict'; const CDP = require('chrome-remote-interface');<commit_title>[PATCH] copyright headers (#72)<commit_description><fixed_code> /* * Copyright 2017 Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in ...
<vulnerable_code> # squashfs-root-0). UNIQUE_PATH_DELIMITER = '%%' # Unprivileged user account to execute external extraction utilities UNPRIVILEGED_USER_NAME = 'binwalk_safe_user_69' TITLE = 'Extraction' ORDER = 9 PRIMARY = False # Don't run as root, unless explicitly instr...
<vulnerable_code> int ret; skb = nci_skb_alloc(nspi->ndev, 0, GFP_KERNEL); /* add the NCI SPI header to the start of the buffer */ hdr = skb_push(skb, NCI_SPI_HDR_LEN);<commit_title>[PATCH] nfc: nci: fix possible NULL pointer dereference in<commit_description><fixed_code> int ret; skb = nci_skb_alloc(nspi->ndev...
<vulnerable_code>from tensorflow.python.framework import tensor_spec from tensorflow.python.framework import test_util from tensorflow.python.ops import array_ops from tensorflow.python.ops import gradient_checker from tensorflow.python.ops import nn_ops from tensorflow.python.ops import sparse_ops self._assertSp...
<vulnerable_code>define("app-config",[],function(){"use strict";var e=JSON.parse(JSON.stringify(SULU));return{getUser:function(){return e.user},getLocales:function(t){return t?e.translatedLocales:e.locales},getTranslations:function(){return e.translations},getFallbackLocale:function(){return e.fallbackLocale},getSectio...
<vulnerable_code>require.config({waitSeconds:0,paths:{suluadmin:"../../suluadmin/js",main:"login",cultures:"vendor/globalize/cultures","aura_extensions/backbone-relational":"aura_extensions/backbone-relational",husky:"vendor/husky/husky","__component__$login@suluadmin":"components/login/main"},include:["aura_extensions...
<vulnerable_code> ' <div class="border">' + ' <div class="text">' + ' <% _.each(fields, function(field, idx) { %>' + ' <div class="suggestion-column" style="width: <%= field.width %>;"><%= context[field.id] %></di...
<vulnerable_code>var requirejs,require,define;(function(global){function isFunction(e){return ostring.call(e)==="[object Function]"}function isArray(e){return ostring.call(e)==="[object Array]"}function each(e,t){if(e){var n;for(n=0;n<e.length;n+=1)if(e[n]&&t(e[n],n,e))break}}function eachReverse(e,t){if(e){var n;for(n...
<vulnerable_code> void AccountSettings::slotOpenOC() { if (_OCUrl.isValid()) QDesktopServices::openUrl(_OCUrl); } void AccountSettings::slotUpdateQuota(qint64 total, qint64 used)<commit_title>[PATCH] Validate sensitive URLs to onle allow http(s) schemes.<commit_description>Signed-off-by: allexzander <black...
<vulnerable_code>#include "theme.h" #include "networkjobs.h" #include "configfile.h" namespace OCC { { case actionOpenBrowser: // Try to open Browser if (!QDesktopServices::openUrl(authorisationLink())) { // We cannot open the browser, then we claim we don't sup...
<vulnerable_code>#include "theme.h" #include "networkjobs.h" #include "creds/httpcredentials.h" namespace OCC { bool OAuth::openBrowser() { if (!QDesktopServices::openUrl(authorisationLink())) { // We cannot open the browser, then we claim we don't support OAuth. emit result(NotSupported, QString...
<vulnerable_code>#include <QUrlQuery> #include "common/asserts.h" using namespace OCC; Q_LOGGING_CATEGORY(lcUtility, "nextcloud.gui.utility", QtInfoMsg) bool Utility::openBrowser(const QUrl &url, QWidget *errorWidgetParent) { if (!QDesktopServices::openUrl(url)) { if (errorWidgetParent) { QM...
<vulnerable_code>#include "accountmanager.h" #include "common/syncjournalfilerecord.h" #include "creds/abstractcredentials.h" #ifdef WITH_LIBCLOUDPROVIDERS #include "cloudproviders/cloudprovidermanager.h" #endif void ownCloudGui::slotOpenOwnCloud() { if (auto account = qvariant_cast<AccountPtr>(sender()->property(p...
<vulnerable_code> auto url = QUrl(data.value("url").toString()); if(!url.isEmpty()) Utility::openBrowser(url, nullptr); }); job->start(); } void OCC::SocketApi::openPrivateLink(const QString &link) { Utility::openBrowser(link, nullptr); } void SocketApi::command_GET_STRINGS(con...
<vulnerable_code>#include "iconjob.h" #include "accessmanager.h" #include "owncloudgui.h" #include "ActivityData.h" #include "ActivityListModel.h" QDesktopServices::openUrl(path); } else { const auto link = data(modelIndex, LinkRole).toUrl(); QDesktopServices::openUrl(link); } } co...
<vulnerable_code>#include "configfile.h" #include "notificationconfirmjob.h" #include "logger.h" #include <QDesktopServices> #include <QIcon> const auto talkApp = currentUser()->talkApp(); if (talkApp) { QDesktopServices::openUrl(talkApp->url()); } else { qCWarning(lcActivity) << "The Talk...
<vulnerable_code>#include <QDir> #include <QUrl> #include "wizard/owncloudwizardresultpage.h" #include "wizard/owncloudwizardcommon.h" #include "theme.h" { Theme *theme = Theme::instance(); QUrl url = QUrl(field("OCUrl").toString() + theme->wizardUrlPostfix()); QDesktopServices::openUrl(url); } } // names...
<vulnerable_code>#include <QWebEngineCertificateError> #include <QMessageBox> #include "common/utility.h" namespace OCC { { Q_UNUSED(type); Q_UNUSED(isMainFrame); QDesktopServices::openUrl(url); return false; } <commit_title>[PATCH] Validate sensitive URLs to onle allow http(s) schemes.<commit_descrip...
<vulnerable_code> this.status = status; } public String sanitizeNotes(String note) { return WebUtil.escapeHTML(note); } public String getNotes() { return notes; }<commit_title>[PATCH] Update<commit_description><fixed_code> this.status = status; } public Stri...
<vulnerable_code># "^" / "_" / "`" / "|" / "~" / DIGIT / ALPHA # token = 1*tchar _TCHAR_SPECIALS : Final[str] = "!#$%&'*+-.^_`|~" METHRE: Final[Pattern[str]] = re.compile("[0-9A-Za-z%s]+" % re.escape(_TCHAR_SPECIALS)) VERSRE: Final[Pattern[str]] = re.compile(r"HTTP/(\d)\.(\d)") # FIXME: unreadable, and ...
<vulnerable_code> 'https://www.slideshare.net/api/oembed/2', '\'unsafe-inline\'' // this is ignored by browsers supporting nonces/hashes ], styleSrc: [config.serverURL + '/build/', '\'unsafe-inline\'', 'https://github.githubassets.com'], // unsafe-inline is required for some libs, plus used in views object...
<vulnerable_code> }, globals: { 'ts-jest': { tsConfig: './tsconfig.spec.json', stringifyContentPathRegex: '\\.html$', astTransformers: ['jest-preset-angular/build/InlineFilesTransformer', 'jest-preset-angular/build/StripStylesTransformer'], },<commit_title>[PATCH] feat(lib): (FEAT) prevent ...
<vulnerable_code> preset: '../../../jest.config.js', globals: { 'ts-jest': { tsConfig: '<rootDir>/tsconfig.spec.json', }, }, transform: {<commit_title>[PATCH] feat(lib): (FEAT) prevent possible XSS attack by encoding<commit_description><fixed_code> preset: '../../../jest.config.js', globals: { ...
<vulnerable_code> __file_uri__=None, ): # Merge served directory and requested file if provided root_path = file_path = unquote(file_or_directory) if __file_uri__: # Strip all / that in the beginning of the URL to help prevent raise BadRequest("Invalid URL...
<vulnerable_code>/* $OpenBSD: server_file.c,v 1.63 2017/01/30 09:54:41 reyk Exp $ */ /* * Copyright (c) 2006 - 2015 Reyk Floeter <reyk@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above #define MINIMUM(a, ...
<vulnerable_code>/* $OpenBSD: server_http.c,v 1.111 2017/01/31 12:21:27 reyk Exp $ */ /* * Copyright (c) 2006 - 2015 Reyk Floeter <reyk@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above server_close(clt, ...
<vulnerable_code> return; } } if (expectedContentLength != UNSET_CONTENT_LENGTH && HttpUtil.isTransferEncodingChunked(req)) { // TODO(carl-mastrangelo): this is not right, but meh. Fix this to return a proper 400. ctx.writeAndFl...
<vulnerable_code> case RSVP_OBJ_FASTREROUTE: /* the differences between c-type 1 and 7 are minor */ obj_ptr.rsvp_obj_frr = (const struct rsvp_obj_frr_t *)obj_tptr; bw.i = EXTRACT_32BITS(obj_ptr.rsvp_obj_frr->bandwidth); switch(rsvp_obj_ctype) { case RS...
<vulnerable_code> function gitClone () { // --depth implies --single-branch const flag = depth < Infinity ? '--depth=' + depth : '--single-branch' const args = ['clone', flag, url, outPath] debug('git ' + args.join(' ')) spawn('git', args, {}, function (err) { if (err) err.message += ' (git c...
<vulnerable_code> "19827342231.999888000", decimal); } @Test public void testExtractNanosecondDecimal01() { BigDecimal value = new BigDecimal("0"); long seconds = value.longValue(); assertEquals("The second part is not correct.", 0L, seconds); int nanose...
<vulnerable_code> if (!esd) continue; if (!esd->decoderConfig || (esd->decoderConfig->objectTypeIndication==GF_CODECID_TEXT_MPEG4)) { gf_odf_desc_del((GF_Descriptor *) esd); continue; } ) { nb_samp += gf_isom_get_sample_count(load->isom, i+1); gf_odf_desc_del((GF_Descriptor *) esd); continue; ...
<vulnerable_code>package io.dropwizard.validation; import static org.assertj.core.api.Assertions.assertThat; import javax.annotation.concurrent.NotThreadSafe; import javax.validation.Validator; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import...
<vulnerable_code> YYABORT; } data_node = actual; actual_type = NOTIFICATION_KEYWORD; } <commit_title>[PATC...
<vulnerable_code> mbedtls_mpi *r, mbedtls_mpi *s, const mbedtls_mpi *d, const unsigned char *buf, size_t blen, int (*f_rng)(void *, unsigned char *, size_t), void *p_rng, mbedtls_ecdsa_restart_ctx *rs_ctx ) { int ret, key_tries, sign_tries; mul: #endif ...
<vulnerable_code> mbedtls_hmac_drbg_random, p_rng, f_rng_blind, p_rng_blind, rs_ctx ); else /* * Use the same RNG for both blinding and ephemeral key generation. * Since the RNG output is always the same for the sam...
<vulnerable_code># Define the logger logger = logging.getLogger(__name__) def get_pyinfo(): try: class UserForm(CherryForm): userid = StringField(_('UserID')) username = StringField(_('Username'), validators=[validators.data_required()]) email = EmailField(_('Email'), validators=[validators.optional(...
<vulnerable_code>import cherrypy from wtforms.fields import PasswordField, StringField from wtforms.fields.simple import HiddenField from wtforms.validators import InputRequired from rdiffweb.controller import Controller, flash from rdiffweb.controller.cherrypy_wtf import CherryForm class LoginForm(CherryForm): lo...
<vulnerable_code> class UserProfileForm(CherryForm): email = EmailField(_('Email'), validators=[DataRequired(), Regexp(PATTERN_EMAIL, message=_("Invalid email."))]) class UserPasswordForm(CherryForm):<commit_title>[PATCH] Define field limit for username, email and root directory<commit_description><fixed_code> ...
<vulnerable_code> user = self.app.store.get_user('test6') self.assertEqual('', user.user_root) def test_delete_user_with_not_existing_username(self): """ Verify failure to delete invalid username.<commit_title>[PATCH] Define field limit for username, email and root directory<commit_d...
<vulnerable_code> self.getPage('/login/', method='GET') self.assertStatus('200 OK') def test_getpage_with_empty_password(self): """ Check if authentication is failing without a password.<commit_title>[PATCH] Define field limit for username, email and root directory<commit_description...
<vulnerable_code> self._set_profile_info("test@test.com, test2@test.com") self.assertInBody("Invalid email") def test_change_password(self): # When udating user's password self._set_password(self.PASSWORD, "newpassword", "newpassword")<commit_title>[PATCH] Define field limit for user...
<vulnerable_code> newvp->vp_length = 1; fr_pair_add(&(r->vps), newvp); attr += 3; attrlen -= 3; /* now, loop processing each attribute that we find */ while(attrlen > 0) { uint8_t *p; if(attrlen < 2) { fr_strerror_printf("EAP-Sim attribute %d too short: %d < 2", es_attribute_count, attrlen); retu...
<vulnerable_code> from traitlets import Set from .common import next_page_from_links from .oauth2 import OAuthLoginHandler, OAuthenticator # Support gitlab.com and gitlab community edition installations def _check_group_whitelist(self, username, user_id, is_admin, access_token): http_client = AsyncHTTPCli...
<vulnerable_code> a->hseq = a_form.hseq; a->y = a_form.y; a->end.pos = pos + ecol - col; l->lineBuf[pos - 1] = '['; l->lineBuf[a->end.pos] = ']'; for (k = pos; k < a->end.pos; k++)<commit_title>[PATCH] Prevent segfault due to buffer overflows in addMultirowsForm<commit_description>Bug-Debia...
<vulnerable_code> OM_uint32 tmpmin; size_t i; generic_gss_release_oid(&tmpmin, &sc->internal_mech); gss_delete_sec_context(&tmpmin, &sc->ctx_handle, GSS_C_NO_BUFFER); <commit_title>[PATCH] Fix double-free in SPNEGO [CVE-2014-4343]<commit_description>In commit cd7d6b08 ("Verify acceptor's mech in SPNEGO in...
<vulnerable_code>#define mono_finalizer_lock() EnterCriticalSection (&finalizer_mutex) #define mono_finalizer_unlock() LeaveCriticalSection (&finalizer_mutex) static CRITICAL_SECTION finalizer_mutex; static GSList *domains_to_finalize= NULL; static MonoMList *threads_to_finalize = NULL; static void mono_gchandle_set_...
<vulnerable_code> if (lex< variable >()) { return SASS_MEMORY_NEW(Variable, pstate, Util::normalize_underscores(lexed)); } // Special case handling for `%` proceeding an interpolant. if (lex< sequence< exactly<'%'>, optional< percentage > > >()) { return SASS_MEMORY_NEW(String_Constant, pstate, lexe...
<vulnerable_code> // Either the call to readlink failed, or the result was truncated. return QString(); } pathbuf[len] = '\0'; logger.debug() << "Mapped PID" << pid << "to" << pathbuf; return QString::fromLocal8Bit(pathbuf, len); }<commit_title>[PATCH] Tidy up some debug<commit_description><fixed_code...
<vulnerable_code> if(stream->bodystarted) { /* This is trailer fields. */ /* 3 is for ":" and "\r\n". */ uint32_t n = (uint32_t)(namelen + valuelen + 3); DEBUGF(infof(data_s, "h2 trailer: %.*s: %.*s\n", namelen, name, valuelen, value));<commit_title>[PATCH] http2.c: fix incorrect tra...
<vulnerable_code> { int i = strlen(pieces[1]); s = strchr(pieces[1], '('); if (!s && pieces[1][i - 1] != ')') { pool_error(pool, 0, "testcase_read: bad namespace '%s'", pieces[1]); }<commit_title>[PATCH] Fix: testsolv segfaults<commit_description>ERROR: AddressSanitizer: SEGV on unknown addres...
<vulnerable_code>module.exports = function (email, callback, timeout, from_email) { timeout = timeout || 5000; from_email = from_email || email; if (!/^\S+@\S+$/.test(email)) { callback(null, false); return; } dns.resolveMx(email.split('@')[1], function(err, addresses){ if (err || addresses.length === 0) { ...
<vulnerable_code> var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar.source); /** Used to match leading and trailing whitespace. */ var reTrim = /^\s+|\s+$/g, reTrimStart = /^\s+/, reTrimEnd = /\s+$/; /** Used to match wrap detail comments. */ var reWrapComment ...
<vulnerable_code> gf_filter_pid_set_eos(ch->pid); } break; } else { read->force_fetch = GF_TRUE; break;<commit_title>[PATCH] fixed #1876<commit_description><fixed_code> gf_filter_pid_set_eos(ch->pid); } break; } else if (ch->last_state==GF_ISOM_INVALID_FILE) { if (!ch->eos_sen...
<vulnerable_code> if (!ch->has_edit_list && ch->sample_num) ch->sample_num--; } else { if (ch->sample_num >= gf_isom_get_sample_count(ch->owner->mov, ch->track)) { ch->last_state = GF_EOS; }<commit_title>[PATCH] fixed #1876<commit_description><fixed_code> if (!ch->has_edit_list && ch->sample...
<vulnerable_code>{ int phy_addr; struct netdev_private *np = netdev_priv(dev); struct mii_data *miidata = (struct mii_data *) &rq->ifr_ifru; struct netdev_desc *desc; int i; phy_addr = np->phy_addr; switch (cmd) { case SIOCDEVPRIVATE: break; case SIOCDEVPRIVATE + 1: miidata->out_value = mii_read (dev, p...
<vulnerable_code> return FALSE; } if (!num_chans) { strcpy (wpc->error_message, "channel count cannot be zero!"); return FALSE; } if (wpc->config.num_channels == 1) wpc->block_samples *= 2; while (wpc->block_samples > 12000 && wpc->block_samples * wpc->c...
<vulnerable_code> Handlers to which the logger sends log messages are added using the |add| method. Note that you can use the |Logger| right after import as it comes pre-configured (logs are emitted to |sys.stderr| by default). Messages can be logged with different severity levels and using braces attri...
<vulnerable_code> } function confirmModal( link ) { var i, dataAtts, $info = initModal( '#frm_confirm_modal', '400px' ), continueButton = document.getElementById( 'frm-confirmed-click' ); if ( $info === false ) { return false; } var caution = link.getAttribute( 'data-frmcaution' ); var cautionHtm...
<vulnerable_code>#!/usr/bin/env node /** * Copyright (c) 2014 Trent Mick. All rights reserved. * Copyright (c) 2014 Joyent Inc. All rights reserved. * * json -- JSON love for your command line. * * * 'a.b.c' -> ["a","b","c"] * 'b["a"]' -> ["b","a"] * 'b["a" + "c"]' -> ["b","ac"] * * Optionally recei...
<vulnerable_code> parseLookup: function (test) { var parseLookup = require('../lib/json.js').parseLookup; test.deepEqual(parseLookup('42'), [42]); test.deepEqual(parseLookup('a'), ['a']); test.deepEqual(parseLookup('a.b'), ['a', 'b']); test.deepEqual(parseLookup('a.b.c'), ['a...
<vulnerable_code> var_header_length += sizeof(u16_t); } param->message.payload.data = NULL; param->message.payload.len = var_length - var_header_length; <commit_title>[PATCH] net: mqtt: Improve PUBLISH message length validation<commit_description>Identify when received PUBLISH message is malformed and overall pack...
<vulnerable_code> */ static int eval_msg_publish(struct mqtt_test *mqtt_test); /** * @brief eval_msg_subscribe Evaluate the given mqtt_test against the * subscribe packing/unpacking routines. .message.payload.len = 2, }; /* * MQTT SUBSCRIBE msg: * pkt_id: 1, topic: sensors, qos: 0 .ctx = &msg_publish4, .eva...
<vulnerable_code> * - [cookieParser](https://github.com/expressjs/cookie-parser) cookie parser * - [compress](https://github.com/expressjs/compression) Gzip compression middleware * - [csrf](https://github.com/expressjs/csurf) Cross-site request forgery protection * - [errorHandler](https://github.com/expressjs/...
<vulnerable_code> * MIT Licensed */ // TODO: arrow key navigation // TODO: make icons extensible /** * Module dependencies. */ var fs = require('fs') , parse = require('url').parse , utils = require('../utils') , path = require('path') , normalize = path.normalize , sep = path.sep , extname = path.ext...
<vulnerable_code> gnrc_sixlowpan_frag_vrb_t *vrbe = NULL; #endif /* MODULE_GNRC_SIXLOWPAN_FRAG_VRB */ if (rbuf != NULL) { ipv6 = rbuf->pkt; assert(ipv6 != NULL);<commit_title>[PATCH] gnrc_sixlowpan_iphc: check IPHC dispatch for truncation<commit_description><fixed_code> gnrc_sixlowpan_frag_...
<vulnerable_code> * another trick required to cope with how the PROCOM state * machine works. -acme */ skb->sk = sk; } if (!sock_owned_by_user(sk)) llc_conn_rcv(sk, skb);<commit_title>[PATCH] net/llc: avoid BUG_ON() in skb_orphan()<commit_description>It seems nobody used LLC since linux-3.12. Fortunately...
<vulnerable_code> ev->type = LLC_SAP_EV_TYPE_PDU; ev->reason = 0; skb->sk = sk; llc_sap_state_process(sap, skb); } <commit_title>[PATCH] net/llc: avoid BUG_ON() in skb_orphan()<commit_description>It seems nobody used LLC since linux-3.12. Fortunately fuzzers like syzkaller still know how to run this code, otherw...
<vulnerable_code> return NULL; } RBuffer *tbuf = r_buf_new (); r_buf_set_bytes (tbuf, buf, sz); struct r_bin_bflt_obj *res = r_bin_bflt_new_buf (tbuf); r_buf_free (tbuf); r_buf_write_at (buf, addr_to_patch, (void *)val, sizeof (val)); } static int search_old_relocation(struct reloc_struct_t *reloc_table, ut32 a...
<vulnerable_code> if (si->slice_type > 9) return -1; pps_id = gf_bs_read_ue_log(bs, "pps_id"); if ((pps_id<0) || (pps_id > 255)) return -1; si->pps = &avc->pps[pps_id]; if (!si->pps->slice_group_count) return -2; if (si->pps->sps_id>=255) return -1; si->sps = &avc->sps[si->pps->sps_id]; if (!si->sps->log2_max_f...
<vulnerable_code> """ os.mkdir(os.path.join(self.tempdir, 'existing_directory')) url = f'/python.org/..%2f..%2f..%2f..%2f..%2f../%0a%0d/../{self.tempdir_name}/existing_directory' # Canonicalizes to /tmp/tempdir_name/existing_directory which does # exist and is a dir, triggering th...
<vulnerable_code>static void setup_namespaces(struct lo_data *lo, struct fuse_session *se) { pid_t child; char template[] = "virtiofsd-XXXXXX"; char *tmpdir; /* * Create a new pid namespace for *child* processes. We'll have to exit(1); } tmpdir = mkdtemp(template); if (!tmpdi...
<vulnerable_code> ast_debug_dtls(3, "(%p) DTLS - __rtp_recvfrom rtp=%p - Got SSL packet '%d'\n", instance, rtp, *in); /* * A race condition is prevented between dtls_perform_handshake() * and this function because both functions have to get the<commit_title>[PATCH] res_rtp_asterisk.c: Check DTLS packets agai...
<vulnerable_code> return c; } /** * Checks whether this is an invalid VCHAR based on RFC9110. * If this not a valid ISO-8859-1 character or a control character<commit_title>[PATCH] Issue #9554 - changes from review<commit_description>Signed-off-by: Lachlan Roberts <lachlan@webtide.com><fixed_...
<vulnerable_code> if (LOG.isDebugEnabled()) LOG.debug(String.format("CtxTbl[%x] decoding %d octets", _context.hashCode(), buffer.remaining())); // If the buffer is big, don't even think about decoding it if (buffer.remaining() > _builder.getMaxSize()) throw new HpackExcep...
<vulnerable_code> _contentLength = -1; } } /** * Check that the max size will not be exceeded. * * @param length the length * @param huffman the huffman name * @throws SessionException in case of size errors */ public void checkSize(int length, boolean huffm...
<vulnerable_code> LOG.debug("Decoding: streamId={}, buffer={}", streamId, BufferUtil.toDetailString(buffer)); // If the buffer is big, don't even think about decoding it int maxHeaderSize = getMaxHeaderSize(); if (buffer.remaining() > maxHeaderSize) throw new QpackExcepti...
<vulnerable_code> if (typeof windowhash === 'string' && windowhash.indexOf('frameurl=') > -1) { var hash = windowhash.split('frameurl=')[1]; var hash = decodeURI(atob(hash)) // iframe.src = hash; } else { <commit_title>[PATCH] update<commit_description><fixed_code> if (typeof wind...
<vulnerable_code> name = name.replace('-', '_') # bpo-35907: # disallow the file reading with the type not allowed if not hasattr(self, name) or \ getattr(self, name) == self.open_local_file: if proxy: return self.open_unknown_proxy(proxy, fullurl, data) ...
<vulnerable_code>{ if (text_locked()) { clearopbeep(oap); text_locked_msg(); return TRUE; } return FALSE; } /* * Handle the count before a normal command and set cap->count0. */ goto normal_end; } if ((nv_cmds[idx].cmd_flags & NV_NCW) && (check_text_locked(oap) || curbuf_locked())) ...
<vulnerable_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 946, /**/<commit_title>[PATCH] patch 9.0.0947: invalid memory access in substitute with<commit_description><fixed_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 947, ...
<vulnerable_code> case Ctrl_F: wingotofile: CHECK_CMDWIN; ptr = grab_file_name(Prenum1, &lnum); if (ptr != NULL) * When "new_wp" is NULL: split the current window in two. * When "new_wp" is not NULL: insert this window at the far * top/left/right/bottom. * return FAIL for failure, OK otherwise */ int...
<vulnerable_code> char *ch; char *ch2; char *str; str = xmalloc(strlen(path)); ch = path; ch2 = str; while (true) {<commit_title>[PATCH] checkpath: fix allocation size of string buffer<commit_description>strlen's return value isn't enough to be used directly for (x)malloc; it doesn't include the null byte at the ...
<vulnerable_code> // to invalidate the cache var cwd = process.cwd() if (cwd !== lastCwd) { cache = {} lastCwd = cwd } var result = relative.call(path, from, to) cache[from] = cache[from] || {} cache[from][to] = result return result<commit_title>[PATCH] Fix other instances of prototype pollut...
<vulnerable_code><commit_title>[PATCH] [format-errors] Deploy validation fixes (#4941)<commit_description><fixed_code> def mul(a,b): return a*b
<vulnerable_code><commit_title>[PATCH] [format-errors] Deploy validation fixes (#4941)<commit_description><fixed_code> from js import Response from other import add from arith import mul import bcrypt def fetch(request): password = b"super secret password" hashed = bcrypt.hashpw(password, bcrypt.gensalt(14)) retu...
<vulnerable_code><commit_title>[PATCH] [format-errors] Deploy validation fixes (#4941)<commit_description><fixed_code> def add(a, b): return a + b
<vulnerable_code> ignorePatterns: [ "dist", "scripts", // template files are ignored by the eslint-config-worker configuration // we do however want the c3 files to be linted "!**/templates/**/c3.ts",<commit_title>[PATCH] [format-errors] Deploy validation fixes (#4941)<commit_description><fixed_code> ignoreP...
<vulnerable_code>"use strict"; /* tslint:disable */ Object.defineProperty(exports, "__esModule", { value: true }); exports.Extension = exports.Extension_Module = exports.TlsOptions = exports.TlsOptions_Version = exports.TlsOptions_Keypair = exports.HttpOptions = exports.HttpOptions_Header = exports.HttpOptions_S...
<vulnerable_code><commit_title>[PATCH] [format-errors] Deploy validation fixes (#4941)<commit_description><fixed_code> module.exports = { root: true, extends: ["@cloudflare/eslint-config-worker"], };
<vulnerable_code> private static final Pattern scriptPattern = Pattern.compile("script", Pattern.CASE_INSENSITIVE); private static final Pattern imgOnErrorPattern = Pattern.compile("img([^>]+)(onerror=[^>]+>)", Pattern.CASE_INSENSITIVE); /** * <p>sanitizeString</p> Matcher scriptMatcher = sc...
<vulnerable_code> package org.opennms.core.utils; import static org.junit.Assert.assertTrue; import org.junit.Test; @Test public void testBasicSanitizeString() { String script = "<script>foo</script>"; String html = "<table>"; script = WebSecurityUtils.sanitizeString(script); html = WebSecurityUtils.sanitiz...
<vulnerable_code>} void jslTokenAsString(int token, char *str, size_t len) { // see JS_ERROR_TOKEN_BUF_SIZE if (token>32 && token<128) { assert(len>=4); return; } switch (token) { case LEX_EOF : strncpy(str, "EOF", len); return; case LEX_ID : strncpy(str, "ID", len); return; case LEX_INT : strnc...
<vulnerable_code> return super.fetchChildrenFromBackEnd(query); } }); } <commit_title>[PATCH] Use index and depth as an item ID<commit_description><fixed_code> return super.fetchChildrenFromBackEnd(query); } ...