text
stringlengths
79
3.72M
<vulnerable_code> @Override public PropertiesRequest getRequestedFields( InputStream in ) { final Set<QName> set = new LinkedHashSet<QName>(); try { ByteArrayOutputStream bout = new ByteArrayOutputStream(); StreamUtils.readTo( in, bout, false, true ); byte[]...
<vulnerable_code> ByteArrayInputStream bin = new ByteArrayInputStream( arr ); XMLReader reader = XMLReaderFactory.createXMLReader(); reader.setFeature("http://xml.org/sax/features/external-parameter-entities", false); PropPatchSaxHandler handler = new PropPatchSaxHandler(); ...
<vulnerable_code> export default function rtrim(str, chars) { assertString(str); // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#Escaping const pattern = chars ? new RegExp(`[${chars.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}]+$`, 'g') : /(\s)+$/g; return str.replace(pattern, '...
<vulnerable_code> void DecodedBitStreamParser::append(std::string& result, const char* bufIn, size_t nIn, ErrorHandler& err_handler) { if (err_handler.ErrCode()) return; // avoid null pointer exception if (nIn == 0 || bufIn == nullptr) { return; } #ifndef NO_I...
<vulnerable_code>}; static bool create_section_from_phdr(ELFOBJ *bin, RzVector *result, const char *name, ut64 addr, ut64 sz) { RzBinElfSection *section = rz_vector_push(result, NULL); if (!section) { RZ_LOG_WARN("Failed to allocate memory for the section.") return false; } section->offset = Elf_(rz_bin_elf_v...
<vulnerable_code> self.parent.privmsg(u':)', params.channel) def geben(self, params, name, words): if len(params.args) == 1: if params.target == params.args[0]: keks = self.aendern(params.target, 0, name) self.parent.privmsg(u'hast du nicht was vergessen? (Du ...
<vulnerable_code> self.config = conf.data self.commands = {} self.import_modules() self.connect() if(line[0]=='ERROR' and line[1] == ':Closing' and line[2] =='Link:'): print("[Fehler] Verbindung extern getrennt") sys.exit(2) ...
<vulnerable_code>class BasicAuthLoginProvider(LoginProvider): name = 'basic_auth' #TODO: These fields don't do anything yet, but they will eventually correlate to the kwargs in login_user username = serializers.CharField(max_length=50) password = serializers.CharField(max_length=50) otp = serialize...
<vulnerable_code><commit_title>[PATCH] Refactor 2FA and prepare for fido support<commit_description><fixed_code> # Generated by Django 3.0.5 on 2020-08-10 11:11 from django.conf import settings from django.db import migrations, models import django.db.models.deletion import pyotp class Migration(migrations.Migration...
<vulnerable_code>from datetime import timedelta from django.contrib.auth import get_user_model from django.db import models from django.utils import timezone class PasswordResetToken(models.Model): user = models.ForeignKey(get_user_model(), on_delete=models.CASCADE) token = models.CharField(max_length=64) ...
<vulnerable_code>class LoginSerializer(serializers.Serializer): username = serializers.CharField() password = serializers.CharField(trim_whitespace=False) otp = serializers.CharField(max_length=6, allow_null=True, allow_blank=True) def validate(self, data): user = providers.get_provider('login'...
<vulnerable_code> path('add_2fa/', views.AddTwoFactorView.as_view(), name='add-2fa'), path('verify_2fa/', views.VerifyTwoFactorView.as_view(), name='verify-2fa'), path('remove_2fa/', views.VerifyTwoFactorView.as_view(), name='remove-2fa'), path('logout/', views.LogoutView.as_view(), name='logout'), p...
<vulnerable_code>import random import string import secrets import pyotp from django.contrib.auth import get_user_model from django.core.validators import EmailValidator from django.db import transaction from django.views.decorators.debug import sensitive_post_parameters from django_filters.rest_framework import Djang...
<vulnerable_code><commit_title>[PATCH] Refactor 2FA and prepare for fido support<commit_description><fixed_code> # Generated by Django 3.0.5 on 2020-08-10 11:11 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('member', '0003_auto_20200808_1649'), ] ...
<vulnerable_code>import secrets import time from enum import IntEnum "Required. 36 characters or fewer. Letters, digits and @/./+/-/_ only." ), validators=[username_validator], error_messages={"unique": _("A user with that username already exists."),}, ) email = models.EmailF...
<vulnerable_code> class Meta: model = get_user_model() fields = ['id', 'username', 'is_staff', 'bio', 'discord', 'discordid', 'twitter', 'reddit', 'team', 'points', 'is_visible', 'is_active', 'solves', 'team_name', 'leaderboard_points', 'date_joined', 'incorrect_s...
<vulnerable_code>[clinic start generated code]*/ /*[clinic end generated code: output=da39a3ee5e6b4b0d input=3c81ac2402d06a8b]*/ /*[clinic input] test_object_converter /*[clinic end generated code: output=886f4f9b598726b6 input=005e6a8a711a869b]*/ /*[clinic input] test_object_converter_one_arg mangle2_impl(PyObjec...
<vulnerable_code> out = self.parse_function_should_fail(block) self.assertEqual(out, expected_error_msg) def test_unused_param(self): block = self.parse(""" module foo<commit_title>[PATCH 2/2] gh-104683: Argument clinic: use an enum to describe the<commit_description><fixed_code>...
<vulnerable_code> default_return_converter = (not f.return_converter or f.return_converter.type == 'PyObject *') new_or_init = f.kind in (METHOD_NEW, METHOD_INIT) vararg = NO_VARARG pos_only = min_pos = max_pos = min_kw_only = pseudo_args = 0 if new_or_init: ...
<vulnerable_code> * @param {number} options.numToKeep - The max numbers of files to keep. * @param {number} options.maxSize - The maxSize one file can reach. Unit is Byte. * This should be more than 1024. The default is Number.MAX_SAFE_INTEGER. * @param {string} options.mode...
<vulnerable_code> const _parseOption = function(rawOptions){ const defaultOptions = { mode: parseInt("0644", 8), compress: false, }; const options = Object.assign({}, defaultOptions, rawOptions);<commit_title>[PATCH] Changed default file modes from 0o644 to 0o600 for better<commit_description><fixed_code>...
<vulnerable_code> }); it("with default settings for the underlying stream", function() { stream.currentFileStream.mode.should.eql(420); stream.currentFileStream.flags.should.eql("a"); }); });<commit_title>[PATCH] Changed default file modes from 0o644 to 0o600 for better<commit_description><fix...
<vulnerable_code> }); it("should apply default settings to the underlying stream", function() { stream.theStream.mode.should.eql(420); stream.theStream.flags.should.eql("a"); }); });<commit_title>[PATCH] Changed default file modes from 0o644 to 0o600 for better<commit_description><fixed_code> ...
<vulnerable_code> it("should take a filename and options, return Writable", () => { s.should.be.an.instanceOf(stream.Writable); s.currentFileStream.path.should.eql(fileObj.path); s.currentFileStream.mode.should.eql(420); s.currentFileStream.flags.should.eql("a"); }); it("should apply...
<vulnerable_code> addDisqus: false, addGoogleAnalytics: false, upgradeInsecureRequests: 'auto', reportURI: undefined }, cookiePolicy: 'lax', protocolUseSSL: false,<commit_title>[PATCH] Add config option to disallow framing via CSP<commit_description>Signed-off-by: David Mehren <git@herrmehren.de><f...
<vulnerable_code> enable: toBooleanConfig(process.env.CMD_CSP_ENABLE), reportURI: process.env.CMD_CSP_REPORTURI, addDisqus: toBooleanConfig(process.env.CMD_CSP_ADD_DISQUS), addGoogleAnalytics: toBooleanConfig(process.env.CMD_CSP_ADD_GOOGLE_ANALYTICS) }, cookiePolicy: process.env.CMD_COOKIE_POLICY, ...
<vulnerable_code> ], styleSrc: [config.serverURL + '/build/', '\'unsafe-inline\'', 'https://github.githubassets.com'], // unsafe-inline is required for some libs, plus used in views objectSrc: ['*'], // Chrome PDF viewer treats PDFs as objects :/ mediaSrc: ['*'], childSrc: ['*'], connectSrc: ['*'] } const c...
<vulnerable_code> max_nodes_per_window_ = banded_alignment_ ? CUDAPOA_MAX_NODES_PER_WINDOW_BANDED : CUDAPOA_MAX_NODES_PER_WINDOW; // calculate static and dynamic sizes of buffers needed per POA entry. size_t host_size_fixed, device_size_fixed; size_t host_size_per_poa, device_size_per_poa; std:...
<vulnerable_code>from __future__ import annotations import bcrypt import re import datetime as dt from sqlalchemy import Column, String, Integer, ForeignKey, DateTime from vantage6.server.model.base import DatabaseSessionManager from vantage6.server.model.authenticatable import Authenticatable from vantage6.server.mod...
<vulnerable_code>import logging import datetime as dt import pyotp from http import HTTPStatus from flask import request, render_template return {"msg": failed_login_msg}, HTTPStatus.UNAUTHORIZED def notify_user_blocked( user: db.User, max_n_attempts: int, min_rem: int, mail: Mail, config: dict<commit_ti...
<vulnerable_code> from vantage6.common.task_status import TaskStatus from vantage6.server.default_roles import DefaultRole _MAX_LEN_STR_SHORT = 128 _MAX_LEN_STR_LONG = 1024 id = fields.Integer(required=True, validate=Range(min=1)) class ChangePasswordInputSchema(Schema): """ Schema for validating input for c...
<vulnerable_code>} accountsController.uploadImage = function (req, res) { var fs = require('fs') var path = require('path') var Busboy = require('busboy') var busboy = Busboy({ headers: req.headers, limits: { files: 1, } }) var object = {} var error busboy.on('field', function (fiel...
<vulnerable_code> const _ = require('lodash') const xss = require('xss') module.exports.sanitizeFieldPlainText = function (text) { const t = xss(text, { return t } module.exports.sendToSelf = function (socket, method, data) { socket.emit(method, data) }<commit_title>[PATCH] fix(uploads): removal of EXIF data on...
<vulnerable_code> import copy from optparse import OptionGroup, SUPPRESS_HELP, Option from pip.locations import ( CA_BUNDLE_PATH, USER_CACHE_DIR, build_prefix, src_prefix, ) def make_option_group(group, parser): '-b', '--build', '--build-dir', '--build-directory', dest='build_dir', metavar='dir', ...
<vulnerable_code>import warnings from pip.req import InstallRequirement, RequirementSet, parse_requirements from pip.locations import virtualenv_no_global, distutils_scheme from pip.basecommand import Command from pip.index import PackageFinder from pip.exceptions import ( InstallationError, CommandError, Previous...
<vulnerable_code>from pip.exceptions import CommandError, PreviousBuildDirError from pip.req import InstallRequirement, RequirementSet, parse_requirements from pip.utils import normalize_path from pip.utils.deprecation import RemovedInPip7Warning, RemovedInPip8Warning from pip.wheel import WheelBuilder from pip import ...
<vulnerable_code><commit_title>[PATCH] Use a secure randomized build directory when possible<commit_description><fixed_code> from __future__ import absolute_import import tempfile from pip.utils import rmtree class BuildDirectory(object): def __init__(self, name=None, delete=None): # If we were not giv...
<vulnerable_code> """ Test --no-clean option blocks cleaning after install """ result = script.pip( 'install', '--no-clean', '--no-index', '--find-links=%s' % data.find_links, 'simple' ) build = script.venv_path / 'build' / 'simple' assert exists(build), "build/simple should s...
<vulnerable_code> Test --no-clean option blocks cleaning after wheel build """ script.pip('install', 'wheel') result = script.pip( 'wheel', '--no-clean', '--no-index', '--find-links=%s' % data.find_links, 'simple', ) build = script.venv_path / 'build' / 'simple' assert exists(...
<vulnerable_code> ldns_buffer_remaining(rd_buf) > 0){ /* skip spaces */ while (*(ldns_buffer_current(rd_buf)) == ' ') { ldns_buffer_skip(rd_buf, 1); } if (*(ldns_buffer_current(rd_buf)) == '\"') { delimiters = "\"\0"; ldns_buffer_skip(rd_buf, 1); quoted = true; } else if (ldns_rr_des...
<vulnerable_code> request: Request, U: str = Form(default=str()), # Username E: str = Form(default=str()), # Email H: str = Form(default=False), # Hide Email BE: str = Form(default=None), # Backup Email R: str = Form(default=""), # Real Name HP: str = Form(default=None), # Homepage ...
<vulnerable_code> ovs_mutex_lock(&ipf->ipf_lock); if (!ipf_handle_frag(ipf, pkt, dl_type, zone, now, hash_basis)) { dp_packet_batch_refill(pb, pkt, pb_idx); } ovs_mutex_unlock(&ipf->ipf_lock); } else {<commit_title>[PATCH] ipf: release unhandled pac...
<vulnerable_code> struct timespec ts; __u32 ts_status; bool is_drop_n_account = false; /* struct tpacket{2,3}_hdr is aligned to a multiple of TPACKET_ALIGNMENT. * We may add members to them until current aligned size without forcing netoff = TPACKET_ALIGN(po->tp_hdrlen + (maclen < 16 ? 16 : maclen)) ...
<vulnerable_code># This module is part of GitPython and is released under the # 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/ from io import BytesIO import logging import os import os.path as osp from pathlib import Path import re from stat import S_ISLNK, ST_MODE import subprocess import tempfile...
<vulnerable_code> /* memory allocation for include */ /* prevent an integer overflow issue */ l_current_pi->include = 00; if (l_step_l && l_tcp->numlayers < ((OPJ_UINT32)-1) / sizeof(OPJ_INT16) / l_step_l - 1) { l_current_pi->include = (OPJ_INT16*) opj_calloc((l_tcp->numlayers +1) * l_step_l, sizeof(OPJ_INT16)); ...
<vulnerable_code> /** * Allow an invalid cookie, without applicable violation, to be ignored rather than an exception generated. */ IGNORED_INVALID_COOKIE("https://tools.ietf.org/html/rfc6265", "Non compliant cookie is ignored"), /** * A cookie attribute(s) was found a...
<vulnerable_code>{ protected static final Logger LOG = LoggerFactory.getLogger(CookieCutter.class); protected final CookieCompliance _complianceMode; private final ComplianceViolation.Listener _complianceListener; public CookieCutter(CookieCompliance compliance, ComplianceViolation.Listener compliance...
<vulnerable_code>/** * <p>Cookie parser.</p> * <p>An interface for variations of a cookie parser.</p> * */ public interface CookieParser { * @param complianceListener A listener for compliance violations or null. * @return A CookieParser instance. */ static CookieParser newParser(CookieCompliance...
<vulnerable_code>import org.slf4j.Logger; import org.slf4j.LoggerFactory; import static org.eclipse.jetty.http.CookieCompliance.Violation.ATTRIBUTE; import static org.eclipse.jetty.http.CookieCompliance.Violation.COMMA_NOT_VALID_OCTET; import static org.eclipse.jetty.http.CookieCompliance.Violation.COMMA_SEPARATOR; im...
<vulnerable_code> } } class TestCutter extends CookieCutter implements CookieParser.Handler { List<String> names = new ArrayList<>(); List<String> values = new ArrayList<>(); protected TestCutter() { super(CookieCompliance.RFC6265_LEGACY, null); }...
<vulnerable_code> public TestCutter(CookieCompliance compliance, ComplianceViolation.Listener complianceListener) { cutter = new CookieCutter(compliance, complianceListener); } @Override public void parseFields(String... fields) { cutter.parseFie...
<vulnerable_code> @Test public void testNewCookieParser() { assertThat(CookieParser.newParser(CookieCompliance.RFC2965_LEGACY, null), instanceOf(CookieCutter.class)); assertThat(CookieParser.newParser(CookieCompliance.RFC6265_LEGACY, null), instanceOf(CookieCutter.class)); assertThat(...
<vulnerable_code> private TestCookieParser(CookieCompliance compliance) { parser = new RFC6265CookieParser(compliance, this); } @Override private List<Cookie> parseFields(String... fields) { parser.parseFields(this, Arrays.asList(fields)); ...
<vulnerable_code> public Cookies(CookieCompliance compliance, ComplianceViolation.Listener complianceListener) { _parser = CookieParser.newParser(compliance, complianceListener); } public void addCookieField(String rawField) if (_parsed) return _cookies; _parser.par...
<vulnerable_code><commit_title>[PATCH] =?UTF-8?q?Security=20update=20/=20=E5=AE=89=E5=85=A8?=<commit_description><fixed_code> webpackJsonp([1],{"+NZg":function(t,e){},"/BJT":function(t,e){},"/Ph2":function(t,e){},"09Ki":function(t,e){},"0G7g":function(t,e){},"1nff":function(t,e){},"2eZB":function(t,e){},"2kXg":function...
<vulnerable_code>var sprintf = require('util').format; module.exports = function(image, output, cb) { var cmd = module.exports.cmd(image, output); exec(cmd, {timeout: 30000}, function(e, stdout, stderr) { if (e) { return cb(e); } return cb(null, output.versions); }); }; /**<commit_title>[PATCH] fix: ch...
<vulnerable_code> change_user_is_active(user_profile, False) delete_user_sessions(user_profile) clear_scheduled_emails(user_profile.id) revoke_invites_generated_by_user(user_profile) if settings.BILLING_ENABLED: update_license_ledger_if_needed(user_profile.realm, ev...
<vulnerable_code>import orjson from django.conf import settings from django.contrib.contenttypes.models import ContentType from django.core.exceptions import ValidationError from django.test import override_settings from django.utils.timezone import now as timezone_now ).expiry_date ) def test_...
<vulnerable_code> FILTER_NEGATION_LOOKUP_MAP = {"n": "exact"} # # Reserved Names #<commit_title>[PATCH] Fix GHSA-v4xv-795h-rv4h.<commit_description><fixed_code> FILTER_NEGATION_LOOKUP_MAP = {"n": "exact"} # # User input sanitization # # Subset of the HTML tags allowed by default by ammonia: # https://github.com/rus...
<vulnerable_code> # TODO: Port Markdown cheat sheet to internal documentation default_helptext = ( '<i class="mdi mdi-information-outline"></i> ' '<a href="https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet" target="_blank">' "Markdown</a> syntax is supported" ) def...
<vulnerable_code> ), "SUPPORT_MESSAGE": ConstanceConfigItem( default="", help_text="Help message to include on 4xx and 5xx error pages. Markdown is supported.\n" "If unspecified, instructions to join Network to Code's Slack community will be provided.", ), }<commit_title>[PATCH] Fix G...
<vulnerable_code>from django.contrib.staticfiles.finders import find from django.templatetags.static import static, StaticNode from django.urls import NoReverseMatch, reverse from django.utils.html import format_html, strip_tags from django.utils.safestring import mark_safe from django.utils.text import slugify as djan...
<vulnerable_code> helpers.render_markdown("**bold and _italics_**"), "<p><strong>bold and <em>italics</em></strong></p>" ) self.assertEqual(helpers.render_markdown("* list"), "<ul>\n<li>list</li>\n</ul>") self.assertEqual( helpers.render_markdown("[I am a link](https://www...
<vulnerable_code>"""Utilities for working with log messages and similar features.""" import logging import re from django.conf import settings logger = logging.getLogger(__name__) logger.warning("No sanitizer support for %s data", type(dirty)) return dirty<commit_title>[PATCH] Fix GHSA-v4xv-795h-rv4h.<comm...
<vulnerable_code> description = forms.CharField( required=False, help_text="Also used as the help text when editing models using this custom field.<br>" '<a href="https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet" target="_blank">' "Markdown</a> syntax is supported.", ...
<vulnerable_code> help_text="Human-readable name of this job", unique=True, ) description = models.TextField(blank=True, help_text="Markdown formatting is supported") # Control flags installed = models.BooleanField(<commit_title>[PATCH] Fix GHSA-v4xv-795h-rv4h.<commit_description><fixed_...
<vulnerable_code> if (js_try(J)) { js_free(J, s); fclose(f); js_throw(J); } <commit_title>[PATCH] Issue #161: Don't fclose a FILE that is NULL.<commit_description><fixed_code> if (js_try(J)) { js_free(J, s); if (f) fclose(f); js_throw(J); }
<vulnerable_code>const express = require('express'); const fs = require('fs'); const PACKAGE = require('../../../package.json'); const router = express.Router({ caseSensitive: true, version: PACKAGE.version }); } else { fs.readFile('dist' + req.params.page, 'utf8', function (er...
<vulnerable_code> static inline int z_vrfy_kscan_disable_callback(struct device *dev); { return z_impl_kscan_disable_callback((struct device *)dev); } #include <syscalls/kscan_disable_callback_mrsh.c> static int z_vrfy_kscan_enable_callback(struct device *dev); { return z_impl_kscan_enable_callback((struct device *)...
<vulnerable_code>/* Tree Kit Copyright (c) 2014 - 2019 Cédric Ronvel The MIT License (MIT) // Browser only get the essential of tree-kit, not the unfinished parts of it var tree = {} ; module.exports = tree ; tree.extend = require( './extend.js' ) ; tree.clone = require( './clone.js' ) ; tree.path = require( ...
<vulnerable_code>(function(e){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=e()}else if(typeof define==="function"&&define.amd){define([],e)}else{var t;if(typeof window!=="undefined"){t=window}else if(typeof global!=="undefined"){t=global}else if(typeof self!=="undefined"){t=self}else{t=this...
<vulnerable_code> cache_none: bool=False, make_cache_key: Optional[Callable]=None, source_check: Optional[bool]=None, ) -> Callable: """Decorator. Use this to cache a function. By default the cache key is `view/request.path`. You are able to use this decorator with any ...
<vulnerable_code>import java.lang.reflect.Method; import java.net.MalformedURLException; import java.net.URL; import java.nio.charset.StandardCharsets; import java.security.MessageDigest; import java.util.ArrayList; import java.util.Collections; .isXsrfProtectionEnabled()) { String sessionTo...
<vulnerable_code> src = p->data; in = 0; compressedSize = (ULONG)SwapDWord((BYTE*)src + in, 4); in += 4; uncompressedSize = (ULONG)SwapDWord((BYTE*)src + in, 4); // each flag byte flags 8 literals/references, 1 per bit flags = (flagCount++ % 8 == 0) ? src[in++] : flags >> 1; if ((flags & 1) ...
<vulnerable_code> } pixel_info=(MemoryInfo *) NULL; if (setjmp(png_jmpbuf(ping))) {<commit_title>[PATCH] https://github.com/ImageMagick/ImageMagick/issues/621<commit_description><fixed_code> } pixel_info=(MemoryInfo *) NULL; quantum_scanline = (Quantum *) NULL; quantum_info = (QuantumInfo *) NUL...
<vulnerable_code> return prometheusJob; } Collection<String> getHostsAllowlist() { return Collections.unmodifiableCollection(this.hostsAllowlist); } return this; } public Builder hostsAllowlist(final List<String> hostsAllowlist) { this.hostsAllowlist = hostsAllowlist; return thi...
<vulnerable_code> for (i = web_files, wc = web_cache; i > 0; i --, wc ++) if (!strcmp(wc->name, filename)) return (wc->url); return (filename); }<commit_title>[PATCH] Fix JPEG error handling (Issue #415)<commit_description><fixed_code> for (i = web_files, wc = web_cache; i > 0; i --, wc ++) { ...
<vulnerable_code> password_column = __password_column(**connection_args) cur = dbc.cursor() if salt.utils.versions.version_cmp(server_version, '8.0.11') >= 0: qry = ("ALTER USER '" + user + "'@'" + host + "'" " IDENTIFIED BY '" + password + "';") args = {} else: ...
<vulnerable_code> mysql.user_chpass('testuser', password='BLUECOW') calls = ( call().cursor().execute( "ALTER USER 'testuser'@'localhost' IDENTIFIED BY 'BLUECOW';" ), call().cursor(...
<vulnerable_code> // Combine signal if exactly three repeats were found if (n_rows == 3) { uint8_t *b = bitbuffer->bb[bitbuffer->num_rows]; for (int i = 0; i < 11; ++i) { // The majority bit count wins b[i] = (b_rows[0][i] & b_rows[1][i]) | (b_rows[1][...
<vulnerable_code> ssize_t ret = -1; file_t* file = _cast_file(file_); if (!file) OE_RAISE_ERRNO(OE_EINVAL); if (oe_syscall_read_ocall(&ret, file->host_fd, buf, count) != OE_OK) OE_RAISE_ERRNO(OE_EINVAL); done: return ret; } ssize_t ret = -1; file_t* file = _cast_file(file_)...
<vulnerable_code> oe_errno = 0; if (!file) OE_RAISE_ERRNO(OE_EINVAL); /* Call the host. */ if (oe_syscall_read_ocall(&ret, file->host_fd, buf, count) != OE_OK) OE_RAISE_ERRNO(OE_EINVAL); done: return ret; } static ssize_t _epoll_write(oe_fd_t* epoll_, const void* buf, size_t count...
<vulnerable_code>#include <openenclave/internal/syscall/raise.h> #include <openenclave/internal/syscall/sys/socket.h> #include <openenclave/internal/syscall/netdb.h> #include <openenclave/internal/syscall/resolver.h> #include <openenclave/internal/safemath.h> #include <openenclave/internal/calls.h> #define RESOLV_MAGI...
<vulnerable_code> oe_errno = 0; if (!sock || (count && !buf)) OE_RAISE_ERRNO(OE_EINVAL); if (buf) if (oe_syscall_recv_ocall(&ret, sock->host_fd, buf, count, flags) != OE_OK) OE_RAISE_ERRNO(OE_EINVAL); done: return ret; } void* buf, size_t count, int flags, const st...
<vulnerable_code> const struct oe_iovec* iov, int iovcnt, void** buf_out, size_t* buf_size_out) { int ret = -1; struct oe_iovec* buf = NULL; if (buf_size_out) *buf_size_out = 0; /* Reject invalid parameters. */ if (iovcnt < 0 || (iovcnt > 0 && !iov) || !buf_out || !buf_size_o...
<vulnerable_code> void* buf, size_t len, int flags, const struct oe_sockaddr* src_addr, oe_socklen_t* addrlen) { ssize_t ret = -1;<commit_title>[PATCH] Merge pull request from GHSA-525h-wxcc-f66m<commit_description>Signed-off-by: Ming-Wei Shih <mishih@microsoft.com><fixed_code> void* buf, ...
<vulnerable_code> void* buf = (void*)arg2; size_t len = (size_t)arg3; int flags = (int)arg4; const struct oe_sockaddr* dest_add = (const struct oe_sockaddr*)arg5; oe_socklen_t* addrlen = (oe_socklen_t*)arg6; ret = oe_recvfrom(sockfd...
<vulnerable_code> } // Sanitize *nowTemp* variable to avoid *Path Traversal* attacks var nowTemp = (host.frondend + (request.url.replace('/', '') || host.baseTemp)).replace(/(\.\.(\/|\\|$))/g, ''); var httpHead = header(nowTemp); conf.app = conf.getApp(host.backend); if(!host) {<commit_title>[P...
<vulnerable_code> length--; } while (length != 0); } } <commit_title>[PATCH] Fixed Array.prototype.slice() for primitive types.<commit_description>This closes #188 issue on Github.<fixed_code> length--; } while (length != 0); } else { ...
<vulnerable_code> { nxt_string("Array.prototype.slice.call(new String('αβZγ'))"), nxt_string("α,β,Z,γ") }, { nxt_string("Array.prototype.pop()"), nxt_string("undefined") }, <commit_title>[PATCH] Fixed Array.prototype.slice() for primitive types.<commit_description>This closes #188 issue on Github.<f...
<vulnerable_code> /* create driver workqueue */ fm10k_workqueue = alloc_workqueue("%s", WQ_MEM_RECLAIM, 0, fm10k_driver_name); fm10k_dbg_init(); <commit_title>[PATCH] fm10k: Fix a potential NULL pointer dereference<commit_description>Syzkaller report this: kasan: GPF could be caused by NULL-ptr deref or user...
<vulnerable_code> GF_XMLAttribute *attrs; GF_XMLSaxAttribute *sax_attrs; u32 nb_attrs, nb_alloc_attrs; }; static GF_XMLSaxAttribute *xml_get_sax_attribute(GF_SAXParser *parser) parser->line_size = 0; parser->elt_start_pos = 0; parser->sax_state = SAX_STATE_TEXT_CONTENT; e = gf_xml_sax_parse_i...
<vulnerable_code> /* * Copyright 2014 Nexenta Systems, Inc. All rights reserved. */ /* smb_sdrc_t smb2_flush(smb_request_t *sr) { smb_ofile_t *of = NULL; uint16_t StructSize; uint16_t reserved1; uint32_t reserved2; smb2sr_put_error(sr, status); return (SDRC_SUCCESS); } of = sr->fid_ofile; /* * XXX - t...
<vulnerable_code>/* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ /* #include <smbsrv/smb_fsops.h> static void smb_flush_file(struct smb_request *sr, struct smb_ofile *ofile); /* * smb_com_flush * ERRDOS, ERRbadfid); return (SDRC_ERROR); } sm...
<vulnerable_code>/* * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2015 Nexenta Systems, Inc. All rights reserved. */ /* return (rc); } /* * smb_ofile_is_open */<commit_title>[PATCH] 7483 SMB flush on pipe triggers NULL pointer dereference in<commit_description><fixe...
<vulnerable_code> return slug.replace(/[^a-z0-9-_+/]/gi, ''); }; pimcore.helpers.registerKeyBindings = function (bindEl, ExtJS) { if (!ExtJS) {<commit_title>[PATCH] [Security] Fix xss in static routes panel (#14947)<commit_description>* added new helper function to htmlEncode textFields, fixed xss issue in sta...
<vulnerable_code> var typesColumns = [ {text:t("name"), flex:50, sortable:true, dataIndex:'name', editor:new Ext.form.TextField({})}, {text:t("pattern"), flex:100, sortable:true, dataIndex:'pattern', editor:new Ext.form.TextField({})}, {text:t(...
<vulnerable_code> var exec = require("child_process").exec; var fs = require("fs"); var flag = "--exists"; // Normally |pkg-config opencv ...| could report either OpenCV 2.x or OpenCV 3.y // depending on what is installed. To enable both 2.x and 3.y to co-exist on<commit_title>[PATCH] Fix install script<commit_descri...
<vulnerable_code> this.redirects = [] this.redirectsFollowed = 0 this.removeRefererHeader = false } Redirect.prototype.onRequest = function (options) { if (options.followOriginalHttpMethod !== undefined) { self.followOriginalHttpMethod = options.followOriginalHttpMethod } } Redirect.prototype.redirectTo ...
<vulnerable_code> tape(name, function (t) { var toHttps = 'http://localhost:' + plainServer.port + '/to_https' var toPlain = 'https://localhost:' + httpsServer.port + '/to_plain' var options = { httpModules: httpModules, strictSSL: false } var modulesTest = httpModules || {} clearFauxRequests()<co...