code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
/*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org
*
* 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 without restriction, including without limitation the rights
* to use, copy,... | vuln | Vulnerable | Java |
static int dpcm_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame_ptr, AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
const uint8_t *buf_end = buf + buf_size;
DPCMContext *s = avctx->priv_data;
int out = 0, ret;
int pred... | vuln | Vulnerable | Unknown |
function renderFile(file)
{
if (prevDiv == null)
{
return;
}
prevDiv.style.background = 'transparent';
prevDiv.innerText = '';
function showRenderMsg(msg)
{
prevDiv.style.background = 'transparent';
prevDiv.innerText = '';
var status = document.createElement('div');
status.classNa... | vuln | Safe | JavaScript |
/* Copyright 2016 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 uint32_t m5206_mbar_readw(void *opaque, target_phys_addr_t offset)
{
m5206_mbar_state *s = (m5206_mbar_state *)opaque;
int width;
offset &= 0x3ff;
if (offset >= 0x200) {
hw_error("Bad MBAR read offset 0x%x", (int)offset);
}
width = m5206_mbar_width[offset >> 2];
if (width > 2)... | vuln | Safe | C/C++ |
public boolean isLandscape() {
// DisplayMetrics from activity context knows about MultiWindow feature
// while DisplayMetrics from app context doesn't
return DeviceUtils.isLandscape(getParentActivity());
} | vuln | Vulnerable | Java |
"use strict";
var osmStream = require('osm-stream'),
reqwest = require('reqwest'),
moment = require('moment'),
_ = require('underscore'),
LRU = require('lru-cache'),
query_string = require('querystring');
var bboxArray = ["-90.0", "-180.0", "90.0", "180.0"];
var mapCenter = [51.505, -0.09];
var fi... | vuln | Safe | JavaScript |
protected function renderImageByGD($code)
{
$image = imagecreatetruecolor($this->width, $this->height);
$backColor = imagecolorallocate(
$image,
(int) ($this->backColor % 0x1000000 / 0x10000),
(int) ($this->backColor % 0x10000 / 0x100),
$this->backCol... | vuln | Vulnerable | PHP |
static int thp_read_header(AVFormatContext *s,
AVFormatParameters *ap)
{
ThpDemuxContext *thp = s->priv_data;
AVStream *st;
AVIOContext *pb = s->pb;
int64_t fsize= avio_size(pb);
int i;
avio_rb32(pb);
thp->version = avio_rb32(pb... | vuln | Safe | C/C++ |
static int build_def_list(Picture *def, Picture **in, int len, int is_long, int sel)
{
int i[2] = { 0 };
int index = 0;
while (i[0] < len || i[1] < len) {
while (i[0] < len && !(in[i[0]] && (in[i[0]]->reference & sel)))
i[0]++;
while (i[1] < len && !(in[i[1]] && (in[i[1]]->refer... | vuln | Vulnerable | C/C++ |
void PaymentRequest::Retry(mojom::PaymentValidationErrorsPtr errors) {
if (!client_.is_bound() || !binding_.is_bound()) {
DLOG(ERROR) << "Attempted Retry(), but binding(s) missing.";
OnConnectionTerminated();
return;
}
if (!display_handle_) {
DLOG(ERROR) << "Attempted Retry(), but display_han... | vuln | Vulnerable | C/C++ |
produce_frozen_state (const char *name)
{
FILE *file;
int h;
symbol *sym;
const builtin *bp;
if (file = fopen (name, O_BINARY ? "wb" : "w"), !file)
{
M4ERROR ((warning_status, errno, "%s", name));
return;
}
/* Write a recognizable header. */
xfprintf (file, "# This is a frozen stat... | vuln | Safe | Unknown |
from urllib.parse import urlparse
from urllib.request import url2pathname
from django.conf import settings
from django.contrib.staticfiles import utils
from django.contrib.staticfiles.views import serve
from django.http import Http404
from .http import AsgiHandler
class StaticFilesWrapper:
"""
ASGI applicat... | vuln | Vulnerable | Python |
int http_parse_cont_len_header(struct ist *value, unsigned long long *body_len,
int not_first)
{
char *e, *n;
unsigned long long cl;
struct ist word;
int check_prev = not_first;
word.ptr = value->ptr;
e = value->ptr + value->len;
while (1) {
if (word.ptr >= e) {
/* empty hea... | vuln | Safe | C/C++ |
@csrf.csrf_protect
def subscribe_for_tags(request):
"""process subscription of users by tags"""
#todo - use special separator to split tags
tag_names = request.REQUEST.get('tags','').strip().split()
pure_tag_names, wildcards = forms.clean_marked_tagnames(tag_names)
if request.user.is_authenticated()... | vuln | Vulnerable | Python |
static void mirror_start_job(const char *job_id, BlockDriverState *bs,
int creation_flags, BlockDriverState *target,
const char *replaces, int64_t speed,
uint32_t granularity, int64_t buf_size,
BlockMirro... | vuln | Safe | C/C++ |
static int fourxm_read_packet(AVFormatContext *s,
AVPacket *pkt)
{
FourxmDemuxContext *fourxm = s->priv_data;
ByteIOContext *pb = &s->pb;
unsigned int fourcc_tag;
unsigned int size, out_size;
int ret = 0;
int track_number;
int packet_read = 0;
unsigned char ... | vuln | Vulnerable | C/C++ |
/*!
* VisualEditor user interface MWMediaDialog class.
*
* @copyright 2011-2020 VisualEditor Team and others; see AUTHORS.txt
* @license The MIT License (MIT); see LICENSE.txt
*/
/**
* Dialog for inserting and editing MediaWiki media.
*
* @class
* @extends ve.ui.NodeDialog
*
* @constructor
* @param {Object... | vuln | Safe | JavaScript |
makeOperatorDependencies(HeapTuple tuple, 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 the operator, delete any existing entr... | vuln | Safe | Unknown |
static int __check_block_validity(struct inode *inode, const char *func,
unsigned int line,
struct ext4_map_blocks *map)
{
if (ext4_has_feature_journal(inode->i_sb) &&
(inode->i_ino ==
le32_to_cpu(EXT4_SB(inode->i_sb)->s_es->s_journal_inum)))
return 0;
if (!ext4_data_block_valid(EXT4_SB(inode->i_... | vuln | Vulnerable | Unknown |
int rpmfiSetFX(rpmfi fi, int fx)
{
int i = -1;
if (fi != NULL && fx >= 0 && fx < rpmfilesFC(fi->files)) {
int dx = fi->j;
i = fi->i;
fi->i = fx;
fi->j = rpmfilesDI(fi->files, fi->i);
i = fi->i;
if (fi->j != dx && fi->onChdir) {
int chrc = fi->onChdir(fi, fi->onChdirData);
if (chrc < 0)
i = c... | vuln | Safe | C/C++ |
/*
** vm.c - virtual machine for mruby
**
** See Copyright Notice in mruby.h
*/
#include <mruby.h>
#include <mruby/array.h>
#include <mruby/class.h>
#include <mruby/hash.h>
#include <mruby/irep.h>
#include <mruby/numeric.h>
#include <mruby/proc.h>
#include <mruby/range.h>
#include <mruby/string.h>
#include <mruby/vari... | vuln | Safe | C/C++ |
formatItem: function(data) {
var s = data[options.nameKey],
desc;
if (options.descKey) {
desc = $('<div/>').text(data[options.descKey]).html();
s += " <span>(" + desc + ")</span>";
}
... | vuln | Safe | JavaScript |
rdpdr_process(STREAM s)
{
uint32 handle;
uint16 vmin;
uint16 component;
uint16 pakid;
#if WITH_DEBUG_RDP5
printf("--- rdpdr_process ---\n");
hexdump(s->p, s->end - s->p);
#endif
in_uint16(s, component);
in_uint16(s, pakid);
if (component == RDPDR_CTYP_CORE)
{
switch (pakid)
{
case PAKID_CORE_DEVICE_... | vuln | Vulnerable | Unknown |
rsvg_node_use_draw (RsvgNode * self, RsvgDrawingCtx * ctx, int dominate)
{
RsvgNodeUse *use = (RsvgNodeUse *) self;
RsvgNode *child;
RsvgState *state;
double affine[6];
double x, y, w, h;
x = _rsvg_css_normalize_length (&use->x, ctx, 'h');
y = _rsvg_css_normalize_length (&use->y, ctx, 'v');
... | vuln | Vulnerable | Unknown |
do_uncompress( compress_filter_context_t *zfx, z_stream *zs,
IOBUF a, size_t *ret_len )
{
int zrc;
int rc=0;
size_t n;
int nread, count;
int refill = !zs->avail_in;
if( DBG_FILTER )
log_debug("begin inflate: avail_in=%u, avail_out=%u, inbuf=%u\n",
(unsigned)zs->avail_in, (unsigned)zs... | vuln | Vulnerable | Unknown |
static void rds_tcp_kill_sock(struct net *net)
{
struct rds_tcp_connection *tc, *_tc;
struct sock *sk;
LIST_HEAD(tmp_list);
struct rds_tcp_net *rtn = net_generic(net, rds_tcp_netid);
rds_tcp_listen_stop(rtn->rds_tcp_listen_sock);
rtn->rds_tcp_listen_sock = NULL;
flush_work(&rtn->rds_tcp_accept_w);
spin_lock_ir... | vuln | Safe | C/C++ |
bool GLES2DecoderImpl::SimulateFixedAttribs(
GLuint max_vertex_accessed, bool* simulated) {
DCHECK(simulated);
*simulated = false;
if (gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2)
return true;
if (!vertex_attrib_manager_.HaveFixedAttribs()) {
return true;
}
int num_vertices ... | vuln | Vulnerable | C/C++ |
static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *pkt)
{
BinkContext * const c = avctx->priv_data;
GetBitContext gb;
int blk;
int i, j, plane, plane_idx, bx, by;
uint8_t *dst, *prev, *ref, *ref_start, *ref_end;
int v, col[2];
const uint8_t *scan;
int xo... | vuln | Safe | C/C++ |
static bool ok_csv_circular_buffer_skip(ok_csv_circular_buffer *buffer, size_t length) {
ok_assert(length <= buffer->length);
if (length > buffer->length) {
return false;
}
buffer->start = (buffer->start + length) % buffer->capacity;
buffer->length -= length;
return true;
} | vuln | Safe | C/C++ |
static int mov_read_packet(AVFormatContext *s, AVPacket *pkt)
{
MOVContext *mov = s->priv_data;
MOVStreamContext *sc;
AVIndexEntry *sample;
AVStream *st = NULL;
int ret;
mov->fc = s;
retry:
sample = mov_find_next_sample(s, &st);
if (!sample) {
mov->found_mdat = 0;
if (!m... | vuln | Vulnerable | C/C++ |
public function params()
{
$project = $this->getProject();
$values = $this->request->getValues();
if (empty($values['action_name']) || empty($values['project_id']) || empty($values['event_name'])) {
$this->create();
return;
}
$action = $this->actionM... | vuln | Vulnerable | PHP |
/**
* A simple, static http GET server.
*
* (C) 2015 TekMonks. All rights reserved.
* License: See enclosed file.
*/
const extensions = [];
const fs = require("fs");
const zlib = require("zlib");
const path = require("path");
const http = require("http");
const https = require("https");
let access; let error;
... | vuln | Vulnerable | 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 | Vulnerable | Java |
static int ssi_sd_load(QEMUFile *f, void *opaque, int version_id)
{
SSISlave *ss = SSI_SLAVE(opaque);
ssi_sd_state *s = (ssi_sd_state *)opaque;
int i;
if (version_id != 1)
return -EINVAL;
s->mode = qemu_get_be32(f);
s->cmd = qemu_get_be32(f);
for (i = 0; i < 4; i++)
s->cmdarg... | vuln | Safe | C/C++ |
__ext4_set_acl(handle_t *handle, struct inode *inode, int type,
struct posix_acl *acl)
{
int name_index;
void *value = NULL;
size_t size = 0;
int error;
switch (type) {
case ACL_TYPE_ACCESS:
name_index = EXT4_XATTR_INDEX_POSIX_ACL_ACCESS;
if (acl) {
error = posix_acl_equiv_mode(acl, &inode->i_mode);... | vuln | Vulnerable | Unknown |
@ReactMethod
synchronized public void enableControl(String control, boolean enable, ReadableMap options) {
init();
long controlValue;
switch(control) {
case "skipForward":
if (options.hasKey("interval"))
skipOptions.put("skipForward", options.... | vuln | Vulnerable | Java |
static void *iommu_init(target_phys_addr_t addr, uint32_t version, qemu_irq irq)
{
DeviceState *dev;
SysBusDevice *s;
dev = qdev_create(NULL, "iommu");
qdev_prop_set_uint32(dev, "version", version);
qdev_init(dev);
s = sysbus_from_qdev(dev);
sysbus_connect_irq(s, 0, irq);
sysbus_mmio_map... | vuln | Vulnerable | C/C++ |
public boolean hitEntity(ItemStack itemStack, PlayerEntity player, LivingEntity target, double damageMultiplier,
float knockbackBase, float knockbackMultiplier) {
float targetModifier = EnchantmentHelper.getModifierForCreature(itemStack, target.getCreatureAttribute());
float critMultiplier =... | vuln | Vulnerable | Java |
var T=document.createElement("tbody"),N=(new Date).toDateString();null!=b.currentPage&&null!=b.pages&&(g=mxUtils.indexOf(b.pages,b.currentPage));for(q=e.length-1;0<=q;q--){var Q=function(R){var Y=new Date(R.modifiedDate),ba=null;if(0<=Y.getTime()){var ea=function(fa){x.stop();v.innerHTML="";var aa=mxUtils.parseXml(fa),... | vuln | Safe | JavaScript |
package errors
import (
"fmt"
"io"
"path"
"runtime"
"strings"
)
// Frame represents a program counter inside a stack frame.
type Frame uintptr
// pc returns the program counter for this frame;
// multiple frames may have the same PC value.
func (f Frame) pc() uintptr { return uintptr(f) - 1 }
// file returns t... | vuln | Vulnerable | Go |
private static BlockPos rotate(BlockPos origin, int x, int y, EnumFacing sideHit, EnumFacing horizontalFacing) {
if (sideHit == null) {
return BlockPos.ORIGIN;
}
switch (sideHit.getAxis()) {
case X:
return origin.add(0, y, x);
case Z:
... | vuln | Safe | Java |
static Image *ReadTIFFImage(const ImageInfo *image_info,
ExceptionInfo *exception)
{
#define ThrowTIFFException(severity,message) \
{ \
if (tiff_pixels != (unsigned char *) NULL) \
tiff_pixels=(unsigned char *) RelinquishMagickMemory(tiff_pixels); \
if (quantum_info != (QuantumInfo *) NULL) \
quantum_info... | vuln | Vulnerable | Unknown |
static pid_t do_cmd(char *cmd, char *machine, char *user, char **remote_argv, int remote_argc,
int *f_in_p, int *f_out_p)
{
int i, argc = 0;
char *args[MAX_ARGS], *need_to_free = NULL;
pid_t pid;
int dash_l_set = 0;
if (!read_batch && !local_server) {
char *t, *f, in_quote = '\0';
char *rsh_env = getenv... | vuln | Vulnerable | Unknown |
static void read_apic(AVFormatContext *s, AVIOContext *pb, int taglen, char *tag, ID3v2ExtraMeta **extra_meta)
{
int enc, pic_type;
char mimetype[64];
const CodecMime *mime = ff_id3v2_mime_tags;
enum AVCodecID id = AV_CODEC_ID_NONE;
ID3v2ExtraMetaAPIC *apic = NULL;
ID3... | vuln | Safe | C/C++ |
static int pad_pkcs2(bn_t m, int *p_len, int m_len, int k_len, int operation) {
uint8_t pad, h1[RLC_MD_LEN], h2[RLC_MD_LEN];
/* MSVC does not allow dynamic stack arrays */
uint8_t *mask = RLC_ALLOCA(uint8_t, k_len);
int result = RLC_ERR;
bn_t t;
bn_null(t);
RLC_TRY {
bn_new(t);
switch... | vuln | Safe | C/C++ |
void CoordinatorImpl::RequestGlobalMemoryDumpAndAppendToTrace(
MemoryDumpType dump_type,
MemoryDumpLevelOfDetail level_of_detail,
const RequestGlobalMemoryDumpAndAppendToTraceCallback& callback) {
auto adapter =
[](const RequestGlobalMemoryDumpAndAppendToTraceCallback& callback,
bool s... | vuln | Vulnerable | C/C++ |
/*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org
*
* 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 without restriction, including without limitation the rights
* to use, copy,... | vuln | Safe | Java |
static void vfio_map_bar(VFIOPCIDevice *vdev, int nr)
{
VFIOBAR *bar = &vdev->bars[nr];
uint64_t size = bar->region.size;
char name[64];
uint32_t pci_bar;
uint8_t type;
int ret;
if (!size) {
return;
}
snprintf(name, sizeof(name), "VFIO %04x:%02x:%02x.%x BAR %d",
... | vuln | Vulnerable | C/C++ |
static ssize_t
sg_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos)
{
int mxsize, cmd_size, k;
int input_size, blocking;
unsigned char opcode;
Sg_device *sdp;
Sg_fd *sfp;
Sg_request *srp;
struct sg_header old_hdr;
sg_io_hdr_t *hp;
unsigned char cmnd[SG_MAX_CDB_SIZE];
if ((!(sfp = ... | vuln | Vulnerable | C/C++ |
public static float getRenderWidth(Player player)
{
CarryOnData carry = CarryOnDataManager.getCarryData(player);
if(carry.isCarrying(CarryType.BLOCK))
{
BlockState state = getRenderState(player);
VoxelShape shape = state.getShape(player.level, player.blockPosition());
if(shape == null)
return 1f;
... | vuln | Vulnerable | Java |
public boolean isExcludedAssistant() {
return mTopTask.configuration.windowConfiguration
.getActivityType() == ACTIVITY_TYPE_ASSISTANT
&& (mTopTask.baseIntent.getFlags() & FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS) != 0;
} | vuln | Vulnerable | Java |
'use strict';
var required = require('requires-port')
, qs = require('querystringify')
, slashes = /^[A-Za-z][A-Za-z0-9+-.]*:[\\/]+/
, protocolre = /^([a-z][a-z0-9.+-]*:)?([\\/]{1,})?([\S\s]*)/i
, whitespace = '[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\... | vuln | Safe | Java |
def _resolve_connection(self) -> dict[str, Any]:
# Build from connection master or default to yarn if not available
conn_data = {
"master": "yarn",
"queue": None,
"deploy_mode": None,
"spark_binary": self._spark_binary or "spark-submit",
"names... | vuln | Safe | Python |
int xen_be_init(void)
{
xenstore = xs_daemon_open();
if (!xenstore) {
xen_be_printf(NULL, 0, "can't connect to xenstored\n");
return -1;
}
if (qemu_set_fd_handler(xs_fileno(xenstore), xenstore_update, NULL, NULL) < 0) {
goto err;
}
if (xen_xc == XC_HANDLER_INITIAL_VALUE) ... | vuln | Vulnerable | C/C++ |
nm_connection_list_new (GType def_type)
{
NMConnectionList *list;
DBusGConnection *dbus_connection;
GError *error = NULL;
list = g_object_new (NM_TYPE_CONNECTION_LIST, NULL);
if (!list)
return NULL;
/* load GUI */
list->gui = glade_xml_new (GLADEDIR "/nm-connection-editor.glade", "NMConnectionList", NULL);
... | vuln | Safe | Unknown |
static void cg3_realizefn(DeviceState *dev, Error **errp)
{
SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
CG3State *s = CG3(dev);
int ret;
char *fcode_filename;
vmstate_register_ram_global(&s->rom);
fcode_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, CG3_ROM_FILE);
if (fcode_filename) {
... | vuln | Vulnerable | C/C++ |
/**
* 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, Version 2.0 (the ... | vuln | Safe | Java |
xmlValidNormalizeAttributeValue(xmlDocPtr doc, xmlNodePtr elem,
const xmlChar *name, const xmlChar *value) {
xmlChar *ret;
xmlAttributePtr attrDecl = NULL;
if (doc == NULL) return(NULL);
if (elem == NULL) return(NULL);
if (name == NULL) return(NULL);
if (value == NULL) return(NULL);
... | vuln | Safe | Unknown |
package main
import (
"fmt"
_ "github.com/go-sql-driver/mysql"
"net/http"
)
var base_url = "http://localhost"
var host = "localhost"
var port = "3306"
var database = "information_schema"
func faviconHandler(w http.ResponseWriter, r *http.Request) {
http.StatusText(404)
}
func loginPageHandler(w http.ResponseWri... | vuln | Vulnerable | Go |
static int extract_extradata_h2645(AVBSFContext *ctx, AVPacket *pkt,
uint8_t **data, int *size)
{
static const int extradata_nal_types_hevc[] = {
HEVC_NAL_VPS, HEVC_NAL_SPS, HEVC_NAL_PPS,
};
static const int extradata_nal_types_h264[] = {
H264_NAL_SPS, H264... | vuln | Safe | C/C++ |
void Scan::CreateParser(void)
{
ScanType type = m_pFrame->ScanTypeOf();
//
assert(m_pParser == NULL);
//
switch(type) {
case Baseline:
m_pParser = new(m_pEnviron) class SequentialScan(m_pFrame,this,
m_ucScanStart,m_ucScanStop,
... | vuln | Vulnerable | Unknown |
void saveVCalendar (TNEFStruct *tnef, const gchar *tmpdir) {
gchar ifilename[256];
variableLength *filename;
gchar *charptr, *charptr2;
FILE *fptr;
gint index;
DWORD *dword_ptr;
DWORD dword_val;
dtr thedate;
sprintf(ifilename, "%s/calendar.ics", tmpdir);
printf("%s\n", ifilename... | vuln | Vulnerable | Unknown |
IW_IMPL(int) iw_read_jpeg_file(struct iw_context *ctx, struct iw_iodescr *iodescr)
{
int retval=0;
struct jpeg_decompress_struct cinfo;
struct my_error_mgr jerr;
int cinfo_valid=0;
int colorspace;
JDIMENSION rownum;
JSAMPLE *jsamprow;
int numchannels=0;
struct iw_image img;
struct iwjpegrcontext rctx;
JSAMPL... | vuln | Vulnerable | C/C++ |
private static void movePage(int number) {
currPageNumber += number;
currPageNumber = Mth.clamp(currPageNumber, 0, GUIDEBOOK_PAGES.size() - 1);
} | vuln | Safe | Java |
GF_RTPHinter *gf_hinter_track_new(GF_ISOFile *file, u32 TrackNum,
u32 Path_MTU, u32 max_ptime, u32 default_rtp_rate, u32 flags, u8 PayloadID,
Bool copy_media, u32 InterleaveGroupID, u8 InterleaveGroupPriority, GF_Err *e)
{
GF_SLConfig my_sl;
u32 des... | vuln | Vulnerable | Unknown |
CPUArchState *cpu_copy(CPUArchState *env)
{
CPUState *cpu = ENV_GET_CPU(env);
CPUState *new_cpu = cpu_init(cpu_model);
CPUArchState *new_env = cpu->env_ptr;
CPUBreakpoint *bp;
CPUWatchpoint *wp;
cpu_reset(new_cpu);
memcpy(new_env, env, sizeof(CPUArchState));
QTAILQ_INIT(&cpu->b... | vuln | Vulnerable | C/C++ |
CheckSetDeviceIndicators(char *wire,
DeviceIntPtr dev,
int num, int *status_rtrn, ClientPtr client,
xkbSetDeviceInfoReq * stuff)
{
xkbDeviceLedsWireDesc *ledWire;
int i;
XkbSrvLedInfoPtr sli;
ledWire = (xkbDeviceLedsWireDesc *) ... | vuln | Safe | Unknown |
public boolean isTweakable(ItemStack itemStack) {
if (itemStack.hasTag()) {
String variant = itemStack.getTag().getString(variantTagKey);
return Arrays.stream(tweaks)
.anyMatch(data -> variant.equals(data.variant));
}
return false;
} | vuln | Safe | Java |
@register.filter
def json_dumps(value, indent=None):
if isinstance(value, QuerySet):
result = serialize('json', value, indent=indent)
else:
result = json.dumps(value, indent=indent, cls=DjbletsJSONEncoder)
return mark_safe(result) | vuln | Vulnerable | Python |
static int write_target_commit(BlockDriverState *bs, int64_t sector_num,
const uint8_t* buffer, int nb_sectors) {
BDRVVVFATState* s = *((BDRVVVFATState**) bs->opaque);
return try_commit(s);
} | vuln | Safe | C/C++ |
int nghttp2_session_add_settings(nghttp2_session *session, uint8_t flags,
const nghttp2_settings_entry *iv, size_t niv) {
nghttp2_outbound_item *item;
nghttp2_frame *frame;
nghttp2_settings_entry *iv_copy;
size_t i;
int rv;
nghttp2_mem *mem;
nghttp2_inflight_settings *infl... | vuln | Safe | Unknown |
def abi_decode(lll_node, src, clamp=True, pos=None):
os = o_list(lll_node, pos=pos)
lll_ret = ["seq"]
parent_abi_t = abi_type_of(lll_node.typ)
for i, o in enumerate(os):
abi_t = abi_type_of(o.typ)
src_loc = LLLnode("src_loc", typ=o.typ, location=src.location)
if parent_abi_t.is_c... | vuln | Safe | Python |
static cchar *findAcceptableVersion(cchar *name, cchar *originalCriteria)
{
MprDirEntry *dp;
MprList *files;
cchar *criteria;
int next;
criteria = originalCriteria;
if (!criteria || smatch(criteria, "*")) {
criteria = "x";
}
if (schr(name, '#'))... | vuln | Vulnerable | C/C++ |
public function uploadCustomLogoAction(Request $request)
{
$sourcePath = $_FILES['Filedata']['tmp_name'];
$fileExt = File::getFileExtension($_FILES['Filedata']['name']);
if (!in_array($fileExt, ['svg', 'png', 'jpg'])) {
throw new \Exception('Unsupported file format');
}
... | vuln | Safe | PHP |
@Override
public void initialize(ServiceConfiguration config) throws IOException {
this.configuration = new HashMap<>();
final String allowedIdsPatternRegExp = config.getSaslJaasClientAllowedIds();
configuration.put(JAAS_CLIENT_ALLOWED_IDS, allowedIdsPatternRegExp);
configuration.put... | vuln | Safe | Java |
static uint64_t vfio_rtl8168_window_quirk_read(void *opaque,
hwaddr addr, unsigned size)
{
VFIOQuirk *quirk = opaque;
VFIOPCIDevice *vdev = quirk->vdev;
switch (addr) {
case 4:
if (quirk->data.flags) {
trace_vfio_rtl8168_window_quirk_re... | vuln | Vulnerable | C/C++ |
int ff_mpeg4_decode_video_packet_header(MpegEncContext *s)
{
int mb_num_bits= av_log2(s->mb_num - 1) + 1;
int header_extension=0, mb_num, len;
if( get_bits_count(&s->gb) > s->gb.size_in_bits-20) return -1;
for(len=0; len<32; len++){
if(get_bits1(&s->gb)) break;
}
if(len!=ff_mpeg4_ge... | vuln | Safe | C/C++ |
// --- BEGIN COPYRIGHT BLOCK ---
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; version 2 of the License.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT... | vuln | Safe | C/C++ |
private void clearViews() {
if (viewPager != null) {
viewPagerPosition = viewPager.getCurrentItem();
viewPager = null;
}
if (handler != null) {
handler.removeCallbacksAndMessages(null);
}
topFragment = null;
dNSCryptRunFragment = nul... | vuln | Vulnerable | Java |
setup_seccomp (FlatpakBwrap *bwrap,
const char *arch,
gulong allowed_personality,
FlatpakRunFlags run_flags,
GError **error)
{
gboolean multiarch = (run_flags & FLATPAK_RUN_FLAG_MULTIARCH) != 0;
gboolean devel = (run_flags & FLATPAK_R... | vuln | Safe | C/C++ |
ikev1_attrmap_print(netdissect_options *ndo,
const u_char *p, const u_char *ep,
const struct attrmap *map, size_t nmap)
{
int totlen;
uint32_t t, v;
if (p[0] & 0x80)
totlen = 4;
else
totlen = 4 + EXTRACT_16BITS(&p[2]);
if (ep < p + totlen) {
ND_PRINT((ndo,"[|attr]"));
return ep + 1;
}
ND_PR... | vuln | Vulnerable | C/C++ |
static int
print_exception_notes(struct exception_print_context *ctx, PyObject *value)
{
PyObject *f = ctx->file;
if (!PyExceptionInstance_Check(value)) {
return 0;
}
PyObject *notes;
int res = _PyObject_LookupAttr(value, &_Py_ID(__notes__), ¬es);
if (res <= 0) {
return res;... | vuln | Vulnerable | C/C++ |
fep_client_open (const char *address)
{
FepClient *client;
struct sockaddr_un sun;
ssize_t sun_len;
int retval;
if (!address)
address = getenv ("LIBFEP_CONTROL_SOCK");
if (!address)
return NULL;
if (strlen (address) + 1 >= sizeof(sun.sun_path))
{
fep_log (FEP_LOG_LEVEL_WARNING,
... | vuln | Safe | Unknown |
static int send_client_reply_packet(MCPVIO_EXT *mpvio,
const uchar *data, int data_len)
{
MYSQL *mysql= mpvio->mysql;
NET *net= &mysql->net;
char *buff, *end;
size_t buff_size;
size_t connect_attrs_len=
(mysql->server_capabilities & CLIENT_CONNECT_ATTRS &&
mysql->o... | vuln | Vulnerable | C/C++ |
void UncompressElementOp::Compute(OpKernelContext* ctx) {
Tensor tensor = ctx->input(0);
const Variant& variant = tensor.scalar<Variant>()();
const CompressedElement* compressed = variant.get<CompressedElement>();
std::vector<Tensor> components;
OP_REQUIRES_OK(ctx, UncompressElement(*compressed, &components)... | vuln | Vulnerable | Unknown |
int WebObjects_translate(request_rec *r) {
WebObjects_config *wc;
WOURLComponents url;
WOURLError urlerr;
WOURLError charcheck;
// get the module configuration (this is the structure created by WebObjects_create_config())
wc = ap_get_module_config(r->server->module_config, &WebObjects_module);
... | vuln | Safe | C/C++ |
public AppWidgetHost newLauncherWidgetHost() {
return new LauncherAppWidgetHost(mContext.getApplicationContext());
} | vuln | Safe | Java |
WandPrivate MagickBooleanType CLIListOperatorImages(MagickCLI *cli_wand,
const char *option,const char *arg1n,const char *arg2n)
{
const char /* percent escaped versions of the args */
*arg1,
*arg2;
Image
*new_images;
MagickStatusType
status;
ssize_t
parse;
#define _image_info (... | vuln | Safe | C/C++ |
@Override
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
super.channelInactive(ctx);
// update active channel count stats
RequestStats.ACTIVE_CHANNEL_COUNT_INSTANCE.decrementAndGet();
close();
} | vuln | Safe | Java |
/*
** codegen.c - mruby code generator
**
** See Copyright Notice in mruby.h
*/
#include <mruby.h>
#include <mruby/compile.h>
#include <mruby/proc.h>
#include <mruby/dump.h>
#include <mruby/numeric.h>
#include <mruby/string.h>
#include <mruby/debug.h>
#include <mruby/presym.h>
#include "node.h"
#include <mruby/opcode.... | vuln | Safe | C/C++ |
bool_t xdr_nullstring(XDR *xdrs, char **objp)
{
u_int size;
if (xdrs->x_op == XDR_ENCODE) {
if (*objp == NULL)
size = 0;
else
size = strlen(*objp) + 1;
}
if (! xdr_u_int(xdrs, &size)) {
return FALSE;
}
switch (xdrs->x_op) {
case XDR_DECODE:
if (size == 0) {
... | vuln | Vulnerable | C/C++ |
@Override
public Collection<OperationResult<AclChange>> executeCommand(final AdminClient client) {
final Optional<V1SecurityObject> optional = specFile().specs().security();
if (optional.isEmpty()) {
return Collections.emptyList();
}
final V1Secu... | vuln | Vulnerable | Java |
function $(a) {var b=[],c={},d,f,h,k;if (!a.i) {if (a.o===q) {var e=a.input,g;if (!a.D)a:{var l=a.input,p;for(p=l.length-12;0<p;--p)if (l[p]===Z[0]&&l[p+1]===Z[1]&&l[p+2]===Z[2]&&l[p+3]===Z[3]) {a.D=p;break a}m(Error("End of Central Directory Record not found"))}g=a.D;(e[g++]!==Z[0]||e[g++]!==Z[1]||e[g++]!==Z[2]||e[g++... | vuln | Safe | JavaScript |
static int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh,
struct netlink_ext_ack *extack)
{
struct net *net = sock_net(in_skb->sk);
struct rtmsg *rtm;
struct nlattr *tb[RTA_MAX+1];
struct fib_result res = {};
struct rtable *rt = NULL;
struct flowi4 fl4;
__be32 dst = 0;
__be32 src = 0;
... | vuln | Vulnerable | C/C++ |
spnego_gss_export_sec_context(
OM_uint32 *minor_status,
gss_ctx_id_t *context_handle,
gss_buffer_t interprocess_token)
{
OM_uint32 ret;
ret = gss_export_sec_context(minor_status,
context_handle,
interprocess_token);
return (ret);
} | vuln | Vulnerable | C/C++ |
int av_find_stream_info(AVFormatContext *ic)
{
int i, count, ret, read_size, j;
AVStream *st;
AVPacket pkt1, *pkt;
AVPacketList *pktl=NULL, **ppktl;
int64_t last_dts[MAX_STREAMS];
int duration_count[MAX_STREAMS]={0};
double duration_error[MAX_STREAMS][MAX_STD_TIMEBASES]={{0}};
offset_t ... | vuln | Vulnerable | C/C++ |
static ecma_value_t
ecma_builtin_array_flatten_into_array (ecma_value_t target, /**< target will contains source's elements */
ecma_object_t *source, /**< source object */
ecma_length_t source_len, /**< source object length */
... | vuln | Vulnerable | C/C++ |
static int qcow2_update_ext_header(BlockDriverState *bs,
const char *backing_file, const char *backing_fmt)
{
size_t backing_file_len = 0;
size_t backing_fmt_len = 0;
BDRVQcowState *s = bs->opaque;
QCowExtension ext_backing_fmt = {0, 0};
int ret;
if (backing_fmt && !backing_file) {
... | vuln | Safe | C/C++ |
Status UncompressElement(const CompressedElement& compressed,
std::vector<Tensor>* out) {
int num_components = compressed.component_metadata_size();
out->clear();
out->reserve(num_components);
// Step 1: Prepare the memory that we will uncompress into.
std::vector<struct iovec> iov(n... | vuln | Vulnerable | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.