code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
static av_cold int imc_decode_init(AVCodecContext * avctx)
{
int i, j;
IMCContext *q = avctx->priv_data;
double r1, r2;
q->decoder_reset = 1;
for(i = 0; i < BANDS; i++)
q->old_floor[i] = 1.0;
ff_sine_window_init(q->mdct_sine_window, COEFFS);
for(i = 0; i < COEFFS; i++)
q... | vuln | Vulnerable | C/C++ |
static struct sctp_auth_bytes *sctp_auth_create_key(__u32 key_len, gfp_t gfp)
{
struct sctp_auth_bytes *key;
/* Allocate the shared key */
key = kmalloc(sizeof(struct sctp_auth_bytes) + key_len, gfp);
if (!key)
return NULL;
key->len = key_len;
atomic_set(&key->refcnt, 1);
SCTP_DBG_OBJCNT_INC(keys);
return ... | vuln | Vulnerable | Unknown |
public void onHashingAlgorithm(String algorithm) {
if (algorithm == null) {
return;
}
final String algorithmId = algorithm.toUpperCase(Locale.ROOT);
if (!config.getIastWeakHashAlgorithms().contains(algorithmId)) {
return;
}
final AgentSpan span = AgentTracer.activeSpan();
if (!ov... | vuln | Safe | Java |
static inline bool can_follow_write_pmd(pmd_t pmd, unsigned int flags)
{
return pmd_write(pmd) ||
((flags & FOLL_FORCE) && (flags & FOLL_COW) && pmd_dirty(pmd));
} | vuln | Vulnerable | C/C++ |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | vuln | Vulnerable | C/C++ |
/** @odoo-module **/
import { registry } from "@web/core/registry";
import {
Many2ManyTagsAvatarUserField,
KanbanMany2ManyTagsAvatarUserField,
many2ManyTagsAvatarUserField,
kanbanMany2ManyTagsAvatarUserField,
listMany2ManyTagsAvatarUserField,
} from "@mail/web/fields/many2many_avatar_user_field/man... | vuln | Safe | JavaScript |
/******************************************************************************
* bwm-ng handle cmdline and config file options *
* *
* for more info read README. *
... | vuln | Safe | C/C++ |
def get_remote_branch(cls, repo: str):
if not repo:
return super().get_remote_branch(repo)
try:
result = cls._popen(["ls-remote", "--symref", "--", repo, "HEAD"])
except RepositoryException:
report_error(cause="Listing remote branch")
return super(... | vuln | Safe | Python |
@Override
protected boolean sameAs(TransformState otherState) {
if (super.sameAs(otherState)) {
return true;
}
if (otherState instanceof ImageTransformState) {
final Icon otherIcon = ((ImageTransformState) otherState).mIcon;
return mIcon == otherIcon || (m... | vuln | Safe | Java |
static int xan_huffman_decode(unsigned char *dest, const unsigned char *src,
int dest_len)
{
unsigned char byte = *src++;
unsigned char ival = byte + 0x16;
const unsigned char * ptr = src + byte*2;
unsigned char val = ival;
unsigned char *dest_end = dest + dest_len;
GetBitContext gb;
ini... | vuln | Safe | C/C++ |
/* This file is part of libmspack.
* (C) 2003-2018 Stuart Caie.
*
* libmspack is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License (LGPL) version 2.1
*
* For further details, see the file COPYING.LIB distributed with libmspack
*/
/* CHM decompress... | vuln | Safe | C/C++ |
static int read_header(AVFormatContext *s,
AVFormatParameters *ap)
{
JVDemuxContext *jv = s->priv_data;
AVIOContext *pb = s->pb;
AVStream *vst, *ast;
int64_t audio_pts = 0;
int64_t offset;
int i;
avio_skip(pb, 80);
ast = av_new_stream(s, 0);
vst = av_new_stream... | vuln | Safe | C/C++ |
/**
*
* @file Utilities.cc
* @author An Tao
*
* Copyright 2018, An Tao. All rights reserved.
* https://github.com/an-tao/drogon
* Use of this source code is governed by a MIT license
* that can be found in the License file.
*
* Drogon
*
*/
#include <drogon/utils/Utilities.h>
#include "filesystem.h"... | vuln | Safe | C/C++ |
static FFPsyWindowInfo psy_lame_window(FFPsyContext *ctx, const float *audio,
const float *la, int channel, int prev_type)
{
AacPsyContext *pctx = (AacPsyContext*) ctx->model_priv_data;
AacPsyChannel *pch = &pctx->ch[channel];
int grouping = 0;
int uselongbloc... | vuln | Vulnerable | C/C++ |
#define UNP_READ_SIZE_MT 0x400000
#define UNP_BLOCKS_PER_THREAD 2
struct UnpackThreadDataList
{
UnpackThreadData *D;
uint BlockCount;
};
THREAD_PROC(UnpackDecodeThread)
{
UnpackThreadDataList *DL=(UnpackThreadDataList *)Data;
for (uint I=0;I<DL->BlockCount;I++)
DL->D->UnpackPtr->UnpackDe... | vuln | Safe | C/C++ |
@EventHandler
public void onGameObjectSelectionChanged (GameObjectSelectionChanged event) {
Array<GameObject> gameObjects = event.get();
selectGizmos(gameObjects);
} | vuln | Vulnerable | Java |
public static boolean newPlayer(UUID uid, String name, CPlayer player) {
if (DataCon.containinfieldslist(name)) {
kickplayer(player, 2, "");
return false;
}
Connection connection = database.getConnectionAndCheck();
switch (XConomy.Config.UUIDMODE) {
ca... | vuln | Safe | Java |
public int size() {
try {
return ByteUtils.safeBitLength(n.decode());
} catch (IntegerOverflowException e) {
throw new ArithmeticException(e.getMessage());
}
} | vuln | Safe | Java |
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
TF_LITE_ENSURE_EQ(context, NumInputs(node), 2);
TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1);
// Reinterprete the opaque data provided by user.
OpData* data = reinterpret_cast<OpData*>(node->user_data);
const TfLiteTensor* input1;
TF_LITE... | vuln | Safe | C/C++ |
xmlParseElementChildrenContentDeclPriv(xmlParserCtxtPtr ctxt, int inputchk,
int depth) {
xmlElementContentPtr ret = NULL, cur = NULL, last = NULL, op = NULL;
const xmlChar *elem;
xmlChar type = 0;
if (((depth > 128) && ((ctxt->options & XML_PARSE_HUGE) == 0)) ||
... | vuln | Safe | C/C++ |
function html_show_tabs_left() {
global $config, $tabs_left;
if (is_realm_allowed(8)) {
$show_console_tab = true;
} else {
$show_console_tab = false;
}
if (get_selected_theme() == 'classic') {
if ($show_console_tab == true) {
?><a <?php print (is_console_page(get_current_page()) ? " id='maintab-anchor" ... | vuln | Safe | PHP |
static void launch(OpKernelContext* context,
const TensorShape& tensor_in_shape,
const Tensor& out_backprop,
const std::array<int64, 3>& window,
const std::array<int64, 3>& stride,
const std::array<int64, 3>& output... | vuln | Vulnerable | C/C++ |
@AttackVector(
vulnerabilityExposed = {VulnerabilityType.PERSISTENT_XSS},
description =
"PERSISTENT_XSS_HTML_TAG_URL_PARAM_DIRECTLY_INJECTED_IN_DIV_TAG_REPLACING_IMG_AND_INPUT_TAG_CASE_INSENSITIVEIF_TAGS_ARE_PRESENT_BEFORE_NULL_BYTE")
@VulnerableAppRequestMapping(
... | vuln | Safe | Java |
/**
* Copyright (c) 2006-2020, JGraph Ltd
* Copyright (c) 2006-2020, draw.io AG
*/
var StorageDialog = function(editorUi, fn, rowLimit)
{
rowLimit = (rowLimit != null) ? rowLimit : 2;
var div = document.createElement('div');
div.style.textAlign = 'center';
div.style.whiteSpace = 'nowrap';
div.style.paddingTo... | vuln | Safe | JavaScript |
GF_Err gf_bifs_dec_sf_field(GF_BifsDecoder * codec, GF_BitStream *bs, GF_Node *node, GF_FieldInfo *field, Bool is_mem_com)
{
GF_Err e;
GF_Node *new_node;
u32 size, length, w, h, i;
char *buffer;
//blindly call unquantize. return is OK, error or GF_EOS
if (codec->ActiveQP && node) {
e = gf_bifs_dec_unquant_fiel... | vuln | Safe | C/C++ |
extern "C" void *malloc_wrapper(size_t size, void *caller)
{
void *ptr = NULL;
#ifdef MBED_MEM_TRACING_ENABLED
mbed_mem_trace_lock();
#endif
#ifdef MBED_HEAP_STATS_ENABLED
malloc_stats_mutex->lock();
alloc_info_t *alloc_info = NULL;
if (size <= SIZE_MAX - sizeof(alloc_info_t)) {
alloc_info =... | vuln | Safe | Unknown |
static bool _db_chain_eq(const struct db_arg_chain_tree *a,
const struct db_arg_chain_tree *b)
{
return ((a->arg == b->arg) && (a->op == b->op) &&
(a->datum == b->datum) && (a->mask == b->mask));
} | vuln | Vulnerable | Unknown |
static av_cold int prores_encode_init(AVCodecContext *avctx)
{
int i;
ProresContext* ctx = avctx->priv_data;
if (avctx->pix_fmt != PIX_FMT_YUV422P10LE) {
av_log(avctx, AV_LOG_ERROR, "need YUV422P10\n");
return -1;
}
if (avctx->width & 0x1) {
av_log(avctx, AV_LOG_ERROR,
... | vuln | Safe | C/C++ |
opts_visitor_new(const QemuOpts *opts)
{
OptsVisitor *ov;
ov = g_malloc0(sizeof *ov);
ov->visitor.type = VISITOR_INPUT;
ov->visitor.start_struct = &opts_start_struct;
ov->visitor.check_struct = &opts_check_struct;
ov->visitor.end_struct = &opts_end_struct;
ov->visitor.start_list = &opts_st... | vuln | Vulnerable | C/C++ |
static int adts_decode_extradata(AVFormatContext *s, ADTSContext *adts, const uint8_t *buf, int size)
{
GetBitContext gb;
PutBitContext pb;
MPEG4AudioConfig m4ac;
int off, ret;
ret = init_get_bits8(&gb, buf, size);
if (ret < 0)
return ret;
off = avpriv_mpeg4audio_get_config2(&m4ac, ... | vuln | Safe | Unknown |
void *bson_realloc( void *ptr, size_t size ) {
void *p;
p = bson_realloc_func( ptr, size );
bson_fatal_msg( !!p, "realloc() failed" );
return p;
} | vuln | Safe | C/C++ |
/*-------------------------------------------------------------------------
*
* postmaster.c
* This program acts as a clearing house for requests to the
* POSTGRES system. Frontend programs send a startup message
* to the Postmaster and the postmaster uses the info in the
* message to setup a backend pro... | vuln | Vulnerable | Java |
@Override
public void writeToParcel(Parcel out, int flags) {
out.writeBoolean(mShouldLetInstallerDecide);
out.writeBundle(mExtras);
if (mShouldLetInstallerDecide) {
return;
}
out.writeParcelable(mDigest, flags);
out.writeString(mPackageName);
out.w... | vuln | Safe | Java |
aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id)
{
struct usb_device *usbdev = interface_to_usbdev(intf);
struct usb_endpoint_descriptor *endpoint;
struct aiptek *aiptek;
struct input_dev *inputdev;
int i;
int speeds[] = { 0,
AIPTEK_PROGRAMMABLE_DELAY_50,
AIPTEK_PROGRAMMABLE_DELAY_400,... | vuln | Safe | C/C++ |
/*
* Copyright © 2010 Codethink Limited
*
* 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, or (at your option) any later version.
*
* This libr... | vuln | Safe | C/C++ |
// Copyright 2018 The Nakama 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 |
#include "mongoose.h"
#ifdef MG_MODULE_LINES
#line 1 "mongoose/src/mg_internal.h"
#endif
/*
* Copyright (c) 2014 Cesanta Software Limited
* All rights reserved
*/
#ifndef CS_MONGOOSE_SRC_INTERNAL_H_
#define CS_MONGOOSE_SRC_INTERNAL_H_
/* Amalgamated: #include "common/mg_mem.h" */
#ifndef MBUF_REALLOC
#define MBUF... | vuln | Safe | C/C++ |
@Override
public void update(float delta) {
// Hide and disable controls if the main game screen is not visible.
boolean mainGameScreenVisible = solApplication.getInputManager().isScreenOn(solApplication.getGame().getScreens().mainGameScreen);
((AbstractWidget)contents).setVisible(mainGameSc... | vuln | Safe | Java |
static void get_socket_name( char* buf, int len )
{
char* dpy = g_strdup(g_getenv("DISPLAY"));
if(dpy && *dpy)
{
char* p = strchr(dpy, ':');
for(++p; *p && *p != '.' && *p != '\n';)
++p;
if(*p)
*p = '\0';
}
#if GLIB_CHECK_VERSION(2, 28, 0)
g_snprint... | vuln | Safe | C/C++ |
static void __proc_set_tty(struct tty_struct *tty)
{
unsigned long flags;
spin_lock_irqsave(&tty->ctrl_lock, flags);
/*
* The session and fg pgrp references will be non-NULL if
* tiocsctty() is stealing the controlling tty
*/
put_pid(tty->session);
put_pid(tty->pgrp);
tty->pgrp = get_pid(task_pgrp(current)... | vuln | Safe | Unknown |
def save_failure_transaction(self, user_id, project_id, money):
self.cursor.execute("insert into transactions (project_id,user_id, money, timestamp, state) values (%s, %s, %s, now(), 'failed' )" % (project_id, user_id, money))
self.db.commit() | vuln | Vulnerable | Python |
static Image *ReadOneJNGImage(MngInfo *mng_info,
const ImageInfo *image_info, ExceptionInfo *exception)
{
Image
*alpha_image,
*color_image,
*image,
*jng_image;
ImageInfo
*alpha_image_info,
*color_image_info;
MagickBooleanType
logging;
int
unique_filenames;
ssize_t
y... | vuln | Vulnerable | C/C++ |
@Override
public Optional<BlockPos> locateSpawn() {
Random random = new Random();
int spawnX;
int spawnY;
int spawnZ;
int attempts = 0;
int width = this.chunkProvider.getLevelWidth();
int length = this.chunkProvider.getLevelLength();... | vuln | Vulnerable | Java |
static int cleanup_bundling_task(ncInstance * instance, struct bundling_params_t *params, bundling_progress result)
{
int rc = 0;
char cmd[MAX_PATH] = { 0 };
char buf[MAX_PATH] = { 0 };
LOGINFO("[%s] bundling task result=%s\n", instance->instanceId, bundling_progress_names[result]);
sem_p(inst_sem... | vuln | Safe | Unknown |
static st64 buf_format(RBuffer *dst, RBuffer *src, const char *fmt, int n) {
st64 res = 0;
int i;
for (i = 0; i < n; i++) {
int j;
int m = 1;
int tsize = 2;
bool bigendian = true;
for (j = 0; fmt[j]; j++) {
switch (fmt[j]) {
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
... | vuln | Vulnerable | C/C++ |
function info_application($bp_name, $bdd){
$sql = "select * from bp where name = ?";
$req = $bdd->prepare($sql);
$req->execute(array($bp_name));
$info = $req->fetch();
echo json_encode($info);
} | vuln | Safe | PHP |
def similarity_search_with_score(
self, query: str, k: int = 4, filter: Optional[dict] = None
) -> List[Tuple[Document, float]]:
"""Return docs most similar to query. Uses cosine similarity.
Args:
query: Text to look up documents similar to.
k: Number of Documents to... | vuln | Safe | Python |
mlx5_rx_poll_len(struct mlx5_rxq_data *rxq, volatile struct mlx5_cqe *cqe,
uint16_t cqe_cnt, volatile struct mlx5_mini_cqe8 **mcqe)
{
struct rxq_zip *zip = &rxq->zip;
uint16_t cqe_n = cqe_cnt + 1;
int len;
uint16_t idx, end;
do {
len = 0;
/* Process compressed data in the CQE and mini arrays. */
if (zip-... | vuln | Vulnerable | Unknown |
/*
* . .o8 oooo
* .o8 "888 `888
* .o888oo oooo d8b oooo oooo .oooo888 .ooooo. .oooo.o 888 oooo
* 888 `888""8P `888 `888 d88' `888 d88' `88b d88( "8 888 .8P'
* 888 888 888 888 8... | vuln | Safe | JavaScript |
#! /usr/bin/env node
var path = require('path'),
fs = require('fs'),
url = require('url'),
mime = require('mime'),
urlJoin = require('url-join'),
showDir = require('./ecstatic/showdir'),
version = JSON.parse(
fs.readFileSync(__dirname + '/../package.json').toString()
).version,
st... | vuln | Vulnerable | Java |
Pl_DCT::compress(void* cinfo_p, Buffer* b)
{
struct jpeg_compress_struct* cinfo =
reinterpret_cast<jpeg_compress_struct*>(cinfo_p);
#if ((defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406) || \
defined(__clang__))
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "... | vuln | Vulnerable | Unknown |
nfs4_file_open(struct inode *inode, struct file *filp)
{
struct nfs_open_context *ctx;
struct dentry *dentry = file_dentry(filp);
struct dentry *parent = NULL;
struct inode *dir;
unsigned openflags = filp->f_flags;
struct iattr attr;
int err;
/*
* If no cached dentry exists or if it's negative, NFSv4 handled... | vuln | Safe | C/C++ |
private void setStateImpl(boolean state) {
if (Platform.isRaspberryPi()) {
try {
// stop any active blink
pigpioSocket.waveTxStop();
} catch (PigpioException e) {
logger.error("Failed to stop blink!", e);
} catch (NullPointerExc... | vuln | Safe | Java |
status_t GraphicBuffer::unflatten(
void const*& buffer, size_t& size, int const*& fds, size_t& count) {
if (size < 8*sizeof(int)) return NO_MEMORY;
int const* buf = static_cast<int const*>(buffer);
if (buf[0] != 'GBFR') return BAD_TYPE;
const size_t numFds = buf[8];
const size_t numInts = buf[9];
... | vuln | Safe | C/C++ |
/* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICENSE. */
/*
* LSQUIC Logger implementation.
*/
#include <assert.h>
#include <errno.h>
#include <inttypes.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifndef WIN32
#include <sys/time.h>
#endif
#include <time.h>
#de... | vuln | Safe | C/C++ |
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include "CarbonProtocolReader.h"
namespace carbon {
void CarbonProtocolReader::skipLinearContainer() {
const auto pr = readLine... | vuln | Safe | C/C++ |
def pcsd_restart_nodes(session, nodes)
node_response = {}
threads = []
nodes.each { |node|
threads << Thread.new {
code, response = send_request_with_token(
session, node, '/pcsd_restart', true
)
node_response[node] = [code, response]
}
}
threads.each { |t| t.join }
node_e... | vuln | Vulnerable | Ruby |
@Override
public void flowY(int width, int height, int preferred) {
super.flowX(width, preferred);
for (int x = 0; x < grid.size(); x++) {
List<GuiChildControl> rows = grid.get(x);
for (int y = 0; y < rows.size(); y++) {
GuiChildControl child = rows.get(y);
... | vuln | Safe | Java |
static void emulated_push_type(EmulatedState *card, uint32_t type)
{
EmulEvent *event = (EmulEvent *)g_malloc(sizeof(EmulEvent));
assert(event);
event->p.gen.type = type;
emulated_push_event(card, event);
} | vuln | Vulnerable | C/C++ |
private void onMenuSearch() {
Bundle args = new Bundle();
args.putLong("account", account);
args.putLong("folder", folder);
FragmentDialogSearch fragment = new FragmentDialogSearch();
fragment.setArguments(args);
fragment.show(getParentFragmentManager(), "search");
} | vuln | Vulnerable | Java |
int monitor_read_bdrv_key_start(Monitor *mon, BlockDriverState *bs,
BlockCompletionFunc *completion_cb,
void *opaque)
{
Error *local_err = NULL;
int err;
bdrv_add_key(bs, NULL, &local_err);
if (!local_err) {
if (completion_cb)
... | vuln | Safe | C/C++ |
/*
Copyright The Helm 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 in writing, software
distrib... | vuln | Vulnerable | Go |
'use strict';
// The Console constructor is not actually used to construct the global
// console. It's exported for backwards compatibility.
const {
ArrayFrom,
ArrayIsArray,
Boolean,
Error,
Map,
ObjectDefineProperties,
ObjectDefineProperty,
ObjectKeys,
ObjectPrototypeHasOwnProperty,
ObjectValues,
... | vuln | Vulnerable | JavaScript |
static void tm_reclaim_thread(struct thread_struct *thr,
struct thread_info *ti, uint8_t cause)
{
unsigned long msr_diff = 0;
/*
* If FP/VSX registers have been already saved to the
* thread_struct, move them to the transact_fp array.
* We clear the TIF_RESTORE_TM bit since after the reclaim
* the t... | vuln | Vulnerable | C/C++ |
bool EmbFile::save2(FILE *f) {
int c;
if (unlikely(!m_objStr.isStream()))
return false;
m_objStr.streamReset();
while ((c = m_objStr.streamGetChar()) != EOF) {
fputc(c, f);
}
return true;
} | vuln | Safe | C/C++ |
@Nullable
InputStream getBlobStream(final long blobHandle) throws IOException {
final LongHashMap<InputStream> blobStreams = this.blobStreams;
if (blobStreams != null) {
final InputStream stream = blobStreams.get(blobHandle);
if (stream != null) {
stream.rese... | vuln | Safe | Java |
static TfLiteStatus InitTemporaryTensors(TfLiteContext* context,
TfLiteNode* node) {
OpData* data = reinterpret_cast<OpData*>(node->user_data);
// The prepare function may be executed multiple times. But temporary tensors
// only need to be initiated once.
if (data->fft_... | vuln | Safe | C/C++ |
NativeBrowserFrame* NativeBrowserFrame::CreateNativeBrowserFrame(
BrowserFrame* browser_frame,
BrowserView* browser_view) {
if (views::Widget::IsPureViews() &&
views::ViewsDelegate::views_delegate->GetDefaultParentView())
return new BrowserFrameViews(browser_frame, browser_view);
return new Br... | vuln | Safe | C/C++ |
/*
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2000-2020
* 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 ... | vuln | Vulnerable | C/C++ |
xmlParseDocument(xmlParserCtxtPtr ctxt) {
xmlChar start[4];
xmlCharEncoding enc;
xmlInitParser();
if ((ctxt == NULL) || (ctxt->input == NULL))
return(-1);
GROW;
/*
* SAX: detecting the level.
*/
xmlDetectSAX2(ctxt);
/*
* SAX: beginning of the document processi... | vuln | Vulnerable | Unknown |
function start(config) {
var host = conf.constant.host;
if(config) conf.serv = config;
function onRequest(request, response) {
var frontUrl = '';
if(request.url === '/favicon.ico') return;
for(var key in conf.serv) {
if(request.headers.host.indexOf(key) !== -1) {
host = conf.serv[key];
... | vuln | Safe | JavaScript |
static int format8BIM(Image *ifile, Image *ofile)
{
char
temp[MagickPathExtent];
unsigned int
foundOSType;
int
ID,
resCount,
i,
c;
ssize_t
count;
unsigned char
*PString,
*str;
resCount=0;
foundOSType=0; /* found the OSType */
(void) foundOSType;
c=ReadBlobByte(... | vuln | Safe | C/C++ |
png_set_IHDR(png_structp png_ptr, png_infop info_ptr,
png_uint_32 width, png_uint_32 height, int bit_depth,
int color_type, int interlace_type, int compression_type,
int filter_type)
{
png_debug1(1, "in %s storage function", "IHDR");
if (png_ptr == NULL || info_ptr == NULL)
return;
info_ptr->w... | vuln | Vulnerable | C/C++ |
@Override
public void run() {
this.threadNum.incrementAndGet();
String stmt = null;
DumpFileWriter writer = this.context.getWriter();
while (!Thread.currentThread().isInterrupted()) {
try {
//thread pool shrink
boolean shrink = shrinkThread... | vuln | Vulnerable | Java |
function add_application($uniq_name_orig,$uniq_name,$process_name,$display,$url,$command,$type,$min_value,$bdd){
if($type != 'MIN'){
$min_value = "";
}
$sql = "select count(*) from bp where name = ?;";
$req = $bdd->prepare($sql);
$req->execute(array($uniq_name));
$bp_exist = $req->fetch();
// add
if($bp_exis... | vuln | Safe | PHP |
@Override
public void renderByItem(ItemStack stack, ItemTransforms.TransformType transformType, PoseStack poseStack, MultiBufferSource renderTypeBuffer, int combinedLight, int combinedOverlay) {
ICraftingPattern pattern = PatternItem.fromCache(Minecraft.getInstance().level, stack);
ItemStack output... | vuln | Safe | Java |
/**
* Copyright (c) 2006-2012, JGraph Ltd
*/
// Workaround for handling named HTML entities in mxUtils.parseXml
// LATER: How to configure DOMParser to just ignore all entities?
(function()
{
var entities = [
['nbsp', '160'],
['shy', '173']
];
var parseXml = mxUtils.parseXml;
mxUtils.parseXml = function... | vuln | Vulnerable | JavaScript |
int WebContentsImpl::DownloadImage(
const GURL& url,
bool is_favicon,
uint32_t max_bitmap_size,
bool bypass_cache,
const WebContents::ImageDownloadCallback& callback) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
static int next_image_download_id = 0;
const image_downloader::ImageDownloaderPtr& mo... | vuln | Vulnerable | C/C++ |
void utf32_to_utf8(const char32_t* src, size_t src_len, char* dst)
void utf32_to_utf8(const char32_t* src, size_t src_len, char* dst, size_t dst_len)
{
if (src == NULL || src_len == 0 || dst == NULL) {
return;
}
const char32_t *cur_utf32 = src;
const char32_t *end_utf32 = src + src_len;
char *c... | vuln | Safe | C/C++ |
static void ivshmem_read(void *opaque, const uint8_t *buf, int size)
{
IVShmemState *s = opaque;
int incoming_fd, tmp_fd;
int guest_max_eventfd;
long incoming_posn;
if (fifo8_is_empty(&s->incoming_fifo) && size == sizeof(incoming_posn)) {
memcpy(&incoming_posn, buf, size);
} else {
... | vuln | Vulnerable | C/C++ |
long do_sigreturn(CPUSH4State *regs)
{
struct target_sigframe *frame;
abi_ulong frame_addr;
sigset_t blocked;
target_sigset_t target_set;
target_ulong r0;
int i;
int err = 0;
#if defined(DEBUG_SIGNAL)
fprintf(stderr, "do_sigreturn\n");
#endif
frame_addr = regs->gregs[15];
if (!lo... | vuln | Safe | C/C++ |
def add_input(self, data):
connection = self.connect()
try:
# The following introduces a deliberate security flaw - SQL Injection
query = "INSERT INTO crimes (description) VALUES (%s);"
with connection.cursor() as cursor:
cursor.execute(query, data)
... | vuln | Safe | Python |
public void cactusAbility(@Nullable Player player, @Nullable TravelersBackpackBlockEntity blockEntity)
{
if(player == null && blockEntity != null)
{
FluidTank leftTank = blockEntity.getLeftTank();
FluidTank rightTank = blockEntity.getRightTank();
int drops = 0;
... | vuln | Safe | Java |
/*
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2000-2022
* 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++ |
void
tcpdump_kill(tcpdump_t *tcpdump)
{
if (tcpdump->pid) {
if (kill(tcpdump->pid, SIGTERM) != 0) {
kill(tcpdump->pid, SIGKILL);
}
}
tcpdump->infd = 0;
tcpdump->outfd = 0;
tcpdump->pid = 0;
} | vuln | Vulnerable | C/C++ |
function html_edit_form($param) {
global $TEXT;
if ($param['target'] !== 'section') {
msg('No editor for edit target ' . hsc($param['target']) . ' found.', -1);
}
$attr = array('tabindex'=>'1');
if (!$param['wr']) $attr['readonly'] = 'readonly';
$param['form']->addElement(form_makeWik... | vuln | Safe | PHP |
http_client_check_response_cb (SoupSession *session, SoupMessage *msg, gpointer user_data)
{
GError *error;
CheckData *data = user_data;
gboolean op_res;
error = NULL;
op_res = FALSE;
/* status == SOUP_STATUS_CANCELLED, if we are being aborted by the
* GCancellable or due to an SSL error.
*/
if (m... | vuln | Safe | Unknown |
void Win32StackFrameUnwinder::Win32UnwindFunctions::VirtualUnwind( | vuln | Safe | C/C++ |
@endpoints.route("/ranks")
def ranks():
if db == None:
init()
scene = request.args.get('scene', default='austin')
date = request.args.get('date')
# If no date was provided, pick the date of the latest tournament
if date == None:
sql = "SELECT distinct date FROM ranks WHERE scene='... | vuln | Safe | Python |
var http = require('http');
var querystring = require('querystring');
var errorTemplate = require('../templates/error.js');
const snip = require('../snip.js');
const genReqLogLine = ({ head, method, path, params, suffix }) =>
!process.appParams.color
? [
head,
method,
path[0] + (path.leng... | vuln | Vulnerable | JavaScript |
public void setFileSeqs(String[] fileSeqs) {
this.fileSeqs = fileSeqs != null ? fileSeqs.clone() : null;
} | vuln | Safe | 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->cmda... | vuln | Vulnerable | Unknown |
ip_optprint(netdissect_options *ndo,
register const u_char *cp, u_int length)
{
register u_int option_len;
const char *sep = "";
for (; length > 0; cp += option_len, length -= option_len) {
u_int option_code;
ND_PRINT((ndo, "%s", sep));
sep = ",";
ND_TCHECK(*cp);
option_code = *cp;
ND_PRI... | vuln | Vulnerable | Unknown |
PHP_HASH_API void PHP_HAVAL128Final(unsigned char *digest, PHP_HAVAL_CTX * context)
{
unsigned char bits[10];
unsigned int index, padLen;
/* Version, Passes, and Digest Length */
bits[0] = (PHP_HASH_HAVAL_VERSION & 0x07) |
((context->passes & 0x07) << 3) |
((context->output & 0x03) << 6);
bits[1] = (conte... | vuln | Vulnerable | Unknown |
static void update_logging() {
bool should_log = module_started &&
(logging_enabled_via_api || stack_config->get_btsnoop_turned_on());
if (should_log == is_logging)
return;
is_logging = should_log;
if (should_log) {
btsnoop_net_open();
const char *log_path = stack_config->get_btsnoop_log_path();
if (st... | vuln | Vulnerable | C/C++ |
static void free_picture(MpegEncContext *s, Picture *pic){
int i;
if(pic->data[0] && pic->type!=FF_BUFFER_TYPE_SHARED){
free_frame_buffer(s, pic);
}
av_freep(&pic->mb_var);
av_freep(&pic->mc_mb_var);
av_freep(&pic->mb_mean);
av_freep(&pic->mbskip_table);
av_freep(&pic->qscale_tab... | vuln | Vulnerable | C/C++ |
int lookup(struct sip_msg* _m, char* _t, char* _f, char* _s)
{
unsigned int flags;
urecord_t* r;
str aor, uri;
ucontact_t* ptr,*it;
int res;
int ret;
str path_dst;
str flags_s;
pv_value_t val;
int_str istr;
str sip_instance = {0,0},call_id = {0,0};
flags = 0;
if (_f && _f[0]!=0) {
if (fixup_get_svalue( ... | vuln | Vulnerable | Unknown |
# -*- 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 |
int ares_parse_aaaa_reply(const unsigned char *abuf, int alen,
struct hostent **host, struct ares_addr6ttl *addrttls,
int *naddrttls)
{
struct ares_addrinfo ai;
struct ares_addrinfo_node *next;
struct ares_addrinfo_cname *next_cname;
char **aliases = NULL;
c... | vuln | Safe | Unknown |
DECLAREContigPutFunc(putagreytile)
{
int samplesperpixel = img->samplesperpixel;
uint32** BWmap = img->BWmap;
(void) y;
while (h-- > 0) {
for (x = w; x-- > 0;)
{
*cp++ = BWmap[*pp][0] & (*(pp+1) << 24 | ~A1);
pp += samplesperpixel;
}
cp += toskew;
pp += fromsk... | vuln | Vulnerable | Unknown |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.