text
stringlengths
79
3.72M
<vulnerable_code>import org.xml.sax.InputSource; import javax.servlet.http.HttpServletRequest; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.transform.OutputKeys; public static Document stringToDocument(String xml) throws Exception { try { DocumentBui...
<vulnerable_code> // not print scientific notation for magnitudes greater than -5 and smaller than some amount (+5?). if (fDecimalQuantity->isZero()) { fDecimalStr->append("0", -1, status); } else if (std::abs(fDecimalQuantity->getMagnitude()) < 5) { fDecimalStr->appendInvariantChars(fD...
<vulnerable_code> } result.append(u'E'); int32_t _scale = upperPos + scale; if (_scale < 0) { _scale *= -1; result.append(u'-'); } else {<commit_title>[PATCH] ICU-20246 Fixing another integer overflow in number parsing.<commit_description><fixed_code> } result.append(u'E'); ...
<vulnerable_code> assertEquals(u"Should not overflow and should parse only the first exponent", u"1E-2147483647", {sp.data(), sp.length(), US_INV}); } void NumberFormatTest::Test13840_ParseLongStringCrash() {<commit_title>[PATCH] ICU-20246 Fixing another integer overflow in number ...
<vulnerable_code> } result.append('E'); int _scale = upperPos + scale; if (_scale < 0) { _scale *= -1; result.append('-'); } else {<commit_title>[PATCH] ICU-20246 Fixing another integer overflow in number parsing.<commit_description><fixed_code> } ...
<vulnerable_code> tempLong = tempLong * 10 + getDigitPos(shift); } BigDecimal result = BigDecimal.valueOf(tempLong); result = result.scaleByPowerOfTen(scale); if (isNegative()) result = result.negate(); return result;<commit_titl...
<vulnerable_code> result = nf.parse("1E-547483647"); assertEquals("Should *not* snap to zero", "1E-547483647", result.toString()); } @Test<commit_title>[PATCH] ICU-20246 Fixing another integer overflow in number parsing.<commit_description><fixed_code> result = nf.parse("...
<vulnerable_code> } var parserHandlesEnd = false; if (parser) { try { // Unbuffered parsers are supposed to emit response early, // terminating events res.once('error', function(err){ self.callback(err, null); }); if (!parserHandlesEnd) res.once('end', function(){<commit...
<vulnerable_code> return this; }; /** * Convert to a plain javascript object (not JSON string) of scalar properties. * Note as this method is designed to return a useful non-this value,<commit_title>[PATCH] Limit maximum response size<commit_description>Fixes #1259<fixed_code> return this; }; /** * Maximum size...
<vulnerable_code> }); }); it('should ignore trailing junk', function(done) { request .get(base + '/junk')<commit_title>[PATCH] Limit maximum response size<commit_description>Fixes #1259<fixed_code> }); }); it('should protect from zip bombs', function(done) { request .get(base) ...
<vulnerable_code> if (strncmp(MATLAB_HDR.identific, "MATLAB", 6)) { MATLAB_KO: clone_info=DestroyImageInfo(clone_info); ThrowReaderException(CorruptImageError,"ImproperImageHeader"); } <commit_title>[PATCH] https://github.com/ImageMagick/ImageMagick/issues/598<commit_description><fixed_code> if (...
<vulnerable_code> import logging from functools import wraps from typing import TYPE_CHECKING from synapse.api.errors import SynapseError from synapse.http.servlet import ( RestServlet, assert_params_in_dict, parse_json_object_from_request, ) from synapse.types import GroupID from ._base import client_pat...
<vulnerable_code>rand = random.SystemRandom() def random_string(length): return "".join(rand.choice(string.ascii_letters) for _ in range(length)) def random_string_with_symbols(length): return "".join(rand.choice(_string_with_symbols) for _ in range(length)) def is_ascii(s): if isinstance(s, bytes): ...
<vulnerable_code> } (void) button_set_mask(b); r = sd_event_add_io(b->manager->event, &b->io_event_source, b->fd, EPOLLIN, button_dispatch, b); if (r < 0) { log_error_errno(r, "Failed to add button event: %m");<commit_title>[PATCH] =?UTF-8?q?bus=5Fopen=20leak=20sd=5Feven...
<vulnerable_code> ) monkeypatch.setattr(subscription.RegistrationCommand, "from_tool_opts", fake_from_tool_opts) class FakeProcess(mock.Mock): called_count = 0 <commit_title>[PATCH] Add comment about why FakeSpawn in unittests is not global<commit_description>Would need to be made a ...
<vulnerable_code> // Save flags for recursion. They can change for e.g. // :s/^/\=execute("s#^##gn") subflags_save = subflags; #endif // get length of substitution part sublen = vim_regsub_multi(&regmatch, sub_firstlnum - regmatch.startpos[0].lnum, sub, sub_firstline, FALSE, magic_isset(), T...
<vulnerable_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 4976, /**/<commit_title>[PATCH] patch 8.2.4977: memory access error when substitute<commit_description><fixed_code> static int included_patches[] = { /* Add new patch number below this line */ /**/ 4977, /**...
<vulnerable_code> } } for ( ; offset < (MagickOffsetType) dpx.file.image_offset; offset++) (void) ReadBlobByte(image); /* Read DPX image header. */ if (image_info->ping != MagickFalse) { (void) CloseBlob(image);<commit_title>[PATCH] https://github.com/ImageMagick/ImageMagick/issues/...
<vulnerable_code><commit_title>[PATCH] chore: expose static resources explicitly (#34)<commit_description>ServletContext resources are not available anymore via HTTP after vaadin/osgi#50. So they should be exposed explicitly via resource service Co-authored-by: Denis Anisimov <denis@vaadin.com><fixed_code> package com...
<vulnerable_code><commit_title>[PATCH] chore: expose static resources explicitly (#34)<commit_description>ServletContext resources are not available anymore via HTTP after vaadin/osgi#50. So they should be exposed explicitly via resource service Co-authored-by: Denis Anisimov <denis@vaadin.com><fixed_code> package com...
<vulnerable_code> function linkAction() { const $this = $(this); $.post($this.data('url'), { _csrf: csrf }).done((data) => { if (data.redirect) { window.location.href = data.redirect; } else { window.location.reload(); }<commit_title>[PATCH] Update for redirect<commit_description>Signe...
<vulnerable_code> const InString *input, int pos, const widechar *passInstructions, int passIC) { int k; int kk = pos; for (k = passIC + 2; k < passIC + 2 + passInstructions[passIC + 1]; k++) if (input->chars[kk] == ENDSEGMENT || passInstructions[k] != input->chars[kk++]) return 0; return 1;<commit_title>[PAT...
<vulnerable_code> void Client::encryptConnection() { boost::asio::ssl::context ctx{boost::asio::ssl::context::sslv23}; if (client_options_.always_verify_peer_) { ctx.set_verify_mode(boost::asio::ssl::verify_peer); } else { ctx.set_verify_mode(boost::asio::ssl::verify_none); } if (client_options_.serv...
<vulnerable_code>DECLARE_string(enroll_secret_path); DECLARE_bool(disable_caching); bool TLSServerRunner::start() { auto& self = instance(); if (self.server_ != nullptr) { return true; auto python_server_path = (getTestHelperScriptsDirectory() / "test_http_server.py"); auto test_config_dir = ge...
<vulnerable_code> FLAGS_disable_database = true; DatabasePlugin::setAllowOpen(true); DatabasePlugin::initPlugin(); certs_ = FLAGS_tls_server_certs; FLAGS_tls_server_certs = ""; ASSERT_TRUE(TLSServerRunner::start()); port_ = TLSServerRunner::port(); } }; TEST_F(TLSTransportsTests, test_ca...
<vulnerable_code>util.setProperty = function setProperty(dst, path, value) { function setProp(dst, path, value) { var part = path.shift(); if (part === "__proto__") { return dst; } if (path.length > 0) {<commit_title>[PATCH] fix: do not let setProperty change the prototype ...
<vulnerable_code> util.setProperty(o, 'prop.subprop', { subsub2: 7}); test.same(o, {prop1: [5, 6], prop: {subprop: [{subsub: [5,6]}, {subsub2: 7}]}}, "should convert nested properties to array"); test.end(); });<commit_title>[PATCH] fix: do not let setProperty change the prototype (#1899)<c...
<vulnerable_code>(function ($) { 'use strict'; // Polyfill for browsers with no classList support // Remove in v2 if (!('classList' in document.createElement('_'))) { dropdownAlignRight: false, windowPadding: 0, virtualScroll: 600, display: false }; if (version.major === '4') { ...
<vulnerable_code> switch (form->type) { case FORM_INPUT_CHECKBOX: case FORM_INPUT_RADIO: if (form->checked) buf->currentLine->lineBuf[spos] = '*'; else spos = a->start.pos; epos = a->end.pos; } if (a->start.line != a->end.line || spos > epos || epos >= l->len) break; pos = form_up...
<vulnerable_code> template: [ '<md-dialog flex="40" flex-sm="80" flex-xs="100" aria-label="' + l('View Raw Source') + '">', ' <md-dialog-content class="md-dialog-content">', ' <pre>', data, ' </pre>', ' </md-dialog-content>', ...
<vulnerable_code> if (nlmsg_len(nlh) < sizeof(*req)) return -EINVAL; hndl = sock_diag_lock_handler(req->sdiag_family); if (hndl == NULL) err = -ENOENT;<commit_title>[PATCH] sock_diag: Fix out-of-bounds access to sock_diag_handlers[]<commit_description>Userland can send a netlink message requesting SOCK_DIAG_BY_F...
<vulnerable_code> auto job = new SignPublicKeyApiJob(account, e2eeBaseUrl() + "public-key", this); job->setCsr(csrContent); connect(job, &SignPublicKeyApiJob::jsonReceived, [this, account, keyPair = std::move(keyPair)](const QJsonDocument& json, int retCode) { if (retCode == 200) { const...
<vulnerable_code> # allow for double- and single-quoted realm values # (single quotes are a violation of the RFC, but appear in the wild) rx = re.compile('(?:.*,)*[ \t]*([^ \t]+)[ \t]+' 'realm=(["\'])(.*?)\\2', re.I) # XXX could pre-emptively send auth info already accepted (RFC 261...
<vulnerable_code> HTTPCookieProcessor, HTTPRefererProcessor, \ HTTPErrorProcessor, HTTPHandler from mechanize import OpenerDirector, build_opener, Request from mechanize._urllib2_fork import AbstractHTTPHandler, normalize_url from mechanize._util import write_file import mechanize._response self.ass...
<vulnerable_code>import json import logging import os import re import socket import time import webbrowser<commit_title>[PATCH] Update src/snowflake/connector/auth/webbrowser.py<commit_description>Co-authored-by: Mark Keller <mark.keller@snowflake.com><fixed_code> import json import logging import os import socket imp...
<vulnerable_code> file = (XkbFile *) file->common.next) { if (file->file_type < FIRST_KEYMAP_FILE_TYPE || file->file_type > LAST_KEYMAP_FILE_TYPE) { log_err(ctx, "Cannot define %s in a keymap file\n", xkb_file_type_to_string(file->file_type)); cont...
<vulnerable_code> return 0; } int manager_serialize( Manager *m, FILE *f, for (q = 0; q < _MANAGER_TIMESTAMP_MAX; q++) { _cleanup_free_ char *joined = NULL; /* The following timestamps only apply to the host system, hence only serialize th...
<vulnerable_code> }); }); }); });<commit_title>[PATCH 3/3] chore(release): 5.4.3 [skip ci]<commit_description>## [5.4.3](https://github.com/parse-community/parse-server/compare/5.4.2...5.4.3) (2023-03-22) ### Bug Fixes * Unable to create new role if `beforeSave` hook exists ([#8474](https://github.com/pars...
<vulnerable_code> // Shared SchemaController to be reused to reduce the number of loadSchema() calls per request // Once set the schemaData should be immutable this.validSchemaController = null; this.pendingOps = {}; } // A convenient method to perform all the steps of processing the } const { originalObje...
<vulnerable_code> } if (priv->cac_id_len) { serial->len = MIN(priv->cac_id_len, SC_MAX_SERIALNR); memcpy(serial->value, priv->cac_id, priv->cac_id_len); SC_FUNC_RETURN(card->ctx, SC_LOG_DEBUG_NORMAL, SC_SUCCESS); } SC_FUNC_RETURN(card->ctx, SC_LOG_DEBUG_NORMAL, SC_ERROR_FILE_NOT_FOUND);<commit_title>[PA...
<vulnerable_code> while (0x80 != plaintext[cipher_len - 2] && (cipher_len - 2 > 0)) cipher_len--; if (2 == cipher_len) return -1; memcpy(out, plaintext, cipher_len - 2); r = sc_check_sw(card, sm->sw1, sm->sw2); if (r == SC_SUCCESS) { if (exdata->sm) { if (0 != decrypt_response(card, sm->resp, sm->resplen...
<vulnerable_code> mscfs_check_cache(priv->fs); for(x = 0; x < fs->cache.size; x++) { u8* oid= fs->cache.array[x].objectId.id; sc_debug(card->ctx, SC_LOG_DEBUG_NORMAL, "FILE: %02X%02X%02X%02X\n", oid[0],oid[1],oid[2],oid[3]); buf[1] = oid[3]; if(buf[0] == 0x00 && buf[1] == 0x00) continue; /* No directo...
<vulnerable_code> file->path = *in_path; for(i=2; i+1<apdu.resplen && i+1+apdu.resp[i+1]<apdu.resplen; i+=2+apdu.resp[i+1]){ int j, len=apdu.resp[i+1]; unsigned char type=apdu.resp[i], *d=apdu.resp+i+2; switch (type) { file->id = (d[0]<<8) | d[1]; break; case 0x84: memcpy(file->name, d, len); fil...
<vulnerable_code> /* read the serial (document number) */ r = sc_read_record (card, SC_ESTEID_PD_DOCUMENT_NR, buff, sizeof(buff), SC_RECORD_BY_REC_NR); SC_TEST_RET(card->ctx, SC_LOG_DEBUG_NORMAL, r, "read document number failed"); buff[r] = '\0'; set_string (&p15card->tokeninfo->serial_number, (const char *) buff);...
<vulnerable_code> * the private key. */ ind = 2; /* skip length */ while (ibuf[ind] == 0x01) { if (ibuf[ind+1] == 0xFE) { gemsafe_prkeys[i].ref = ibuf[ind+4]; sc_log(card->ctx, "Key container %d is allocated and uses key_ref %d",<commit_title>[PATCH] fixed out of bounds writes<commit_description>Thanks to ...
<vulnerable_code> r = read_file(p15card, (u8 *) "\x2F\x02", efbin, &len, 1); LOG_TEST_RET(card->ctx, r, "Skipping optional EF.C_DevAut"); /* save EF_C_DevAut for further use */ ptr = realloc(priv->EF_C_DevAut, len); if (ptr) { memcpy(ptr, efbin, len); priv->EF_C_DevAut = ptr; priv->EF_C_DevAut_len = ...
<vulnerable_code> return SC_ERROR_INVALID_ARGUMENTS; } if (sec_attr == NULL) { if (file->sec_attr != NULL) free(file->sec_attr); file->sec_attr = NULL;<commit_title>[PATCH] fixed out of bounds writes<commit_description>Thanks to Eric Sesterhenn from X41 D-SEC GmbH for reporting the problems.<fixed_code> re...
<vulnerable_code>#include "config.h" #include "libopensc/sc-ossl-compat.h" #include <openssl/bn.h> #include <openssl/rsa.h> #include <openssl/x509.h> fprintf(stderr, "Unable to select public key file: %s\n", sc_strerror(r)); return 2; } bufsize = file->size; sc_file_free(file); r = sc_read_binary(card, 0, buf,...
<vulnerable_code> goto err; } len = file ? file->size : 4096; p = realloc(*data, len); if (!p) { goto err;<commit_title>[PATCH] fixed out of bounds writes<commit_description>Thanks to Eric Sesterhenn from X41 D-SEC GmbH for reporting the problems.<fixed_code> goto err; } len = file && file->size > 0 ? file...
<vulnerable_code> strcpy(buf, "????"); break; } strcat(line, buf); strcat(line, " "); e = e->next; } line[strlen(line)-1] = 0; /* get rid of trailing space */ return line; }<commit_title>[PATCH] fixed out of bounds writes<commit_description>Thanks to Eric Sesterhenn from X41 D-SEC GmbH for reporting the...
<vulnerable_code> from Components.config import config from Tools.Directories import fileExists def new_getRequestHostname(self): host = self.getHeader(b'host') action = request.args["action"][0] if "file" in request.args: filename = request.args["file"][0].decode('utf-8', 'ignore').encode('utf-8') filena...
<vulnerable_code>import twisted.web.static from twisted.web import http import file MANY_SLASHES_PATTERN = r'[\/]+' MANY_SLASHES_REGEX = re.compile(MANY_SLASHES_PATTERN) #: default path from which files will be served DEFAULT_ROOT_PATH = os.path.abspath(os.path.dirname(__file__)) <commit_title>[PATCH] move utilities...
<vulnerable_code><commit_title>[PATCH] move utilities library and actually use it<commit_description><fixed_code>
<vulnerable_code> } PARSER_CATCH { /* Ignore the errors thrown by the lexer. */ if (context_p->error != PARSER_ERR_OUT_OF_MEMORY) { context_p->error = PARSER_ERR_NO_ERROR; } #if ENABLED (JERRY_ES2015) while (scanner_context.active_binding_list_p != NULL) { } #endif /* ENABLED (JE...
<vulnerable_code>function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value:...
<vulnerable_code> } this.run( `INSERT INTO flashcards (user, text, translation, asked, answered) VALUES(${user}, "${text}", "${translation}", ${asked}, ${answered})`, () => { console.log('Adding: ', user, text, translation); } )...
<vulnerable_code><commit_title>[PATCH] fix(security): don't follow redirects (#10)<commit_description><fixed_code>
<vulnerable_code> 'etag', 'expires', 'last-modified', 'pragma', 'server', 'transfer-encoding', `${protocol}://${pathdomain}/${remainingpath}`, { method: req.method, headers, body: (req.method !== 'GET' && req.method !== 'HEAD') ? req : undefined } ).then(f => { ...
<vulnerable_code> """Get regex sections.""" filename = os.path.expanduser(config.get("rights", "file")) rights_type = config.get("rights", "type").lower() regex = ConfigParser({"login": user, "path": collection_url}) if rights_type in DEFINED_RIGHTS: log.LOGGER.debug("Rights type '%s'" % righ...
<vulnerable_code> component_name = parts[0] component_root = self._registry.get_component_path(component_name) if component_root is None: self.write(f"{path} not found") self.set_status(404) return with open(abspath, "r", encoding="utf-8") as file:...
<vulnerable_code> media_file_manager.get(absolute_path) except KeyError: LOGGER.error("MediaFileManager: Missing file %s" % absolute_path) raise tornado.web.HTTPError(404, "%s not found", absolute_path) return absolute_path <commit_title>[PATCH] Remove path from 404 r...
<vulnerable_code> response = self._request_component("invalid_component") self.assertEqual(404, response.code) self.assertEqual(b"invalid_component not found", response.body) def test_invalid_content_request(self): """Test request failure when invalid content (file) is provided.""" ...
<vulnerable_code> static unsigned int nf_ct_generic_timeout __read_mostly = 600*HZ; static inline struct nf_generic_net *generic_pernet(struct net *net) { return &net->ct.nf_ct_proto.generic; static bool generic_new(struct nf_conn *ct, const struct sk_buff *skb, unsigned int dataoff, unsigned int *timeouts) { ret...
<vulnerable_code> ForwardedPacketExtension.class); if(extensions.isEmpty()) return; ForwardedPacketExtension forwardedExt = extensions.get(0); msg = forwardedExt.getMessage(); if(msg == null || msg.getBody() == nu...
<vulnerable_code> // SQL注入漏洞 sign签名校验(表名,label字段,val字段,条件) String dictCode = tbname+","+text+","+code+","+condition; SqlInjectionUtil.filterContent(dictCode); List<TreeSelectModel> ls = sysDictService.queryTreeList(query,tbname, text, code, pidField, pid,hasChildField,converIsLeafVal); result.setSuccess(...
<vulnerable_code> } /* copy payload */ memcpy(packetbuf_dataptr(), &channel->tx_buffer.sdu[channel->tx_buffer.current_index], data_len);<commit_title>[PATCH] Prevent buffer overflows due to misconfigured BLE MTU.<commit_description><fixed_code> } /*...
<vulnerable_code> static int keepalive_counter = 0; static unsigned char pass_salt[17]; static char username[MT_MNDP_MAX_STRING_SIZE]; static char password[MT_MNDP_MAX_STRING_SIZE]; static char nonpriv_username[MT_MNDP_MAX_STRING_SIZE]; char *terminal = getenv("TERM"); char md5data[100]; unsigned char md5sum[17]; ...
<vulnerable_code> char md5data[100]; struct mt_credentials *user; char *slavename; /* Reparse user file before each login */ read_userfile(); } #endif /* Concat string of 0 + password + pass_salt */ md5data[0] = 0; strncpy(md5data + 1, user->password, 82); memcpy(md5data + 1 + strlen(user->password), cu...
<vulnerable_code> unsigned char *data = packet->data + packet->size; unsigned int act_size = data_len + (cptype == MT_CPTYPE_PLAINDATA ? 0 : MT_CPHEADER_LEN); /* Something is really wrong. Packets should never become over 1500 bytes */ if (packet->size + act_size > MT_PACKET_LEN) { fprintf(stderr, _("add_control_...
<vulnerable_code> specialIEContainer.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" ' + 'id="' + pluginid + '" width="' + width + '" height="' + height + '" class="mejs-shim">' + '<param name="movie" value="' + opti...
<vulnerable_code> var slash = '/'; var backslash = /\\/g; var enclosure = /[{[].*\/.*[}\]]$/; var globby = /(^|[^\\])([{[]|\([^)]+$)/; var escaped = /\\([!*?|[\](){}])/g; } // special case for strings ending in enclosure containing path separator if (enclosure.test(str)) { str += slash; } // remove esc...
<vulnerable_code> done(); }); }); if (isWin32) {<commit_title>[PATCH] fix: Resolve ReDoS vulnerability from CVE-2021-35065 (#49)<commit_description><fixed_code> done(); }); it('should finish in reasonable time for \'{\' + \'/\'.repeat(n) [CVE-2021-35065]', function(done) { this.timeout(1000); g...
<vulnerable_code> { image->storage_class=PseudoClass; image->colors=icon_info.number_colors; if (image->colors == 0) image->colors=one << icon_info.bits_per_pixel; } if (image->storage_class == PseudoClass)<commit_title>[PATCH] Added extra check that was re...
<vulnerable_code> rc = RedisCluster.from_url("rediss://localhost:16379") assert rc.connection_kwargs["connection_class"] is SSLConnection async def test_max_connections( self, create_redis: Callable[..., RedisCluster] ) -> None:<commit_title>[PATCH] and tests<commit_description><fixed_co...
<vulnerable_code> await r.connection.disconnect() @pytest.mark.onlynoncluster async def test_single_connection(): """Test that concurrent requests on a single client are synchronised."""<commit_title>[PATCH] and tests<commit_description><fixed_code> await r.connection.disconnect() async def test_asynckil...
<vulnerable_code>def get_secret(): if os.path.exists("/etc/tower/SECRET_KEY"): return open('/etc/tower/SECRET_KEY', 'rb').read().strip() return os.getenv("SECRET_KEY", "privateawx") ADMINS = ()<commit_title>[PATCH] Do not set credentials via environment variables<commit_description><fixed_code> def ge...
<vulnerable_code>} void janus_session_notify_event(janus_session *session, json_t *event) { if(session != NULL && !g_atomic_int_get(&session->destroyed) && session->source != NULL && session->source->transport != NULL) { /* Send this to the transport client */ JANUS_LOG(LOG_HUGE, "Sending event to %s (%p)\n", ses...
<vulnerable_code>// Same as url, but TLD is optional $.validator.addMethod( "url2", function( value, element ) { return this.optional( element ) || /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:...
<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> assert.ok( method( "http://www.føtex.dk/" ), "Valid url, danish unicode characters" ); assert.ok( method( "http://bösendorfer.de/" ), "Valid url, german unicode characters" ); assert.ok( method( "http://142.42.1.1" ), "Valid IP Address" ); assert.ok( !method( "http://192.168.8." ), "Invalid IP Addr...
<vulnerable_code> return dst; } #if !AP_MODULE_MAGIC_AT_LEAST(20150222, 13) static request_rec *my_ap_create_request(conn_rec *c) { apr_pool_t *p; request_rec *r; apr_pool_create(&p, c->pool); apr_pool_tag(p, "request"); r = apr_pcalloc(p, sizeof(request_rec)); AP_READ_REQUEST_ENTRY((intptr...
<vulnerable_code> conf->protocols_honor_order = -1; conf->merge_slashes = AP_CORE_CONFIG_UNSET; return (void *)conf; } ? virt->flush_max_pipelined : base->flush_max_pipelined; return conf; } AP_INIT_FLAG("QualifyRedirectURL", se...
<vulnerable_code> apr_size_t nvec; }; struct core_filter_ctx { apr_bucket_brigade *b; apr_bucket_brigade *tmpbb; }; apr_status_t ap_core_input_filter(ap_filter_t *f, apr_bucket_brigade *b, ap_input_mode_t mode, apr_read_type_e block,<commit_title>[PATCH] Merged<commit_des...
<vulnerable_code> } r->args = r->parsed_uri.query; r->uri = r->parsed_uri.path ? r->parsed_uri.path : apr_pstrdup(r->pool, "/"); #if defined(OS2) || defined(WIN32) /* Handle path translations for OS/2 and plug security hole. static int read_request_line(request_rec *r,...
<vulnerable_code>#include "http_vhost.h" #include "http_protocol.h" #include "http_core.h" #if APR_HAVE_ARPA_INET_H #include <arpa/inet.h> } static void check_hostalias(request_rec *r) { /* * Even if the request has a Host: header containing a port we ignore goto found; } return; found: ...
<vulnerable_code> sdb_num_set (sdb, "link", shdr->sh_link, 0); sdb_set (sdb, "link_section_name", link_section_name, 0); for (cnt = 0, i = 0; i >= 0 && cnt < shdr->sh_info && ((char *)defs + i < end); ++cnt) { Sdb *sdb_verdef = sdb_new0 (); char *vstart = ((char*)defs) + i; char key[32] = {0}; verdef->vd_aux...
<vulnerable_code> def XMPPClientFactory(jid, password, contextFactory=None): """ Client factory for XMPP 1.0 (only). @param password: password to authenticate with. @type password: L{unicode} @param contextFactory: An object which creates appropriately configured TLS connections. This is...
<vulnerable_code> @ivar wanted: indicates if TLS negotiation is wanted. @type wanted: C{bool} @ivar contextFactory: An object which creates appropriately configured TLS connections. This is passed to C{startTLS} on the transport and is preferably created using L{twisted.internet.ssl.options...
<vulnerable_code> self.assertFalse(session.required) def test_tlsContextFactory(self): """ Test basic operations. Setup an XMPPClientFactory, which sets up an XMPPAuthenticator, and let it produce a protocol instance. Then inspect the instance variables of the authe...
<vulnerable_code> A custom contextFactory is passed through to startTLS. """ ctx = CertificateOptions() self.init.contextFactory = ctx def fakeStartTLS(contextFactory):<commit_title>[PATCH] Rename contextFactory to configurationForTLS, make private<commit_description><fixed_code>...
<vulnerable_code> bool image; bool active; bool bracket_after; } bracket; typedef struct subject{ bracket *b = (bracket *)subj->mem->calloc(1, sizeof(bracket)); if (subj->last_bracket != NULL) { subj->last_bracket->bracket_after = true; } b->image = image; b->active = true; b->previous_delimiter =...
<vulnerable_code> else: data_start = 0 if self.buffer.find(b"--" + self.boundary) == -1: # No complete boundary in the buffer, but there may be # a partial boundary at the end. As the boundary # starts with either a nl or cr find the earliest and ...
<vulnerable_code>!function(){var s={d:function(e,n){for(var t in n)s.o(n,t)&&!s.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},o:function(s,e){return Object.prototype.hasOwnProperty.call(s,e)},r:function(s){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"...
<vulnerable_code> assert clt.uaclient.security_policy.symmetric_cryptography.Prev_Verifier is None assert clt.uaclient.security_policy.symmetric_cryptography.Prev_Decryptor is None await asyncio.sleep(timeout) sym_crypto = clt.uaclient.security_policy.symmetric_cryptography prev_...
<vulnerable_code>viewer_scopes = [ # Intentionally omitted USER_PERMISSION_READ CLI_OBJECTS_READ, CLIENT_READ, CONFIG_READ, CONNECTION_READ, CONSENT_READ, CONSENT_SETTINGS_READ, MESSAGING_CREATE_OR_UPDATE, MESSAGING_DELETE, PRIVACY_REQUEST_NOTIFICATIONS_CREATE_OR_UPDATE, CONFIG_...
<vulnerable_code> * @return revision */ public static final String getRevision() { return "a"; } /**<commit_title>[PATCH] =?UTF-8?q?=E5=AE=89=E5=85=A8=E6=BC=8F=E6=B4=9E=E4=BF=AE?=<commit_description><fixed_code> * @return revision */ public static final String getRevision() {...
<vulnerable_code> } } @Autowired private SysConfigDataService service; <commit_title>[PATCH] =?UTF-8?q?=E5=AE=89=E5=85=A8=E6=BC=8F=E6=B4=9E=E4=BF=AE?=<commit_description><fixed_code> } } @Override public boolean needAppToken() { return true; } @Autowired pri...
<vulnerable_code> } } @Autowired private SysDatasourceService service; <commit_title>[PATCH] =?UTF-8?q?=E5=AE=89=E5=85=A8=E6=BC=8F=E6=B4=9E=E4=BF=AE?=<commit_description><fixed_code> } } @Override public boolean needAppToken() { return true; } @Autowired pri...
<vulnerable_code> if (!NT_SUCCESS(NtQueryObject(h, ObjectNameInformation, buffer, sizeof(buffer) - 2, &result))) return; name = nameinfo->Name.Buffer; name[nameinfo->Name.Length / sizeof(*name)] = 0; <commit_title>[PATCH] winansi: check result and Buffer before using Name<commit_description>NtQueryObject under W...
<vulnerable_code> } else { if (info->compressed == 2 || bytes_left < 0 || (unsigned long)(es.fields.address + 32 + info->size return type < SECTION_REVHISTORY ? DWG_ERR_INVALIDDWG : DWG_ERR_VALUEOUTOF...