code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
tcpr_dir_t
macinstring(const char *macstring, const u_char *mac)
{
char *tok = NULL, *tempstr, *ourstring;
u_char tempmac[6];
int len = 6, ret = TCPR_DIR_S2C;
ourstring = safe_strdup(macstring);
memset(&tempmac[0], 0, sizeof(tempmac));
tempstr = strtok_r(ourstring, ",", &tok);
if (strlen(t... | vuln | Vulnerable | C/C++ |
public int getHeight(){
return Try.of(()->(int)getFieldsMeta().get(HEIGHT_META_KEY.key())).getOrElse(0);
} | vuln | Vulnerable | Java |
static inline void Process_ipfix_template_add(exporter_ipfix_domain_t *exporter, void *DataPtr, uint32_t size_left, FlowSource_t *fs) {
input_translation_t *translation_table;
ipfix_template_record_t *ipfix_template_record;
ipfix_template_elements_std_t *NextElement;
int i;
uint16_t Offset = 0;
// a template flowset ... | vuln | Vulnerable | Unknown |
static int ssl_verify_server_cert(Vio *vio, const char* server_hostname, const char **errptr)
{
SSL *ssl;
X509 *server_cert;
X509_NAME *x509sn;
int cn_pos;
X509_NAME_ENTRY *cn_entry;
ASN1_STRING *cn_asn1;
const char *cn_str;
DBUG_ENTER("ssl_verify_server_cert");
DBUG_PRINT("enter", ("server_hostname: ... | vuln | Safe | Unknown |
protected function _normpath($path) {
if (empty($path)) {
return '.';
}
$changeSep = (DIRECTORY_SEPARATOR !== '/');
if ($changeSep) {
$path = str_replace(DIRECTORY_SEPARATOR, '/', $path);
}
if (strpos($path, '/') === 0) {
$initial_slashes = true;
} else {
$initial_slashes = false;
}
... | vuln | Vulnerable | JavaScript |
static int mount_entry(const char *fsname, const char *target,
const char *fstype, unsigned long mountflags,
const char *data, int optional, const char *rootfs)
{
#ifdef HAVE_STATVFS
struct statvfs sb;
#endif
if (safe_mount(fsname, target, fstype, mountflags & ~MS_REMOUNT, data, rootfs)) {
if (op... | vuln | Safe | C/C++ |
static URI_INLINE void URI_FUNC(PreventLeakage)(URI_TYPE(Uri) * uri,
unsigned int revertMask, UriMemoryManager * memory) {
if (revertMask & URI_NORMALIZE_SCHEME) {
/* NOTE: A scheme cannot be the empty string
* so no need to compare .first with .afterLast, here. */
memory->free(memory, (URI_CHAR *)uri->... | vuln | Safe | C/C++ |
public Cursor runQuery(CharSequence typed) {
MatrixCursor result = new MatrixCursor(new String[]{"_id", "name", "email", "photo", "local"});
try {
Log.i("Suggest contact=" + typed);
if (typed == null)
return result;
... | vuln | Vulnerable | Java |
function s(){"in"!=r.hoverState&&i.detach(),r.$element.removeAttr("aria-describedby").trigger("hidden.bs."+r.type),n&&n()} | vuln | Safe | JavaScript |
"""
Defines Presentation specific objects
"""
import mistune
import os
import threading
import time
import lookatme.config
import lookatme.contrib
from lookatme.parser import Parser
import lookatme.prompt
import lookatme.themes
import lookatme.tui
from lookatme.utils import dict_deep_update
class Presentation(obj... | vuln | Safe | Python |
static int mov_read_trun(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
MOVFragment *frag = &c->fragment;
AVStream *st = NULL;
MOVStreamContext *sc;
MOVStts *ctts_data;
uint64_t offset;
int64_t dts;
int data_offset = 0;
unsigned entries, first_sample_flags = frag->flags;
int flags, ... | vuln | Safe | C/C++ |
bool WebRtcAudioRenderer::Initialize(WebRtcAudioRendererSource* source) {
base::AutoLock auto_lock(lock_);
DCHECK_EQ(state_, UNINITIALIZED);
DCHECK(source);
DCHECK(!sink_);
DCHECK(!source_);
sink_ = AudioDeviceFactory::NewOutputDevice();
DCHECK(sink_);
int sample_rate = GetAudioOutputSampleRate();
D... | vuln | Safe | C/C++ |
def get_roster(self, server_id):
sql = """SELECT username, role
FROM roles
WHERE roles.server_id = {0};
""".format(server_id)
self.cur.execute(sql)
return self.cur.fetchall() | vuln | Vulnerable | Python |
function test_new_comment_duplicated() {
$comment_args = array(
1,
'administrator',
'administrator',
self::$post->ID,
array(
'content' => rand_str( 100 ),
),
);
// First time it's a valid comment.
$result = $this->myxmlrpcserver->wp_newComment( $comment_args );
$this->assertNotIXRError(... | vuln | Vulnerable | PHP |
int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *a, ASN1_BIT_STRING *signature,
void *asn, EVP_PKEY *pkey)
{
EVP_MD_CTX ctx;
const EVP_MD *type = NULL;
unsigned char *buf_in=NULL;
int ret= -1,inl;
int mdnid, pknid;
EVP_MD_CTX_init(&ctx);
/* Convert signature OID into digest and public key OIDs */
... | vuln | Vulnerable | Unknown |
static void switch_buffer(MPADecodeContext *s, int *pos, int *end_pos,
int *end_pos2)
{
if (s->in_gb.buffer && *pos >= s->gb.size_in_bits) {
s->gb = s->in_gb;
s->in_gb.buffer = NULL;
assert((get_bits_count(&s->gb) & 7) == 0);
skip_bits_long(&s->gb,... | vuln | Vulnerable | C/C++ |
protected void retrieveActivitiesWithoutVLV(
ActivityDatabase database,
String filter,
Integer start,
Integer size,
ActivityCollection response) throws Exception {
// search without VLV
Iterator<ActivityRecord> activities = database.findRecord... | vuln | Vulnerable | Java |
default void tick()
{
Entity entity = getEntity();
if (entity.tickCount % getLightUpdateInterval() == 0)
{
final BlockPos oldPos = getLightPos();
final BlockPos currentPos = entity.blockPosition();
if (oldPos.distSqr(currentPos) > getLightUpdateDistanceSqr... | vuln | Vulnerable | Java |
function e(H,F){F.innerText="";H=new Date(H.modifiedDate);var J=b.timeSince(H);null==J&&(J=mxResources.get("lessThanAMinute"));mxUtils.write(F,mxResources.get("timeAgo",
[J],"{1} ago"));F.setAttribute("title",H.toLocaleDateString()+" "+H.toLocaleTimeString())} | vuln | Safe | JavaScript |
static void nvdimm_build_nfit(GSList *device_list, GArray *table_offsets,
GArray *table_data, BIOSLinker *linker)
{
GArray *structures = nvdimm_build_device_structure(device_list);
unsigned int header;
acpi_add_table(table_offsets, table_data);
header = table_data->len... | vuln | Vulnerable | C/C++ |
/*
Copyright The containerd Authors.
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 agreed to... | vuln | Vulnerable | Go |
public static void prepareExoPlayer(ExoPlayer player, String video_url) {
Uri uri = Uri.parse(video_url);
boolean isRtsp = uri.getScheme().toLowerCase().startsWith("rtsp");
MediaItem mediaItem = MediaItem.fromUri(uri);
MediaSource mediaSource;
if (isRtsp) {
mediaSource = new RtspMediaSource.F... | vuln | Vulnerable | Java |
int main(int argc, char *argv[])
{
struct MHD_Daemon *d;
int port, opti, optc, cmdok, ret, slog_interval;
char *log_file, *slog_file;
program_name = argv[0];
setlocale(LC_ALL, "");
#if ENABLE_NLS
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
#endif
server_data.www_dir = NULL;
#ifdef HAVE_GTOP
se... | vuln | Vulnerable | C/C++ |
void* Type_LUTB2A_Read(struct _cms_typehandler_struct* self, cmsIOHANDLER* io, cmsUInt32Number* nItems, cmsUInt32Number SizeOfTag)
{
cmsUInt8Number inputChan; // Number of input channels
cmsUInt8Number outputChan; // Number of output channels
cmsUInt32Number BaseOffset; // Actu... | vuln | Vulnerable | Unknown |
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: https://www.espocrm.com
*
* EspoCRM is free software: you can redistribute i... | vuln | Safe | JavaScript |
start_input_tga (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
{
tga_source_ptr source = (tga_source_ptr) sinfo;
U_CHAR targaheader[18];
int idlen, cmaptype, subtype, flags, interlace_type, components;
unsigned int width, height, maplen;
boolean is_bottom_up;
#define GET_2B(offset) ((unsigned int) UCH(targa... | vuln | Safe | C/C++ |
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
// CVE-2021-44228
System.setProperty("log4j2.formatMsgNoLookups", "true"); //$NON-NLS-1$ //$NON-NLS-2$
System.setProperty("log4j.formatMsgNoLookups", "true"); //$NON-NLS-1$ //$NON-NLS-2$
... | vuln | Safe | Java |
// Ogg Vorbis audio decoder - v1.16 - public domain
// http://nothings.org/stb_vorbis/
//
// Original version written by Sean Barrett in 2007.
//
// Originally sponsored by RAD Game Tools. Seeking implementation
// sponsored by Phillip Bennefall, Marc Andersen, Aaron Baker,
// Elias Software, Aras Pranckevicius, and Se... | vuln | Vulnerable | C/C++ |
ast_for_arguments(struct compiling *c, const node *n)
{
/* This function handles both typedargslist (function definition)
and varargslist (lambda definition).
parameters: '(' [typedargslist] ')'
typedargslist: (tfpdef ['=' test] (',' tfpdef ['=' test])* [',' [
'*' [tfpdef] (',' ... | vuln | Vulnerable | C/C++ |
public CompoundTag writeNBT(boolean spawnPacket) {
CompoundTag nbt = new CompoundTag();
nbt.putString("Type", getType().id);
CompoundTag blocksNBT = writeBlocksCompound();
ListTag actorsNBT = new ListTag();
for (MutablePair<StructureBlockInfo, MovementContext> actor : getActors()) {
CompoundTag compound ... | vuln | Vulnerable | Java |
/* radare - LGPL - Copyright 2008-2022 - nibble, pancake, thestr4ng3r */
#include <r_anal.h>
#include <r_core.h>
static bool item_matches_filter(RAnalMetaItem *item, RAnalMetaType type, R_NULLABLE const RSpace *space) {
return (type == R_META_TYPE_ANY || item->type == type) && (!space || item->space == space);
}
ty... | vuln | Safe | C/C++ |
static jpc_enc_band_t *band_create(jpc_enc_band_t *band, jpc_enc_cp_t *cp,
jpc_enc_rlvl_t *rlvl, jpc_tsfb_band_t *bandinfos)
{
uint_fast16_t bandno;
uint_fast16_t gblbandno;
uint_fast16_t rlvlno;
jpc_tsfb_band_t *bandinfo;
jpc_enc_tcmpt_t *tcmpt;
uint_fast32_t prcno;
jpc_enc_prc_t *prc;
tcmpt = rlvl->tcmpt;
... | vuln | Vulnerable | Unknown |
@Override
protected void onCreateView (Context context, CustomRecyclerView recyclerView) {
this.adapter = new SettingsAdapter(this) {
@Override
public void setValuedSetting (ListItem item, SettingView view, boolean isUpdate) {
switch (item.getId()) {
case R.id.btn_terminateAllSession... | vuln | Vulnerable | Java |
xdaemon(bool nochdir, bool noclose, bool exitflag)
{
pid_t pid;
int ret;
if (log_file_name)
flush_log_file();
/* In case of fork is error. */
pid = fork();
if (pid < 0) {
log_message(LOG_INFO, "xdaemon: fork error");
return -1;
}
/* In case of this is parent process. */
if (pid != 0) {
if (!exitflag... | vuln | Vulnerable | Unknown |
static bool vmxnet_tx_pkt_parse_headers(struct VmxnetTxPkt *pkt)
{
struct iovec *l2_hdr, *l3_hdr;
size_t bytes_read;
size_t full_ip6hdr_len;
uint16_t l3_proto;
assert(pkt);
l2_hdr = &pkt->vec[VMXNET_TX_PKT_L2HDR_FRAG];
l3_hdr = &pkt->vec[VMXNET_TX_PKT_L3HDR_FRAG];
bytes_read = iov_to_... | vuln | Safe | Unknown |
static void
addr_spec_with_generic_uri(pbelle_sip_messageParser ctx, belle_sip_header_address_t* object)
{
belle_sip_uri_t* uri54;
#undef RETURN_TYPE_uri54
#define RETURN_TYPE_uri54 belle_sip_uri_t*
belle_generic_uri_t* generic_uri55;
#undef RETURN_TYPE_generic_uri55
#define RETURN_TYPE_generic... | vuln | Safe | C/C++ |
@Override
public void endElement(final String namespaceURI, final String sName, final String qName) {
if (qName.equals("item")) {
final DefaultItem item = new DefaultItem(clazz, subclass, name, -1);
item.setWeight(weight);
item.setEquipableSlots(slots);
item.setAttributes(attributes);
item.setDescript... | vuln | Vulnerable | Java |
int fpm_status_handle_request(void) /* {{{ */
{
struct fpm_scoreboard_s scoreboard, *scoreboard_p;
struct fpm_scoreboard_proc_s proc;
char *buffer, *time_format, time_buffer[64];
time_t now_epoch;
int full, encode;
char *short_syntax, *short_post;
char *full_pre, *full_syntax, *full_post, *full_separator;
zend_... | vuln | Safe | Unknown |
/* $OpenBSD: tcp_input.c,v 1.385 2023/01/12 13:09:47 bluhm Exp $ */
/* $NetBSD: tcp_input.c,v 1.23 1996/02/13 23:43:44 christos Exp $ */
/*
* Copyright (c) 1982, 1986, 1988, 1990, 1993, 1994
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, ... | vuln | Safe | C/C++ |
# -*- coding: utf-8 -*-
# rdiffweb, A web interface to rdiff-backup repositories
# Copyright (C) 2012-2021 rdiffweb contributors
#
# 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, either version ... | vuln | Vulnerable | Python |
setActiveElements(activeElements){const lastActive=this._active||[];const active=activeElements.map(({datasetIndex,index})=>{const meta=this.getDatasetMeta(datasetIndex);if(!meta){throw new Error('No dataset found at index '+datasetIndex);}
return{datasetIndex,element:meta.data[index],index,};});const changed=!_element... | vuln | Vulnerable | JavaScript |
static void FixTrackID(GF_ISOFile *mov)
{
if (!mov->moov) return;
if (gf_list_count(mov->moov->trackList) == 1 && gf_list_count(mov->moof->TrackList) == 1) {
GF_TrackFragmentBox *traf = (GF_TrackFragmentBox*)gf_list_get(mov->moof->TrackList, 0);
GF_TrackBox *trak = (GF_TrackBox*)gf_list_get(mov->moov->trackList,... | vuln | Safe | C/C++ |
/* This work is licensed under a Creative Commons CCZero 1.0 Universal License.
* See http://creativecommons.org/publicdomain/zero/1.0/ for more information.
*
* Copyright 2017 (c) Fraunhofer IOSB (Author: Julius Pfrommer)
* Copyright 2017 (c) Julian Grothoff
* Copyright 2017-2018 (c) Mark Giraud, Fraunho... | vuln | Vulnerable | C/C++ |
int bson_ensure_space( bson *b, const size_t bytesNeeded ) {
int pos = b->cur - b->data;
char *orig = b->data;
int new_size;
if ( pos + bytesNeeded <= b->dataSize )
return BSON_OK;
new_size = 1.5 * ( b->dataSize + bytesNeeded );
if( new_size < b->dataSize ) {
if( ( b->dataSize... | vuln | Safe | C/C++ |
static void mmap_release_buffer(AVPacket *pkt)
{
struct v4l2_buffer buf;
int res, fd;
struct buff_data *buf_descriptor = pkt->priv;
if (pkt->data == NULL) {
return;
}
memset(&buf, 0, sizeof(struct v4l2_buffer));
buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
buf.memory = V4L2_MEMORY_MM... | vuln | Safe | C/C++ |
int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
version, stream_size)
z_streamp strm;
int level;
int method;
int windowBits;
int memLevel;
int strategy;
const char *version;
int stream_size;
{
deflate_state *s;
int wrap = 1;
... | vuln | Safe | Unknown |
/**
* @interface ParseServerOptions
* @property {Any} accountLockout account lockout policy for failed login attempts
* @property {Boolean} allowClientClassCreation Enable (or disable) client class creation, defaults to true
* @property {Boolean} allowCustomObjectId Enable (or disable) custom objectId
* @property ... | vuln | Safe | JavaScript |
public function isLocal() {
$localhosts = array('::1', '127.0.0.1', '0.0.0.0');
return (
in_array(server::get('SERVER_ADDR'), $localhosts) ||
server::get('SERVER_NAME') == 'localhost' ||
str::endsWith(server::get('SERVER_NAME'), '.localhost') ||
str::endsWith(server::get('SERVER_NAME'), ... | vuln | Vulnerable | PHP |
function editClient() {
var elem = $(this).attr("id");
var tr = $(this).closest("tr");
var id = tr.attr("data-id");
var groups = tr.find("#multiselect_" + id).val();
var ip = tr.find("#ip_" + id).text();
var name = utils.escapeHtml(tr.find("#name_" + id).text());
var comment = utils.escapeHtml(tr.find("#c... | vuln | Vulnerable | JavaScript |
@RequestMapping(value = "/query", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@ResponseBody
public String query(@RequestBody String json) {
String targetStr = "target";
try {
JsonObject jsonObject = GSON.fromJson(json, JsonObject.class);
if (Objects.isNull(jsonObject)) {
return nul... | vuln | Safe | Java |
def create_basename_core(basename):
try:
basename = basename.casefold()
except Exception:
basename = basename.lower()
basename = basename.replace(' ', '-')
basename = re.sub(r'<[^>]*>', r'', basename)
basename = re.sub(r'[^a-z0-9\-]', r'', basename)
basename = re.sub(r'\-\-', r'... | vuln | Vulnerable | Python |
void libxsmm_sparse_csr_reader( libxsmm_generated_code* io_generated_code,
const char* i_csr_file_in,
unsigned int** o_row_idx,
unsigned int** o_column_idx,
doubl... | vuln | Safe | Unknown |
def initialize_repo(self):
"""
Clones repository
"""
logging.info('Repo {} doesn\'t exist. Cloning...'.format(self.repo_dir))
clone_args = ['git', 'clone']
if self.depth and self.depth > 0:
clone_args.extend(['--depth', str(self.depth)])
clone_args.ext... | vuln | Vulnerable | Python |
/* vi:set ts=8 sts=4 sw=4 noet:
*
* VIM - Vi IMproved by Bram Moolenaar
*
* Do ":help uganda" in Vim to read copying and usage conditions.
* Do ":help credits" in Vim to see a list of people who contributed.
* See README.txt for an overview of the Vim source code.
*/
#include "vim.h"
/*
* Vim originated fro... | vuln | Safe | C/C++ |
# -*- coding: utf-8 -*-
# rdiffweb, A web interface to rdiff-backup repositories
# Copyright (C) 2012-2021 rdiffweb contributors
#
# 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, either version ... | vuln | Safe | Python |
int node_is_equal_ex(xmlNodePtr node, char *name, char *ns)
{
if (name == NULL || ((node->name) && strcmp((char*)node->name, name) == 0)) {
if (ns) {
xmlNsPtr nsPtr = node_find_ns(node);
if (nsPtr) {
return (strcmp((char*)nsPtr->href, ns) == 0);
} else {
return FALSE;
}
}
return TRUE;
}
ret... | vuln | Safe | Unknown |
refresh_account (GoaProvider *provider,
GoaClient *client,
GoaObject *object,
GtkWindow *parent,
GError **error)
{
AddAccountData data;
GVariantBuilder builder;
GoaAccount *account;
GoaEwsClient *ews_client;
GoaExchan... | vuln | Vulnerable | Unknown |
int LiStartConnection(const char* host, PSTREAM_CONFIGURATION streamConfig, PCONNECTION_LISTENER_CALLBACKS clCallbacks,
PDECODER_RENDERER_CALLBACKS drCallbacks, PAUDIO_RENDERER_CALLBACKS arCallbacks,
void* renderContext, int drFlags, int _serverMajorVersion) {
int err;
NegotiatedVideoFormat = 0;
Se... | vuln | Vulnerable | C/C++ |
int rtp_packetize_xiph_config( sout_stream_id_sys_t *id, const char *fmtp,
int64_t i_pts )
{
if (fmtp == NULL)
return VLC_EGENERIC;
/* extract base64 configuration from fmtp */
char *start = strstr(fmtp, "configuration=");
assert(start != NULL);
start += sizeo... | vuln | Vulnerable | C/C++ |
int GetS32BE (const unsigned int& nPos, bool *pbSuccess)
{
//*pbSuccess = true;
if ( m_nLen < 4 || nPos > (m_nLen - 4) )
{
*pbSuccess = false;
return 0;
}
int nRes = m_sFile[ nPos ];
nRes = (nRes <<... | vuln | Safe | C/C++ |
jbig2_image_resize(Jbig2Ctx *ctx, Jbig2Image *image, int width, int height)
{
if (width == image->width) {
/* check for integer multiplication overflow */
int64_t check = ((int64_t) image->stride) * ((int64_t) height);
if (check != (int)check) {
jbig2_error(ctx, JBIG2_SEVERIT... | vuln | Vulnerable | C/C++ |
@Override
public void onStreamUpdated(final String id, final JSONObject updateInfo) {
DCHECK(callbackExecutor);
callbackExecutor.execute(() -> {
try {
String field = updateInfo.getString("field");
switch (field) {
case "video.layout":
... | vuln | Safe | Java |
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
OpData* data = static_cast<OpData*>(node->user_data);
TF_LITE_ENSURE_EQ(context, NumInputs(node), 1);
TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1);
const TfLiteTensor* input = GetInput(context, node, 0);
TfLiteTensor* output = GetOutput(cont... | vuln | Vulnerable | C/C++ |
private void setupRenderer() {
StructureTemplate schematic = SchematicItem.loadSchematic(activeSchematicItem);
Vec3i size = schematic.getSize();
if (size.equals(Vec3i.ZERO))
return;
Level clientWorld = Minecraft.getInstance().level;
SchematicWorld w = new SchematicWorld(clientWorld);
SchematicWorld wMir... | vuln | Safe | Java |
@Deprecated
public static String loadTextFile(File textFile, String encoding) throws IOException {
try (BufferedReader iStream = new BufferedReader(
new InputStreamReader(new FileInputStream(textFile), encoding))) {
return loadTextFile(iStream);
}
} | vuln | Safe | Java |
static int io_read(struct io_kiocb *req, unsigned int issue_flags)
{
struct iovec inline_vecs[UIO_FASTIOV], *iovec = inline_vecs;
struct kiocb *kiocb = &req->rw.kiocb;
struct iov_iter __iter, *iter = &__iter;
struct io_async_rw *rw = req->async_data;
ssize_t io_size, ret, ret2;
bool force_nonblock = issue_flags &... | vuln | Safe | C/C++ |
static int mov_write_moov_tag(AVIOContext *pb, MOVMuxContext *mov,
AVFormatContext *s)
{
int i;
int64_t pos = avio_tell(pb);
avio_wb32(pb, 0);
ffio_wfourcc(pb, "moov");
for (i = 0; i < mov->nb_streams; i++) {
if (mov->tracks[i].entry <= 0 && !(mov->flags & FF_M... | vuln | Safe | C/C++ |
static void spapr_nvram_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
VIOsPAPRDeviceClass *k = VIO_SPAPR_DEVICE_CLASS(klass);
k->realize = spapr_nvram_realize;
k->devnode = spapr_nvram_devnode;
k->dt_name = "nvram";
k->dt_type = "nvram";
k->dt_compatible... | vuln | Vulnerable | C/C++ |
int rad_decode(RADIUS_PACKET *packet, RADIUS_PACKET *original,
const char *secret)
{
uint32_t lvalue;
uint32_t vendorcode;
VALUE_PAIR **tail;
VALUE_PAIR *pair;
uint8_t *ptr;
int packet_length;
int attribute;
int attrlen;
int vendorlen;
radius_packet_t *hdr;
int vsa_tlen, vsa_llen;
D... | vuln | Safe | Unknown |
void handler::print_error(int error, myf errflag)
{
bool fatal_error= 0;
DBUG_ENTER("handler::print_error");
DBUG_PRINT("enter",("error: %d",error));
if (ha_thd()->transaction_rollback_request)
{
/* Ensure this becomes a true error */
errflag&= ~(ME_WARNING | ME_NOTE);
}
int textno= -1; // impos... | vuln | Vulnerable | Unknown |
void fb_write_bin(uint8_t *bin, int len, const fb_t a) {
bn_t t;
bn_null(t);
if (len != RLC_FB_BYTES) {
RLC_THROW(ERR_NO_BUFFER);
return;
}
RLC_TRY {
bn_new(t);
bn_read_raw(t, a, RLC_FB_DIGS);
bn_write_bin(bin, len, t);
} | vuln | Vulnerable | C/C++ |
static krb5_error_code
build_principal_va(krb5_context context, krb5_principal princ,
unsigned int rlen, const char *realm, va_list ap)
{
krb5_error_code retval = 0;
char *r = NULL;
krb5_data *data = NULL;
krb5_int32 count = 0;
krb5_int32 size = 2; /* initial guess at needed spac... | vuln | Safe | C/C++ |
@Override
public void c() {
WStackedSpawner stackedSpawner = this.stackedSpawner.get();
if (stackedSpawner == null) {
super.c();
return;
}
if (!hasNearbyPlayers()) {
if (stackedSpawner.isDebug())
Debug.debug("StackedMobSpawner", "... | vuln | Safe | Java |
int cap_bprm_set_creds(struct linux_binprm *bprm)
{
const struct cred *old = current_cred();
struct cred *new = bprm->cred;
bool effective, has_cap = false;
int ret;
effective = false;
ret = get_file_caps(bprm, &effective, &has_cap);
if (ret < 0)
return ret;
if (!issecure(SECURE_NOROOT)) {
/*
* If the ... | vuln | Vulnerable | Unknown |
return txt.replace(/[&<>"']/gm, (str) => {
if (str === "&") return "&";
if (str === "<") return "<";
if (str === ">") return ">";
if (str === "\"") return """;
if (str === "'") return "'";
}); | vuln | Safe | JavaScript |
HttpTransact::handle_trace_and_options_requests(State* s, HTTPHdr* incoming_hdr)
{
ink_assert(incoming_hdr->type_get() == HTTP_TYPE_REQUEST);
// This only applies to TRACE and OPTIONS
if ((s->method != HTTP_WKSIDX_TRACE) && (s->method != HTTP_WKSIDX_OPTIONS))
return false;
// If there is no Max-Forwards r... | vuln | Safe | Unknown |
static void unzzip_cat_file(FILE* disk, char* name, FILE* out)
{
ZZIP_ENTRY_FILE* file = zzip_entry_ffile (disk, name);
if (file)
{
char buffer[1024]; int len;
while ((len = zzip_entry_fread (buffer, 1024, 1, file)))
fwrite (buffer, len, 1, out);
zzip_entry_fclose (file);
}
} | vuln | Vulnerable | C/C++ |
public function column_title( $post ) {
list( $mime ) = explode( '/', $post->post_mime_type );
$title = _draft_or_post_title();
$thumb = wp_get_attachment_image( $post->ID, array( 60, 60 ), true, array( 'alt' => '' ) );
$link_start = $link_end = '';
if ( current_user_can( 'edit_post', $post->ID ) && ! $this... | vuln | Safe | PHP |
static int stimer_set_config(struct kvm_vcpu_hv_stimer *stimer, u64 config,
bool host)
{
union hv_stimer_config new_config = {.as_uint64 = config},
old_config = {.as_uint64 = stimer->config.as_uint64};
struct kvm_vcpu *vcpu = hv_stimer_to_vcpu(stimer);
struct kvm_vcpu_hv *hv_vcpu = to_hv_vcpu(vcpu);
struc... | vuln | Safe | Unknown |
int Visualizer_command(effect_handle_t self, uint32_t cmdCode, uint32_t cmdSize,
void *pCmdData, uint32_t *replySize, void *pReplyData) {
VisualizerContext * pContext = (VisualizerContext *)self;
int retsize;
if (pContext == NULL || pContext->mState == VISUALIZER_STATE_UNINITIALIZED) {
return -EINVAL;
}
... | vuln | Vulnerable | C/C++ |
void numa_set_mem_node_id(ram_addr_t addr, uint64_t size, uint32_t node)
{
struct numa_addr_range *range;
if (!size) {
return;
}
range = g_malloc0(sizeof(*range));
range->mem_start = addr;
range->mem_end = addr + size - 1;
QLIST_INSERT_HEAD(&numa_info[node].addr, range, entry);
... | vuln | Safe | C/C++ |
public static List<String> getFluidTooltip(String fluidName) {
if (fluidName == null || fluidName.isEmpty()) {
return null;
}
return getFluidTooltip(FluidRegistry.getFluid(fluidName));
} | vuln | Safe | Java |
static int do_sigframe_return_v2(CPUState *env, target_ulong frame_addr,
struct target_ucontext_v2 *uc)
{
sigset_t host_set;
abi_ulong *regspace;
target_to_host_sigset(&host_set, &uc->tuc_sigmask);
sigprocmask(SIG_SETMASK, &host_set, NULL);
if (restore_sigcontext(env... | vuln | Safe | C/C++ |
static int add_uint64_element(struct ldb_context *ldb, struct ldb_message *msg,
const char *attr, uint64_t v)
{
int ret;
if (ldb_msg_find_element(msg, attr) != NULL) {
return LDB_SUCCESS;
}
/* always set as replace. This works because on add ops, the flag
is ignored */
ret = samdb_msg_append_uint6... | vuln | Safe | Unknown |
public void removeMultiValuesInAttributes(String inum, boolean mandatory, String removeValue) {
if (StringHelper.isEmpty(inum)) {
return;
}
GluuAttribute tmpAttribute = this.attributeInums.get(inum);
if (tmpAttribute == null) {
return;
}
String id = this.attributeIds.get(tmpAttribute);
this.availa... | vuln | Safe | Java |
drv_initcolor(TERMINAL_CONTROL_BLOCK * TCB,
int color, int r, int g, int b)
{
SCREEN *sp = TCB->csp;
AssertTCB();
if (initialize_color != NULL) {
NCURSES_PUTP2("initialize_color",
TIPARM_4(initialize_color, color, r, g, b));
}
} | vuln | Safe | Unknown |
static int parse_numa(void *opaque, QemuOpts *opts, Error **errp)
{
NumaOptions *object = NULL;
Error *err = NULL;
{
Visitor *v = opts_visitor_new(opts);
visit_type_NumaOptions(v, NULL, &object, &err);
visit_free(v);
}
if (err) {
goto error;
}
switch (object->... | vuln | Vulnerable | C/C++ |
void
snmp_api_set_oid(snmp_varbind_t *varbind, uint32_t *oid, uint32_t *ret_oid)
{
snmp_api_replace_oid(varbind, oid);
varbind->value_type = BER_DATA_TYPE_OID;
varbind->value.oid = ret_oid;
} | vuln | Vulnerable | C/C++ |
import dayjs from 'dayjs'
import utc from 'dayjs/plugin/utc'
import { saveAs } from 'file-saver'
import { FlowRouter } from 'meteor/ostrio:flow-router-extra'
import { NullXlsx } from '@neovici/nullxlsx'
import './periodtimetable.html'
import './pagination.js'
import './limitpicker.js'
import { i18nReady, t } from '../.... | vuln | Safe | JavaScript |
export function parse(formula: string): [a: number, b: number] {
formula = formula.trim().toLowerCase();
if (formula === "even") {
return [2, 0];
} else if (formula === "odd") {
return [2, 1];
}
const parsed = formula.match(RE_NTH_ELEMENT);
if (!parsed) {
throw new Err... | vuln | Vulnerable | JavaScript |
void ConnPoolImplBase::onConnectionEvent(ActiveClient& client, absl::string_view failure_reason,
Network::ConnectionEvent event) {
if (client.state() == ActiveClient::State::CONNECTING) {
ASSERT(connecting_stream_capacity_ >= client.effectiveConcurrentStreamLimit());
c... | vuln | Safe | Unknown |
load_image (const gchar *filename,
GError **error)
{
FILE *fd;
GimpDrawable *drawable;
GimpPixelRgn pixel_rgn;
guint16 offset_x, offset_y, bytesperline;
gint32 width, height;
gint32 image, layer;
guchar *dest, cmap[768];
guint8 header_buf[128];... | vuln | Safe | C/C++ |
_archive_write_disk_close(struct archive *_a)
{
struct archive_write_disk *a = (struct archive_write_disk *)_a;
struct fixup_entry *next, *p;
struct stat st;
char *c;
int fd, ret;
archive_check_magic(&a->archive, ARCHIVE_WRITE_DISK_MAGIC,
ARCHIVE_STATE_HEADER | ARCHIVE_STATE_DATA,
"archive_write_disk_c... | vuln | Vulnerable | Unknown |
const bootbox = require('bootbox');
require('../services/Requisitions');
require('../services/Synchronize');
/**
* @author Alejandro Galue <agalue@opennms.org>
* @copyright 2014 The OpenNMS Group, Inc.
*/
(function() {
'use strict';
const quickAddNodeView = require('../../views/quick-add-node.html');
const c... | vuln | Vulnerable | Java |
VirtIODevice *virtio_scsi_init(DeviceState *dev, VirtIOSCSIConf *proxyconf)
{
VirtIOSCSI *s;
static int virtio_scsi_id;
size_t sz;
int i;
sz = sizeof(VirtIOSCSI) + proxyconf->num_queues * sizeof(VirtQueue *);
s = (VirtIOSCSI *)virtio_common_init("virtio-scsi", VIRTIO_ID_SCSI,
... | vuln | Vulnerable | C/C++ |
bool ExtractUnixLink30(CommandData *Cmd,ComprDataIO &DataIO,Archive &Arc,const wchar *LinkName)
{
char Target[NM];
if (IsLink(Arc.FileHead.FileAttr))
{
size_t DataSize=(size_t)Arc.FileHead.PackSize;
if (DataSize>ASIZE(Target)-1)
return false;
if ((size_t)DataIO.UnpRead((byte *)Target,DataSize)!=... | vuln | Safe | Unknown |
/*
* sc.c: General functions
*
* Copyright (C) 2001, 2002 Juha Yrjölä <juha.yrjola@iki.fi>
*
* This library 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 the License, ... | vuln | Safe | C/C++ |
void RtmpProtocol::handle_chunk(RtmpPacket::Ptr packet) {
auto &chunk_data = *packet;
switch (chunk_data.type_id) {
case MSG_ACK: {
if (chunk_data.buffer.size() < 4) {
throw std::runtime_error("MSG_ACK: Not enough data");
}
//auto bytePeerRecv = load_b... | vuln | Safe | Unknown |
private void onPreDraw() {
updateScrollbarState();
mTrackView.setVisibility(mScrollbarEnabled ? View.VISIBLE : View.INVISIBLE);
mThumbView.setVisibility(mScrollbarEnabled ? View.VISIBLE : View.INVISIBLE);
if (!mScrollbarEnabled) {
mPopupView.setVisibility(View.INVISIBLE);
... | vuln | Vulnerable | Java |
public void set(Location l) {
mProvider = l.mProvider;
mTime = l.mTime;
mElapsedRealtimeNanos = l.mElapsedRealtimeNanos;
mElapsedRealtimeUncertaintyNanos = l.mElapsedRealtimeUncertaintyNanos;
mFieldsMask = l.mFieldsMask;
mLatitude = l.mLatitude;
mLongitude = l.mLo... | vuln | Vulnerable | Java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.