code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
public boolean isEnabled() {
if(leadComponent != null) {
return leadComponent.isEnabled();
}
return super.isEnabled();
} | vuln | Vulnerable | Java |
/*
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator p... | vuln | Safe | Java |
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// ... | vuln | Vulnerable | Java |
{% load i18n %}
{% load inventree_extras %}
{% load status_codes %}
/* globals
attachSelect,
closeModal,
constructField,
constructFormBody,
getFormFieldValue,
global_settings,
handleFormErrors,
imageHoverIcon,
inventreeDelete,
inventreeGet,
inventreePut,
launchModalForm,... | vuln | Vulnerable | Python |
static int
make_canonical(struct ly_ctx *ctx, int type, const char **value, void *data1, void *data2)
{
const uint16_t buf_len = 511;
char buf[buf_len + 1];
struct lys_type_bit **bits = NULL;
struct lyxp_expr *exp;
const char *module_name, *cur_expr, *end;
int i, j, count;
int64_t num;
u... | vuln | Safe | C/C++ |
accountsController.uploadImage = function (req, res) {
const fs = require('fs')
const path = require('path')
const Busboy = require('busboy')
const busboy = Busboy({
headers: req.headers,
limits: {
files: 1,
fileSize: 1024 * 1024 * 3 // 3mb limit
}
})
const object = {}
let error
... | vuln | Vulnerable | JavaScript |
static void gen_spr_74xx (CPUPPCState *env)
{
spr_register(env, SPR_PIR, "PIR",
SPR_NOACCESS, SPR_NOACCESS,
&spr_read_generic, &spr_write_pir,
0x00000000);
spr_register(env, SPR_MMCR2, "MMCR2",
SPR_NOACCESS, SPR_NOACCESS,
... | vuln | Safe | C/C++ |
static int nfnl_cthelper_del(struct net *net, struct sock *nfnl,
struct sk_buff *skb, const struct nlmsghdr *nlh,
const struct nlattr * const tb[],
struct netlink_ext_ack *extack)
{
char *helper_name = NULL;
struct nf_conntrack_helper *cur;
struct nf_conntrack_tuple tuple;
bool tuple_set = f... | vuln | Safe | Unknown |
public static String dumpTree(
List<ListEntry> entries,
NotificationInteractionTracker interactionTracker,
boolean includeRecordKeeping,
String indent) {
StringBuilder sb = new StringBuilder();
final String childEntryIndent = indent + INDENT;
for (... | vuln | Vulnerable | Java |
void DevToolsAgentHostImpl::InnerAttachClient(DevToolsAgentHostClient* client) {
scoped_refptr<DevToolsAgentHostImpl> protect(this);
DevToolsSession* session = new DevToolsSession(this, client);
sessions_.insert(session);
session_by_client_[client].reset(session);
AttachSession(session);
if (sessions_.s... | vuln | Vulnerable | C/C++ |
int ff_vc1_parse_frame_header(VC1Context *v, GetBitContext* gb)
{
int pqindex, lowquant, status;
if (v->finterpflag)
v->interpfrm = get_bits1(gb);
if (!v->s.avctx->codec)
return -1;
if (v->s.avctx->codec_id == AV_CODEC_ID_MSS2)
v->respic =
v->rangered =
v->multi... | vuln | Vulnerable | C/C++ |
static js_Ast *expression(js_State *J, int notin)
{
js_Ast *a;
INCREC();
a = assignment(J, notin);
while (jsP_accept(J, ','))
a = EXP2(COMMA, a, assignment(J, notin));
DECREC();
return a;
} | vuln | Vulnerable | Unknown |
public static boolean requestBluetoothPermission(final Fragment fragment) {
final BluetoothManager bluetoothManager = (BluetoothManager) fragment.getActivity().getSystemService(Context.BLUETOOTH_SERVICE);
BluetoothAdapter btAdapter = bluetoothManager.getAdapter();
if (btAdapter == null || !btAd... | vuln | Vulnerable | Java |
static void qdict_do_flatten(QDict *qdict, QDict *target, const char *prefix)
{
QObject *value;
const QDictEntry *entry, *next;
const char *new_key;
bool delete;
entry = qdict_first(qdict);
while (entry != NULL) {
next = qdict_next(qdict, entry);
value = qdict_entry_value(entry);... | vuln | Vulnerable | C/C++ |
function _init(index) {
i = keys[index];
path = prefix + i;
schemaType = docSchema.path(path);
// Should still work if not a model-level discriminator, but should not be
// necessary. This is *only* to catch the case where we queried using the
// base model and the discriminated model has a pro... | vuln | Vulnerable | JavaScript |
@Override
public void initialize() {
if (cacheDir == null) {
throw new IllegalStateException("Cache directory is not set.");
}
for (Repository repository : repositories) {
repository.setCacheDirectory(cacheDir);
File rootDirectory = repository.getRootDir... | vuln | Safe | Java |
njs_typed_array_alloc(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs,
njs_bool_t zeroing, njs_object_type_t type)
{
double num;
int64_t i, length;
uint32_t element_size;
uint64_t size, offset;
njs_int_t ret;
njs_value_t *val... | vuln | Safe | Unknown |
void AudioOutputController::DoFlush() {
DCHECK_EQ(message_loop_, MessageLoop::current());
if (!sync_reader_) {
if (state_ != kPaused)
return;
AutoLock auto_lock(lock_);
buffer_.Clear();
}
} | vuln | Safe | C/C++ |
TfLiteStatus Rfft2dHelper(TfLiteContext* context, TfLiteNode* node) {
const TfLiteTensor* input;
TF_LITE_ENSURE_OK(context, GetInputSafe(context, node, kInputTensor, &input));
const float* input_data = GetTensorData<float>(input);
const TfLiteTensor* fft_length;
TF_LITE_ENSURE_OK(context,
... | vuln | Safe | C/C++ |
void CoordinatorImpl::FinalizeGlobalMemoryDumpIfAllManagersReplied() {
TRACE_EVENT0(base::trace_event::MemoryDumpManager::kTraceCategory,
"GlobalMemoryDump.Computation");
DCHECK(!queued_memory_dump_requests_.empty());
QueuedRequest* request = &queued_memory_dump_requests_.front();
if (!request->... | vuln | Vulnerable | C/C++ |
/*
* Copyright 2004-2005 Paul Querna
* Copyright 2008 Nikos Mavrogiannopoulos
* Copyright 2011 Dash Shendy
* Copyright 2015-2020 Fiona Klute
*
* 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 th... | vuln | Vulnerable | C/C++ |
export default function handleLoginFactory(
handler: BaseHandleLogin,
nextConfig: NextConfig,
baseConfig: BaseConfig
): HandleLogin {
return async (req, res, options = {}): Promise<void> => {
try {
assertReqRes(req, res);
if (req.query.returnTo) {
const dangerousReturnTo = Array.isArray(... | vuln | Safe | JavaScript |
int decryptFinal(byte[] in, int inOfs, int len,
byte[] out, int outOfs)
throws IllegalBlockSizeException, AEADBadTagException,
ShortBufferException {
int ret;
synchronized (this) {
if (len < tagLenBytes) {
throw new AEADBadTagException("I... | vuln | Safe | Java |
void bm_fillrect(Bitmap *b, int x0, int y0, int x1, int y1) {
int x,y;
assert(b);
if(x1 < x0) {
x = x0;
x0 = x1;
x1 = x;
}
if(y1 < y0) {
y = y0;
y0 = y1;
y1 = y;
}
for(y = MAX(y0, b->clip.y0); y < MIN(y1 + 1, b->clip.y1); y++) {
for(x = MA... | vuln | Safe | C/C++ |
/**
* FreeRDP: A Remote Desktop Protocol Implementation
* Serial Port Device Service Virtual Channel
*
* Copyright 2011 O.S. Systems Software Ltda.
* Copyright 2011 Eduardo Fiss Beloni <beloni@ossystems.com.br>
* Copyright 2014 Hewlett-Packard Development Company, L.P.
*
* Licensed under the Apache License, Ver... | vuln | Safe | C/C++ |
bool bdrv_all_can_snapshot(BlockDriverState **first_bad_bs)
{
bool ok = true;
BlockDriverState *bs;
BdrvNextIterator it;
for (bs = bdrv_first(&it); bs; bs = bdrv_next(&it)) {
AioContext *ctx = bdrv_get_aio_context(bs);
aio_context_acquire(ctx);
if (bdrv_is_inserted(bs) && !bdrv_i... | vuln | Vulnerable | C/C++ |
private function decryptContentEncryptionKey($private_key_or_secret) {
switch ($this->header['alg']) {
case 'RSA1_5':
$rsa = $this->rsa($private_key_or_secret, RSA::ENCRYPTION_PKCS1);
$this->content_encryption_key = $rsa->decrypt($this->jwe_encrypted_key);
... | vuln | Vulnerable | PHP |
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
try {
Path path = ioService.get(new URI(request.getParameter("path")));
byte[] bytes = ioService.readAllBytes(path);
response.setHeader("Conte... | vuln | Vulnerable | Java |
def team_organize
Log.add_info(request, params.inspect)
team_id = params[:team_id]
unless team_id.nil? or team_id.empty?
begin
@team = Team.find(team_id)
rescue
@team = nil
ensure
if @team.nil?
flash[:notice] = t('msg.already_deleted', :name => Team.model... | vuln | Vulnerable | Ruby |
static void i6300esb_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
k->config_read = i6300esb_config_read;
k->config_write = i6300esb_config_write;
k->realize = i6300esb_realize;
k->exit = i6300esb_exit;
k->ven... | vuln | Safe | C/C++ |
static int hnm_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame, AVPacket *avpkt)
{
AVFrame *frame = data;
Hnm4VideoContext *hnm = avctx->priv_data;
int ret;
uint16_t chunk_id;
if (avpkt->size < 8) {
av_log(avctx, AV_LOG_ERROR, "packet too small\n");... | vuln | Safe | C/C++ |
static inline void fuse_make_bad(struct inode *inode)
{
set_bit(FUSE_I_BAD, &get_fuse_inode(inode)->state);
} | vuln | Vulnerable | C/C++ |
struct pxa2xx_state_s *pxa255_init(unsigned int sdram_size,
DisplayState *ds)
{
struct pxa2xx_state_s *s;
struct pxa2xx_ssp_s *ssp;
int iomemtype, i;
s = (struct pxa2xx_state_s *) qemu_mallocz(sizeof(struct pxa2xx_state_s));
s->env = cpu_init();
cpu_arm_set_model(s->env, "pxa255"... | vuln | Safe | C/C++ |
static size_t curl_read_cb(void *ptr, size_t size, size_t nmemb, void *opaque)
{
CURLState *s = ((CURLState*)opaque);
size_t realsize = size * nmemb;
int i;
DPRINTF("CURL: Just reading %zd bytes\n", realsize);
if (!s || !s->orig_buf)
goto read_end;
if (s->buf_off >= s->buf_len) {
... | vuln | Safe | C/C++ |
static int fsl_lpspi_probe(struct platform_device *pdev)
{
struct device_node *np = pdev->dev.of_node;
struct fsl_lpspi_data *fsl_lpspi;
struct spi_controller *controller;
struct spi_imx_master *lpspi_platform_info =
dev_get_platdata(&pdev->dev);
struct resource *res;
int i, ret, irq;
u32 temp;
bool is_slave;... | vuln | Vulnerable | C/C++ |
def email_verify_send
raise Exceptions::UnprocessableEntity, 'No email!' if !params[:email]
user = User.find_by(email: params[:email].downcase)
if !user || user.verified == true
# result is always positive to avoid leaking of existing user accounts
render json: { message: 'ok' }, status: :ok
... | vuln | Safe | Ruby |
/**
* OLAT - Online Learning and Training<br>
* http://www.olat.org
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* ... | vuln | Vulnerable | Java |
if(!self.define){const e=e=>{"require"!==e&&(e+=".js");let i=Promise.resolve();return r[e]||(i=new Promise((async i=>{if("document"in self){const r=document.createElement("script");r.src=e,document.head.appendChild(r),r.onload=i}else importScripts(e),i()}))),i.then((()=>{if(!r[e])throw new Error(`Module ${e} didn’t reg... | vuln | Safe | JavaScript |
static void quantsmooth_block(JCOEFPTR coef, UINT16 *quantval,
JSAMPLE *image, JSAMPLE *image2, int stride, int flags, float **tables, int luma) {
int k, n = DCTSIZE, x, y, need_refresh = 1;
JSAMPLE ALIGN(32) buf[DCTSIZE2 + DCTSIZE * 6], *border = buf + n * n;
#ifndef NO_SIMD
int16_t ALIGN(32) temp[DCTSIZE2 * 4 + ... | vuln | Vulnerable | Unknown |
static char **fill_envp(struct dhcp_packet *packet)
{
int envc;
int i;
char **envp, **curr;
const char *opt_name;
uint8_t *temp;
uint8_t overload = 0;
#define BITMAP unsigned
#define BBITS (sizeof(BITMAP) * 8)
#define BMASK(i) (1 << (i & (sizeof(BITMAP) * 8 - 1)))
#define FOUND_OPTS(i) (found_opts[(unsigned)i / ... | vuln | Vulnerable | C/C++ |
static void do_viewlog(HttpRequest req, HttpResponse res) {
if (is_readonly(req)) {
send_error(req, res, SC_FORBIDDEN, "You do not have sufficient privileges to access this page");
return;
}
do_head(res, "_viewlog", "View log", 100);
if ((Run.flags & Run_L... | vuln | Vulnerable | C/C++ |
public void deletePurls(String vulnerabilityId, DSLContext context) {
context.delete(VulnerabilitiesPurls.VULNERABILITIES_PURLS)
.where(VulnerabilitiesPurls.VULNERABILITIES_PURLS.VULNERABILITY_ID.equal(vulnerabilityId));
} | vuln | Vulnerable | Java |
static int print_block_option_help(const char *filename, const char *fmt)
{
BlockDriver *drv, *proto_drv;
QEMUOptionParameter *create_options = NULL;
drv = bdrv_find_format(fmt);
if (!drv) {
error_report("Unknown file format '%s'", fmt);
return 1;
}
create_options = append_o... | vuln | Safe | C/C++ |
var create = require('./create')
var ssbKeys = require('ssb-keys')
var path = require('path')
var osenv = require('osenv')
var mkdirp = require('mkdirp')
var rimraf = require('rimraf')
var valid = require('./lib/validators')
var pkg = require('./package.json')
const pull = require(... | vuln | Vulnerable | JavaScript |
static int encode_dvd_subtitles(AVCodecContext *avctx,
uint8_t *outbuf, int outbuf_size,
const AVSubtitle *h)
{
DVDSubtitleContext *dvdc = avctx->priv_data;
uint8_t *q, *qq;
int offset1, offset2;
int i, rects = h->num_rects, ret;
unsign... | vuln | Safe | C/C++ |
explicit AsStringOp(OpKernelConstruction* ctx) : OpKernel(ctx) {
int32 precision;
bool scientific;
bool shortest;
int32 width;
string fill_string;
DataType dtype;
OP_REQUIRES_OK(ctx, ctx->GetAttr("T", &dtype));
OP_REQUIRES_OK(ctx, ctx->GetAttr("precision", &precision));
OP_REQUIRES_O... | vuln | Safe | C/C++ |
@Override
public void putObject(String objectName, String contentType, Map<String, String> metadata, byte[] objectData)
throws IOException {
// TODO: do something with metadata
// Prevent directory traversal
Path path = root.resolve(objectName);
if (!path.toFile().getCan... | vuln | Safe | Java |
ext2_xattr_cache_insert(struct buffer_head *bh)
ext2_xattr_cache_insert(struct mb2_cache *cache, struct buffer_head *bh)
{
__u32 hash = le32_to_cpu(HDR(bh)->h_hash);
int error;
error = mb2_cache_entry_create(cache, GFP_NOFS, hash, bh->b_blocknr);
if (error) {
if (error == -EBUSY) {
ea_bdebug(bh, "alrea... | vuln | Safe | C/C++ |
private SyncNotedAppOp noteOperationUnchecked(int code, int uid, @NonNull String packageName,
@Nullable String attributionTag, int proxyUid, String proxyPackageName,
@Nullable String proxyAttributionTag, @OpFlags int flags,
boolean shouldCollectAsyncNotedOp, @Nullable String message,... | vuln | Safe | Java |
@Override
protected RemoteOperationResult<UserInfo> doInBackground(Object... params) {
RemoteOperationResult<UserInfo> result;
if (params != null && params.length == 2 && mWeakContext.get() != null) {
String url = (String) params[0];
Context context = mWeakContext.get();
... | vuln | Vulnerable | Java |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | vuln | Safe | C/C++ |
/*
* Copyright © 2015-2018 Aeneas Rekkas <aeneas+oss@aeneas.io>
*
* 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... | vuln | Safe | Go |
/*
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre, Romain Bouqueau, Cyril Concolato
* Copyright (c) Telecom ParisTech 2000-2021
* All rights reserved
*
* This file is part of GPAC / Media Tools sub-project
*
* GPAC is free software; you can redistribute it and/or modify
* it unde... | vuln | Vulnerable | C/C++ |
_copyConstraint(const Constraint *from)
{
Constraint *newnode = makeNode(Constraint);
COPY_SCALAR_FIELD(contype);
COPY_STRING_FIELD(conname);
COPY_SCALAR_FIELD(deferrable);
COPY_SCALAR_FIELD(initdeferred);
COPY_LOCATION_FIELD(location);
COPY_SCALAR_FIELD(is_no_inherit);
COPY_NODE_FIELD(raw_expr);
COPY_STRING_... | vuln | Vulnerable | Unknown |
static inline ut32 r_read_at_le32(const void *src, size_t offset) {
if (!src) {
return UT32_MAX;
}
const ut8 *s = (const ut8*)src + offset;
return r_read_le32 (s);
} | vuln | Safe | Unknown |
idna_to_ascii_4i (const uint32_t * in, size_t inlen, char *out, int flags)
{
size_t len, outlen;
uint32_t *src; /* XXX don't need to copy data? */
int rc;
/*
* ToASCII consists of the following steps:
*
* 1. If all code points in the sequence are in the ASCII range (0..7F)
* then skip to step 3.
... | vuln | Safe | Unknown |
DOMStorageContextWrapper::DOMStorageContextWrapper(
scoped_refptr<DOMStorageContextWrapper> DOMStorageContextWrapper::Create(
service_manager::Connector* connector,
const base::FilePath& profile_path,
const base::FilePath& local_partition_path,
storage::SpecialStoragePolicy* special_storage_policy) {... | vuln | Safe | C/C++ |
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
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 law or a... | vuln | Safe | Python |
static Image *ReadVIFFImage(const ImageInfo *image_info,
ExceptionInfo *exception)
{
#define VFF_CM_genericRGB 15
#define VFF_CM_ntscRGB 1
#define VFF_CM_NONE 0
#define VFF_DEP_DECORDER 0x4
#define VFF_DEP_NSORDER 0x8
#define VFF_DES_RAW 0
#define VFF_LOC_IMPLICIT 1
#define VFF_MAPTYP_NONE 0
#define VFF_MAPTY... | vuln | Safe | C/C++ |
static handler_t wstunnel_handler_setup (request_st * const r, plugin_data * const p) {
handler_ctx *hctx = r->plugin_ctx[p->id];
int hybivers;
hctx->errh = r->conf.errh;/*(for mod_wstunnel-specific DEBUG_* macros)*/
hctx->conf = p->conf; /*(copies struct)*/
hybivers = wstunnel_check_request(r, hctx... | vuln | Safe | Unknown |
int usbredirparser_serialize(struct usbredirparser *parser_pub,
uint8_t **state_dest, int *state_len)
{
struct usbredirparser_priv *parser =
(struct usbredirparser_priv *)parser_pub;
struct usbredirparser_buf *wbuf;
uint8_t *write_buf_count_pos, *state = NULL, *pos = NUL... | vuln | Vulnerable | Unknown |
const got = require('@/utils/got');
const cheerio = require('cheerio');
module.exports = async (ctx) => {
const language = ctx.params.language || 'www';
const username = ctx.params.username;
const sort = ctx.params.sort || 'mr';
const link = `https://${language}.pornhub.com/pornstar/${username}/videos?... | vuln | Vulnerable | JavaScript |
BIO *PKCS7_dataInit(PKCS7 *p7, BIO *bio)
{
int i;
BIO *out = NULL, *btmp = NULL;
X509_ALGOR *xa = NULL;
const EVP_CIPHER *evp_cipher = NULL;
STACK_OF(X509_ALGOR) *md_sk = NULL;
STACK_OF(PKCS7_RECIP_INFO) *rsk = NULL;
X509_ALGOR *xalg = NULL;
PKCS7_RECIP_INFO *ri = NULL;
ASN1_OCTET_... | vuln | Vulnerable | C/C++ |
void client_reset(t_client *client)
{
char *hash;
char *msg;
char *cidinfo;
debug(LOG_DEBUG, "Resetting client [%s]", client->mac);
// Reset traffic counters
client->counters.incoming = 0;
client->counters.outgoing = 0;
client->counters.last_updated = time(NULL);
// Reset session time
client->session_start ... | vuln | Vulnerable | C/C++ |
void vhost_dev_cleanup(struct vhost_dev *hdev)
{
int i;
for (i = 0; i < hdev->nvqs; ++i) {
vhost_virtqueue_cleanup(hdev->vqs + i);
}
memory_listener_unregister(&hdev->memory_listener);
if (hdev->migration_blocker) {
migrate_del_blocker(hdev->migration_blocker);
error_free(hde... | vuln | Safe | C/C++ |
static int rsa_builtin_keygen(RSA *rsa, int bits, BIGNUM *e_value,
BN_GENCB *cb)
{
BIGNUM *r0 = NULL, *r1 = NULL, *r2 = NULL, *r3 = NULL, *tmp;
BIGNUM local_r0, local_d, local_p;
BIGNUM *pr0, *d, *p;
int bitsp, bitsq, ok = -1, n = 0;
BN_CTX *ctx = NULL;
unsigned lon... | vuln | Safe | Unknown |
@OnlyIn(Dist.CLIENT)
@Override
public void onRadialKeyPressed(ItemStack stack, Player player) {
List<RadialMenuSlot<SlotData>> slots = new ArrayList<>();
for(int i = 0; i < player.inventory.getContainerSize(); i++) {
if(slots.size() >= 9)
break;
ItemStack ... | vuln | Vulnerable | Java |
private Map<String, String> getEnvVars() {
String versionName = Optional.ofNullable(options.getVersionName()).orElse(version.getId());
Map<String, String> env = new HashMap<>();
env.put("INST_NAME", versionName);
env.put("INST_ID", versionName);
env.put("INST_DIR", repository.get... | vuln | Vulnerable | Java |
def _checkPairing():
if winner == loser:
raise ValueError('Attempt to match player against self')
q = '''
SELECT COUNT(*) FROM matches
WHERE (matches.winner_id = %s AND matches.loser_id = %s)
OR (matches.winner_id = %s AND matches.loser_id = %s);
''' % ... | vuln | Vulnerable | Python |
static void co_schedule_bh_cb(void *opaque)
{
AioContext *ctx = opaque;
QSLIST_HEAD(, Coroutine) straight, reversed;
QSLIST_MOVE_ATOMIC(&reversed, &ctx->scheduled_coroutines);
QSLIST_INIT(&straight);
while (!QSLIST_EMPTY(&reversed)) {
Coroutine *co = QSLIST_FIRST(&reversed);
QSLIST_R... | vuln | Vulnerable | C/C++ |
static int smka_decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size)
{
GetBitContext gb;
HuffContext h[4];
VLC vlc[4];
int16_t *samples = data;
int val;
int i, res;
int unp_size;
int bits, stereo;
int pred[2] = {0, 0};
unp_size = AV_RL32(buf... | vuln | Safe | C/C++ |
static int mov_read_stts(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
AVStream *st;
MOVStreamContext *sc;
unsigned int i, entries;
int64_t duration=0;
int64_t total_sample_count=0;
if (c->fc->nb_streams < 1)
return 0;
st = c->fc->streams[c->fc->nb_streams-1];
sc = st->priv_dat... | vuln | Vulnerable | C/C++ |
package com.jflyfox.modules.front.controller;
import com.alibaba.fastjson.JSONObject;
import com.jfinal.aop.Before;
import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Page;
import com.jfinal.plugin.activerecord.Record;
import com.jflyfox.component.base.BaseProjectController;
import... | vuln | Safe | Java |
static void create_power_zone_common_attributes(
struct powercap_zone *power_zone)
{
int count = 0;
power_zone->zone_dev_attrs[count++] = &dev_attr_name.attr;
if (power_zone->ops->get_max_energy_range_uj)
power_zone->zone_dev_attrs[count++] =
&dev_attr_max_energy_range_uj.attr;
if (power_zone->ops->get... | vuln | Safe | Unknown |
int
notify(xlator_t *this, int32_t event, void *data, ...)
{
int i = 0;
int32_t ret = 0;
fuse_private_t *private = NULL;
gf_boolean_t start_thread = _gf_false;
gf_boolean_t event_graph = _gf_true;
glusterfs_graph_t *graph = NULL;
struct pollfd pfd = {0};
private = this->private;
gr... | vuln | Safe | C/C++ |
it "should reject a subjectAltName for a non-DNS value" do
@request.stubs(:subject_alt_names).returns ['DNS:foo', 'email:bar@example.com']
expect { @ca.check_internal_signing_policies(@name, @request, true) }.to raise_error(
Puppet::SSL::CertificateAuthority::CertificateSigningError,
... | vuln | Safe | Ruby |
matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data, int size,
int64_t pos, uint64_t cluster_time, uint64_t duration,
int is_keyframe, int is_bframe)
{
int res = 0;
int track;
AVStream *st;
AVPacket *pkt;
uint8_t *origdata = data;
int16_t ... | vuln | Vulnerable | C/C++ |
/*
* Copyright (C) 2003-2004 The FFmpeg project
* Copyright (C) 2019 Peter Ross
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 ... | vuln | Safe | C/C++ |
function decode (str) {
var out = {}
var p = out
var section = null
// section |key = value
var re = /^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i
var lines = str.split(/[\r\n]+/g)
lines.forEach(function (line, _, __) {
if (!line || line.match(/^\s*[;#]/)) return
var match = line.match(re... | vuln | Vulnerable | JavaScript |
func (u *SessionUtil) changeModeOfSudoersFile(log log.T) error {
fileMode := os.FileMode(sudoersFileMode)
if err := os.Chmod(sudoersFile, fileMode); err != nil {
log.Errorf("Failed to change mode of %s to %d: %v", sudoersFile, sudoersFileMode, err)
return err
}
log.Infof("Successfully changed mode of %s to %d",... | vuln | Vulnerable | Go |
njs_object_prop_define(njs_vm_t *vm, njs_value_t *object,
njs_value_t *name, njs_value_t *value, njs_object_prop_define_t type)
{
uint32_t length;
njs_int_t ret;
njs_array_t *array;
njs_object_prop_t *prop, *prev;
njs_property_query_t pq;
static const... | vuln | Vulnerable | Unknown |
static int
lambda_function_body(
char_u **arg,
typval_T *rettv,
evalarg_T *evalarg,
garray_T *newargs,
garray_T *argtypes,
int varargs,
garray_T *default_args,
char_u *ret_type)
{
int evaluate = (evalarg->eval_flags & EVAL_EVALUATE);
garray_T *gap = &evalarg->eval_ga;
garr... | vuln | Safe | C/C++ |
const createCommand = ({ ref, path }: Input) => {
return `git show ${ref}:${path}`;
}; | vuln | Vulnerable | JavaScript |
MediaStreamImpl::~MediaStreamImpl() {
DCHECK(!peer_connection_handler_);
if (dependency_factory_.get())
dependency_factory_->ReleasePeerConnectionFactory();
if (network_manager_) {
if (chrome_worker_thread_.IsRunning()) {
chrome_worker_thread_.message_loop()->PostTask(FROM_HERE, base::Bind(
... | vuln | Vulnerable | C/C++ |
def __init__(self, hs: "HomeServer"):
super().__init__(hs)
self.checkers = {} # type: Dict[str, UserInteractiveAuthChecker]
for auth_checker_class in INTERACTIVE_AUTH_CHECKERS:
inst = auth_checker_class(hs)
if inst.is_enabled():
self.checkers[inst.AUTH_T... | vuln | Safe | Python |
/*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* th... | vuln | Vulnerable | Java |
public AuthResult auth(final HttpServletRequest request,
final String scope,
final String responseType,
final String clientId,
final String redirectUri,
@Nullable final String nonce,
@Nullable final S... | vuln | Safe | Java |
def bulk_load(self, table: str, tmp_file: str) -> None:
"""Load a tab-delimited file into a database table."""
conn = self.get_conn()
cur = conn.cursor()
cur.execute(
f"LOAD DATA LOCAL INFILE %s INTO TABLE {table}",
(tmp_file,),
)
conn.commit()
... | vuln | Safe | Python |
void PrintPreviewMessageHandler::OnDidPreviewPage(
const PrintHostMsg_DidPreviewPage_Params& params) {
int page_number = params.page_number;
if (page_number < FIRST_PAGE_INDEX || !params.data_size)
return;
PrintPreviewUI* print_preview_ui = GetPrintPreviewUI();
if (!print_preview_ui)
return;
... | vuln | Safe | C/C++ |
TfLiteTensor* GetTempRhs(TfLiteContext* context, TfLiteNode* node,
const TfLiteTensor* rhs) {
TfLiteTensor* transposed_rhs = GetTemporary(context, node, 1);
if (transposed_rhs == nullptr) {
return nullptr;
}
if (rhs->type == kTfLiteInt8) {
// Get the quantization params from th... | vuln | Safe | Unknown |
var BackgroundImageDialog=function(b,e,f){var c=document.createElement("div");c.style.whiteSpace="nowrap";var m=document.createElement("h2");mxUtils.write(m,mxResources.get("backgroundImage"));m.style.marginTop="0px";c.appendChild(m);var n=null!=f&&null!=f.originalSrc;m=!1;var v=document.createElement("input");v.style.... | vuln | Safe | JavaScript |
/*
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator p... | vuln | Safe | Java |
def get_queryset(self, **kwargs):
queryset = Article.objects.order_by('-time')
for i in queryset:
i.md = markdown(i.content, extensions=[
'markdown.extensions.extra',
'markdown.extensions.codehilite',
'markdown.extensions.toc',
])
... | vuln | Vulnerable | Python |
@NonNull
private String getConfiguredAuthToken()
{
final I_AD_User configuredESUser = getConfiguredESUser();
final UserId configuredUserId = UserId.ofRepoId(configuredESUser.getAD_User_ID());
final Role role = getAndValidateRole(configuredUserId);
final UserAuthToken userAuthToken = authTokenRepository.retri... | vuln | Safe | Java |
static int vp6_parse_header(VP56Context *s, const uint8_t *buf, int buf_size)
{
VP56RangeCoder *c = &s->c;
int parse_filter_info = 0;
int coeff_offset = 0;
int vrt_shift = 0;
int sub_version;
int rows, cols;
int res = 0;
int ret;
int separated_coeff = buf[0] & 1;
s->frames[VP56_F... | vuln | Safe | C/C++ |
static int dirac_decode_frame_internal(DiracContext *s)
{
DWTContext d;
int y, i, comp, dsty;
int ret;
if (s->low_delay) {
for (comp = 0; comp < 3; comp++) {
Plane *p = &s->plane[comp];
memset(p->idwt_buf, 0, p->idwt_stride * p->idwt_height * sizeof(IDWTELEM));
... | vuln | Safe | C/C++ |
static void search_for_ms(AACEncContext *s, ChannelElement *cpe,
const float lambda)
{
int start = 0, i, w, w2, g;
float M[128], S[128];
float *L34 = s->scoefs, *R34 = s->scoefs + 128, *M34 = s->scoefs + 128*2, *S34 = s->scoefs + 128*3;
SingleChannelElement *sce0 = &cpe->ch[0];... | vuln | Safe | C/C++ |
public Map<Long, JSONObject> findVulnerableCallables(Set<Long> vulnerablePackageVersions, Set<Long> callableIDs) {
var result = context
.select(Callables.CALLABLES.ID, Callables.CALLABLES.METADATA)
.from(Callables.CALLABLES)
.join(Modules.MODULES)
... | vuln | Safe | Java |
batadv_frag_merge_packets(struct hlist_head *chain, struct sk_buff *skb)
{
struct batadv_frag_packet *packet;
struct batadv_frag_list_entry *entry;
struct sk_buff *skb_out = NULL;
int size, hdr_size = sizeof(struct batadv_frag_packet);
/* Make sure incoming skb has non-bogus data. */
packet = (struct batadv_frag... | vuln | Vulnerable | C/C++ |
@Override
public int fill(FluidStack resource, FluidAction action)
{
if(!allowFill)
return 0;
FluidStack remaining = resource.copy();
for(IFluidTank tank : internal)
{
int filledHere = tank.fill(remaining, action);
remaining.shrink(filledHere);
if(remaining.isEmpty())
break;
}
if(resource.... | vuln | Vulnerable | Java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.