text
stringlengths
79
3.72M
<vulnerable_code>const assert = require('assert'); const fs = require('../src/utils/fs'); const {bundle, rimraf, ncp} = require('./utils'); describe('content hashing', function() { beforeEach(async function() { await rimraf(__dirname + '/input'); }); it('should update content hash when content changes', asy...
<vulnerable_code>const assert = require('assert'); const fs = require('../src/utils/fs'); const {bundle, run, assertBundleTree, rimraf, ncp} = require('./utils'); describe('css', function() { it('should produce two bundles when importing a CSS file', async function() { let b = await bundle(__dirname + '/integrat...
<vulnerable_code>const assert = require('assert'); const fs = require('../src/utils/fs'); const {bundle, assertBundleTree} = require('./utils'); describe('encodedURI', function() { it('should support bundling files which names in encoded URI', async function() { let b = await bundle(__dirname + '/integration/enc...
<vulnerable_code> it('should invalidate when dependency included in parent changes', async () => { const cache = new FSCache({cacheDir: cachePath}); await ncp(__dirname + '/integration/fs', inputPath); const filePath = path.join(inputPath, 'test.txt'); await cache.write(__filename, { const cache ...
<vulnerable_code>const assert = require('assert'); const fs = require('../src/utils/fs'); const {bundle, run, assertBundleTree} = require('./utils'); describe('fs', function() { describe('--target=browser', function() { it('should inline a file as a string', async function() { let b = await bundle(__dirnam...
<vulnerable_code>const assert = require('assert'); const fs = require('../src/utils/fs'); const {bundle, run, assertBundleTree} = require('./utils'); describe('glob', function() { it('should require a glob of files', async function() { let b = await bundle(__dirname + '/integration/glob/index.js'); await as...
<vulnerable_code>const assert = require('assert'); const fs = require('../src/utils/fs'); const {bundle, run, assertBundleTree} = require('./utils'); describe('glsl', function() { it('should support requiring GLSL files via glslify', async function() { let b = await bundle(__dirname + '/integration/glsl/index.js...
<vulnerable_code>const assert = require('assert'); const gql = require('graphql-tag'); const {bundle, run, assertBundleTree} = require('./utils'); describe('graphql', function() { it('should support requiring graphql files', async function() { let b = await bundle(__dirname + '/integration/graphql/index.js'); ...
<vulnerable_code> let b, ws, stub; beforeEach(async function() { stub = sinon.stub(console, 'clear'); await rimraf(__dirname + '/input'); }); afterEach(async function() { } it('should emit an HMR update for the file that changed', async function() { await ncp(__dirname + '/integration/commonjs'...
<vulnerable_code> describe('html', function() { it('should support bundling HTML', async function() { let b = await bundle(__dirname + '/integration/html/index.html'); await assertBundleTree(b, { name: 'index.html', ] }); let files = await fs.readdir(__dirname + '/dist'); let html = ...
<vulnerable_code>../local.js<commit_title>[PATCH 02/57] Process inline styles and scripts (#1456)<commit_description><fixed_code>
<vulnerable_code>const assert = require('assert'); const fs = require('../src/utils/fs'); const path = require('path'); const {bundle, run, assertBundleTree, deferred} = require('./utils'); const {mkdirp} = require('../src/utils/fs'); describe('javascript', function() { it('should produce a basic JS bundle with Comm...
<vulnerable_code>const assert = require('assert'); const fs = require('../src/utils/fs'); const {bundle, run, assertBundleTree} = require('./utils'); describe('less', function() { it('should support requiring less files', async function() { let b = await bundle(__dirname + '/integration/less/index.js'); awa...
<vulnerable_code>const assert = require('assert'); const fs = require('../src/utils/fs'); const {bundle, assertBundleTree} = require('./utils'); describe('parser', function() { it('should support case-insensitive file extension', async function() { let b = await bundle( __dirname + '/integration/parser-cas...
<vulnerable_code>const assert = require('assert'); const {bundle, run, assertBundleTree} = require('./utils'); describe('plugins', function() { it('should load plugins and apply custom asset type', async function() { let b = await bundle(__dirname + '/integration/plugins/index.js'); await assertBundleTree(b...
<vulnerable_code>const assert = require('assert'); const fs = require('../src/utils/fs'); const {bundle, assertBundleTree} = require('./utils'); describe('pug', function() { it('should support bundling HTML', async function() { const b = await bundle(__dirname + '/integration/pug/index.pug'); await assertBu...
<vulnerable_code>const assert = require('assert'); const {bundle, run} = require('./utils'); describe('reason', function() { it('should produce a bundle', async function() { let b = await bundle(__dirname + '/integration/reason/index.js'); assert.equal(b.assets.size, 2); assert.equal(b.childBundles.size...
<vulnerable_code>const Resolver = require('../src/Resolver'); const path = require('path'); const assert = require('assert'); const rootDir = path.join(__dirname, 'integration', 'resolver'); const resolver = new Resolver({ rootDir, extensions: { '.js': true, '.json': true } }); describe('resolver', func...
<vulnerable_code>const assert = require('assert'); const {bundle, bundler, run, assertBundleTree} = require('./utils'); const fs = require('../src/utils/fs'); const commandExists = require('command-exists'); it('should generate a wasm file from a rust file with rustc with --target=browser', async function() { th...
<vulnerable_code>const assert = require('assert'); const fs = require('../src/utils/fs'); const {bundle, run, assertBundleTree} = require('./utils'); describe('sass', function() { it('should support requiring sass files', async function() { let b = await bundle(__dirname + '/integration/sass/index.js'); awa...
<vulnerable_code>const assert = require('assert'); const {bundle: _bundle, run} = require('./utils'); const fs = require('../src/utils/fs'); _bundle(name, Object.assign({scopeHoist: true}, opts)); describe('scope hoisting', function() { describe('es6', function() { it('supports default imports and exports of ...
<vulnerable_code>const assert = require('assert'); const fs = require('../src/utils/fs'); const {bundler} = require('./utils'); const http = require('http'); } it('should serve files', async function() { let b = bundler(__dirname + '/integration/commonjs/index.js'); server = await b.serve(0); let data...
<vulnerable_code> describe('sourcemaps', function() { it('should create a valid sourcemap as a child of a JS bundle', async function() { let b = bundler(__dirname + '/integration/sourcemap/index.js'); let bu = await b.bundle(); await assertBundleTree(bu, { it('should create a valid sourcemap as a chil...
<vulnerable_code>const assert = require('assert'); const fs = require('../src/utils/fs'); const {bundle, run, assertBundleTree} = require('./utils'); describe('stylus', function() { it('should support requiring stylus files', async function() { let b = await bundle(__dirname + '/integration/stylus/index.js'); ...
<vulnerable_code> describe('sugarss', function() { it('should correctly parse SugarSS asset', async function() { let b = await bundle(__dirname + '/integration/sugarss/index.sss'); await assertBundleTree(b, { name: 'index.css',<commit_title>[PATCH 02/57] Process inline styles and scripts (#1456)<commit...
<vulnerable_code>const assert = require('assert'); const fs = require('../src/utils/fs'); const {bundle, run, assertBundleTree} = require('./utils'); describe('typescript', function() { it('should produce a ts bundle using ES6 imports', async function() { let b = await bundle(__dirname + '/integration/typescript...
<vulnerable_code>const rimraf = promisify(require('rimraf')); const ncp = promisify(require('ncp')); beforeEach(async function() { // Test run in a single process, creating and deleting the same file(s) // Windows needs a delay for the file handles to be released before deleting // is possible. Without a delay, ...
<vulnerable_code>const assert = require('assert'); const {bundle, assertBundleTree, run} = require('./utils'); const fs = require('../src/utils/fs'); describe('vue', function() { it('should produce a basic vue bundle', async function() { let b = await bundle(__dirname + '/integration/vue-basic/Basic.vue'); ...
<vulnerable_code>const assert = require('assert'); const {bundle, run, assertBundleTree, deferred} = require('./utils'); describe('wasm', function() { for (const target of ['browser', 'node']) { describe(`--target=${target}`, function() { it('should preload a wasm file for a sync require', async function()...
<vulnerable_code> rimraf, ncp } = require('./utils'); describe('watcher', function() { let b; beforeEach(async function() { await rimraf(__dirname + '/input'); }); afterEach(function() { }); it('should rebuild on file change', async function() { await ncp(__dirname + '/integration/commonjs', _...
<vulnerable_code>const SCRIPT_TYPES = { 'application/javascript': 'js', 'text/javascript': 'js', 'application/json': false }; // Options to be passed to `addURLDependency` for certain tags + attributes<commit_title>[PATCH 02/57] Process inline styles and scripts (#1456)<commit_description><fixed_code> const SCRI...
<vulnerable_code> this.registerExtension('vue', './assets/VueAsset'); this.registerExtension('json', './assets/JSONAsset'); this.registerExtension('json5', './assets/JSONAsset'); this.registerExtension('yaml', './assets/YAMLAsset'); this.registerExtension('yml', './assets/YAMLAsset'); this.regist...
<vulnerable_code> if (rendition.meta) { for (let res of processed) { res.meta = rendition.meta; } } <commit_title>[PATCH 02/57] Process inline styles and scripts (#1456)<commit_description><fixed_code> if (rendition.meta) { for (let res of processed) { ...
<vulnerable_code> 'msapplication-square310x310logo', 'msapplication-square70x70logo', 'msapplication-wide310x150logo', 'msapplication-TileImage' ], itemprop: [ 'image', 'application/javascript': 'js', 'text/javascript': 'js', 'application/json': false, 'text/html': false }; if (typ...
<vulnerable_code><commit_title>[PATCH 02/57] Process inline styles and scripts (#1456)<commit_description><fixed_code> const urlJoin = require('../utils/urlJoin'); const isURL = require('../utils/is-url'); const Asset = require('../Asset'); const logger = require('../Logger'); // A list of all attributes in a schema t...
<vulnerable_code><commit_title>[PATCH 02/57] Process inline styles and scripts (#1456)<commit_description><fixed_code> const {bundle, assertBundleTree} = require('./utils'); describe('schema ld+json', function() { it('Should parse a LD+JSON schema and collect dependencies', async function() { let b = await bundl...
<vulnerable_code> const envPath = await config.resolve(filepath, [dotenvFile]); if (envPath) { const envs = dotenv.config({path: envPath}); variableExpansion(envs) } }) );<commit_title>[PATCH 02/57] Process inline styles and scripts (#1456)<commit_description><fixed_code> co...
<vulnerable_code>// Hacky fix to make node 6 tests pass if (parseInt(process.versions.node, 10) < 8) { require("babel-register"); } const {Asset} = require('../../../../../src/Bundler');<commit_title>[PATCH 02/57] Process inline styles and scripts (#1456)<commit_description><fixed_code> // Hacky fix to make node 6 t...
<vulnerable_code> async stop() { if (this.watcher) { this.watcher.stop(); } if (this.hmr) {<commit_title>[PATCH 02/57] Process inline styles and scripts (#1456)<commit_description><fixed_code> async stop() { if (this.watcher) { await this.watcher.stop(); } if (this.hmr) {
<vulnerable_code> /** * Stop watching all paths */ stop() { this.stopped = true; this.watcher.close(); } } <commit_title>[PATCH 02/57] Process inline styles and scripts (#1456)<commit_description><fixed_code> /** * Stop watching all paths */ async stop() { this.stopped = true; await...
<vulnerable_code> // If the dep isn't in this bundle, add it to the list of external modules to preload. // Only do this if this is the root JS bundle, otherwise they will have already been // loaded in parallel with this bundle as part of a dynamic import. if ( !this.bundle.ass...
<vulnerable_code> ws = new WebSocket('ws://localhost:' + b.options.hmrPort); const buildEnd = nextEvent(b, 'buildEnd'); if (process.platform === 'win32') { await sleep(100); } await fs.writeFile( path.join(__dirname, '/input/local.js'), 'exports.a = 5;\nexports.b = 5;' ); ...
<vulnerable_code> await sleep(100); }); afterEach(function() { if (b) { b.stop(); } }); let output = await run(bundle); assert.equal(output(), 3); await fs.writeFile( path.join(inputDir, '/local.js'), 'exports.a = 5; exports.b = 5;' ); // change b.js so that it...
<vulnerable_code> this.options = options; this.encoding = 'utf8'; this.type = path.extname(this.name).slice(1); this.processed = false; this.contents = options.rendition ? options.rendition.value : null;<commit_title>[PATCH 02/57] Process inline styles and scripts (#1456)<commit_description><fixed_c...
<vulnerable_code> }); } const containsHtmlAsset = assets.some(asset => asset.type === 'html'); if (containsHtmlAsset) { this.broadcast({ type: 'reload' });<commit_title>[PATCH 02/57] Process inline styles and scripts (#1456)<commit_description><fixed_code> }); } cons...
<vulnerable_code> this.registerExtension('ts', './assets/TypeScriptAsset'); this.registerExtension('tsx', './assets/TypeScriptAsset'); this.registerExtension('coffee', './assets/CoffeeScriptAsset'); this.registerExtension('vue', './assets/VueAsset'); this.registerExtension('json', './assets/JSONAsset...
<vulnerable_code><commit_title>[PATCH 02/57] Process inline styles and scripts (#1456)<commit_description><fixed_code> const Asset = require('../Asset'); const commandExists = require('command-exists'); const localRequire = require('../utils/localRequire'); const {minify} = require('terser'); const path = require('path...
<vulnerable_code> super(name, options); this.type = 'html'; this.isAstDirty = false; } async parse(code) {<commit_title>[PATCH 02/57] Process inline styles and scripts (#1456)<commit_description><fixed_code> super(name, options); this.type = 'html'; this.isAstDirty = false; this.hmrPageR...
<vulnerable_code><commit_title>[PATCH 02/57] Process inline styles and scripts (#1456)<commit_description><fixed_code> const assert = require('assert'); const fs = require('../src/utils/fs'); const {bundle, assertBundleTree, run} = require('./utils'); describe('elm', function() { it('should produce a basic Elm bundl...
<vulnerable_code><commit_title>[PATCH 02/57] Process inline styles and scripts (#1456)<commit_description><fixed_code> var local = require('./src/Main.elm'); module.exports = function () { return local; };
<vulnerable_code> } c_node = xmlTextReaderExpand(c_reader); c_property = c_node->properties; while (c_property != NULL) { VALUE rb_name = NOKOGIRI_STR_NEW2(c_property->name);<commit_title>[PATCH] fix(cruby): XML::Reader#attribute_hash returns nil on error<commit_description>Note that on JRuby, the namespace...
<vulnerable_code> sk_eat_skb(sk, skb, 0); if (!desc->count) break; } tp->copied_seq = seq; <commit_title>[PATCH] net: Fix oops from tcp_collapse() when using splice()<commit_description>tcp_read_sock() can have a eat skbs without immediately advancing copied_seq. This can cause a panic in tcp_collapse() if it i...
<vulnerable_code>import time from enum import Flag, auto from json.decoder import JSONDecodeError from typing import Any, Dict, List, Optional, Union, cast import requests from requests.adapters import HTTPAdapter _network_config: Union[Dict, str] = sources.UNSET _crawled_metadata: Union[Dict, str] = sources.U...
<vulnerable_code># Vultr Metadata API: # https://www.vultr.com/metadata/ import cloudinit.sources.helpers.vultr as vultr from cloudinit import log as log from cloudinit import sources, stages, util, version dsname = "Vultr" def __init__(self, sys_cfg, distro, paths): super(DataSourceVultr, self).__in...
<vulnerable_code> sub_key_path = key_path + "/" + key else: sub_key_path = key if key in sensitive_keys or sub_key_path in sensitive_keys: sens_keys.append(sub_key_path) if isinstance(val, str) and val.startswith("ci-b64:"): base64_encoded_keys.appe...
<vulnerable_code> util.ensure_dirs(self._initial_subdirs()) log_file = util.get_cfg_option_str(self.cfg, "def_log_file") if log_file: util.ensure_file(log_file, mode=0o640, preserve_mode=True) perms = self.cfg.get("syslog_fix_perms") if not perms: ...
<vulnerable_code> "cred2": "othersekret", } }, }, ) self.assertCountEqual( ( "merged_cfg", "security-credentials", ), datasource.sensitive_metadata_keys, ) ...
<vulnerable_code> # Assert we create it 0o640 by default if it doesn't already exist assert 0o640 == stat.S_IMODE(log_file.stat().mode) def test_existing_file_permissions_are_not_modified(self, init, tmpdir): """If the log file already exists, we should not modify its permissions S...
<vulnerable_code> with self.assertRaises(ValueError): string_ops.substr(b"test", 3, 1, unit="UTF8") if __name__ == "__main__": test.main()<commit_title>[PATCH] Fix crash of tf.strings.substr when pos and len have<commit_description><fixed_code> with self.assertRaises(ValueError): string_o...
<vulnerable_code> - ``'pari'`` - (default) use the PARI c library - ``'kash'`` - use KASH computer algebra system (requires that kash be installed) sage: factor( -next_prime(10^2) * next_prime(10^7) ) -1 * 101 * 10000019 :: sage: factor(-500, algorithm='kash') ...
<vulnerable_code> return at(JsonPointer.compile(jsonPtrExpr)); } protected abstract JsonNode _at(JsonPointer ptr); /* * and can be used to check that this node is an {@code ObjectNode} (that is, represents * JSON Object value) and has value for specified property with key {@code fieldName...
<vulnerable_code> @Override protected JsonNode _at(JsonPointer ptr) { // will only allow direct matches, but no traversal through // (base class checks for direct match) return MissingNode.getInstance(); } /**<commit_title>[PATCH] Fixed #3003<commit_description><fixed_code> ...
<vulnerable_code>public class RequiredAccessorTest extends BaseMapTest { private final ObjectMapper MAPPER = sharedMapper(); private final JsonNode TEST_OBJECT, TEST_ARRAY; } public void testIMPORTANT() { _checkRequiredAt(TEST_OBJECT, "/data/weird/and/more", "/weird/and/more"); } ...
<vulnerable_code>import uuid from functools import partial from ansible.module_utils._text import to_bytes, to_text from ansible.module_utils.common.json import AnsibleJSONEncoder from ansible.module_utils.six import iteritems from ansible.module_utils.six.moves import cPickle def write_to_file_descriptor(fd, obj): ...
<vulnerable_code> return (0); } /* Assert that 'pathname' is a dir. If mode >= 0, verify that too. */ int assertion_is_dir(const char *file, int line, const char *pathname, int mode)<commit_title>[PATCH] Test cases for Github Issue #744, #745, and #746.<commit_description><fixed_code> return (0); } /* Verify mode o...
<vulnerable_code><commit_title>[PATCH] Test cases for Github Issue #744, #745, and #746.<commit_description><fixed_code> /*- * Copyright (c) 2003-2007,2016 Tim Kientzle * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the foll...
<vulnerable_code><commit_title>[PATCH] Test cases for Github Issue #744, #745, and #746.<commit_description><fixed_code> /*- * Copyright (c) 2003-2007,2016 Tim Kientzle * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the foll...
<vulnerable_code><commit_title>[PATCH] Test cases for Github Issue #744, #745, and #746.<commit_description><fixed_code> /*- * Copyright (c) 2003-2007,2016 Tim Kientzle * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the foll...
<vulnerable_code> } } } (void) SetImageType(image,PaletteType); colors=image->colors; if (transparent != MagickFalse)<commit_title>[PATCH] https://github.com/ImageMagick/ImageMagick/issues/562<commit_description><fixed_code> } } } if (i ...
<vulnerable_code> assert c.ret10_slice() == b"A" def test_slice_convert(get_contract): # test slice of converting between bytes32 and Bytes code = """<commit_title>[PATCH] Merge pull request from GHSA-7vrm-3jc8-5wwm<commit_description>* add more tests for string comparison explicitly test the codepath wit...
<vulnerable_code> assert c.test(12345, "bar")[-3:] == b"bar" def test_string_equality(get_contract_with_gas_estimation): code = """ _compA: String[100] _compB: String[100] @external def equal_true() -> bool: compA: String[100] = "The quick brown fox jumps over the lazy dog" compB: String[100] = "The q...
<vulnerable_code> with src.cache_when_complex("src") as (b1, src), length.cache_when_complex( "copy_bytes_count" ) as (b2, length,), dst.cache_when_complex("dst") as (b3, dst): # fast code for common case where num bytes is small # TODO expand this for more cases where num words is less...
<vulnerable_code>from vyper.address_space import DATA, IMMUTABLES, MEMORY, STORAGE from vyper.codegen import external_call, self_call from vyper.codegen.core import ( LOAD, bytes_data_ptr, clamp_basetype, ensure_in_memory, get_dyn_array_count, left = Expr(self.expr.left, self.context).ir...
<vulnerable_code>from math import ceil from vyper.codegen.core import ensure_in_memory from vyper.codegen.ir_node import IRnode from vyper.codegen.types import BaseType, ByteArrayLike, is_base_type from vyper.exceptions import CompilerPanic return SHA3_BASE + num_words * SHA3_PER_WORD def keccak256_helper(expr, ...
<vulnerable_code> else: if (_iat + _storage_time) < (_now - _skew): raise IATError("Issued too long ago") return True <commit_title>[PATCH 1/4] Fix `iat` claim in the future<commit_description><fixed_code> else: if (_iat + _storage_time) < (_now - _skew): ...
<vulnerable_code>from urllib.parse import urlencode import pytest from jwkest import BadSignature from jwkest.jwk import SYMKey from jwkest.jws import left_hash from oic.oic.message import BackChannelLogoutRequest from oic.oic.message import CHashError from oic.oic.message import Claims from oic.oic.message import Fro...
<vulnerable_code>import warnings from typing import Dict from typing import Optional from oic import rndstr from oic.exception import AuthzError from oic.oic.message import BackChannelLogoutRequest from oic.oic.message import Claims from oic.oic.message import ClaimsRequest from oic.utils import http_util from oic.uti...
<vulnerable_code>from oic.oic.consumer import IGNORE from oic.oic.consumer import Consumer from oic.oic.consumer import clean_response from oic.oic.message import AccessTokenResponse from oic.oic.message import AuthorizationResponse from oic.oic.message import IdToken self.consumer.userinfo_endpoint = "https://...
<vulnerable_code> "openid", "code", path="https://example.com" ) resp = self.provider.authorization_endpoint(request=request_location) aresp = self.consumer.parse_authz(resp.message) assert self.consumer.sdb[sid]["issuer"] == self.provider.baseurl # Simulate an acces...
<vulnerable_code>from oic.oic.message import IdToken from oic.oic.message import Message from oic.oic.message import OpenIDSchema from oic.oic.message import RefreshAccessTokenRequest from oic.oic.message import RegistrationRequest from oic.oic.message import RegistrationResponse self.cons.keyjar.import_jwks( ...
<vulnerable_code> _log_info("response: %s" % sanitize(query)) if "code" in self.consumer_config["response_type"]: aresp, _state = self._parse_authz(query, **kwargs) <commit_title>[PATCH 1/4] Fix `iat` claim in the future<commit_description><fixed_code> _log_info("response: %s" % sa...
<vulnerable_code>from jwkest.jwk import SYMKey from oic.oauth2.message import MissingSigningKey from oic.oic import DEF_SIGN_ALG from oic.oic import Server from oic.oic import response_types_to_grant_types _state = "state0" self.consumer.consumer_config["response_type"] = ["id_token", "token"] ...
<vulnerable_code>from oic.oauth2.message import ErrorResponse from oic.oauth2.message import Message from oic.oauth2.message import MessageFactory from oic.oauth2.util import get_or_post from oic.oic.message import SCOPE2CLAIMS from oic.oic.message import AccessTokenResponse return resp def _verify_id_toke...
<vulnerable_code> if check_hash: _alg = idt.jws_header["alg"] # What if _alg == 'none' hfunc = "HS" + _alg[-3:] if "access_token" in instance: if "at_hash" not in idt: raise MissingRequiredAttribute("Missing at_hash property", idt) if idt["at...
<vulnerable_code> with freeze_time("2019-08-09 11:00:00"): part = self.consumer.parse_authz(query=parsed.query) auth = part[0] atr = part[1] assert part[2] is None assert auth is None assert isinstance(atr, AccessTokenResponse) assert _eq( ...
<vulnerable_code>/* }}} */ #endif /* {{{ proto resource ldap_first_reference(resource link, resource result) Return first reference */ PHP_FUNCTION(ldap_first_reference) /* }}} */ #endif /* {{{ arginfo */ ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_connect, 0, 0, 0) ZEND_ARG_INFO(0, hostname) ZEND_ARG_INFO(0, value) ZEN...
<vulnerable_code> WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, &link, -1, "ldap link", le_link); ZEND_FETCH_RESOURCE(ldap_result, LDAPMessage *, &result, -1, "ldap result", le_result); rc = ldap_parse_extended_result(ld->link, ldap_result, myargcount > 2 ? &lretoid: NULL, if (lretdata == ...
<vulnerable_code> LDAPMessage *ldap_res; int rc, msgid, myargcount = ZEND_NUM_ARGS(); if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|zzzz", &link, &user, &oldpw, &newpw, &newpasswd) == FAILURE) { WRONG_PARAM_COUNT; } /* synchronous call */ rc = ldap_passwd_s(ld->link, &luser, loldpw.bv_len > 0 ? ...
<vulnerable_code> Extract information from <draft-zeilenga-ldap-authzid> whoami extended operation result (a Work in Progress) */ PHP_FUNCTION(ldap_parse_exop_whoami) { zval *link, *result, **authzid; ldap_linkdata *ld; LDAPMessage *ldap_result; struct berval *lauthzid; int rc, myargcount = ZEND_NUM_ARGS(); if...
<vulnerable_code> struct berval lnewpasswd; int rc, myargcount = ZEND_NUM_ARGS(); if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrz", &link, &result, &newpasswd) != SUCCESS) { WRONG_PARAM_COUNT; } ZEND_END_ARG_INFO() #endif #ifdef HAVE_LDAP_REFRESH ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_refresh, 0, 0, 4) ...
<vulnerable_code> struct berval *lretdata; int rc, myargcount = ZEND_NUM_ARGS(); if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr|zz", &link, &result, &retoid, &retdata) == SUCCESS) { WRONG_PARAM_COUNT; } int rc, msgid, myargcount = ZEND_NUM_ARGS(); /* int reqoid_len, reqdata_len, retdata_len, retoid_l...
<vulnerable_code> /* }}} */ #ifdef HAVE_LDAP_REFRESH /* {{{ proto ? ldap_refresh(resource link , string dn , int ttl, [int *newttl]) DDS refresh extended operation */ PHP_FUNCTION(ldap_refresh) { zval *link, *dn, *ttl, *newttl; struct berval ldn; ber_int_t lttl; ber_int_t lnewttl; ldap_linkdata *ld; LDAP *lda...
<vulnerable_code> REGISTER_LONG_CONSTANT("LDAP_ESCAPE_FILTER", PHP_LDAP_ESCAPE_FILTER, CONST_PERSISTENT | CONST_CS); REGISTER_LONG_CONSTANT("LDAP_ESCAPE_DN", PHP_LDAP_ESCAPE_DN, CONST_PERSISTENT | CONST_CS); le_link = zend_register_list_destructors_ex(_close_ldap_link, NULL, "ldap link", module_number); le_result =...
<vulnerable_code> RETURN_TRUE; } /* }}} */ #ifdef HAVE_LDAP_PARSE_PASSWD /* {{{ proto bool ldap_parse_exop_passwd(resource link, resource result, string newpasswd) RETURN_TRUE; } #else /* TODO: implement based on ldap_parse_exop() */ /* }}} */ #endif } RETURN_TRUE; } #else /* TODO: implement based on ldap_parse_e...
<vulnerable_code>} /* }}} */ #endif #ifdef HAVE_LDAP_PARSE_PASSWD /* {{{ proto bool ldap_parse_exop_passwd(resource link, resource result, string newpasswd) Extract information from RFC 3062 password modify extended operation result */ PHP_FUNCTION(ldap_parse_exop_passwd) { zval *link, *result, *newpasswd; ldap_l...
<vulnerable_code> /* {{{ Extended operation response parsing, Pierangelo Masarati */ #ifdef HAVE_LDAP_PARSE_EXTENDED_RESULT /* {{{ proto bool ldap_parse_exop(resource link, resource result [, string retoid [, string retdata]]) Extract information from extended operation result */ PHP_FUNCTION(ldap_parse_exop) { zva...
<vulnerable_code> struct berval *lretdata; int rc, myargcount = ZEND_NUM_ARGS(); if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr|z/z/", &link, &result, &retdata, &retoid) != SUCCESS) { WRONG_PARAM_COUNT; } myargcount > 2 ? &lretdata: NULL, 0); if (rc != LDAP_SUCCESS) { php_error_docref(NULL T...
<vulnerable_code> char *lreqoid, *lretoid = NULL; struct berval lreqdata, *lretdata = NULL; ldap_linkdata *ld; LDAP *ldap; LDAPMessage *ldap_res; int rc, msgid, myargcount = ZEND_NUM_ARGS(); /* int reqoid_len, reqdata_len, retdata_len, retoid_len, retdat_len; */ zval *link, *user, *newpw, *oldpw, *newpasswd; st...
<vulnerable_code>#endif #ifdef HAVE_LDAP_PASSWD_S /* {{{ proto bool ldap_exop_passwd(resource link [, string user [, string oldpw [, string newpw [, string genpasswd ]]]]) Passwd modify extended operation */ PHP_FUNCTION(ldap_exop_passwd) { zval *link, *user, *newpw, *oldpw, *newpasswd; struct berval luser, loldp...
<vulnerable_code> buf = emalloc(data_len + EVP_CIPHER_CTX_block_size(&ctx)); EVP_CIPHER_CTX_cleanup(&ctx); if (!EVP_SealInit(&ctx, cipher, eks, eksl, NULL, pkeys, nkeys) || !EVP_SealUpdate(&ctx, buf, &len1, (unsigned char *)data, data_len)) { RETVAL_FALSE; efree(buf); EVP_CIPHER_CTX_cleanup(&ctx); goto clean...