code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
static int try_decode_frame(AVStream *st, AVPacket *avpkt)
{
int16_t *samples;
AVCodec *codec;
int got_picture, data_size, ret=0;
AVFrame picture;
if(!st->codec->codec){
codec = avcodec_find_decoder(st->codec->codec_id);
if (!codec)
return -1;
ret = avcodec_open(s... | vuln | Vulnerable | C/C++ |
xfs_ioc_fsgeometry(
xfs_mount_t *mp,
void __user *arg)
{
xfs_fsop_geom_t fsgeo;
int error;
error = xfs_fs_geometry(mp, &fsgeo, 4);
if (error)
return -error;
if (copy_to_user(arg, &fsgeo, sizeof(fsgeo)))
return -XFS_ERROR(EFAULT);
return 0;
} | vuln | Safe | Unknown |
static char *parsetree_to_sql(struct ldb_module *module,
void *mem_ctx,
const struct ldb_parse_tree *t)
{
struct ldb_context *ldb;
const struct ldb_schema_attribute *a;
struct ldb_val value, subval;
char *wild_card_string;
char *child, *tmp;
char *ret = NULL;
char *attr;
unsigned int i;
ldb ... | vuln | Safe | C/C++ |
void silk_NLSF_stabilize(
opus_int16 *NLSF_Q15, /* I/O Unstable/stabilized normalized LSF vector in Q15 [L] */
const opus_int16 *NDeltaMin_Q15, /* I Min distance vector, NDeltaMin_Q15[L] must be >= 1 [L+1] */
const opus_int L /* I Number... | vuln | Vulnerable | C/C++ |
static int ocfs2_dio_get_block(struct inode *inode, sector_t iblock,
static int ocfs2_dio_wr_get_block(struct inode *inode, sector_t iblock,
struct buffer_head *bh_result, int create)
{
struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
struct ocfs2_inode_info *oi = OCFS2_I(inode);
struct ocfs2_write_ctxt... | vuln | Safe | C/C++ |
static int normalize_bits(int num, int width)
{
if (!num)
return 0;
if (num == -1)
return width;
if (num < 0)
num = ~num;
return width - av_log2(num) - 1;
} | vuln | Safe | C/C++ |
@Override
public long skip(long n) throws IOException {
return n < 0 ? 0 : read(SKIP_BUFFER, 0, (int) Math.min(n, SKIP_BUFFER_SIZE));
} | vuln | Vulnerable | Java |
/*
* Copyright (C) Igor Sysoev
* Copyright (C) NGINX, Inc.
*/
#include <njs_main.h>
#define njs_array_func(type) \
((type << 1) | NJS_ARRAY_FUNC)
#define njs_array_arg(type) \
((type << 1) | NJS_ARRAY_AR... | vuln | Safe | C/C++ |
static Image *ReadMIFFImage(const ImageInfo *image_info,
ExceptionInfo *exception)
{
#define BZipMaxExtent(x) ((x)+((x)/100)+600)
#define LZMAMaxExtent(x) ((x)+((x)/3)+128)
#define ThrowMIFFException(exception,message) \
{ \
if (quantum_info != (QuantumInfo *) NULL) \
quantum_info=DestroyQuantumInfo(quantum_i... | vuln | Safe | C/C++ |
static void gen_check_sr(DisasContext *dc, uint32_t sr, unsigned access)
{
if (!xtensa_option_bits_enabled(dc->config, sregnames[sr].opt_bits)) {
if (sregnames[sr].name) {
qemu_log("SR %s is not configured\n", sregnames[sr].name);
} else {
qemu_log("SR %d is not implemented\n... | vuln | Safe | C/C++ |
static int nl80211_get_ftm_responder_stats(struct sk_buff *skb,
struct genl_info *info)
{
struct cfg80211_registered_device *rdev = info->user_ptr[0];
struct net_device *dev = info->user_ptr[1];
struct wireless_dev *wdev = dev->ieee80211_ptr;
struct cfg80211_ftm_responder_stats ftm_stats = {};
struct sk_bu... | vuln | Safe | C/C++ |
static int ___sys_recvmsg(struct socket *sock, struct msghdr __user *msg,
struct msghdr *msg_sys, unsigned int flags, int nosec)
{
struct compat_msghdr __user *msg_compat =
(struct compat_msghdr __user *)msg;
struct iovec iovstack[UIO_FASTIOV];
struct iovec *iov = iovstack;
unsigned long cmsg_ptr;
int err... | vuln | Vulnerable | Unknown |
private void requestUploadOfFilesFromFileSystem(String localBasePath, String[] filePaths, int resultCode) {
if (localBasePath != null && filePaths != null) {
if (!localBasePath.endsWith("/")) {
localBasePath = localBasePath + "/";
}
String[] remotePaths = new... | vuln | Safe | Java |
BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert)
{
int i, j;
BIO *out = NULL, *btmp = NULL, *etmp = NULL, *bio = NULL;
X509_ALGOR *xa;
ASN1_OCTET_STRING *data_body = NULL;
const EVP_MD *evp_md;
const EVP_CIPHER *evp_cipher = NULL;
EVP_CIPHER_CTX *evp_ctx = NULL;
... | vuln | Safe | Unknown |
/*
* 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 | C/C++ |
static void x86_cpu_common_class_init(ObjectClass *oc, void *data)
{
X86CPUClass *xcc = X86_CPU_CLASS(oc);
CPUClass *cc = CPU_CLASS(oc);
DeviceClass *dc = DEVICE_CLASS(oc);
xcc->parent_realize = dc->realize;
dc->realize = x86_cpu_realizefn;
dc->props = x86_cpu_properties;
xcc->parent_reset =... | vuln | Vulnerable | C/C++ |
// SPDX-License-Identifier: GPL-2.0-only
#include <linux/types.h>
#include <linux/skbuff.h>
#include <linux/socket.h>
#include <linux/sysctl.h>
#include <linux/net.h>
#include <linux/module.h>
#include <linux/if_arp.h>
#include <linux/ipv6.h>
#include <linux/mpls.h>
#include <linux/netconf.h>
#include <linux/nospec.h>
... | vuln | Safe | C/C++ |
public function getUser(CakeRequest $request)
{
if (empty(self::$user)) {
if (self::$client) {
self::$user = self::$client;
// If $sync is true, allow the creation of the user from the certificate
$sync = Configure::read('CertAuth.syncUser');
if ($sync) {
if (!self::getRestUser()) return fals... | vuln | Safe | PHP |
private void readObject(ObjectInputStream s)
throws IOException, ClassNotFoundException
{
Object[] aoData = readObjectArray(s);
m_iFirst = 0;
m_iLast = aoData.length;
m_cElements = aoData.length - 1;
m_aoData = aoData;
} | vuln | Safe | Java |
GF_Err gf_hinter_finalize(GF_ISOFile *file, GF_SDP_IODProfile IOD_Profile, u32 bandwidth)
{
u32 i, sceneT, odT, descIndex, size, size64;
GF_InitialObjectDescriptor *iod;
GF_SLConfig slc;
GF_ISOSample *samp;
Bool remove_ocr;
u8 *buffer;
char buf64[5000], sdpLine[5100];
gf_isom_sdp_clean(file);
if (bandwidth)... | vuln | Vulnerable | C/C++ |
refreshToken() {
return new Promise((resolve, reject) => {
Vue.prototype.$axios.get('users/refreshtoken')
.then((response) => {
var token = response.data.datas.token;
this.user = jwtDecode(token);
resolve()
})
.catch... | vuln | Safe | JavaScript |
Mangle(input, control) /* returns a pointer to a controlled Mangle */
char *input;
char *control;
{
int limit;
register char *ptr;
static char area[STRINGSIZE * 2] = {0};
char area2[STRINGSIZE * 2] = {0};
strcpy(area, input);
for (ptr = control; *ptr; ptr++)
{
switch (*ptr)
{
ca... | vuln | Safe | C/C++ |
@Override
public Supplier<OpenRegistry<BiomeBuilder>> registrySupplier() {
return () -> pack.getRegistryFactory().create(registry -> (TypeLoader<BiomeBuilder>) (t, c, loader) -> {
if(c.equals("SELF")) return null;
BiomeBuilder obj = registry.get((String) c);
if(obj == nul... | vuln | Safe | Java |
int tls1_set_server_sigalgs(SSL *s)
{
int al;
size_t i;
/* Clear any shared sigtnature algorithms */
if (s->cert->shared_sigalgs) {
OPENSSL_free(s->cert->shared_sigalgs);
s->cert->shared_sigalgs = NULL;
s->cert->shared_sigalgslen = 0;
}
/* Clear certificate digests and va... | vuln | Safe | Unknown |
iscsi_unmap_cb(struct iscsi_context *iscsi, int status,
void *command_data, void *opaque)
{
IscsiAIOCB *acb = opaque;
if (acb->canceled != 0) {
qemu_aio_release(acb);
scsi_free_scsi_task(acb->task);
acb->task = NULL;
return;
}
acb->status = 0;
if ... | vuln | Vulnerable | C/C++ |
Status ShapeRefiner::InferShapesForFunctionSubNode(
const Node* node, InferenceContext* outer_context) {
TF_RETURN_IF_ERROR(AddNodeInternal(node, outer_context));
InferenceContext* node_context = CHECK_NOTNULL(GetContext(node));
if (StringPiece(node->type_string()) == kArgOp) {
// Handle special node: fu... | vuln | Safe | C/C++ |
public @Nullable ConversationMessage getItem(int position) {
position = isTypingViewEnabled() ? position - 1 : position;
if (position < 0) {
return null;
} else {
if (pagingController != null) {
pagingController.onDataNeededAroundIndex(position);
}
if (position < getItemCou... | vuln | Safe | Java |
@Override
public void run() {
TcpSocketClient socketClient = getTcpClient(cId);
socketClient.destroy();
socketMap.remove(cId);
} | vuln | Vulnerable | Java |
// @flow
// A database adapter that works with data exported from the hosted
// Parse database.
// @flow-disable-next
import { Parse } from 'parse/node';
// @flow-disable-next
import _ from 'lodash';
// @flow-disable-next
import intersect from 'intersect';
// @flow-disable-next
import deepcopy from 'deepcopy';
import... | vuln | Safe | JavaScript |
// SPDX-License-Identifier: BSD-2-Clause
/*
* Copyright (c) 2015-2016, Linaro Limited
* Copyright (c) 2014, STMicroelectronics International N.V.
*/
#include <assert.h>
#include <bench.h>
#include <compiler.h>
#include <initcall.h>
#include <io.h>
#include <kernel/linker.h>
#include <kernel/msg_param.h>
#include <k... | vuln | Safe | C/C++ |
package org.jolokia.jvmagent.handler;
/*
* Copyright 2009-2013 Roland Huss
*
* 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
*
* U... | vuln | Safe | Java |
function footnote_inline(state, silent) {
var labelStart,
labelEnd,
footnoteId,
token,
tokens,
max = state.posMax,
start = state.pos;
if (start + 2 >= max) { return false; }
if (state.src.charCodeAt(start) !== 0x5E/* ^ */) { return false; }
if (state.src.... | vuln | Safe | JavaScript |
UWORD16 impeg2d_get_mb_addr_incr(stream_t *ps_stream)
{
UWORD16 u2_mb_addr_incr = 0;
while (impeg2d_bit_stream_nxt(ps_stream,MB_ESCAPE_CODE_LEN) == MB_ESCAPE_CODE &&
ps_stream->u4_offset < ps_stream->u4_max_offset)
{
impeg2d_bit_stream_flush(ps_stream,MB_ESCAPE_CODE_LEN);
u2... | vuln | Safe | C/C++ |
static void rtsp_cmd_pause(HTTPContext *c, const char *url, RTSPHeader *h)
{
HTTPContext *rtp_c;
rtp_c = find_rtp_session_with_url(url, h->session_id);
if (!rtp_c) {
rtsp_reply_error(c, RTSP_STATUS_SESSION);
return;
}
if (rtp_c->state != HTTPSTATE_SEND_DATA &&
rtp_c->sta... | vuln | Safe | C/C++ |
makeOperatorDependencies(HeapTuple tuple,
bool makeExtensionDep,
bool isUpdate)
{
Form_pg_operator oper = (Form_pg_operator) GETSTRUCT(tuple);
ObjectAddress myself,
referenced;
myself.classId = OperatorRelationId;
myself.objectId = oper->oid;
myself.objectSubId = 0;
/*
* If we are updating t... | vuln | Safe | Unknown |
static void
copy_compressed_bytes (BITCODE_RC *restrict dst, BITCODE_RC *restrict src,
BITCODE_RC *restrict src_end, int length)
{
while (length >= 32)
{
copy_16 (16);
copy_16 (0);
src += 32;
length -= 32;
if (src > src_end)
return;
}
switch (le... | vuln | Safe | C/C++ |
YUV2PACKED16WRAPPER(yuv2, rgb48, rgb48be, PIX_FMT_RGB48BE)
YUV2PACKED16WRAPPER(yuv2, rgb48, rgb48le, PIX_FMT_RGB48LE)
YUV2PACKED16WRAPPER(yuv2, rgb48, bgr48be, PIX_FMT_BGR48BE)
YUV2PACKED16WRAPPER(yuv2, rgb48, bgr48le, PIX_FMT_BGR48LE)
static av_always_inline void
yuv2rgb_write(uint8_t *_dest, int i, unsigned Y1, unsig... | vuln | Vulnerable | C/C++ |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import datetime, timedelta
from functools import partial
from itertools import groupby
from odoo import api, fields, models, _
from odoo.exceptions import UserError, ValidationError
from odoo.tools.misc im... | vuln | Safe | Python |
NTSTATUS smb2cli_session_set_session_key(struct smbXcli_session *session,
const DATA_BLOB _session_key,
const struct iovec *recv_iov)
{
struct smbXcli_conn *conn = session->conn;
uint16_t no_sign_flags = 0;
uint8_t session_key[16];
bool check_signature = true;
uint32_t hdr_flags;
NTSTATUS status;
str... | vuln | Safe | Unknown |
int qemu_register_machine(QEMUMachine *m)
{
char *name = g_strconcat(m->name, TYPE_MACHINE_SUFFIX, NULL);
TypeInfo ti = {
.name = name,
.parent = TYPE_MACHINE,
.class_init = machine_class_init,
.class_data = (void *)m,
};
type_register(&ti);
g_free(name);
... | vuln | Safe | C/C++ |
void set(int currentIndex, AppDetailsItem appDetailsItem) {
mAdapterList.set(currentIndex, appDetailsItem);
notifyItemChanged(currentIndex);
// Update the value in the app ops list in view model
if (neededProperty == APP_OPS) {
new Thread(() -> mainModel.s... | vuln | Vulnerable | Java |
@WorkerThread
@GuardedBy("blockerLocker")
public boolean togglePermission(final AppDetailsPermissionItem permissionItem) {
if (mIsExternalApk) return false;
boolean isSuccessful;
try {
if (!permissionItem.isGranted()) {
Log.d(TAG, "Granting permission: " + per... | vuln | Vulnerable | Java |
def _find_host_from_wwpn(self, connector):
for wwpn in connector['wwpns']:
ssh_cmd = 'svcinfo lsfabric -wwpn %s -delim !' % wwpn
out, err = self._run_ssh(ssh_cmd)
if not len(out.strip()):
# This WWPN is not in use
continue
host_li... | vuln | Vulnerable | Python |
static VALUE
parse_io(VALUE klass, VALUE io, VALUE encoding)
{
xmlParserCtxtPtr ctxt;
xmlCharEncoding enc = (xmlCharEncoding)NUM2INT(encoding);
if (!rb_respond_to(io, id_read)) {
rb_raise(rb_eTypeError, "argument expected to respond to :read");
}
ctxt = xmlCreateIOParserCtxt(NULL, NULL,
... | vuln | Safe | C/C++ |
bool nfc_scene_detect_reader_on_event(void* context, SceneManagerEvent event) {
Nfc* nfc = context;
NfcReaderRequestData* reader_data = &nfc->dev->dev_data.reader_data;
uint32_t state = scene_manager_get_scene_state(nfc->scene_manager, NfcSceneDetectReader);
bool consumed = false;
if(event.type == ... | vuln | Vulnerable | C/C++ |
static
rpmTagVal headerMergeLegacySigs(Header h, Header sigh, char **msg)
{
const struct taglate_s *xl;
struct rpmtd_s td;
rpmtdReset(&td);
for (xl = xlateTags; xl->stag; xl++) {
/* There mustn't be one in the main header */
if (headerIsEntry(h, xl->xtag))
break;
if (headerGet(sigh, xl->stag, &... | vuln | Safe | C/C++ |
read_system_page (Bit_Chain *dat, int64_t size_comp, int64_t size_uncomp,
int64_t repeat_count)
{
int i;
int error = 0;
int64_t pesize; // Pre RS encoded size
int64_t block_count; // Number of RS encoded blocks
int64_t page_size;
long pedata_size;
BITCODE_RC *rsdata; // RS encoded... | vuln | Vulnerable | Unknown |
@Override
public Object pack(Object obj) throws Exception {
UIDefaults uiDefaults = new UIDefaults();
Object multiUIDefaults =
ReflectionHelper.newInstance("javax.swing.MultiUIDefaults", new Object[]{new UIDefaults[]{uiDefaults}});
uiDefaults.put("lazyValue", obj);
r... | vuln | Safe | Java |
@Override
public IMqttToken subscribe(MqttSubscription[] subscriptions, Object userContext, MqttActionListener callback,
IMqttMessageListener messageListener, MqttProperties subscriptionProperties) throws MqttException {
int subId = 0;
try {
subId = subscriptionProperties.getSubscriptionIdentifiers().get(0)... | vuln | Safe | Java |
import logging
from pathlib import Path
from shutil import which
from elasticsearch.exceptions import RequestError
from flask import Flask
from flask_compress import Compress
from flask_login import LoginManager
from archivy import helpers
from archivy.api import api_bp
from archivy.models import User
from archivy.co... | vuln | Vulnerable | Python |
virtual ~InputMethodLibraryImpl() {
} | vuln | Vulnerable | C/C++ |
def anyWeirdJsObjField(obj: JsObject, maxLength: Int): Option[String] = {
for ((fieldName, fieldValue) <- obj.fields) {
if (fieldName.isEmpty) return Some("Empty field name")
if (!fieldName.isOkVariableName) return Some(s"Weird field name: $fieldName")
if (fieldName.length > maxLength) return Some... | vuln | Vulnerable | Scala |
vhost_scsi_send_evt(struct vhost_scsi *vs,
struct vhost_scsi_tpg *tpg,
struct se_lun *lun,
u32 event,
u32 reason)
{
struct vhost_scsi_evt *evt;
evt = vhost_scsi_allocate_evt(vs, event, reason);
if (!evt)
return;
if (tpg && lun) {
/* TODO: share lun setup code with virtio-scsi.ko */
/*
... | vuln | Vulnerable | Unknown |
int vnc_client_io_error(VncState *vs, int ret, int last_errno)
{
if (ret == 0 || ret == -1) {
if (ret == -1) {
switch (last_errno) {
case EINTR:
case EAGAIN:
#ifdef _WIN32
case WSAEWOULDBLOCK:
#endif
return 0;
de... | vuln | Vulnerable | C/C++ |
StatusWith<std::size_t> SnappyMessageCompressor::decompressData(ConstDataRange input,
DataRange output) {
bool ret =
snappy::RawUncompress(input.data(), input.length(), const_cast<char*>(output.data()));
if (!ret) {
return Status{E... | vuln | Vulnerable | Unknown |
const bootbox = require('bootbox');
const Requisition = require('../model/Requisition');
require('../services/Requisitions');
require('../services/Synchronize');
/**
* @author Alejandro Galue <agalue@opennms.org>
* @copyright 2014 The OpenNMS Group, Inc.
*/
(function() {
'use strict';
angular.module('onms-req... | vuln | Vulnerable | Java |
/******************************************************************************
*
* Module Name: nsutils - Utilities for accessing ACPI namespace, accessing
* parents and siblings and Scope manipulation
*
*****************************************************************************/
/*
* C... | vuln | Safe | C/C++ |
static struct sctp_chunk *_sctp_make_chunk(const struct sctp_association *asoc,
__u8 type, __u8 flags, int paylen,
gfp_t gfp)
{
struct sctp_chunkhdr *chunk_hdr;
struct sctp_chunk *retval;
struct sk_buff *skb;
struct sock *sk;
/* No need to allocate LL here, as this is only a chunk. */
skb = alloc... | vuln | Vulnerable | Unknown |
static int load_sofa(AVFilterContext *ctx, char *filename, int *samplingrate)
{
struct SOFAlizerContext *s = ctx->priv;
int ncid, n_dims, n_vars, n_gatts, n_unlim_dim_id, status;
char data_delay_dim_name[NC_MAX_NAME];
float *sp_a, *sp_e, *sp_r, *data_ir;
char *sofa_conventions;
char dim_nam... | vuln | Safe | C/C++ |
int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src)
{
const AVCodec *orig_codec = dest->codec;
uint8_t *orig_priv_data = dest->priv_data;
if (avcodec_is_open(dest)) {
av_log(dest, AV_LOG_ERROR,
"Tried to copy AVCodecContext %p into already-initialized %p\n",
... | vuln | Safe | C/C++ |
GC_API void * GC_CALL GC_generic_malloc(size_t lb, int k)
{
void * result;
DCL_LOCK_STATE;
if (EXPECT(GC_have_errors, FALSE))
GC_print_all_errors();
GC_INVOKE_FINALIZERS();
if (SMALL_OBJ(lb)) {
LOCK();
result = GC_generic_malloc_inner((word)lb, k);
UNLOCK();
} else... | vuln | Safe | C/C++ |
PHP_FUNCTION(openssl_random_pseudo_bytes)
{
long buffer_length;
unsigned char *buffer = NULL;
zval *zstrong_result_returned = NULL;
int strong_result = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|z", &buffer_length, &zstrong_result_returned) == FAILURE) {
... | vuln | Vulnerable | Unknown |
protected function _mkdir($path, $name) {
$path = $this->_joinPath($path, $name);
if (ftp_mkdir($this->connect, $path) === false) {
return false;
}
$this->options['dirMode'] && ftp_chmod($this->connect, $this->options['dirMode'], $path);
return $path;
} | vuln | Safe | JavaScript |
static int fscrypt_d_revalidate(struct dentry *dentry, unsigned int flags)
{
struct dentry *dir;
struct fscrypt_info *ci;
int dir_has_key, cached_with_key;
if (flags & LOOKUP_RCU)
return -ECHILD;
dir = dget_parent(dentry);
if (!d_inode(dir)->i_sb->s_cop->is_encrypted(d_inode(dir))) {
dput(dir);
return 0;
... | vuln | Vulnerable | Unknown |
PredictorEncodeTile(TIFF* tif, uint8* bp0, tmsize_t cc0, uint16 s)
{
static const char module[] = "PredictorEncodeTile";
TIFFPredictorState *sp = PredictorState(tif);
uint8 *working_copy;
tmsize_t cc = cc0, rowsize;
unsigned char* bp;
int result_code;
assert(sp != NULL);
assert(sp->encodepfunc !=... | vuln | Vulnerable | Unknown |
void gf_isom_sample_entry_init(GF_SampleEntryBox *ent)
{
} | vuln | Vulnerable | C/C++ |
static int dirac_probe(AVProbeData *p)
{
if (AV_RL32(p->buf) == MKTAG('B', 'B', 'C', 'D'))
return AVPROBE_SCORE_MAX;
else
return 0;
} | vuln | Vulnerable | C/C++ |
match(struct magic_set *ms, struct magic *magic, uint32_t nmagic,
const unsigned char *s, size_t nbytes, size_t offset, int mode, int text,
int flip, int *returnval)
{
uint32_t magindex = 0;
unsigned int cont_level = 0;
int need_separator = 0;
int returnvalv = 0, e; /* if a match is found it is set to 1*/
... | vuln | Vulnerable | Unknown |
/*
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2000-2012
* All rights reserved
*
* This file is part of GPAC / ISO Media File Format sub-project
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU L... | vuln | Vulnerable | C/C++ |
@Override
public T parse(final InputStream contents) throws IOException, ParserConfigurationException, SAXException {
final var spf = SAXParserFactory.newInstance();
spf.setNamespaceAware(true);
final var xmlReader = spf.newSAXParser().getXMLReader();
xmlReader.setEntityResolver((publicId, systemId) -> new Inp... | vuln | Vulnerable | Java |
static int dnxhd_encode_picture(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data)
{
DNXHDEncContext *ctx = avctx->priv_data;
int first_field = 1;
int offset, i, ret;
if (buf_size < ctx->cid_table->frame_size) {
av_log(avctx, AV_LOG_ERROR, "output buffer is too small to compres... | vuln | Safe | C/C++ |
const sharp = require(`./safe-sharp`)
const { generateImageData } = require(`./image-data`)
const imageSize = require(`probe-image-size`)
const { isCI } = require(`gatsby-core-utils/ci`)
const _ = require(`lodash`)
const fs = require(`fs-extra`)
const path = require(`path`)
const { createArgsDigest } = require(`./pro... | vuln | Vulnerable | JavaScript |
static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg)
{
struct fib* srbfib;
int status;
struct aac_srb *srbcmd = NULL;
struct user_aac_srb *user_srbcmd = NULL;
struct user_aac_srb __user *user_srb = arg;
struct aac_srb_reply __user *user_reply;
struct aac_srb_reply* reply;
u32 fibsize = 0;
u32 fl... | vuln | Safe | C/C++ |
'X-Parse-Session-Token': user1.getSessionToken(),
},
},
});
let foundGraphQLClassReadPreference = false;
let foundUserClassReadPreference = false;
databaseAdapter.database.serverConfig.cursor.calls
.... | vuln | Vulnerable | JavaScript |
function download_item($dir, $item)
{
// Security Fix:
$item=basename($item);
if (!permissions_grant($dir, $item, "read"))
show_error($GLOBALS["error_msg"]["accessfunc"]);
if (!get_is_file($dir,$item))
{
_debug("error download");
show_error($item.": ".$GLOBALS["error_msg"]["fileexist"]);
... | vuln | Vulnerable | PHP |
void ff_hevc_set_qPy(HEVCContext *s, int xC, int yC,
int xBase, int yBase, int log2_cb_size)
{
int qp_y = get_qPy_pred(s, xC, yC, xBase, yBase, log2_cb_size);
if (s->HEVClc->tu.cu_qp_delta != 0) {
int off = s->sps->qp_bd_offset;
s->HEVClc->qp_y = ((qp_y + s->HEVClc->tu.cu_qp... | vuln | Vulnerable | C/C++ |
@Override
protected void executeAction() {
runBackground(
() -> {
if (!MapTool.isPersonalServer()) {
MapTool.showError("msg.error.alreadyRunningServer");
return;
}
// TODO: Need to shut down the existing... | vuln | Safe | Java |
static int vf_load_font(DviParams *params, DviFont *font)
{
FILE *p;
Uchar *macros;
int msize;
int mlen;
Int32 checksum;
long alpha, beta, z;
int op;
int i;
int nchars;
int loc, hic;
DviFontRef *last;
macros = NULL;
msize = mlen = 0;
p = font->in;
if(fuget1(p) != 247 || fuget1(p) != 202)
goto badvf... | vuln | Vulnerable | Unknown |
gplotCreate(const char *rootname,
l_int32 outformat,
const char *title,
const char *xlabel,
const char *ylabel)
{
char *newroot;
char buf[L_BUFSIZE];
l_int32 badchar;
GPLOT *gplot;
PROCNAME("gplotCreate");
if (!rootname)
return (GPLOT ... | vuln | Safe | C/C++ |
void ieee80211_sta_ps_deliver_wakeup(struct sta_info *sta)
{
struct ieee80211_sub_if_data *sdata = sta->sdata;
struct ieee80211_local *local = sdata->local;
struct sk_buff_head pending;
int filtered = 0, buffered = 0, ac;
unsigned long flags;
clear_sta_flag(sta, WLAN_STA_SP);
BUILD_BUG_ON(BITS_TO_LONGS(IEEE802... | vuln | Safe | C/C++ |
processDataRcvd(ptcpsess_t *const __restrict__ pThis,
char **buff,
const int buffLen,
struct syslogTime *stTime,
const time_t ttGenTime,
multi_submit_t *pMultiSub,
unsigned *const __restrict__ pnMsgs)
{
DEFiRet;
char c = **buff;
int octatesToCopy, octatesToDiscard;
uchar *propPeerName = NULL;
int lenPeerName... | vuln | Vulnerable | Unknown |
/* Parser-tokenizer link implementation */
#include "pgenheaders.h"
#include "tokenizer.h"
#include "node.h"
#include "grammar.h"
#include "parser.h"
#include "parsetok.h"
#include "errcode.h"
#include "graminit.h"
/* Forward */
static node *parsetok(struct tok_state *, grammar *, int, perrdetail *, int *);
static ... | vuln | Safe | Python |
void TNEFFillMapi(TNEFStruct *TNEF, BYTE *data, DWORD size, MAPIProps *p) {
int i, j;
DWORD num;
BYTE *d;
MAPIProperty *mp;
DWORD type;
DWORD length;
variableLength *vl;
WORD temp_word;
DWORD temp_dword;
DDWORD temp_ddword;
int count = -1;
int offset;
d = data;
p->count = SwapDWord((BYTE*)... | vuln | Vulnerable | C/C++ |
int read_next_sample(int ifd, int action, int curr, char *file, int *rtype, int tab,
struct file_magic *file_magic, struct file_activity *file_actlst,
struct tm *rectime, struct tm *loctime, int oneof)
{
int rc;
char rec_hdr_tmp[MAX_RECORD_HEADER_SIZE];
/* Read current record */
if ((rc = read_record... | vuln | Vulnerable | Unknown |
public void readFromPacketBuf(PacketByteBuf buf) {
NbtCompound compound = buf.readNbt();
ShulkerBoxTooltip.synchronisedWithServer = true;
if (compound.contains("server", NbtType.COMPOUND)) {
NbtCompound serverTag = compound.getCompound("server");
if (serverTag.contains("clientIntegration", Nbt... | vuln | Safe | Java |
function init(_settings, _runtime) {
settings = _settings;
runtime = _runtime;
try {
if (settings.editorTheme.projects.enabled === true) {
projectsEnabled = true;
} else if (settings.editorTheme.projects.enabled === false) {
projectLogMessages.push(log._("storage.loc... | vuln | Safe | JavaScript |
void rand_bytes(uint8_t *buf, size_t size) {
uint8_t hash[RLC_MD_LEN];
int carry, len = (RLC_RAND_SIZE - 1)/2;
ctx_t *ctx = core_get();
if (sizeof(int) > 2 && size > (1 << 16)) {
RLC_THROW(ERR_NO_VALID);
return;
}
/* buf = hash_gen(size) */
rand_gen(buf, size);
/* H = hash(03 || V) */
ctx->rand[0] = 0x3... | vuln | Safe | C/C++ |
static void tftp_handle_error(Slirp *slirp, struct sockaddr_storage *srcsas,
struct tftp_t *tp, int pktlen)
{
int s;
s = tftp_session_find(slirp, srcsas, tp);
if (s < 0) {
return;
}
tftp_session_terminate(&slirp->tftp_sessions[s]);
} | vuln | Vulnerable | Unknown |
public static XMLMemento createReadRoot(Reader reader, String baseDir)
throws Exception {
String errorMessage = null;
Exception exception = null;
DocumentBuilderFactory factory = null;
Object attributeDTDOldValue = null;
Object attributeSchemaOldValue = null;
try {
factory = DocumentBuilderFactory.new... | vuln | Safe | Java |
protected int ensureInitialized(Frame frameNext)
{
return frameNext.f_nDepth > 128
? raiseException("Stack overflow")
: frameNext.f_function.ensureInitialized(this, frameNext);
} | vuln | Safe | Java |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nebula, Inc.
#
# 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
#
# ... | vuln | Vulnerable | JavaScript |
static uint64_t macio_nvram_readb(void *opaque, hwaddr addr,
unsigned size)
{
MacIONVRAMState *s = opaque;
uint32_t value;
addr = (addr >> s->it_shift) & (s->size - 1);
value = s->data[addr];
NVR_DPRINTF("readb addr %04" HWADDR_PRIx " val %" PRIx32 "\n",
... | vuln | Safe | C/C++ |
public void translate(ServerTradeListPacket packet, GeyserSession session) {
Inventory openInventory = session.getOpenInventory();
if (!(openInventory instanceof MerchantContainer && openInventory.getId() == packet.getWindowId())) {
return;
}
// Retrieve the fake villager in... | vuln | Vulnerable | Java |
static int jas_iccprof_gettagtab(jas_stream_t *in, jas_icctagtab_t *tagtab)
{
int i;
jas_icctagtabent_t *tagtabent;
if (tagtab->ents) {
jas_free(tagtab->ents);
tagtab->ents = 0;
}
if (jas_iccgetuint32(in, &tagtab->numents))
goto error;
if (!(tagtab->ents = jas_malloc(tagtab->numents *
sizeof(jas_icctagt... | vuln | Vulnerable | Unknown |
# Copyright (c) 2016 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a copy of G... | vuln | Vulnerable | Python |
protected void showPicker(final InteractionDialogAPI dialog, final Map<String, MemoryAPI> memoryMap) {
List<FleetMemberAPI> members = getEligibleShips(false);
int cols = Math.min(members.size(), 7);
if (cols < 4) cols = 4;
int rows = (int)Math.ceil(members.size()/(float)cols);
if (rows == 0) rows = 1;
dial... | vuln | Safe | Java |
int ff_raw_read_partial_packet(AVFormatContext *s, AVPacket *pkt)
{
int ret, size;
size = RAW_PACKET_SIZE;
if (av_new_packet(pkt, size) < 0)
return AVERROR(ENOMEM);
pkt->pos= avio_tell(s->pb);
pkt->stream_index = 0;
ret = ffio_read_partial(s->pb, pkt->data, size);
if (ret < 0) {
... | vuln | Safe | C/C++ |
void MBMotionComp(
VideoDecData *video,
int CBP
)
{
/*----------------------------------------------------------------------------
; Define all local variables
----------------------------------------------------------------------------*/
/* Previous Video Object Plane */
Vop *prev = video->prevVop;
/* ... | vuln | Vulnerable | C/C++ |
static int io_uring_flush(struct file *file, void *data)
{
struct io_ring_ctx *ctx = file->private_data;
/*
* If the task is going away, cancel work it may have pending
*/
if (fatal_signal_pending(current) || (current->flags & PF_EXITING))
data = NULL;
io_uring_cancel_task_requests(ctx, data);
io_uring_att... | vuln | Safe | Unknown |
public void send(OutMessage message) {
if (wsPendingClientContext != null) {
// This is normally done in the old connecton's `onClose()`, but that doesn't always fire
// (e.g., browser crash)
this.finalizeReplacementConnection();
}
String messageJson = null;
try {
messageJson = ... | vuln | Safe | Java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.