text stringlengths 79 3.72M |
|---|
<vulnerable_code>from airflow.providers.apache.drill.hooks.drill import DrillHook
@pytest.mark.parametrize(
"host, expect_error", [("host_with/", True), ("host_with&", True), ("good_host", False)]
)
def test_get_host(host, expect_error):
with patch(
"airflow.providers.apache.drill.hooks.drill.DrillHoo... |
<vulnerable_code> },
search: function () {
var formValues = this.formPanel.getForm().getFieldValues();
var proxy = this.store.getProxy();
proxy.setExtraParam("type", "asset");
proxy.setExtraParam("query", formValues.query);
proxy.setExtraParam("subtype", formValues.subty... |
<vulnerable_code> },
search: function () {
var formValues = this.formPanel.getForm().getFieldValues();
var proxy = this.store.getProxy();
proxy.setExtraParam("type", "document");
proxy.setExtraParam("query", formValues.query);
proxy.setExtraParam("subtype", formValues.su... |
<vulnerable_code> },
applyExtraParamsToStore: function () {
var formValues = this.formPanel.getForm().getFieldValues();
var proxy = this.store.getProxy();
proxy.setExtraParam("type", "object");
proxy.setExtraParam("query", formValues.query);
proxy.setExtraParam("subtype... |
<vulnerable_code> strong(src, maskedSrc, prevChar = '') {
let match = this.rules.inline.strong.start.exec(src);
if (match && (!match[1] || (match[1] && (prevChar === '' || this.rules.inline.punctuation.exec(prevChar))))) {
maskedSrc = maskedSrc.slice(-1 * src.length);
const endReg = match[0] === '... |
<vulnerable_code> maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
}
while (src) {
if (!keepPrevChar) {
prevChar = '';
continue;
}
// strong
if (toke... |
<vulnerable_code> }
}
strong(src, maskedSrc, prevChar = '') {
let match = this.rules.inline.strong.start.exec(src);
<commit_title>[PATCH] Passing all tests<commit_description><fixed_code>
}
}
emStrong(src, maskedSrc, prevChar = '') {
console.log("trying to match:");
console.log(src);
le... |
<vulnerable_code> reflink: /^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,
nolink: /^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,
reflinkSearch: 'reflink|nolink(?!\\()',
strong: {
start: /^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/, // (1) returns if starts w/ punctuation
mi... |
<vulnerable_code> refspec_appendf(&remote->fetch, "+%s*:%s*", src_ref_prefix,
branch_top.buf);
transport = transport_get(remote, remote->url[0]);
transport_set_verbosity(transport, option_verbosity, option_progress);
transport->family = family;
path = get_repo_path(remote->url[0], &is_bundle);
is_local = opti... |
<vulnerable_code>{
struct dir_iterator_int *iter = xcalloc(1, sizeof(*iter));
struct dir_iterator *dir_iterator = &iter->base;
int saved_errno;
strbuf_init(&iter->base.path, PATH_MAX);
strbuf_addstr(&iter->base.path, path);
iter->flags = flags;
/*
* Note: stat already checks for NULL or empty strings and
*... |
<vulnerable_code> if (state->cached)
return 0;
res = try_create_file(state, path, mode, buf, size);
if (res < 0)
return -1;<commit_title>[PATCH 04/17] apply: fix writing behind newly created symbolic links<commit_description>When writing files git-apply(1) initially makes sure that none of the
files it is about ... |
<vulnerable_code> return avail;
}
static curlioerr rpc_ioctl(CURL *handle, int cmd, void *clientp)
{
struct rpc_state *rpc = clientp;
switch (cmd) {
case CURLIOCMD_NOP:
return CURLIOE_OK;
case CURLIOCMD_RESTARTREAD:
if (rpc->initial_buffer) {
rpc->pos = 0;
return CURLIOE_OK;
}
error(_("unable to re... |
<vulnerable_code> curl_easy_setopt(handle, CURLOPT_DEBUGDATA, NULL);
}
static long get_curl_allowed_protocols(int from_user)
{
long allowed_protocols = 0;
if (is_transport_allowed("http", from_user))
allowed_protocols |= CURLPROTO_HTTP;
if (is_transport_allowed("https", from_user))
allowed_protocols |= CURLPRO... |
<vulnerable_code>/* $OpenBSD: auth2-gss.c,v 1.28 2018/07/10 09:13:30 djm Exp $ */
/*
* Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved.
size_t len;
u_char *doid = NULL;
if (!authctxt->valid || authctxt->user == NULL)
return (0);
if ((r = sshpkt_get_u32(ssh, &mechs)) != 0)
fatal("%s: %s", __func... |
<vulnerable_code>/* $OpenBSD: auth2-hostbased.c,v 1.35 2018/07/09 21:35:50 markus Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
*
size_t alen, blen, slen;
int r, pktype, authenticated = 0;
if (!authctxt->valid) {
debug2("%s: disabled because of invalid user", __func__);
return 0;
}
/... |
<vulnerable_code>/* $OpenBSD: auth2-pubkey.c,v 1.82 2018/07/11 18:55:11 markus Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
*
{
Authctxt *authctxt = ssh->authctxt;
struct passwd *pw = authctxt->pw;
struct sshbuf *b;
struct sshkey *key = NULL;
char *pkalg, *userstyle = NULL, *key_s = NULL... |
<vulnerable_code> * the License.
*/
package com.vaadin.flow.server.connect.typeconversion;
public class EntityWithPrivateFields {
@SuppressWarnings("unused")
private String codeNumber = "007";
private String name = "Bond";<commit_title>[PATCH] rest endpoint test refactor<commit_description><fixed_code>
* the ... |
<vulnerable_code><commit_title>[PATCH] rest endpoint test refactor<commit_description><fixed_code>
/*
* Copyright 2000-2020 Vaadin Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*... |
<vulnerable_code><commit_title>[PATCH] rest endpoint test refactor<commit_description><fixed_code>
/*
* Copyright 2000-2020 Vaadin Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*... |
<vulnerable_code> * the License.
*/
package com.vaadin.flow.server.connect.typeconversion;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class MyRestController {
@GetMapping("api/get")
public EntityWithPrivateField... |
<vulnerable_code><commit_title>[PATCH] rest endpoint test refactor<commit_description><fixed_code>
/*
* Copyright 2000-2020 Vaadin Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*... |
<vulnerable_code>/*
* Copyright 2000-2020 Vaadin Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable... |
<vulnerable_code>import java.util.stream.Collectors;
import com.vaadin.flow.server.connect.Endpoint;
@Endpoint
public class VaadinConnectTypeConversionEndpoints {
return new BeanWithZonedDateTimeField();
}
public EntityWithPrivateFields getEntityWithPrivateFields(){
return new EntityWithPriva... |
<vulnerable_code> if (typeof date !== 'undefined' && !new Date(date).getTime()) {
return Promise.reject(colors.red(`\`date\` must be a valid Date format if provided; got ${inspect(date)}`));
}
const tmpDirP = getProjectTempDir({ npmNeeded, logger });
const npmRC = path.join(path.dirname(packageFile), '.npmrc');
c... |
<vulnerable_code> return 0;
}
/*******************************************************************/
void
scp_session_destroy(struct SCP_SESSION *s)
g_free(s->client_ip);
g_free(s->errstr);
g_free(s->mng);
g_free(s);
}<commit_title>[PATCH] sesman: change vnc password file to guid<commit_description><... |
<vulnerable_code>
/******************************************************************************/
enum SCP_SERVER_STATES_E
scp_v0s_allow_connection(struct SCP_CONNECTION *c, SCP_DISPLAY d)
{
out_uint32_be(c->out_s, 0); /* version */
out_uint32_be(c->out_s, 14); /* size */
out_uint16_be(c->out_s, 3); /* c... |
<vulnerable_code>
if (1 == access_login_allowed(s->username))
{
if (0 != s->client_ip)
{
log_message(LOG_LEVEL_INFO, "++ created session (access granted): "
display = session_start(s->width, s->height, s->bpp, s->username,
... |
<vulnerable_code> log_message(LOG_LEVEL_INFO, "starting Xvnc session...");
display = session_start(s->width, s->height, s->bpp, s->username,
s->password, data, SESMAN_SESSION_TYPE_XVNC,
s->domain, s->program, s->directory, s-... |
<vulnerable_code>static int APP_CC
session_start_fork(int width, int height, int bpp, char *username,
char *password, tbus data, tui8 type, char *domain,
char *program, char *directory, char *client_ip)
{
int display = 0;
int pid = 0;
}
else ... |
<vulnerable_code> @NamedQuery(name = "User.findByIdAndOrg", query = "select u from JpaUser u where u.id=:id and u.organization.id = :org"),
@NamedQuery(name = "User.findByUsername", query = "select u from JpaUser u where u.username=:u and u.organization.id = :org"),
@NamedQuery(name = "User.findAll", query = "sele... |
<vulnerable_code>/**
* Licensed to The Apereo Foundation under one or more contributor license
* agreements. See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
*
* The Apereo Foundation licenses this file to you under the Educational
* Community License, ... |
<vulnerable_code><commit_title>[PATCH] Replace MD5 with bcrypt for password hashing<commit_description>User passwords are stored in the database using the rather outdated and
cryptographically insecure MD5 hash algorithm. Furthermore, the hashes
are salted using the username instead of a random salt, causing hashes
for... |
<vulnerable_code>
package org.opencastproject.userdirectory;
import org.opencastproject.security.api.Group;
import org.opencastproject.security.api.Role;
import org.opencastproject.security.api.RoleProvider;
import org.opencastproject.security.impl.jpa.JpaUser;
import org.opencastproject.userdirectory.utils.UserDirect... |
<vulnerable_code> return Response.ok(JaxbUser.fromUser(user)).build();
}
@POST
@Path("/")
@RestQuery(<commit_title>[PATCH] Replace MD5 with bcrypt for password hashing<commit_description>User passwords are stored in the database using the rather outdated and
cryptographically insecure MD5 hash algorithm. Fu... |
<vulnerable_code>import static org.opencastproject.util.data.Collections.set;
import static org.opencastproject.util.persistence.PersistenceUtil.newTestEntityManagerFactory;
import org.opencastproject.security.api.Role;
import org.opencastproject.security.api.SecurityConstants;
import org.opencastproject.security.api.... |
<vulnerable_code>
from tensorflow.python.eager import backprop
from tensorflow.python.eager import context
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import errors
from tensorflow.python.framework import sparse_tensor
from tensorflow.python.framework import test_util
from tensorflow... |
<vulnerable_code> register jpc_fix_t *dstptr;
register int n;
register int m;
int hstartcol;
/* Get a buffer. */
if (bufsize > QMFB_SPLITBUFSIZE) {
}
if (numrows >= 2) {
hstartcol = (numrows + 1 - parity) >> 1;
// ORIGINAL (WRONG): m = (parity) ? hstartcol : (numrows - hstartcol);
m = numrows - hstartcol... |
<vulnerable_code> batch->count = total;
}
static void kiocb_batch_free(struct kiocb_batch *batch)
{
struct kiocb *req, *n;
list_for_each_entry_safe(req, n, &batch->head, ki_batch) {
list_del(&req->ki_batch);
kmem_cache_free(kiocb_cachep, req);
}
}
/*
}
blk_finish_plug(&plug);
kiocb_batch_free(&batch);
pu... |
<vulnerable_code>
// Global internal variables used within the highlight.js library.
/** @type {Record<string, Language>} */
var languages = {};
/** @type {Record<string, string>} */
var aliases = {};
/** @type {HLJSPlugin[]} */
var plugins = [];
<commit_title>[PATCH] (parser) use null prototype objects f... |
<vulnerable_code> result.should.have.property('aliases').with.containEql('cs');
should.strictEqual(result, hljs.getLanguage('csharp'))
});
});<commit_title>[PATCH] (parser) use null prototype objects for languages/aliases<commit_description><fixed_code>
result.should.have.property('aliases').with.containEq... |
<vulnerable_code> }
loadAnnotation(css) {
let annotations = css.match(/\/\*\s*# sourceMappingURL=.*\s*\*\//gm)
if (annotations && annotations.length > 0) {
// Locate the last sourceMappingURL to avoid picking up<commit_title>[PATCH] Fix unsafe regexp<commit_description><fixed_code>
}
loadAnnotat... |
<vulnerable_code>#include "leakdetector.h"
#include "logger.h"
#include "loghandler.h"
#include "polkithelper.h"
namespace {
Logger logger("DBusService");
bool DBusService::activate(const QString& jsonConfig) {
logger.debug() << "Activate";
if (!PolkitHelper::instance()->checkAuthorization(
"org.mozilla... |
<vulnerable_code>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "polkithelper.h"
#include "logger.h"
// No extra QT includes after this line!
#undef Q... |
<vulnerable_code> tpgt_str += 5; /* Skip ahead of "tpgt_" */
tpgt = (unsigned short int) simple_strtoul(tpgt_str, &end_ptr, 0);
if (tpgt > TL_TPGS_PER_HBA) {
printk(KERN_ERR "Passed tpgt: %hu exceeds TL_TPGS_PER_HBA:"
" %u\n", tpgt, TL_TPGS_PER_HBA);
return ERR_PTR(-EINVAL);<commit_title>[PATCH] loopback: of... |
<vulnerable_code>
void read_authfile(const char *path) {
size_t n;
FILE *fp;
char token[MAXAUTHTOKENLEN];
if ((amqp_username = malloc(MAXAUTHTOKENLEN)) == NULL ||<commit_title>[PATCH] Initialize file pointer to NULL<commit_description><fixed_code>
void read_authfile(const char *path) {
size_t n;
FILE *fp ... |
<vulnerable_code> attr->type = ATTR_TYPE_STRING;
else if (!strcmp(ptr[2], "date"))
attr->type = ATTR_TYPE_DATE;
else if (!strcmp(ptr[2], "ipaddr"))
attr->type = ATTR_TYPE_IPADDR;
else if (!strcmp(ptr[2], "octets"))
attr->type = ATTR_TYPE_OCTETS;
else if (!strcmp(ptr[2], "ifid"))
... |
<vulnerable_code> case ATTR_TYPE_IPADDR:
case ATTR_TYPE_IFID:
case ATTR_TYPE_IPV6ADDR:
memcpy(&attr->val.integer, ptr, len);
break;
case ATTR_TYPE_IPV6PREFIX:
attr->val.ipv6prefix.len = ptr[1];
memset(&attr->val.ipv6prefix.prefix, 0, sizeof(attr->val.ipv6prefix.prefix));
... |
<vulnerable_code> d = read_body_with_max_size(response, output_stream, max_size)
# Ensure that the body is not read forever.
d = timeout_deferred(d, 60, self.hs.get_reactor())
length = await make_deferred_yieldable(d)
except BodyExceededMaxSize:<commit_title>[PAT... |
<vulnerable_code>
size_t
columns,
number_threads;
number_threads=(size_t) GetMagickResourceLimit(ThreadResource);
pixels=(MagickPixelPacket **) AcquireQuantumMemory(number_threads,
sizeof(*pixels));
if (pixels == (MagickPixelPacket **) NULL)
return((MagickPixelPacket **) NULL);
(void) memset(... |
<vulnerable_code> })
.then(() => done());
});
});
describe('afterFind hooks', () => {<commit_title>[PATCH] fix: Parse Pointer allows to access internal Parse Server<commit_description><fixed_code>
})
.then(() => done());
});
it('should run beforeFind on pointers and array of pointers from... |
<vulnerable_code>
it('should only count', async () => {
await prepareData();
await parseGraphQLServer.parseGraphQLSchema.schemaCache.clear();
const where = {<commit_title>[PATCH] fix: Parse Pointer allows to access internal Parse Server<commit_description><fixed_code>
... |
<vulnerable_code> return Promise.all(promises);
};
const restExecute = spyOn(RestQuery.prototype, 'execute').and.callThrough();
let user, auth, getAllRolesSpy;
createTestUser()<commit_title>[PATCH] fix: Parse Pointer allows to access internal Parse Server<commit_description><fixed_code>
ret... |
<vulnerable_code> }
const config = Config.get('test');
await Parse.Object.saveAll(objects);
const query = new RestQuery(
config,
auth.master(config),
'Object',
{ value: { $gt: 2 } },
{ limit: 2 }
);
const spy = spyOn(query, 'execute').and.callThrough();
const cla... |
<vulnerable_code> });
});
it('locks down session', done => {
let currentUser;
Parse.User.signUp('foo', 'bar')<commit_title>[PATCH] fix: Parse Pointer allows to access internal Parse Server<commit_description><fixed_code>
});
});
it('cannot get object in volatileClasses if not masterKey thro... |
<vulnerable_code> include: 'user',
};
const RestQuery = require('./RestQuery');
const query = new RestQuery(config, master(config), '_Session', { sessionToken }, restOptions);
results = (await query.execute()).results;
} else {
results = (
});
};
var getAuthForLegacySessionToken = function... |
<vulnerable_code>
// Force filtering on only valid device tokens
const updateWhere = applyDeviceTokenExists(where);
badgeUpdate = () => {
// Build a real RestQuery so we can use it in RestWrite
const restQuery = new RestQuery(config, master(config), '_Installation', updateWhere);
... |
<vulnerable_code> }
}
verifyEmail(username, token) {
if (!this.shouldVerifyEmails) {
// Trying to verify email when not enabled
// TODO: Better error here.
updateFields._email_verify_token_expires_at = { __op: 'Delete' };
}
const maintenanceAuth = Auth.maintenance(this.config);
... |
<vulnerable_code>const triggers = require('./triggers');
const { continueWhile } = require('parse/lib/node/promiseUtils');
const AlwaysSelectedKeys = ['objectId', 'createdAt', 'updatedAt', 'ACL'];
// restOptions can include:
// skip
// limit
// readPreference
// includeReadPreference
// subqueryReadPreference... |
<vulnerable_code>};
// The non-third-party parts of User transformation
RestWrite.prototype.transformUser = function () {
var promise = Promise.resolve();
if (this.className !== '_User') {
return promise;
if (this.query && this.objectId()) {
// If we're updating a _User object, we need to clear out the c... |
<vulnerable_code><commit_title>[PATCH] fix: Parse Pointer allows to access internal Parse Server<commit_description><fixed_code>
const classesWithMasterOnlyAccess = [
'_JobStatus',
'_PushStatus',
'_Hooks',
'_GlobalConfig',
'_JobSchedule',
'_Idempotency',
];
// Disallowing access to the _Role collection exce... |
<vulnerable_code>var RestQuery = require('./RestQuery');
var RestWrite = require('./RestWrite');
var triggers = require('./triggers');
function checkTriggers(className, config, types) {
return types.some(triggerType => {
}
// Returns a promise for an object with optional keys 'results' and 'count'.
function find(co... |
<vulnerable_code>package org.olat.core.commons.modules.bc;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.olat.core.gui.UserRequest;
import org.olat.core.util.FileUtils;
import org.olat.core.util.StringHelper;
public class FileSelection {
/** HTML form identifier */
public ... |
<vulnerable_code> public Controller execute(FolderComponent fc, UserRequest ureq, WindowControl wContr, Translator trans) {
this.translator = trans;
this.folderComponent = fc;
this.fileSelection = new FileSelection(ureq, fc.getCurrentContainerPath());
VFSContainer currentContainer = folderComponent.getCurrentC... |
<vulnerable_code> return null;
}
FileSelection selection = new FileSelection(ureq, folderComponent.getCurrentContainerPath());
status = FolderCommandHelper.sanityCheck3(wControl, folderComponent, selection);
if(status == FolderCommandStatus.STATUS_FAILED) {
return null;
if(selection.getFiles().isEmp... |
<vulnerable_code> public Controller execute(FolderComponent fc, UserRequest ureq, WindowControl windowControl, Translator trans) {
this.folderComponent = fc;
this.translator = trans;
this.fileSelection = new FileSelection(ureq, fc.getCurrentContainerPath());
VelocityContainer main = new VelocityContainer("... |
<vulnerable_code> @Override
public Controller execute(FolderComponent folderComponent, UserRequest ureq, WindowControl wContr, Translator trans) {
this.translator = trans;
FileSelection selection = new FileSelection(ureq, folderComponent.getCurrentContainerPath());
VFSContainer currentContainer = folderComponent... |
<vulnerable_code> return null;
}
selection = new FileSelection(ureq, folderComponent.getCurrentContainerPath());
status = FolderCommandHelper.sanityCheck3(wControl, folderComponent, selection);
if(status == FolderCommandStatus.STATUS_FAILED) {
return null;<commit_title>[PATCH] OO-5696: validate file sele... |
<vulnerable_code> if (status == FolderCommandStatus.STATUS_FAILED) {
return null;
}
FileSelection selection = new FileSelection(ureq, folderComponent.getCurrentContainerPath());
status = FolderCommandHelper.sanityCheck3(wControl, folderComponent, selection);
if (status == FolderCommandStatus.STATUS_FAILED) ... |
<vulnerable_code> * The sys_call_table array must be 4K aligned to be accessible from
* kernel/entry.S.
*/
void *sys_call_table[__NR_syscalls] __aligned(4096) = {
[0 ... __NR_syscalls - 1] = sys_ni_syscall,
#include <asm/unistd.h>
};<commit_title>[PATCH] arm64: make sys_call_table const<commit_description>As with x8... |
<vulnerable_code>/**
* Turn async functions into promises
*
* @param {Function} $$__fn__$$
* @return {Function}
* @api public
*/
function thenify($$__fn__$$, options) {
assert(typeof $$__fn__$$ === 'function')
return eval(createWrapper($$__fn__$$.name, options))
}
/**
* Turn async functions into promises a... |
<vulnerable_code> assert.deepEqual(values, [1, 2, 3])
})
})<commit_title>[PATCH] fix: remove eval (#30)<commit_description><fixed_code>
assert.deepEqual(values, [1, 2, 3])
})
})
it('unicode function name', function () {
function 你好$hello_123(a, b, c, cb) {
cb(null, a, b, c)
}
var wrapper = thenify... |
<vulnerable_code> return ecma_op_create_typedarray_with_type_and_length (info_p->id, 0);
}
JMEM_DEFINE_LOCAL_ARRAY (pass_value_list_p, info_p->length * info_p->element_size, lit_utf8_byte_t);
lit_utf8_byte_t *pass_value_p = pass_value_list_p;
uint32_t byte_pos = 0;
for (uint32_t index = 0; index < info_... |
<vulnerable_code><commit_title>[PATCH] Force value conversion in case of TypedArray filter method<commit_description>During the execution of the TypedArray filter method it is possible
to have a different sized output TypedArray than the input one.
When copying the data to the output array the values must be
correctly ... |
<vulnerable_code>package org.dromara.hertzbeat.common.config;
import com.googlecode.aviator.AviatorEvaluator;
import com.googlecode.aviator.lexer.token.OperatorType;
import com.googlecode.aviator.runtime.function.AbstractFunction;
import com.googlecode.aviator.runtime.type.*;
@Bean
public void configAviatorEv... |
<vulnerable_code>package org.dromara.hertzbeat.common.config;
import com.googlecode.aviator.AviatorEvaluator;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
Boolean res13 = (Boolean) AviatorEvaluator.compile(expr10).execute(env);
Asse... |
<vulnerable_code> WASM_UNREACHABLE("invalid code for ref.as_*");
}
curr->value = popNonVoidExpression();
curr->finalize();
}
<commit_title>[PATCH] Add binary format parse checking for ref.as input type<commit_description><fixed_code>
WASM_UNREACHABLE("invalid code for ref.as_*");
}
curr->value = po... |
<vulnerable_code>import { searchForWorkspaceRoot } from 'vite';
import { defineConfig } from 'vitest/config';
import { version } from '../directus/package.json';
const API_PATH = path.join('..', 'api');
const EXTENSIONS_PATH = path.join(API_PATH, 'extensions');
plugins: [
directusExtensions(),
vue(),
yaml({
... |
<vulnerable_code>}
#ifdef HAVE_BACKTRACE
static void *getMcontextEip(ucontext_t *uc) {
#define NOT_SUPPORTED() do {\
UNUSED(uc);\
return NULL;\
} while(0)
#if defined(__APPLE__) && !defined(MAC_OS_X_VERSION_10_6)
/* OSX < 10.6 */
#if defined(__x86_64__)
return (void*) uc->uc_mcontext->__ss.__rip;
... |
<vulnerable_code> GF_SceneGraph *cur_graph = codec->current_graph;
GF_Proto *cur_proto = codec->pCurrentProto;
codec->LastError = GF_OK;
while (go) {
type = gf_bs_read_int(bs, 2);
gf_bifs_dec_qp_remove(codec, GF_TRUE);
}
codec->current_graph = cur_graph;
codec->pCurrentProto = cur_proto;
return e;<commit_t... |
<vulnerable_code> default=build_prefix,
help='Directory to unpack packages into and build in. '
'The default in a virtualenv is "<venv path>/build". '
'The default for global installs is "<OS temp dir>/pip-build".')
cmd_opts.add_option(
'-t', '--target... |
<vulnerable_code> && p->sh_size <= ((unsigned long)file_size - p->sh_offset)
&& p->sh_name < (unsigned long)file_size
&& 10 <= ((unsigned long)file_size - p->sh_name)
// 10 == (1+ strlen(".shstrtab"))
) {
delete [] shstrtab;
sh... |
<vulnerable_code>id_pattern = re.compile(r"([0-9]{15,21})$")
class FakeRole:
"""
We need to fake some attributes of roles for the class UnavailableMember
duration = self._format_timedelta(time)
else:
duration = _("*[No time given]*")
format_description = lambda x: x.for... |
<vulnerable_code>
self.task: asyncio.Task
__version__ = "1.3.17"
__author__ = ["retke (El Laggron)"]
# helpers<commit_title>[PATCH] [WarnSystem] Safely format embed descriptions<commit_description><fixed_code>
self.task: asyncio.Task
__version__ = "1.3.18"
__author__ = ["retke (E... |
<vulnerable_code>
if ( model == "ILCE-6000" && maxAperture == F1_8 ) try {
long focalLength = getKeyLong ("Exif.Photo.FocalLength" ,metadata);
long focalL35mm = getKeyLong ("Exif.Photo.FocalLengthIn35mmFilm",metadata);
long focalRatio = (foca... |
<vulnerable_code> if (nchar == K_DEL || nchar == K_KDEL)
n /= 10;
else if (VIM_ISDIGIT(nchar))
n = n * 10 + (nchar - '0');
else if (nchar == CAR)
{
#ifdef FEAT_GUI<commit_title>[PATCH] patch 9.0.2109: [security]: overflow in nv_z_get_count<commit_description>Problem: [security]: overflow in nv_z_get_count... |
<vulnerable_code>
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
2108,
/**/<commit_title>[PATCH] patch 9.0.2109: [security]: overflow in nv_z_get_count<commit_description>Problem: [security]: overflow in nv_z_get_count
Solution: break out, if count is too large
When getting th... |
<vulnerable_code> * - Follows symbolic links.
*
* @param {object} args The arguments for this function.
* @param {string} args.executable A string representation of the executable.
* @param {object} deps The dependencies for this function.
* @param {Function} deps.exists A function to check if a file exists.
* @p... |
<vulnerable_code> interpolation = interpolation ? true : false;
shell = isString(shell) ? shell : getDefaultShell({ env });
const shellName = getShellName({ shell }, { resolveExecutable });
return { flagProtection, interpolation, shellName };
}<commit_title>[PATCH] Provide explicit $PATH value to which<commit_d... |
<vulnerable_code> * Determines the name of the shell identified by a file path or file name.
*
* @param {object} args The arguments for this function.
* @param {string} args.shell The name or path of the shell.
* @param {object} deps The dependencies for this function.
* @param {Function} deps.resolveExecutable Re... |
<vulnerable_code><commit_title>[PATCH] Provide explicit $PATH value to which<commit_description>Update the implementation of `resolveExecutable` to accept the
environment variables so that they can explicitly be provided to
which [1]. All internal code and tests have been updated accordingly,
no external changes.
This... |
<vulnerable_code> * @license MIT
*/
import test from "ava";
import sinon from "sinon";
import { resolveExecutable } from "../../../src/executables.js";
test.before((t) => {
t.context.deps = { exists, readlink, which };
});
test("the executable cannot be resolved", (t) => {
const { executable } = t.context;
c... |
<vulnerable_code> t.is(t.context.deps.getShellName.callCount, 1);
t.true(
t.context.deps.getShellName.calledWithExactly(
{ shell: defaultShell },
{ resolveExecutable },
),
);
t.is(t.context.deps.getShellName.callCount, 1);
t.true(
t.context.deps.getShellName.calledWi... |
<vulnerable_code> unix.getShellName({ env, shell }, { resolveExecutable });
t.true(
resolveExecutable.calledWithExactly(
{ executable: shell },
{
exists: sinon.match.func,
readlink: sinon.match.func,<commit_title>[PATCH] Provide explicit $PATH value to which<commit_descr... |
<vulnerable_code> strlcat(rpath, name, sizeof(rpath));
}
if (!chrooted && strncmp(dir, home, strlen(home))) {
DBG("Failed non-chroot dir:%s vs home:%s", dir, home);
return NULL;
}<commit_title>[PATCH] FTP/TFTP: Fix directory traversal regression, reported by<commit_description><fixed_code>
strlcat(rpath, nam... |
<vulnerable_code> return {
source: `
import { register } from '${iitmURL}'
import * as namespace from '${url}'
const set = {}
${exportNames.map((n) => `
let $${n} = namespace.${n}
return true
}
`).join('\n')}
register('${realUrl}', namespace, set, '${specifiers.get(realUrl)}')
`
}
}<commit_titl... |
<vulnerable_code> Py_XDECREF(slc);
free(regions);
if (PyErr_Occurred()) {
Py_XDECREF(result);
return NULL;
} else {
return result;<commit_title>[PATCH] MAINT: Fix use-after-free in Py_FindObjects<commit_description><fixed_code>
Py_XDECREF(slc);
free(regions);
if (PyErr... |
<vulnerable_code> typeDeclaration: 'class enum interface struct',
// contextual keywords
// ("var" and "dynamic" are missing because they are used like types)
contextual: 'add alias and ascending async await by descending from get global group into join let nameof not notnull on or orderby partial remove select ... |
<vulnerable_code> print("Ignoring URLError '%s' in test_from_pr" % err)
shutil.rmtree(tmpdir)
def test_from_pr_listed_ecs(self):
"""Test --from-pr in combination with specifying easyconfigs on the command line."""
if self.github_token is None:<commit_title>[PATCH] add test to... |
<vulnerable_code> , extraOption;
function getValue(req, keyName) {
if (req.params && req.params[keyName] !== undefined) {
return req.params[keyName];
} else if (req.body && req.body[keyName] !== undefined) {
return req.body[keyName];
} else if (req.query && req.query[keyName] !== undefined) {
return... |
<vulnerable_code>
function scheduleLivePoll() {
let ti = parseInt(localStorage.sidekiqTimeInterval) || 5000;
livePollTimer = setTimeout(livePollCallback, ti);
}
<commit_title>[PATCH] Validate page refresh interval to ensure a minimum amount of<commit_description><fixed_code>
function scheduleLivePoll() {
let ti ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.