code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
/*
* Nextcloud Android client application
*
* @author Tobias Kaminsky
* Copyright (C) 2017 Tobias Kaminsky
* Copyright (C) 2017 Nextcloud GmbH.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Softw... | vuln | Vulnerable | Java |
pvscsi_on_cmd_setup_msg_ring(PVSCSIState *s)
{
PVSCSICmdDescSetupMsgRing *rc =
(PVSCSICmdDescSetupMsgRing *) s->curr_cmd_data;
trace_pvscsi_on_cmd_arrived("PVSCSI_CMD_SETUP_MSG_RING");
if (!s->use_msg) {
return PVSCSI_COMMAND_PROCESSING_FAILED;
}
if (s->rings_info_valid) {
if... | vuln | Safe | C/C++ |
@Override
public void onUserActionRequired(Intent intent) {
if (mTarget == null) {
return;
}
final Intent fillIn = new Intent();
fillIn.putExtra(PackageInstaller.EXTRA_PACKAGE_NAME, mPackageName);
fillIn.putExtra(PackageInstaller.EXTRA_... | vuln | Safe | Java |
static int i2c_ddc_rx(I2CSlave *i2c)
{
I2CDDCState *s = I2CDDC(i2c);
int value;
value = s->edid_blob[s->reg];
s->reg++;
return value;
} | vuln | Vulnerable | C/C++ |
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* 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 applic... | vuln | Vulnerable | Go |
static void filter_samples(AVFilterLink *inlink, AVFilterBufferRef *samplesref)
{
AVFilterContext *ctx = inlink->dst;
int i;
for (i = 0; i < ctx->nb_outputs; i++)
ff_filter_samples(inlink->dst->outputs[i],
avfilter_ref_buffer(samplesref, ~AV_PERM_WRITE));
} | vuln | Vulnerable | C/C++ |
public float bearingTo(@NonNull Location dest) {
BearingDistanceCache cache = sBearingDistanceCache.get();
// See if we already have the result
if (mLatitudeDegrees != cache.mLat1 || mLongitudeDegrees != cache.mLon1
|| dest.mLatitudeDegrees != cache.mLat2 || dest.mLongitudeDegree... | vuln | Safe | Java |
void vrend_clear(struct vrend_context *ctx,
unsigned buffers,
const union pipe_color_union *color,
double depth, unsigned stencil)
{
GLbitfield bits = 0;
if (ctx->in_error)
return;
if (ctx->ctx_switch_pending)
vrend_finish_context_switch(ctx);
... | vuln | Vulnerable | C/C++ |
public static void load(String originalName, ClassLoader loader) {
// Adjust expected name to support shading of native libraries.
String packagePrefix = calculatePackagePrefix().replace('.', '_');
String name = packagePrefix + originalName;
List<Throwable> suppressed = new ArrayList<>()... | vuln | Vulnerable | Java |
public Reader queryGroupsByMembership(@NonNull Set<RecipientId> recipientIds, boolean includeInactive, boolean excludeV1, boolean excludeMms) {
if (recipientIds.isEmpty()) {
return new Reader(null);
}
List<String> recipientLikeClauses = recipientIds.stream()
... | vuln | Vulnerable | Java |
LibRaw_byte_buffer *LibRaw_buffer_datastream::make_byte_buffer(unsigned int sz)
{
LibRaw_byte_buffer *ret = new LibRaw_byte_buffer(0);
if(streampos + sz > streamsize)
sz = streamsize - streampos;
ret->set_buffer(buf+streampos,sz);
return ret;
} | vuln | Vulnerable | Unknown |
char *BN_bn2dec(const BIGNUM *a)
{
int i = 0, num, ok = 0;
char *buf = NULL;
char *p;
BIGNUM *t = NULL;
BN_ULONG *bn_data = NULL, *lp;
int bn_data_num;
/*-
* get an upper bound for the length of the decimal integer
* num <= (BN_num_bits(a) + 1) * log(2)
* <= 3 * BN_num_bi... | vuln | Vulnerable | Unknown |
public function autocomplete() {
return;
global $db;
$model = $this->params['model'];
$mod = new $model();
$srchcol = explode(",",$this->params['searchoncol']);
/*for ($i=0; $i<count($srchcol); $i++) {
if ($i>=1) $sql .= " OR ";
$sql .= $srchcol[$... | vuln | Vulnerable | PHP |
static int complete_emulated_mmio(struct kvm_vcpu *vcpu)
{
struct kvm_run *run = vcpu->run;
struct kvm_mmio_fragment *frag;
unsigned len;
BUG_ON(!vcpu->mmio_needed);
/* Complete previous fragment */
frag = &vcpu->mmio_fragments[vcpu->mmio_cur_fragment];
len = min(8u, frag->len);
if (!vcpu->mmio_is_write)
me... | vuln | Vulnerable | Unknown |
static int alloc_buffers(AVCodecContext *avctx)
{
CFHDContext *s = avctx->priv_data;
int i, j, k, ret, planes;
if ((ret = ff_set_dimensions(avctx, s->coded_width, s->coded_height)) < 0)
return ret;
avctx->pix_fmt = s->coded_format;
avcodec_get_chroma_sub_sample(avctx->pix_fmt, &s->chroma_x_s... | vuln | Safe | C/C++ |
static int gdb_get_avr_reg(CPUState *env, uint8_t *mem_buf, int n)
{
if (n < 32) {
#ifdef WORDS_BIGENDIAN
stq_p(mem_buf, env->avr[n].u64[0]);
stq_p(mem_buf+8, env->avr[n].u64[1]);
#else
stq_p(mem_buf, env->avr[n].u64[1]);
stq_p(mem_buf+8, env->avr[n].u64[0]);
#endif
return 16... | vuln | Vulnerable | C/C++ |
function finishView (view) {
// todo list
const lis = view.find('li.raw').removeClass('raw').sortByDepth().toArray()
for (let li of lis) {
let html = $(li).clone()[0].innerHTML
const p = $(li).children('p')
if (p.length === 1) {
html = p.html()
li = p[0]
}
html = replaceExtraTags(... | vuln | Safe | JavaScript |
PCIBus *pci_bridge_init(PCIBus *bus, int devfn, uint16_t vid, uint16_t did,
pci_map_irq_fn map_irq, const char *name)
{
PCIDevice *dev;
PCIBridge *s;
dev = pci_create(bus, devfn, "pci-bridge");
qdev_prop_set_uint32(&dev->qdev, "vendorid", vid);
qdev_prop_set_uint32(&dev->qdev... | vuln | Vulnerable | C/C++ |
void ntlm_write_message_fields_buffer(wStream* s, NTLM_MESSAGE_FIELDS* fields)
static void ntlm_write_message_fields_buffer(wStream* s, NTLM_MESSAGE_FIELDS* fields)
{
if (fields->Len > 0)
{
Stream_SetPosition(s, fields->BufferOffset);
Stream_Write(s, fields->Buffer, fields->Len);
}
} | vuln | Safe | C/C++ |
@Method(0x8004888cL)
public static void setNoiseMode(final long channelIndex, final long voiceIndex) {
assert false;
} | vuln | Vulnerable | Java |
vhost_reserve_avail_batch_packed(struct virtio_net *dev,
struct vhost_virtqueue *vq,
struct rte_mempool *mbuf_pool,
struct rte_mbuf **pkts,
uint16_t avail_idx,
uintptr_t *desc_addrs,
uint16_t *ids)
{
bool wrap = vq->avail_wrap_counter;
struct vring_packed_desc *descs = vq->desc_packed;
... | vuln | Safe | Unknown |
// Copyright (C) 2002 UltraVNC Team Members. All Rights Reserved.
// Copyright (C) 2000-2002 Const Kaplinsky. All Rights Reserved.
// Copyright (C) 2002 TightVNC. All Rights Reserved.
// Copyright (C) 2002 RealVNC Ltd. All Rights Reserved.
// Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.... | vuln | Safe | C/C++ |
$row_rub = sql_fetsel("id_rubrique", "spip_rubriques",
"lang='" . $GLOBALS['spip_lang'] . "' AND id_parent=".intval($id_parent));
if ($row_rub) {
$row['id_rubrique'] = $row_rub['id_rubrique'];
}
}
}
} | vuln | Safe | PHP |
private void registerShortcut(NativeKeyEvent event) {
shortcutHook.ifPresent(hook -> {
if (hook.canBeShortcut(event)) {
activationFld.setText(hook.toKeyString(event));
}
});
} | vuln | Safe | Java |
static int latm_decode_frame(AVCodecContext *avctx, void *out,
int *got_frame_ptr, AVPacket *avpkt)
{
struct LATMContext *latmctx = avctx->priv_data;
int muxlength, err;
GetBitContext gb;
if ((err = init_get_bits8(&gb, avpkt->data, avpkt->size)) < 0)
... | vuln | Vulnerable | C/C++ |
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (C) 1994 Linus Torvalds
*
* Cyrix stuff, June 1998 by:
* - Rafael R. Reilova (moved everything from head.S),
* <rreilova@ececs.uc.edu>
* - Channing Corn (tests & fixes),
* - Andrew D. Balsa (code cleanup).
*/
#include <linux/init.h>
#include <linux/ut... | vuln | Safe | C/C++ |
public void onUpdate() {
// If no mc.player
if (mc.player == null || mc.player.isDead) {
disable();
return;
}
// Wait
if (delayTimeTicks < delayTable[stage]) {
delayTimeTicks++;
return;
}
// If the delay is finishe... | vuln | Safe | Java |
public function rules()
{
$rules = [];
$inputs = $this->all();
$validateEmail = false;
$validateUsername = false;
if (!isset($inputs['username']) || !isset($inputs['email'])) {
$validateUsername = true;
}
if (isset($inputs['email']) && !isset(... | vuln | Safe | PHP |
int av_set_options_string(void *ctx, const char *opts,
const char *key_val_sep, const char *pairs_sep)
{
int ret, count = 0;
while (*opts) {
if ((ret = parse_key_value_pair(ctx, &opts, key_val_sep, pairs_sep)) < 0)
return ret;
count++;
if (*opts)
... | vuln | Vulnerable | C/C++ |
var setData = function (data, val, src) {
var a = _fnSplitObjNotation( src ), b;
var aLast = a[a.length-1];
var arrayNotation, funcNotation, o, innerSrc;
for ( var i=0, iLen=a.length-1 ; i<iLen ; i++ )
{
// Protect against prototype pollution
if (a[i] === '__proto__' || a[i] === 'constructor') {... | vuln | Safe | JavaScript |
@Override
public Map<String, String[]> getParameterMap() {
Map<String, String[]> map = new LinkedHashMap<>();
Map<String, String[]> parameters = super.getParameterMap();
for (Map.Entry<String, String[]> entry : parameters.entrySet()) {
String[] values = entry.getValue();
... | vuln | Safe | Java |
int
get_lisp_indent(void)
{
pos_T *pos, realpos, paren;
int amount;
char_u *that;
colnr_T col;
colnr_T firsttry;
int parencount, quotecount;
int vi_lisp;
// Set vi_lisp to use the vi-compatible method
vi_lisp = (vim_strchr(p_cpo, CPO_LISP) != NULL);
realpos = curwin->w_curso... | vuln | Safe | C/C++ |
// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright (c) 2013, Google Inc.
*
* (C) Copyright 2008 Semihalf
*
* (C) Copyright 2000-2006
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
*/
#include <common.h>
#include <fdt_support.h>
#include <fdtdec.h>
#include <env.h>
#include <errno.h>
#include <image.h>... | vuln | Safe | C/C++ |
TfLiteStatus SoftmaxPrepare(TfLiteContext* context, TfLiteNode* node) {
auto* params = reinterpret_cast<TfLiteSoftmaxParams*>(node->builtin_data);
SoftmaxOpData* data = reinterpret_cast<SoftmaxOpData*>(node->user_data);
TF_LITE_ENSURE_EQ(context, NumInputs(node), 1);
TF_LITE_ENSURE_EQ(context, NumOutputs(node)... | vuln | Vulnerable | C/C++ |
static __always_inline void __speculation_ctrl_update(unsigned long tifp,
unsigned long tifn)
{
unsigned long tif_diff = tifp ^ tifn;
u64 msr = x86_spec_ctrl_base;
bool updmsr = false;
lockdep_assert_irqs_disabled();
/* Handle change of TIF_SSBD depending on the mitigation method. */
if (static_cpu_... | vuln | Safe | Unknown |
*/
static void php_imap_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
{
char *mailbox, *user, *passwd;
int mailbox_len, user_len, passwd_len;
long retries = 0, flags = NIL, cl_flags = NIL;
MAILSTREAM *imap_stream;
pils *imap_le_struct;
zval *params = NULL;
int argc = ZEND_NUM_ARGS();
if (zend_parse_par... | vuln | Vulnerable | Unknown |
TfLiteStatus SelectEval(TfLiteContext* context, TfLiteNode* node) {
OpData* data = reinterpret_cast<OpData*>(node->user_data);
const TfLiteTensor* input_condition;
TF_LITE_ENSURE_OK(context, GetInputSafe(context, node, kInputTensorCondition,
&input_condition));
const Tf... | vuln | Safe | C/C++ |
def create_dependency_tree(source_dir, url=None, options=None, update=False):
# make sure the separator is present
source_dir_rp = os.path.join(os.path.realpath(source_dir), '')
root = Subproject.create("root", url, source_dir, {}, {}, toplevel = True)
if url and update:
root... | vuln | Vulnerable | Python |
msg_t* MsgDup(msg_t* pOld)
{
msg_t* pNew;
rsRetVal localRet;
assert(pOld != NULL);
BEGINfunc
if(msgConstructWithTime(&pNew, &pOld->tTIMESTAMP, pOld->ttGenTime) != RS_RET_OK) {
return NULL;
}
/* now copy the message properties */
pNew->iRefCount = 1;
pNew->iSeverity = pOld->iSeverity;
pNew->iFacility = pO... | vuln | Vulnerable | C/C++ |
var dns = require('dns'),
net = require('net'),
os = require('os'),
async = require('async');
module.exports = function (email, callback, timeout, from_email) {
timeout = timeout || 5000;
from_email = from_email || email;
/* Does it look like a valid email? */
/* Our email regex is vulnerable to REDOS o... | vuln | Safe | JavaScript |
void Unpack::Unpack5(bool Solid)
{
FileExtracted=true;
if (!Suspended)
{
UnpInitData(Solid);
if (!UnpReadBuf())
return;
// Check TablesRead5 to be sure that we read tables at least once
// regardless of current block header TablePresent flag.
// So we can safefly use these tables below... | vuln | Safe | C/C++ |
void pjmedia_rtcp_xr_rx_rtcp_xr( pjmedia_rtcp_xr_session *sess,
const void *pkt,
pj_size_t size)
{
const pjmedia_rtcp_xr_pkt *rtcp_xr = (pjmedia_rtcp_xr_pkt*) pkt;
const pjmedia_rtcp_xr_rb_rr_time *rb_rr_time = NULL;
const pjmedia_rtcp_xr_rb_dlrr *rb_dlrr = NULL;
const pjmedia_rtcp_... | vuln | Safe | C/C++ |
public boolean contains(String versionNumber) {
if (versionNumber == null) return false;
return contains(VersionNumber.asVersion(versionNumber));
} | vuln | Safe | Java |
void do_blockdev_backup(BlockdevBackup *backup, BlockJobTxn *txn, Error **errp)
{
BlockDriverState *bs;
BlockDriverState *target_bs;
Error *local_err = NULL;
AioContext *aio_context;
if (!backup->has_speed) {
backup->speed = 0;
}
if (!backup->has_on_source_error) {
backup->on... | vuln | Vulnerable | C/C++ |
static void vnc_init_basic_info_from_server_addr(QIOChannelSocket *ioc,
VncBasicInfo *info,
Error **errp)
{
SocketAddress *addr = NULL;
addr = qio_channel_socket_get_local_address(ioc, errp);
if (!addr) {
v... | vuln | Vulnerable | C/C++ |
av_cold int ffv1_common_init(AVCodecContext *avctx)
{
FFV1Context *s = avctx->priv_data;
if (!avctx->width || !avctx->height)
return AVERROR_INVALIDDATA;
s->avctx = avctx;
s->flags = avctx->flags;
s->picture.f = avcodec_alloc_frame();
s->last_picture.f = av_frame_alloc();
ff_dsputil_... | vuln | Vulnerable | C/C++ |
def validate_include_view_lineage(cls, v, values):
if not values.get("include_table_lineage") and v:
raise ValueError(
"include_table_lineage must be True for include_view_lineage to be set."
)
return v | vuln | Vulnerable | Python |
static int init_tile(Jpeg2000DecoderContext *s, int tileno)
{
int compno;
int tilex = tileno % s->numXtiles;
int tiley = tileno / s->numXtiles;
Jpeg2000Tile *tile = s->tile + tileno;
if (!tile->comp)
return AVERROR(ENOMEM);
tile->coord[0][0] = av_clip(tilex * s->tile_width + s->ti... | vuln | Vulnerable | C/C++ |
static int fic_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame, AVPacket *avpkt)
{
FICContext *ctx = avctx->priv_data;
uint8_t *src = avpkt->data;
int ret;
int slice, nslices;
int msize;
int tsize;
int cur_x, cur_y;
int skip_cursor = ctx->skip_c... | vuln | Vulnerable | C/C++ |
$ret[$key] = sprintf(
$format,
++$i,
$err[0],
$err[1],
htmlspecialchars($err[2]),
$err[3]
);
} | vuln | Safe | PHP |
static int selinux_msg_queue_msgrcv(struct kern_ipc_perm *msq, struct msg_msg *msg,
struct task_struct *target,
long type, int mode)
{
struct ipc_security_struct *isec;
struct msg_security_struct *msec;
struct common_audit_data ad;
u32 sid = task_sid_subj(target);
int rc;
isec = selinux_ipc(msq);... | vuln | Vulnerable | Unknown |
static void cryptinfo_node_start(void *sax_cbck, const char *node_name, const char *name_space, const GF_XMLAttribute *attributes, u32 nb_attributes)
{
GF_XMLAttribute *att;
GF_TrackCryptInfo *tkc;
u32 i;
GF_CryptInfo *info = (GF_CryptInfo *)sax_cbck;
if (!strcmp(node_name, "OMATextHeader")) {
info->in_text_hea... | vuln | Vulnerable | Unknown |
@Inject(method = "handleSystemMessage", at = @At("HEAD"), cancellable = true)
private void onHandleSystemMessage(Component message, boolean overlay, CallbackInfo info) {
if (message instanceof MutableComponent mutable && message.getContents() instanceof TranslatableContents translatable) {
if (translatable.getKey... | vuln | Safe | Java |
static RList *r_bin_wasm_get_global_entries (RBinWasmObj *bin, RBinWasmSection *sec) {
RList *ret = NULL;
RBinWasmGlobalEntry *ptr = NULL;
if (!(ret = r_list_newf ((RListFree)free))) {
return NULL;
}
ut8* buf = bin->buf->buf + (ut32)sec->payload_data;
int buflen = bin->buf->length - (ut32)sec->payload_data;
... | vuln | Safe | C/C++ |
static int decode_packet(AVCodecContext *avctx, void *data,
int *got_frame_ptr, AVPacket* avpkt)
{
WMAProDecodeCtx *s = avctx->priv_data;
GetBitContext* gb = &s->pgb;
const uint8_t* buf = avpkt->data;
int buf_size = avpkt->size;
int num_bits_prev_frame;
int packet... | vuln | Vulnerable | C/C++ |
@Inject(method = "renderShadow", at = @At("HEAD"), cancellable = true)
private static void onRenderShadow(MatrixStack matrices, VertexConsumerProvider vertexConsumers, Entity entity, float opacity, float tickDelta, WorldView world, float radius, CallbackInfo info) {
if (Utils.renderingEntityOutline) info.ca... | vuln | Safe | Java |
def add_texts(
self,
texts: Iterable[str],
metadatas: Optional[List[dict]] = None,
ids: Optional[List[str]] = None,
**kwargs: Any,
) -> List[str]:
"""Run more texts through the embeddings and add to the vectorstore.
Args:
texts: Iterable of string... | vuln | Vulnerable | Python |
private void enforcePermission(
String callingPackage, int callingUid, boolean checkCarrierPrivileges) {
mAppOps.checkPackage(callingUid, callingPackage);
// To gain access through the DUMP permission, the OEM has to allow this package explicitly
// via sysconfig and privileged perm... | vuln | Vulnerable | Java |
parse_args(int argc, char **argv, int *old_optind, int *nargc, char ***nargv,
struct sudo_settings **settingsp, char ***env_addp)
{
struct environment extra_env;
int mode = 0; /* what mode is sudo to be run in? */
int flags = 0; /* mode flags */
int valid_flags = DEFAULT_VALID_FLAGS;
int ch, i... | vuln | Safe | C/C++ |
import operator
from functools import partial
from typing import TYPE_CHECKING, Any, Dict, Iterable, Optional, Tuple
from pypika import Table
from pypika.functions import Upper
from pypika.terms import (
BasicCriterion,
Criterion,
Enum,
Equality,
Term,
ValueWrapper,
basestring,
date,
... | vuln | Safe | Python |
static inline int wnv1_get_code(WNV1Context *w, int base_value)
{
int v = get_vlc2(&w->gb, code_vlc.table, CODE_VLC_BITS, 1);
if (v == 15)
return ff_reverse[get_bits(&w->gb, 8 - w->shift)];
else
return base_value + ((v - 7U) << w->shift);
} | vuln | Safe | C/C++ |
private List<EObject> toEObjectList(Object object) {
List<EObject> list = null;
if(object instanceof List) {
list = ((List<?>)object).stream().filter(EObject.class::isInstance).map(EObject.class::cast).collect(toList());
} else if(object instanceof EObject) {
list = Collections.singletonList((EObject)obj... | vuln | Vulnerable | Java |
Network::FilterStatus Context::onDownstreamData(int data_length, bool end_of_stream) {
if (!in_vm_context_created_ || !wasm_->onDownstreamData_) {
return Network::FilterStatus::Continue;
}
auto result = wasm_->onDownstreamData_(this, id_, static_cast<uint32_t>(data_length),
... | vuln | Safe | C/C++ |
_mdLink(str) {
const re = RE.mdLink || (RE.mdLink = XRegExp('\\[ ([a-zA-Z][^\\]]+) \\] \\( ([^)]+) \\)', 'gx'));
return XRegExp.replace(str, re, (all, text, href) => {
const scheme = href.match(/^\s*(\w+):/) || ['', ''];
if (scheme[1] && ['http', 'https', 'mailto'].indexOf(scheme[1]) == -1) return a... | vuln | Vulnerable | JavaScript |
static int init_filters(const char *filters_descr)
{
char args[512];
int ret;
AVFilter *abuffersrc = avfilter_get_by_name("abuffer");
AVFilter *abuffersink = avfilter_get_by_name("abuffersink");
AVFilterInOut *outputs = avfilter_inout_alloc();
AVFilterInOut *inputs = avfilter_inout_alloc();
... | vuln | Vulnerable | C/C++ |
static const QObject *qmp_input_get_object(QmpInputVisitor *qiv,
const char *name)
{
const QObject *qobj;
if (qiv->nb_stack == 0) {
qobj = qiv->obj;
} else {
qobj = qiv->stack[qiv->nb_stack - 1].obj;
}
if (qobj) {
if (name && qobject... | vuln | Safe | C/C++ |
public static void registerFeature(BiomeLoadingEvent event) {
if (instance.feature != null
&& event.getCategory() != Biome.BiomeCategory.THEEND
&& event.getCategory() != Biome.BiomeCategory.NETHER) {
event.getGeneration().addFeature(GenerationStep.Decoration.UNDERGROU... | vuln | Safe | Java |
@Override
public boolean mouseScrolled(double d, double e, double amount) {
if (amount > 0) {
AccountButton topButton = accountButtons.get(0);
if (topButton == null) return false;
if (topButton.getY() < ((height / 2) - 100)) {
for (int i = 0; i < 20; i++) ... | vuln | Safe | Java |
static int ax25_release(struct socket *sock)
{
struct sock *sk = sock->sk;
ax25_cb *ax25;
ax25_dev *ax25_dev;
if (sk == NULL)
return 0;
sock_hold(sk);
lock_sock(sk);
sock_orphan(sk);
ax25 = sk_to_ax25(sk);
ax25_dev = ax25->ax25_dev;
if (sk->sk_type == SOCK_SEQPACKET) {
switch (ax25->state) {
case AX2... | vuln | Vulnerable | C/C++ |
static int decode_wdlt(GetByteContext *gb, uint8_t *frame, int width, int height)
{
const uint8_t *frame_end = frame + width * height;
uint8_t *line_ptr;
int count, i, v, lines, segments;
int y = 0;
lines = bytestream2_get_le16(gb);
if (lines > height)
return AVERROR_INVALIDDATA;
w... | vuln | Safe | C/C++ |
document.addEventListener('DOMContentLoaded', function(event) {
var settings = {
activeSignatures: [],
burger: document.getElementById('burger'),
connectionStats: document.getElementById('connection-status'),
matchesCount: document.getElementById('matches-count').getElementsByTagName... | vuln | Safe | Go |
void Compute(OpKernelContext* context) override {
// Get inputs
const Tensor& input_tensor = context->input(0);
const auto input_tensor_flat = input_tensor.flat<int32>();
const Tensor& input_splits = context->input(1);
const auto input_splits_flat = input_splits.flat<SPLITS_TYPE>();
// Operatio... | vuln | Safe | C/C++ |
/******************************************************************************
* pdf.c
*
* pdfresurrect - PDF history extraction tool
*
* Copyright (C) 2008-2010, 2012-2013, 2017-19, Matt Davis (enferex).
*
* Special thanks to all of the contributors: See AUTHORS.
*
* Special thanks to 757labs (757 crew), t... | vuln | Vulnerable | C/C++ |
def unpack_model(
model_file: Text, working_directory: Optional[Union[Path, Text]] = None
) -> TempDirectoryPath:
"""Unpack a zipped Rasa model.
Args:
model_file: Path to zipped model.
working_directory: Location where the model should be unpacked to.
If `None` a ... | vuln | Vulnerable | Python |
function authenticationEndpoints(app) {
if (!app) return;
app.get("/auth/auto-onboard", async (_, response) => {
try {
const completeSetup = (await User.count({ role: "admin" })) > 0;
if (completeSetup) {
response.status(200).json({ completed: true });
return;
}
const o... | vuln | Safe | JavaScript |
static MagickBooleanType WriteSIXELImage(const ImageInfo *image_info,Image *image)
{
ExceptionInfo
*exception;
MagickBooleanType
status;
register const IndexPacket
*indexes;
register ssize_t
i,
x;
ssize_t
opacity,
y;
sixel_output_t
*output;
unsigned char
sixel_pal... | vuln | Safe | C/C++ |
private float getMinCompetitiveScore(float minScoreSum, double sumOfOtherMaxScores) {
assert numClauses > 0;
// We need to find a value 'minScore' so that 'minScore + sumOfOtherMaxScores <= minScoreSum'
// TODO: is there an efficient way to find the greatest value that meets this requirement?
float min... | vuln | Safe | Java |
@Override
public boolean canThreatenSpying(Empire e) {
if (!empire.inEconomicRange(id(e)))
return false;
if (empire.atWarWith(id(e)))
return false;
SpyReport rpt = e.viewForEmpire(empire).spies().report();
return (rpt.spiesLost() > 0) && (rpt.confess... | vuln | Vulnerable | Java |
jas_image_t *bmp_decode(jas_stream_t *in, char *optstr)
{
jas_image_t *image;
bmp_hdr_t hdr;
bmp_info_t *info;
uint_fast16_t cmptno;
jas_image_cmptparm_t cmptparms[3];
jas_image_cmptparm_t *cmptparm;
uint_fast16_t numcmpts;
long n;
bmp_dec_importopts_t opts;
size_t num_samples;
image = 0;
info = 0;
... | vuln | Safe | C/C++ |
public static String getCreatorRealmType(final Authentication authentication) {
if (authentication.isAuthenticatedWithApiKey()) {
return (String) authentication.getMetadata().get(AuthenticationField.API_KEY_CREATOR_REALM_TYPE);
} else {
return authentication.getSourceRealm().getT... | vuln | Vulnerable | Java |
static int tower_probe (struct usb_interface *interface, const struct usb_device_id *id)
{
struct device *idev = &interface->dev;
struct usb_device *udev = interface_to_usbdev(interface);
struct lego_usb_tower *dev = NULL;
struct usb_host_interface *iface_desc;
struct usb_endpoint_descriptor* endpoint;
struct tow... | vuln | Vulnerable | C/C++ |
static Jsi_RC jsi_ArrayMapCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,Jsi_Value **ret, Jsi_Func *funcPtr) {
if (_this->vt != JSI_VT_OBJECT || !Jsi_ObjIsArray(interp, _this->d.obj))
return Jsi_LogError("expected array object");
Jsi_RC rc = JSI_OK;
int curlen, nsiz, i, maa = 0;
Jsi_O... | vuln | Safe | C/C++ |
void printIFD(std::ostream& out, PrintStructureOption option, uint64_t dir_offset, int depth)
{
BasicIo& io = Image::io();
depth++;
bool bFirst = true;
// buffer
bool bPrint = true;
... | vuln | Vulnerable | Unknown |
bool HaarEvaluator::read(const FileNode& node, Size _origWinSize)
{
if (!FeatureEvaluator::read(node, _origWinSize))
return false;
size_t i, n = node.size();
CV_Assert(n > 0);
if(features.empty())
features = makePtr<std::vector<Feature> >();
if(optfeatures.empty())
optfeature... | vuln | Safe | Unknown |
/*
dcraw.c -- Dave Coffin's raw photo decoder
Copyright 1997-2013 by Dave Coffin, dcoffin a cybercom o net
This is a command-line ANSI C program to convert raw photos from
any digital camera on any computer running any operating system.
No license is required to download and use dcraw.c. However,
t... | vuln | Safe | C/C++ |
/**
* $Id: ProxyServlet.java,v 1.4 2013/12/13 13:18:11 david Exp $
* Copyright (c) 2011-2012, JGraph Ltd
*/
package com.mxgraph.online;
import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.... | vuln | Safe | Java |
@EventHandler
private void appendTooltip(ItemStackTooltipEvent event) {
// Status effects
if (statusEffects.get()) {
if (event.itemStack.getItem() == Items.SUSPICIOUS_STEW) {
NbtCompound tag = event.itemStack.getNbt();
if (tag != null) {
... | vuln | Vulnerable | Java |
static ssize_t ucma_migrate_id(struct ucma_file *new_file,
const char __user *inbuf,
int in_len, int out_len)
{
struct rdma_ucm_migrate_id cmd;
struct rdma_ucm_migrate_resp resp;
struct ucma_context *ctx;
struct fd f;
struct ucma_file *cur_file;
int ret = 0;
if (copy_from_user(&cmd, inbuf, s... | vuln | Vulnerable | C/C++ |
cssp_read_tsrequest(STREAM token, STREAM pubkey)
{
STREAM s;
int length;
int tagval;
struct stream packet;
s = tcp_recv(NULL, 4);
if (s == NULL)
return False;
if (s->p[0] != (BER_TAG_SEQUENCE | BER_TAG_CONSTRUCTED))
{
logger(Protocol, Error,
"cssp_read_tsrequest(), expected BER_TAG_SEQUENC... | vuln | Safe | C/C++ |
@Operator
public Predicate<ChangeData> label(String name)
throws QueryParseException, IOException, ConfigInvalidException {
Set<Account.Id> accounts = null;
AccountGroup.UUID group = null;
Integer count = null;
PredicateArgs.Operator countOp = null;
// Parse for:
// label:Code-Review=1,... | vuln | Safe | Java |
int
parse_sym_line(buf, which_set)
char *buf;
int which_set;
{
int val, i;
struct symparse *symp;
char *bufp, *commentp, *altp;
if (strlen(buf) >= BUFSZ)
buf[BUFSZ - 1] = '\0';
/* convert each instance of whitespace (tabs, consecutive spaces)
into a single space; leading and trailing... | vuln | Safe | C/C++ |
static void set_k_acc(struct SYMBOL *s)
{
int i, j, nacc;
char accs[8], pits[8];
static char sharp_tb[8] = {26, 23, 27, 24, 21, 25, 22};
static char flat_tb[8] = {22, 25, 21, 24, 20, 23, 26};
if (s->u.key.sf > 0) {
for (nacc = 0; nacc < s->u.key.sf; nacc++) {
accs[nacc] = A_SH;
pits[nacc] = sharp_tb[nacc]... | vuln | Vulnerable | C/C++ |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | vuln | Vulnerable | C/C++ |
@Nonnull
public Optional<String> handle(@Nonnull String address, @Nonnull String nickname) {
Validate.notNull(address, "Address cannot be null!");
Validate.notNull(nickname, "Nickname cannot be null!");
// Increment the connections per second and check if it's bigger than max-cps in config.... | vuln | Vulnerable | Java |
function ri(e,t,n){var r=this;this._config.logVerbosity&&(e=e.use(ni)),this._config.proxy&&this._modules.proxy&&(e=this._modules.proxy.call(this,e)),this._config.keepAlive&&this._modules.keepAlive&&(e=this._modules.keepAlive(e));var o=e;if(t.abortSignal)var i=t.abortSignal.subscribe((function(){o.abort(),i()}));return!... | vuln | Safe | JavaScript |
;(function(exports) {
/**
* @license
* MIT License:
*
* Copyright (c) 2010-2013, Joe Walnes
* 2013-2018, Drew Noakes
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software ... | vuln | Safe | JavaScript |
public static void verify(Consumer<Exception> errorConsumer, PluginDescription... plugins) {
JsonArray root = new JsonArray();
String hash;
for (PluginDescription desc : plugins) {
hash = desc.sha256();
if (hash != null) root.add(hash);
}
try {
... | vuln | Vulnerable | Java |
function unescape(html) {
// explicitly match decimal, hex, and named HTML entities
return html.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/g, function(_, n) {
n = n.toLowerCase();
if (n === 'colon') return ':';
if (n.charAt(0) === '#') {
return n.charAt(1) === 'x'
? String.fromCharC... | vuln | Safe | JavaScript |
static int ffm_write_packet(AVFormatContext *s, int stream_index,
UINT8 *buf, int size, int force_pts)
{
AVStream *st = s->streams[stream_index];
FFMStream *fst = st->priv_data;
INT64 pts;
UINT8 header[FRAME_HEADER_SIZE];
int duration;
if (st->codec.codec_type == CODE... | vuln | Vulnerable | C/C++ |
int PDFiumEngine::GetMostVisiblePage() {
if (in_flight_visible_page_)
return *in_flight_visible_page_;
// We can call GetMostVisiblePage through a callback from PDFium. We have
// to defer the page deletion otherwise we could potentially delete the page
// that originated the calling JS request and dest... | vuln | Safe | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.