text stringlengths 79 3.72M |
|---|
<vulnerable_code> device_keys_query: Dict[str, Optional[List[str]]] = query_body.get(
"device_keys", {}
)
res = await self.query_local_devices(
device_keys_query,
include_displaynames=(<commit_title>[PATCH] Merge pull request from GHSA-mp92-3jfm-3575<commit_des... |
<vulnerable_code> _sort_param, _timeframe_type, _type_format, _yes_no_boolean, _get_dirnames_path,
allowed_fields, is_safe_path, _wazuh_version, _symbols_alphanumeric_param, _base64,
_group_names, _group_names_or_all, _iso8601_date, _iso860... |
<vulnerable_code> ND_PRINT((ndo, " (length bogus, should be >= 6)"));
return len;
}
ND_TCHECK2(*(p + 2), 3);
ND_PRINT((ndo, ": Vendor: %s (%u)",
tok2str(oui_values,"Unknown",EXTRACT_24BITS(p+2)),
EXTRACT_24BITS(p + 2)));
ND_PRINT((ndo, " (length bogus, should be = 4)"));
return len;
}
ND_TCHE... |
<vulnerable_code> collection_posts: Array(2).fill(matchCollectionPost)
});
});
});
it('Can read a Collection', async function () {<commit_title>[PATCH 01/72] Update babel monorepo to v7.22.7<commit_description><fixed_code>
collection_posts: Array(2... |
<vulnerable_code> attachResetToRequest: true,
failCallback(req, res, next, nextValidRequestDate) {
return next(new errors.TooManyRequestsError({
message: `Too many different sign-in attempts try again in ${moment(nextValidRequestDate).fromNow(tr... |
<vulnerable_code>const logging = require('@tryghost/logging');
const {HtmlValidate} = require('html-validate');
function validateHtml(html) {
const htmlvalidate = new HtmlValidate({
extends: [
'html-validate:document',
}
]
});
const report = htmlvalidate.validateStri... |
<vulnerable_code>import AuthConfiguration from 'ember-simple-auth/configuration';
import Route from '@ember/routing/route';
import ShortcutsRoute from 'ghost-admin/mixins/shortcuts-route';
import ctrlOrCmd from 'ghost-admin/utils/ctrl-or-cmd';
import windowProxy from 'ghost-admin/utils/window-proxy';
import {InitSentry... |
<vulnerable_code>const Promise = require('bluebird');
const api = require('./index');
const config = require('../../../shared/config');
const tpl = require('@tryghost/tpl');<commit_title>[PATCH 01/72] Update babel monorepo to v7.22.7<commit_description><fixed_code>
const api = require('./index');
const config = require... |
<vulnerable_code>const Promise = require('bluebird');
const tpl = require('@tryghost/tpl');
const errors = require('@tryghost/errors');
const {mapQuery} = require('@tryghost/mongo-utils');<commit_title>[PATCH 01/72] Update babel monorepo to v7.22.7<commit_description><fixed_code>
const tpl = require('@tryghost/tpl');
c... |
<vulnerable_code>const Promise = require('bluebird');
const moment = require('moment-timezone');
const dbBackup = require('../../data/db/backup');
const exporter = require('../../data/exporter');
const importer = require('../../data/importer');
const mediaInliner = require('../../services/media-inliner');
const errors ... |
<vulnerable_code>const Promise = require('bluebird');
const tpl = require('@tryghost/tpl');
const errors = require('@tryghost/errors');
const invites = require('../../services/invites');<commit_title>[PATCH 01/72] Update babel monorepo to v7.22.7<commit_description><fixed_code>
const tpl = require('@tryghost/tpl');
con... |
<vulnerable_code>const Promise = require('bluebird');
const tpl = require('@tryghost/tpl');
const errors = require('@tryghost/errors');
const models = require('../../models');<commit_title>[PATCH 01/72] Update babel monorepo to v7.22.7<commit_description><fixed_code>
const tpl = require('@tryghost/tpl');
const errors =... |
<vulnerable_code>const Promise = require('bluebird');
const tpl = require('@tryghost/tpl');
const mailService = require('../../services/mail');
const api = require('./');<commit_title>[PATCH 01/72] Update babel monorepo to v7.22.7<commit_description><fixed_code>
const tpl = require('@tryghost/tpl');
const mailService =... |
<vulnerable_code>const Promise = require('bluebird');
const errors = require('@tryghost/errors');
const tpl = require('@tryghost/tpl');
const models = require('../../models');<commit_title>[PATCH 01/72] Update babel monorepo to v7.22.7<commit_description><fixed_code>
const errors = require('@tryghost/errors');
const tp... |
<vulnerable_code>const debug = require('@tryghost/debug')('api:endpoints:utils:permissions');
const Promise = require('bluebird');
const _ = require('lodash');
const permissions = require('../../../services/permissions');
const tpl = require('@tryghost/tpl');<commit_title>[PATCH 01/72] Update babel monorepo to v7.22.7<... |
<vulnerable_code>const Promise = require('bluebird');
const debug = require('@tryghost/debug')('api:endpoints:utils:serializers:output:roles');
const canThis = require('../../../../../services/permissions').canThis;
roles: roles
};
} else {
return Promise.filter(roles.ma... |
<vulnerable_code>const Promise = require('bluebird');
const validator = require('@tryghost/validator');
const debug = require('@tryghost/debug')('api:endpoints:utils:validators:input:invitation');
const tpl = require('@tryghost/tpl');<commit_title>[PATCH 01/72] Update babel monorepo to v7.22.7<commit_description><fixed... |
<vulnerable_code>const Promise = require('bluebird');
const tpl = require('@tryghost/tpl');
const errors = require('@tryghost/errors');
<commit_title>[PATCH 01/72] Update babel monorepo to v7.22.7<commit_description><fixed_code>
const tpl = require('@tryghost/tpl');
const errors = require('@tryghost/errors');
|
<vulnerable_code>/* eslint-disable ghost/filenames/match-regex */
const Promise = require('bluebird');
const validator = require('@tryghost/validator');
const debug = require('@tryghost/debug')('api:endpoints:utils:validators:input:passwordreset');
const tpl = require('@tryghost/tpl');<commit_title>[PATCH 01/72] Update... |
<vulnerable_code>const Promise = require('bluebird');
const _ = require('lodash');
const {ValidationError} = require('@tryghost/errors');
const validator = require('@tryghost/validator');<commit_title>[PATCH 01/72] Update babel monorepo to v7.22.7<commit_description><fixed_code>
const _ = require('lodash');
const {Vali... |
<vulnerable_code>const Promise = require('bluebird');
const debug = require('@tryghost/debug')('api:endpoints:utils:validators:input:users');
const tpl = require('@tryghost/tpl');
const errors = require('@tryghost/errors');<commit_title>[PATCH 01/72] Update babel monorepo to v7.22.7<commit_description><fixed_code>
cons... |
<vulnerable_code>const path = require('path');
const _ = require('lodash');
const Promise = require('bluebird');
const errors = require('@tryghost/errors');
const tpl = require('@tryghost/tpl');
const config = require('../../../shared/config');
module.exports = {
// Activate a app and return it
activateAppByNa... |
<vulnerable_code>const _ = require('lodash');
const Promise = require('bluebird');
const url = require('url');
const debug = require('@tryghost/debug')('services:data:entry-lookup');
const routeMatch = require('path-match')();<commit_title>[PATCH 01/72] Update babel monorepo to v7.22.7<commit_description><fixed_code>
c... |
<vulnerable_code>const downsize = require('downsize');
const Promise = require('bluebird');
const RSS = require('rss');
const urlUtils = require('../../../shared/url-utils');
const {routerManager} = require('../routing');<commit_title>[PATCH 01/72] Update babel monorepo to v7.22.7<commit_description><fixed_code>
const ... |
<vulnerable_code>
const fs = require('fs-extra');
const path = require('path');
const Promise = require('bluebird');
const moment = require('moment');
const tpl = require('@tryghost/tpl');
const logging = require('@tryghost/logging');<commit_title>[PATCH 01/72] Update babel monorepo to v7.22.7<commit_description><fixed... |
<vulnerable_code> } else {
return Promise.all(
roles.map(async (role) => {
const permissionResult = await canThis(frame.options.context).assign.role(role)
.return(role)
.catch(() => {});
return per... |
<vulnerable_code>const Promise = require('bluebird');
const models = require('../../../../models');
module.exports = function before() {<commit_title>[PATCH 01/72] Update babel monorepo to v7.22.7<commit_description><fixed_code>
const models = require('../../../../models');
module.exports = function before() { |
<vulnerable_code>/* eslint-disable ghost/filenames/match-regex */
const Promise = require('bluebird');
module.exports = function afterEach() {
return Promise.resolve();<commit_title>[PATCH 01/72] Update babel monorepo to v7.22.7<commit_description><fixed_code>
/* eslint-disable ghost/filenames/match-regex */
modu... |
<vulnerable_code>/* eslint-disable ghost/filenames/match-regex */
const Promise = require('bluebird');
module.exports = function beforeEach() {
return Promise.resolve();<commit_title>[PATCH 01/72] Update babel monorepo to v7.22.7<commit_description><fixed_code>
/* eslint-disable ghost/filenames/match-regex */
mod... |
<vulnerable_code>const _ = require('lodash');
const Promise = require('bluebird');
const logging = require('@tryghost/logging');
const errors = require('@tryghost/errors');
const tpl = require('@tryghost/tpl');<commit_title>[PATCH 01/72] Update babel monorepo to v7.22.7<commit_description><fixed_code>
const _ = require... |
<vulnerable_code>const _ = require('lodash');
const Promise = require('bluebird');
const tpl = require('@tryghost/tpl');
const errors = require('@tryghost/errors');
const validator = require('@tryghost/validator');<commit_title>[PATCH 01/72] Update babel monorepo to v7.22.7<commit_description><fixed_code>
const _ = re... |
<vulnerable_code>const sizeOf = require('image-size');
const Promise = require('bluebird');
const _ = require('lodash');
const path = require('path');
const errors = require('@tryghost/errors');
}).height;
}
return resolve({
width: dimensions.widt... |
<vulnerable_code>const Promise = require('bluebird');
const crypto = require('crypto');
const tpl = require('@tryghost/tpl');
<commit_title>[PATCH 01/72] Update babel monorepo to v7.22.7<commit_description><fixed_code>
const crypto = require('crypto');
const tpl = require('@tryghost/tpl');
|
<vulnerable_code>const probeSizeOf = require('probe-image-size');
const url = require('url');
const path = require('path');
const Promise = require('bluebird');
const _ = require('lodash');
const errors = require('@tryghost/errors');
const tpl = require('@tryghost/tpl');
dimensions.height = _.maxBy(... |
<vulnerable_code>const models = require('../../models');
const logging = require('@tryghost/logging');
const errors = require('@tryghost/errors');
const Promise = require('bluebird');
// Listen to settings.timezone.edited and settings.notifications.edited to bind extra logic to settings, similar to the bridge and memb... |
<vulnerable_code> */
const _ = require('lodash');
const Promise = require('bluebird');
const ObjectId = require('bson-objectid').default;
const errors = require('@tryghost/errors');
<commit_title>[PATCH 01/72] Update babel monorepo to v7.22.7<commit_description><fixed_code>
*/
const _ = require('lodash');
const Obje... |
<vulnerable_code>const Promise = require('bluebird');
const _ = require('lodash');
const tpl = require('@tryghost/tpl');
const errors = require('@tryghost/errors');<commit_title>[PATCH 01/72] Update babel monorepo to v7.22.7<commit_description><fixed_code>
const _ = require('lodash');
const tpl = require('@tryghost/tpl... |
<vulnerable_code>const _ = require('lodash');
const uuid = require('uuid');
const moment = require('moment');
const Promise = require('bluebird');
const {sequence} = require('@tryghost/promise');
const tpl = require('@tryghost/tpl');
const errors = require('@tryghost/errors');<commit_title>[PATCH 01/72] Update babel mo... |
<vulnerable_code>const _ = require('lodash');
const ghostBookshelf = require('./base');
const Promise = require('bluebird');
const tpl = require('@tryghost/tpl');
const errors = require('@tryghost/errors');
<commit_title>[PATCH 01/72] Update babel monorepo to v7.22.7<commit_description><fixed_code>
const _ = require('l... |
<vulnerable_code>const Promise = require('bluebird');
const ghostBookshelf = require('./base');
const ghostVersion = require('@tryghost/version');
let Webhook;<commit_title>[PATCH 01/72] Update babel monorepo to v7.22.7<commit_description><fixed_code>
const ghostBookshelf = require('./base');
const ghostVersion = requi... |
<vulnerable_code>const moment = require('moment-timezone');
const semver = require('semver');
const Promise = require('bluebird');
const _ = require('lodash');
const errors = require('@tryghost/errors');
const ghostVersion = require('@tryghost/version');<commit_title>[PATCH 01/72] Update babel monorepo to v7.22.7<commi... |
<vulnerable_code>const _ = require('lodash');
const Promise = require('bluebird');
const models = require('../../models');
const errors = require('@tryghost/errors');
const tpl = require('@tryghost/tpl');<commit_title>[PATCH 01/72] Update babel monorepo to v7.22.7<commit_description><fixed_code>
const _ = require('loda... |
<vulnerable_code>const fs = require('fs-extra');
const Promise = require('bluebird');
const path = require('path');
const debug = require('@tryghost/debug')('frontend:services:settings:ensure-settings');
const tpl = require('@tryghost/tpl');<commit_title>[PATCH 01/72] Update babel monorepo to v7.22.7<commit_description... |
<vulnerable_code>const Promise = require('bluebird');
const fs = require('fs-extra');
const crypto = require('crypto');
const urlService = require('../url');
function isBlogRunning() {
debug('waiting for blog running');
return Promise.delay(1000)
.then(() => {
... |
<vulnerable_code>const serialize = require('./serialize');
const Promise = require('bluebird');
module.exports = (event, model) => {
const payload = {};<commit_title>[PATCH 01/72] Update babel monorepo to v7.22.7<commit_description><fixed_code>
const serialize = require('./serialize');
module.exports = (event, mo... |
<vulnerable_code>const _ = require('lodash');
const Promise = require('bluebird');
const errors = require('@tryghost/errors');
const logging = require('@tryghost/logging');
const tpl = require('@tryghost/tpl');<commit_title>[PATCH 01/72] Update babel monorepo to v7.22.7<commit_description><fixed_code>
const _ = require... |
<vulnerable_code> * Dynamically build and execute queries on the API
*/
const _ = require('lodash');
const Promise = require('bluebird');
// The default settings for a default post query
const queryDefaults = {
* Fetch data from API helper for controllers.
*
* Calls out to get posts per page, builds the final post... |
<vulnerable_code>const _ = require('lodash');
const Promise = require('bluebird');
const debug = require('@tryghost/debug')('services:routing:controllers:static');
const renderer = require('../../rendering');
module.exports = function staticController(req, res, next) {
debug('staticController', res.routerOptions);... |
<vulnerable_code>
// If the user's email is set & has changed & we are not importing
if (self.hasChanged('email') && self.get('email') && !options.importing) {
tasks.gravatar = (function lookUpGravatar() {
const {gravatar} = require('../lib/image');
return gr... |
<vulnerable_code>const _ = require('lodash');
const Promise = require('bluebird');
const validator = require('@tryghost/validator');
const ObjectId = require('bson-objectid').default;
const ghostBookshelf = require('./base');<commit_title>[PATCH 01/72] Update babel monorepo to v7.22.7<commit_description><fixed_code>
co... |
<vulnerable_code> return response;
};
const fetchAutocompleteLinks = async () => {
const offers = await this.fetchOffersTask.perform();
}
},
tenor: this.config.tenor?.googleApiKey ? this.config.tenor : null,
fetchEmbed: fetchEm... |
<vulnerable_code> });
}
@computed('session.user.{isAdmin,isEditor}')
get canManageSnippets() {
let {user} = this.session;
}
}
// load supplemental data such as snippets and members count in the background
@restartableTask
*backgroundLoaderTask() {
yield this.... |
<vulnerable_code> env: {}
};
if (DASH_DASH_ARGS.includes('ghost')) {
commands = [COMMAND_GHOST];
} else if (DASH_DASH_ARGS.includes('admin')) {
commands = [COMMAND_ADMIN];
} else {
commands = [COMMAND_GHOST, COMMAND_ADMIN];
}
if (DASH_DASH_ARGS.includes('revisions') || DASH_DASH_ARGS.includes('all')) {... |
<vulnerable_code> @service session;
@service store;
@service settings;
@inject config;
offers = null;
value: this.config.getSiteUrl(offer.code)
};
});
return [...defaults, ...offersLinks];
};
const fetchLabels = async () =>... |
<vulnerable_code>
const rendered = lexicalLib.render(lexicalState);
rendered.should.containEql('<figure class="kg-card kg-image-card kg-width-wide">');
rendered.should.containEql('<div class="kg-card kg-audio-card">');
});
});<commit_title>[PATCH 01/72] Update babel mono... |
<vulnerable_code> # to handle varargs.)
# explanation of ensure_tuple:
# default is to force even a single value into a tuple,
# e.g. _abi_encode(bytes) -> abi_encode((bytes,))
# this follows the encoding convention for functions:
# ://docs.soliditylang.org/en/v0.8.6/abi-spec.html#function-select... |
<vulnerable_code> return configured_project
class TestLoadTasks:
@pytest.mark.parametrize("url", ("file:///etc/passwd", " file://etc/kernel "))
def test_raises_for_local_files(self, url, project):
request = MockedRequest(url=url)<commit_title>[PATCH] Apply formatting<commit_desc... |
<vulnerable_code> if (firstPost) {
const excerpt = truncate(firstPost.contentPlain(), 175);
items.add('excerpt', <div>{excerpt}</div>, -100);
}
}<commit_title>[PATCH] Add explanatory comment<commit_description><fixed_code>
if (firstPost) {
const excerpt = truncate(firstPost... |
<vulnerable_code>
ret = 1;
bad_mapping:
if (ret == -1 && CRYPTO_THREAD_write_lock(x->lock)) {
x->ex_flags |= EXFLAG_INVALID_POLICY;
CRYPTO_THREAD_unlock(x->lock);
}
sk_POLICY_MAPPING_pop_free(maps, POLICY_MAPPING_free);
return ret;
<commit_title>[PATCH] x509: fix double locking prob... |
<vulnerable_code> return 0;
}
struct xcopy_dev_search_info {
const unsigned char *dev_wwn;
struct se_device *found_dev;
};
static int target_xcopy_locate_se_dev_e4_iter(struct se_device *se_dev,
void *data)
{
struct xcopy_dev_search_info *info = data;
unsigned char tmp_dev_wwn[XCOPY_NAA_IEEE_REGEX_LEN]... |
<vulnerable_code> triggers = buildDescribable(req, Trigger.for_(this));
for (Trigger t : triggers)
t.start(this,true);
}
/**<commit_title>[PATCH] [SECURITY-55]<commit_description>This patch makes standard post-build action refuse to let you configure a downstream project you cannot c... |
<vulnerable_code> for (Object o : JSONArray.fromObject(formData)) {
JSONObject jo = (JSONObject)o;
String kind = jo.getString("kind");
items.add(find(descriptors,kind).newInstance(req,jo));
}
}
/**
* Finds a descriptor from a colle... |
<vulnerable_code> /**
* Form validation method.
*/
public FormValidation doCheck(@AncestorInPath Item project, @QueryParameter String value ) {
// Require CONFIGURE permission on this project
if(!project.hasPermission(Item.CONFIGURE)) return FormValidation.o... |
<vulnerable_code>from homeassistant.components.http.view import HomeAssistantView
from homeassistant.core import HomeAssistant
from homeassistant.helpers.network import is_cloud_connection
from homeassistant.util.network import is_local
from . import indieauth
providers = []
for provider in hass.auth... |
<vulnerable_code>from __future__ import annotations
from http import HTTPStatus
from ipaddress import ip_address
import logging
from typing import Any
)
from homeassistant.helpers.entity_component import EntityComponent
from homeassistant.helpers.event import async_track_state_change_event
from homeassistant.helpers.... |
<vulnerable_code>"""Tests for the login flow."""
from collections.abc import Callable
from http import HTTPStatus
from typing import Any
from unittest.mock import patch
import pytest
from homeassistant.auth.models import User
from homeassistant.core import HomeAssistant
from homeassistant.setup import async_setup_com... |
<vulnerable_code>"""The tests for the person component."""
from collections.abc import Callable
from http import HTTPStatus
from typing import Any
from unittest.mock import patch
from .conftest import DEVICE_TRACKER, DEVICE_TRACKER_2
from tests.common import MockUser, mock_component, mock_restore_cache
from tests.test... |
<vulnerable_code>/*
#[ License :
(C) 2016-2018 by authors:
John Collins (jcc8 at psu dot edu)
Jos Vermaseren (t68 at nikhef dot nl)
#include <stdlib.h>
#include <math.h>
#include <string.h>
/*
#] Includes :
*/
#define NAME "axohelp"
#define VERSIONDATE "2018 Feb 20"
#define VERSI... |
<vulnerable_code># Copyright (c) 2012-2021 Snowflake Computing Inc. All rights reserved.
#
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
#
from __future__ import annotations
import re<commit_title>[PATCH] Apply suggestions from code review<commit_description><fixed_code>
# Copyright (c) 2... |
<vulnerable_code># Copyright (c) 2012-2021 Snowflake Computing Inc. All rights reserved.
#
#
# Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.
#
from snowflake.connector.url_util import is_valid_url, url_encode_str
<commit_title>[PATCH] Apply suggestions from code review<commit_description><fix... |
<vulnerable_code> std::cout << "[" << cl->getClientIP() << "] " << req->methodIntToStr(req->getMethod()) << " " << req->getRequestUri() << std::endl;
/*std::cout << "Headers:" << std::endl;
for(int i = 0; i < req->getNumHeaders(); i++) {
std::cout << req->getHeaderStr(i) << std::endl;
}
std::cout << std::endl;*/
... |
<vulnerable_code> if (uri.length() > 255 || uri.empty())
return NULL;
std::string path = baseDiskPath + uri;
Resource* res = NULL;
<commit_title>[PATCH] Deny any directory traversal paths. README update<commit_description><fixed_code>
if (uri.length() > 255 || uri.empty())
return NULL;
if (uri.find("../") !=... |
<vulnerable_code> bytes_left = len;
while (bytes_left > 0) {
/* Read data from the client. Returns 0 on EOF or error, the
* number of bytes otherwise.
*/
read_length = ap_get_client_block(r, &(*data)[bytes_read],
bytes_left);
if... |
<vulnerable_code> # 1.5 Otherwise, allow
return
# Check the auth events.
auth_events = await store.get_events(
event.auth_event_ids(),
redact_behaviour=EventRedactBehaviour.as_is,
)
room_id = event.room_id
auth_dict: MutableStateMap[str] = {}
for auth_event_id in ... |
<vulnerable_code>
var
/* eslint-disable max-len */
// See https://github.com/eslint/eslint/issues/3229
rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,
/* eslint-enable */
// Support: IE <=10 - 11, Edge 12 - 13 only
// In IE/Edge using regex groups her... |
<vulnerable_code> }
wrapper.call( QUnit, title, function( assert ) {
var done = assert.async(),
$iframe = supportjQuery( "<iframe/>" )
.css( { position: "absolute", top: "0", left: "-600px", width: "500px" } )
.attr( { id: "qunit-fixture-iframe", src: url( fileName ) } );
<commit_title>[PATCH] Manipulatio... |
<vulnerable_code>
addGlobalEvents( "ajaxStart ajaxStop ajaxSend ajaxComplete ajaxError", assert )();
jQuery( document ).on( "ajaxStop", done );
jQuery( "<div/>" ).load( baseURL + "404.txt", function() {
assert.ok( true, "complete" );
} );
} );
return "Hello World";
}
} );
jQuery( "<div/>" ).load(... |
<vulnerable_code> assert.equal( jQuery( "#area1" ).attr( "maxLength" ), "30", "Check for maxLength attribute" );
// using innerHTML in IE causes href attribute to be serialized to the full path
jQuery( "<a/>" ).attr( {
"id": "tAnchor5",
"href": "#5"
} ).appendTo( "#qunit-fixture" );
assert.equal( jQuery( "#tAn... |
<vulnerable_code>QUnit.test( "attributes", function( assert ) {
assert.expect( 6 );
var a = jQuery( "<a/>" ).appendTo( "#qunit-fixture" ),
input = jQuery( "<input/>" ).appendTo( "#qunit-fixture" );
assert.strictEqual( a.attr( "foo", "bar" ).attr( "foo" ), "bar", ".attr getter/setter" );
QUnit.test( "css", functi... |
<vulnerable_code>
var elem, i,
obj = jQuery( "div" ),
code = jQuery( "<code/>" ),
img = jQuery( "<img/>" ),
div = jQuery( "<div/><hr/><code/><b/>" ),
exec = false,
expected = 23,
attrObj = {
elem = jQuery( "\n\n<em>world</em>" )[ 0 ];
assert.equal( elem.nodeName.toLowerCase(), "em", "leading newlines" ... |
<vulnerable_code> assert.notEqual( $child.css( "width" ), "20px", "Retrieving a width percentage on the child of a hidden div returns percentage" );
assert.notEqual( $child.css( "height" ), "20px", "Retrieving a height percentage on the child of a hidden div returns percentage" );
div = jQuery( "<div/>" );
// Thes... |
<vulnerable_code> assert.expect( 4 );
var obj, jqobj,
div = jQuery( "<div/>" );
div.data( { "test": "in", "test2": "in2" } );
assert.equal( div.data( "test" ), "in", "Verify setting an object in data" );
assert.expect( 2 );
var div = jQuery( "<div/>", { id: "hyphened" } ).appendTo( "#qunit-fixture" ),
test... |
<vulnerable_code>QUnit[ jQuery.fn.click ? "test" : "skip" ]( "Event aliases", function( assert ) {
// Explicitly skipping focus/blur events due to their flakiness
var $elem = jQuery( "<div />" ).appendTo( "#qunit-fixture" ),
aliases = ( "resize scroll click dblclick mousedown mouseup " +
"mousemove mouseover mo... |
<vulnerable_code>QUnit.test( "table dimensions", function( assert ) {
assert.expect( 2 );
var table = jQuery( "<table><colgroup><col/><col/></colgroup><tbody><tr><td></td><td>a</td></tr><tr><td></td><td>a</td></tr></tbody></table>" ).appendTo( "#qunit-fixture" ),
tdElem = table.find( "td" ).first(),
colElem = ta... |
<vulnerable_code> } );
this.clock.tick( 200 );
$elem = jQuery( "<div />" );
$elem.show( 0, function() {
assert.ok( true, "Show callback with no duration" );
} );
QUnit.test( "hide hidden elements, with animation (bug #7141)", function( assert ) {
assert.expect( 4 );
var div = jQuery( "<div id='bug7141' style=... |
<vulnerable_code> var cur, div,
obj = {};
div = jQuery( "<div/>" ).on( "focusin.a", function( e ) {
assert.equal( e.type, cur, "Verify right single event was fired." );
} );
// manually clean up detached elements
div.remove();
div = jQuery( "<div/>" ).on( "click mouseover", obj, function( e ) {
assert.equ... |
<vulnerable_code> assert.equal( $multipleElements.eq( 1 ).text(), expected, "text() updates multiple elements (#11809)" );
// Prevent memory leaks #11809
$childDiv = jQuery( "<div/>" );
$childDiv.data( "leak", true );
$parentDiv = jQuery( "<div/>" );
$parentDiv.append( $childDiv );
$parentDiv.text( "Dry off" );
... |
<vulnerable_code>}
var supportsFixedPosition, supportsScroll, alwaysScrollable,
forceScroll = supportjQuery( "<div/>" ).css( { width: 2000, height: 2000 } ),
checkSupport = function( assert ) {
// Only run once
QUnit.test( "hidden (display: none) element", function( assert ) {
assert.expect( 4 );
var node = jQ... |
<vulnerable_code>QUnit.test( "selectors with comma", function( assert ) {
assert.expect( 4 );
var fixture = jQuery( "<div><h2><span/></h2><div><p><span/></p><p/></div></div>" );
assert.equal( fixture.find( "h2, div p" ).filter( "p" ).length, 2, "has to find two <p>" );
assert.equal( fixture.find( "h2, div p" ).fi... |
<vulnerable_code>
assert.equal( jQuery( "#text2" ).index(), 2, "Returns the index of a child amongst its siblings" );
assert.equal( jQuery( "<div/>" ).index(), -1, "Node without parent returns -1" );
} );
QUnit.test( "index(Object|String|undefined)", function( assert ) {
obj = jQuery( "#qunit-fixture" ).has( jQuer... |
<vulnerable_code> cacheLength++;
}
j = jQuery( "<label/>" ).wrap( val( "<li/>" ) );
assert.equal(
j[ 0 ] .nodeName.toUpperCase(), "LABEL", "Element is a label"
);
);
// Wrap an element containing a text node
j = jQuery( "<span/>" ).wrap( "<div>test</div>" );
assert.equal(
j[ 0 ].previousSibling.nodeType,... |
<vulnerable_code>#include <signal.h>
#include <time.h>
#include <net/if.h>
#if 0
#include <sys/times.h>
// detect --allow-debuggers
for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "--allow-debuggers") == 0) {
arg_allow_debuggers = 1;
break;
}<commit_title>[PATCH] security fix<commit_description><fixed_cod... |
<vulnerable_code>
if (url_len < 1)
return false;
sprintf(url_address, "%.*s", url_len, url_begin);
<commit_title>[PATCH] Stratum: extract_sockaddr: Truncate overlong addresses rather<commit_description><fixed_code>
if (url_len < 1)
return false;
if (url_len >= sizeof(url_address))
{
applog(LOG_WARNING, "... |
<vulnerable_code> QF_NOMEM = 3,
QF_IGNORE_LINE = 4,
QF_MULTISCAN = 5,
};
/*
/*
* Edit the selected file or help file.
* Returns OK if successfully edited the file, FAIL on failing to open the
* buffer and NOTDONE if the quickfix/location list was freed by an autocmd
* when opening the buffer.
*/
st... |
<vulnerable_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
285,
/**/<commit_title>[PATCH] patch 9.0.0286: using freed memory when location list changed<commit_description><fixed_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
... |
<vulnerable_code><commit_title>[PATCH] Fix http attributes of AWS SDK V2 instrumentation<commit_description>Populate http span attributes during beforeTransmission in the
AWS SDK v2 instrumentation so that a request is instrumented
after it is fully transformed by other interceptors.
Signed-off-by: Raphael Silva <rapp... |
<vulnerable_code> }
@Override
public void afterMarshalling(
Context.AfterMarshalling context, ExecutionAttributes executionAttributes) {
// Since we merge the HTTP attributes into an already started span instead of creating a
// full child span, we have to do some dirty work here.
//<commit_tit... |
<vulnerable_code><commit_title>[PATCH] Fix http attributes of AWS SDK V2 instrumentation<commit_description>Populate http span attributes during beforeTransmission in the
AWS SDK v2 instrumentation so that a request is instrumented
after it is fully transformed by other interceptors.
Signed-off-by: Raphael Silva <rapp... |
<vulnerable_code>import org.apache.dolphinscheduler.common.enums.UserType;
import org.apache.dolphinscheduler.common.utils.JSONUtils;
import org.apache.dolphinscheduler.common.utils.OkHttpUtils;
import org.apache.dolphinscheduler.dao.entity.User;
import org.apache.commons.lang3.StringUtils;
return Result.succe... |
<vulnerable_code> @Autowired
private UsersService usersService;
/**
* create user
*
* @param loginUser login user
* @param userName user name
* @param userPassword user password
* @param email email
* @param tenantId tenant id
* @param phone phone
* @param queue ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.