code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
dump_sig_subpkt (int hashed, int type, int critical,
const byte * buffer, size_t buflen, size_t length)
{
const char *p = NULL;
int i;
/* The CERT has warning out with explains how to use GNUPG to detect
* the ARRs - we print our old message here when it is a faked ARR
* and add an additional notice. *... | vuln | Safe | Unknown |
@Override
public void specificRemoveHandling(RemovalReason removalReason) {
npcEntity.getVillager().removeMetadata(MetadataHandler.NPC_METADATA, MetadataHandler.PLUGIN);
if (removalReason.equals(RemovalReason.REMOVE_COMMAND)) {
npcEntity.deleteNPCEntity();
return;
}
... | vuln | Vulnerable | Java |
double
ruby_strtod(const char *s00, char **se)
{
#ifdef Avoid_Underflow
int scale;
#endif
int bb2, bb5, bbe, bd2, bd5, bbbits, bs2, c, dsign,
e, e1, esign, i, j, k, nd, nd0, nf, nz, nz0, sign;
const char *s, *s0, *s1;
double aadj, adj;
double_u aadj1, rv, rv0;
Long L;
ULong y, z;
... | vuln | Safe | Unknown |
BlockDriverAIOCB *bdrv_aio_writev(BlockDriverState *bs, int64_t sector_num,
QEMUIOVector *iov, int nb_sectors,
BlockDriverCompletionFunc *cb, void *opaque)
{
return bdrv_aio_rw_vector(bs, sector_num, iov, nb_sectors,
c... | vuln | Vulnerable | C/C++ |
client_x11_display_valid(const char *display)
{
size_t i, dlen;
if (display == NULL)
return 0;
dlen = strlen(display);
for (i = 0; i < dlen; i++) {
if (!isalnum((u_char)display[i]) &&
}
} | vuln | Safe | C/C++ |
private void clean(Deobfuscator deobfuscator) {
deobfuscator.classes().stream()
.flatMap(classNode -> classNode.methods.stream())
.forEach(methodNode -> {
boolean modified;
do {
modified = false;
... | vuln | Safe | Java |
int dtls1_accept(SSL *s)
{
BUF_MEM *buf;
unsigned long Time=(unsigned long)time(NULL);
void (*cb)(const SSL *ssl,int type,int val)=NULL;
unsigned long alg_k;
int ret= -1;
int new_state,state,skip=0;
int listen;
#ifndef OPENSSL_NO_SCTP
unsigned char sctpauthkey[64];
char labelbuffer[sizeof(DTLS1_SCTP_AUTH_LABE... | vuln | Vulnerable | Unknown |
constructor(provider, options) {
this[_provider] = provider;
this[_options] = Object.assign({}, options);
this[_allowedAttributeNames] = new Set([
// Core
'height',
'preserveAspectRatio',
'viewBox',
'width',
'x',
'xmlns',
'y',
// Conditional Processing
... | vuln | Safe | JavaScript |
public static Path getResourceCachePath(URI uri) throws IOException {
//Eliminate all path traversals
URI normalizedUri = uri.normalize();
//If there's any /../ left, we bail, as that looks like a malicious URI.
if (normalizedUri.getPath().contains("/../")) {
throw new InvalidURIException(uri.toString(), In... | vuln | Safe | Java |
@Override
public void remapDefaultIds() {
List<String> list = new ArrayList<>();
for (Map.Entry<String, Class<? extends Entity>> entry : this.stringClassBiMap.entrySet()) {
if (!this.getNewKey(entry.getKey()).equals(entry.getKey())) {
list.add(entry.getKey());
}
}
for (String oldKey : list) {
if... | vuln | Safe | Java |
_format(value) {
if (['boolean', 'number'].includes(typeof value)) {
return `${value}`;
} else if ('string' === typeof value) {
if (value.includes('\'')) {
throw Error('Argument must not contain single quote "\'"');
} else if (/^[0-9a-z-=/~.:]+$/i.test(value)) {
return `${value... | vuln | Safe | JavaScript |
public int shrinkMax(double max) {
double t = getLastValue();
int count = 0;
while (t > max) {
values.remove(size() - 1);
t = getLastValue();
count++;
}
return count;
} | vuln | Vulnerable | Java |
"""Classes for manipulating bytestreams containing values that may be fixed-
or variable-size.
"""
import abc
import enum
import io
import struct
import types
import typing
import warnings
from openssh_key import utils
class PascalStyleFormatInstruction(enum.Enum):
"""Format instructions for variable-length val... | vuln | Vulnerable | Python |
int wait_for_key_construction(struct key *key, bool intr)
{
int ret;
ret = wait_on_bit(&key->flags, KEY_FLAG_USER_CONSTRUCT,
intr ? TASK_INTERRUPTIBLE : TASK_UNINTERRUPTIBLE);
if (ret)
return -ERESTARTSYS;
ret = key_read_state(key);
if (ret < 0)
return ret;
return key_validate(key);
} | vuln | Safe | Unknown |
void zipfileStep(sqlite3_context *pCtx, int nVal, sqlite3_value **apVal){
ZipfileCtx *p; /* Aggregate function context */
ZipfileEntry e; /* New entry to add to zip archive */
sqlite3_value *pName = 0;
sqlite3_value *pMode = 0;
sqlite3_value *pMtime = 0;
sqlite3_value *pDat... | vuln | Safe | Unknown |
static void decode_bo_addrmode_post_pre_base(CPUTriCoreState *env,
DisasContext *ctx)
{
uint32_t op2;
uint32_t off10;
int32_t r1, r2;
TCGv temp;
r1 = MASK_OP_BO_S1D(ctx->opcode);
r2 = MASK_OP_BO_S2(ctx->opcode);
off10 = MASK_OP_BO_OFF10_SEXT(ctx-... | vuln | Safe | C/C++ |
import { mainPage } from "../../support/page_objects/mainPage";
import {
isTestSuiteActive,
isXcdb,
getProjectString,
isPostgres,
} from "../../support/page_objects/projectConstants";
export const genTest = (apiType, dbType) => {
if (!isTestSuiteActive(apiType, dbType)) return;
describe(`${api... | vuln | Vulnerable | JavaScript |
static av_cold int vpx_init(AVCodecContext *avctx,
const struct vpx_codec_iface *iface)
{
VP8Context *ctx = avctx->priv_data;
struct vpx_codec_enc_cfg enccfg;
int res;
av_log(avctx, AV_LOG_INFO, "%s\n", vpx_codec_version_str());
av_log(avctx, AV_LOG_VERBOSE, "%s\n", vpx_c... | vuln | Safe | C/C++ |
def messages(self) -> List[BaseMessage]: # type: ignore
"""Retrieve the messages from DynamoDB"""
from botocore.exceptions import ClientError
response = None
try:
response = self.table.get_item(Key={"SessionId": self.session_id})
except ClientError as error:
... | vuln | Safe | Python |
function expand_chart(ref){
var chart = $(ref);
if (!chart.hasClass('statistics-pie')){
chart = chart.parent().find('.statistics-pie');
}
var modal_id = chart[0].id+'_modal';
if($("#"+modal_id).length == 0)
{
var new_chart = chart.clone().empty().attr('id', modal_id + "_chart").removeClass('small');... | vuln | Safe | JavaScript |
static int vhost_user_get_vring_base(struct vhost_dev *dev,
struct vhost_vring_state *ring)
{
VhostUserMsg msg = {
.request = VHOST_USER_GET_VRING_BASE,
.flags = VHOST_USER_VERSION,
.state = *ring,
.size = sizeof(*ring),
};
vhost_user_writ... | vuln | Vulnerable | C/C++ |
package com.publiccms.views.directive.sys;
// Generated 2021-8-2 11:31:34 by com.publiccms.common.generator.SourceGenerator
import java.io.IOException;
import java.io.StringReader;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import org.springframework.beans.factory.annotation.Autowired;... | vuln | Safe | Java |
static void framebuffer_update_request(VncState *vs, int incremental,
int x, int y, int w, int h)
{
int width = pixman_image_get_width(vs->vd->server);
int height = pixman_image_get_height(vs->vd->server);
vs->need_update = 1;
if (incremental) {
return;
... | vuln | Safe | Unknown |
static int sync(AVFormatContext *s, int64_t *timestamp, int *flags, int *stream_index, int64_t *pos){
RMDemuxContext *rm = s->priv_data;
ByteIOContext *pb = s->pb;
int len, num, res, i;
AVStream *st;
uint32_t state=0xFFFFFFFF;
while(!url_feof(pb)){
*pos= url_ftell(pb) - 3;
if(rm-... | vuln | Safe | C/C++ |
'use strict';
/* eslint func-names: off */
require('./polyfills');
const fs = require('fs');
const http = require('http');
const path = require('path');
const url = require('url');
const chokidar = require('chokidar');
const compress = require('compression');
const del = require('del');
const express = require('expre... | vuln | Vulnerable | JavaScript |
@Override
public IAgriGrowCondition liquidFromTag(IntPredicate strength, Collection<Tag<Fluid>> tags) {
return this.liquidFromFluid((str, fluid) -> strength.test(str) || tags.stream().anyMatch(tag -> tag.contains(fluid)),
ImmutableList.of(new StringTextComponent("")
.... | vuln | Safe | Java |
void vp8_decoder_remove_threads(VP8D_COMP *pbi)
void vp8_decoder_remove_threads(VP8D_COMP *pbi) {
/* shutdown MB Decoding thread; */
if (pbi->b_multithreaded_rd) {
int i;
pbi->b_multithreaded_rd = 0;
/* allow all threads to exit */
for (i = 0; i < pbi->allocated_decoding_thread_count; ++i) {
... | vuln | Safe | C/C++ |
int jpc_ppxstab_insert(jpc_ppxstab_t *tab, jpc_ppxstabent_t *ent)
{
int inspt;
int i;
// check on MAX_INT
int correct_num_ents = tab->numents;
if (correct_num_ents > 0x7FFFFFFE)
correct_num_ents = 0x7FFFFFFE;
for (i = 0; i < correct_num_ents; ++i) {
if (tab->ents[i]->ind > ent->ind) {
b... | vuln | Safe | C/C++ |
function Su(e){let t=e.match(/^(-?[0-9]+)(px|%)?$/);return t?t[1]+(t[2]||"px"):void 0} | vuln | Vulnerable | JavaScript |
aio_write_f(int argc, char **argv)
{
int nr_iov, c;
int pattern = 0xcd;
struct aio_ctx *ctx = calloc(1, sizeof(struct aio_ctx));
BlockDriverAIOCB *acb;
while ((c = getopt(argc, argv, "CqP:")) != EOF) {
switch (c) {
case 'C':
ctx->Cflag = 1;
break;
case 'q':
ctx->qflag = 1;
break;
case 'P':
p... | vuln | Vulnerable | C/C++ |
static void vmsvga_fifo_run(struct vmsvga_state_s *s)
{
uint32_t cmd, colour;
int args, len, maxloop = 1024;
int x, y, dx, dy, width, height;
struct vmsvga_cursor_definition_s cursor;
uint32_t cmd_start;
len = vmsvga_fifo_length(s);
while (len > 0 && --maxloop > 0) {
/* May need to ... | vuln | Safe | Unknown |
static ssize_t store_attach(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
struct socket *socket;
int sockfd = 0;
__u32 port = 0, pdev_nr = 0, rhport = 0, devid = 0, speed = 0;
struct usb_hcd *hcd;
struct vhci_hcd *vhci_hcd;
struct vhci_device *vdev;
struct vhci *vhci;... | vuln | Safe | Unknown |
void h2o_configurator__init_core(h2o_globalconf_t *conf)
{
/* check if already initialized */
if (h2o_configurator_get_command(conf, "files") != NULL)
return;
{ /* `hosts` and `paths` */
h2o_configurator_t *c = h2o_configurator_create(conf, sizeof(*c));
h2o_configurator_define_comma... | vuln | Safe | C/C++ |
#include "source/common/runtime/runtime_features.h"
#include "absl/flags/commandlineflag.h"
#include "absl/flags/flag.h"
#include "absl/strings/match.h"
#include "absl/strings/str_replace.h"
#define RUNTIME_GUARD(name) ABSL_FLAG(bool, name, true, ""); // NOLINT
#define FALSE_RUNTIME_GUARD(name) ABSL_FLAG(bool,... | vuln | Safe | C/C++ |
static void __init xen_hvm_guest_init(void)
{
if (xen_pv_domain())
return;
init_hvm_pv_info();
reserve_shared_info();
xen_hvm_init_shared_info();
/*
* xen_vcpu is a pointer to the vcpu_info struct in the shared_info
* page, we use it in the event channel upcall and in some pvclock
* related functions.
... | vuln | Vulnerable | Unknown |
int ip_build_and_send_pkt(struct sk_buff *skb, struct sock *sk,
__be32 saddr, __be32 daddr, struct ip_options *opt)
{
struct inet_sock *inet = inet_sk(sk);
struct rtable *rt = skb_rtable(skb);
struct iphdr *iph;
/* Build the IP header. */
skb_push(skb, sizeof(struct iphdr) + (opt ? opt->optlen : 0));
skb_re... | vuln | Vulnerable | Unknown |
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
OpData* data = reinterpret_cast<OpData*>(node->user_data);
auto* params = reinterpret_cast<TfLiteSubParams*>(node->builtin_data);
TF_LITE_ENSURE_EQ(context, NumInputs(node), 2);
TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1);
const TfLiteTens... | vuln | Safe | C/C++ |
def project_configure(request, project_name):
"""
get configuration
:param request: request object
:param project_name: project name
:return: json
"""
# get configuration
if request.method == 'GET':
project = Project.objects.get(name=project_name)
project = model_to_dict(... | vuln | Vulnerable | Python |
@Inject(at = @At("HEAD"), method = "sendChatMessage", cancellable = true)
private void onSendChatMessage(String message, CallbackInfo info) {
// TODO: Baritone
if (!message.startsWith(Config.get().prefix) && !message.startsWith("/")/* && !message.startsWith(BaritoneAPI.getSettings().prefix.value)*/)... | vuln | Vulnerable | Java |
static void opt_frame_pix_fmt(const char *arg)
{
if (strcmp(arg, "list")) {
frame_pix_fmt = avcodec_get_pix_fmt(arg);
if (frame_pix_fmt == PIX_FMT_NONE) {
fprintf(stderr, "Unknown pixel format requested: %s\n", arg);
av_exit(1);
}
} else {
list_fmts(avcode... | vuln | Safe | C/C++ |
static ssize_t imx_enet_receive(NetClientState *nc, const uint8_t *buf,
size_t len)
{
IMXFECState *s = IMX_FEC(qemu_get_nic_opaque(nc));
IMXENETBufDesc bd;
uint32_t flags = 0;
uint32_t addr;
uint32_t crc;
uint32_t buf_addr;
uint8_t *crc_ptr;
unsigned int b... | vuln | Vulnerable | C/C++ |
public static ResourceLocation pickBiomeFromID(WeightedList<ResourceLocation> biomeWeightedList, Context rand) {
double total = 0;
for (WeightedList.WeightedEntry biomeEntry : ((WeightedListAccess<ResourceLocation>) biomeWeightedList).getEntries())
total = total + ((WeightedListEntryAccess)... | vuln | Vulnerable | Java |
static bool parse_reconnect(struct pool *pool, json_t *val)
{
char *sockaddr_url, *stratum_port, *tmp;
char *url, *port, address[256];
if (opt_disable_client_reconnect) {
applog(LOG_WARNING, "Stratum client.reconnect forbidden, aborting.");
return false;
}
memset(address, 0, 255);
url = (char *)json_string_... | vuln | Vulnerable | C/C++ |
public function myaddressbook() {
global $user;
// check if the user is logged in.
expQueue::flashIfNotLoggedIn('message',gt('You must be logged in to manage your address book.')); //fixme is this redundant to common routine?
if (!$user->isAdmin() && $this->params['user_id'] != $user->id) {
... | vuln | Safe | PHP |
static void vc1_h_overlap_c(uint8_t* src, int stride)
{
int i;
int a, b, c, d;
int d1, d2;
int rnd = 1;
for(i = 0; i < 8; i++) {
a = src[-2];
b = src[-1];
c = src[0];
d = src[1];
d1 = (a - d + 3 + rnd) >> 3;
d2 = (a - d + b - c + 4 - rnd) >> 3;
... | vuln | Safe | C/C++ |
private static void setStringValue(GUIAttribute attr, Attribute extAttr) {
if (attr.getValue() != null)
extAttr.setStringValue(HTMLSanitizer.sanitizeSimpleText((String) attr.getValue()));
else
extAttr.setStringValue(null);
} | vuln | Safe | Java |
public void createDeleteHistoryAlert(BaseFragment fragment, TLRPC.Chat chat, long mergeDialogId, Theme.ResourcesProvider resourcesProvider) {
if (fragment == null || fragment.getParentActivity() == null || chat == null) {
return;
}
Context context = fragment.getParentActivity();
... | vuln | Vulnerable | Java |
static int connect_namedsocket(const char *path)
{
int sockfd, size;
struct sockaddr_un helper;
sockfd = socket(AF_UNIX, SOCK_STREAM, 0);
if (sockfd < 0) {
fprintf(stderr, "socket %s\n", strerror(errno));
return -1;
}
strcpy(helper.sun_path, path);
helper.sun_family = AF_UNIX... | vuln | Safe | C/C++ |
var doBootstrap = function() {
element = jqLite(element);
if (element.injector()) {
var tag = (element[0] === window.document) ? 'document' : startingTag(element);
// Encode angle brackets to prevent input from being sanitized to empty string #8683.
throw ngMinErr(
'btstrpd',
... | vuln | Vulnerable | JavaScript |
#ifndef JSI_LITE_ONLY
#ifndef JSI_AMALGAMATION
#include "jsiInt.h"
#endif
#define ChkString(_this, funcPtr, dest, lenPtr, bytePtr) \
int skip __attribute__((unused)); skip = 0; \
if (_this->vt != JSI_VT_OBJECT || _this->d.obj->ot != JSI_OT_STRING) { \
Jsi_LogError("apply String.%s to a non-string o... | vuln | Vulnerable | C/C++ |
static ut8 read_module_referenced_functions(RFlirtModule *module, RBuffer *b) {
/*parses a module referenced functions*/
/*returns false on parsing error*/
int i, j;
ut8 number_of_referenced_functions;
ut32 ref_function_name_length;
RFlirtFunction *ref_function = NULL;
module->referenced_functions = r_list_new ... | vuln | Vulnerable | C/C++ |
# -*- coding: utf-8 -*-
# Copyright 2015, 2016 OpenMarket Ltd
# Copyright 2018 New Vector Ltd
# Copyright 2019 Matrix.org Federation C.I.C
#
# 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
#
# ... | vuln | Safe | Python |
import * as utils from '../common/utils.js';
import { getOptions } from '../common/options.js';
import { getState, setState } from '../common/state.js';
import { $body } from '../common/cache.js';
import {
ACTIVE,
ACTIVE_SEL,
SECTION_NAV_SEL,
SECTION_NAV,
SECTION_NAV_TOOLTIP,
SHOW_ACTIVE_TOOLTI... | vuln | Vulnerable | JavaScript |
public static synchronized void saveTranslationCache() {
try {
if (translationCaches == null)
return;
File f = new File(TRANSLATION_CACHE_ROOT, "translations.json");
Gson gson = new Gson();
String json = gson.toJson(translationCaches);
... | vuln | Safe | Java |
int main(int argc, char const *argv[]) {
argh::parser cmdl(argv);
if (cmdl[{"-v", "--version"}]) {
std::cout << "svcli (uthenticode) version " << UTHENTICODE_VERSION << '\n';
return 0;
} else if (cmdl[{"-h", "--help"}] || argc != 2) {
std::cout << "Usage: svcli [options] <file>\n\n"
<< ... | vuln | Safe | C/C++ |
h2v1_merged_upsample_565D_internal(j_decompress_ptr cinfo,
JSAMPIMAGE input_buf,
JDIMENSION in_row_group_ctr,
JSAMPARRAY output_buf)
{
my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
r... | vuln | Safe | Unknown |
void ServiceWorkerPaymentInstrument::OnPaymentAppInvoked(
mojom::PaymentHandlerResponsePtr response) {
if (delegate_ != nullptr) {
delegate_->OnInstrumentDetailsReady(response->method_name,
response->stringified_details);
delegate_ = nullptr;
}
} | vuln | Safe | C/C++ |
static NO_INLINE JsVar *jspGetNamedFieldInParents(JsVar *object, const char* name, bool returnName) {
// Now look in prototypes
JsVar * child = jspeiFindChildFromStringInParents(object, name);
/* Check for builtins via separate function
* This way we save on RAM for built-ins because everything comes out of p... | vuln | Safe | Unknown |
@NonNull
@Override
public ImageAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
int resId = 0;
switch (viewType) {
case 0:
resId = R.layout.icon_tab_listview_item;
break;
case... | vuln | Safe | Java |
static int libopenjpeg_copy_unpacked8(AVCodecContext *avctx, const AVFrame *frame, opj_image_t *image)
{
int compno;
int x;
int y;
int width;
int height;
int *image_line;
int frame_index;
const int numcomps = image->numcomps;
for (compno = 0; compno < numcomps; ++compno) {
if... | vuln | Safe | C/C++ |
import dayjs from 'dayjs'
import customParseFormat from 'dayjs/plugin/customParseFormat'
import { t } from './i18n.js'
import Projects from '../api/projects/projects.js'
import projectUsers from '../api/users/users.js'
import { periodToDates } from './periodHelpers.js'
import { getGlobalSetting, getUserSetting } from '... | vuln | Vulnerable | JavaScript |
static void yurex_disconnect(struct usb_interface *interface)
{
struct usb_yurex *dev;
int minor = interface->minor;
dev = usb_get_intfdata(interface);
usb_set_intfdata(interface, NULL);
/* give back our minor */
usb_deregister_dev(interface, &yurex_class);
/* prevent more I/O from starting */
mutex_lock(&de... | vuln | Vulnerable | Unknown |
void Compute(OpKernelContext* context) override {
// Input tensor is of the following dimensions:
// [ batch, in_z, in_y, in_x, in_channels ]
const Tensor& input = context->input(0);
// Input filter is of the following dimensions:
// [ filter_z, filter_y, filter_x, in_channels, out_channels]
co... | vuln | Vulnerable | Unknown |
@Override
public void onClick() {
mContext.startActivity(mIntent);
} | vuln | Vulnerable | Java |
mt76_add_fragment(struct mt76_dev *dev, struct mt76_queue *q, void *data,
int len, bool more)
{
struct page *page = virt_to_head_page(data);
int offset = data - page_address(page);
struct sk_buff *skb = q->rx_head;
struct skb_shared_info *shinfo = skb_shinfo(skb);
if (shinfo->nr_frags < ARRAY_SIZE(shinfo->fra... | vuln | Safe | C/C++ |
/* Pango
* pango-emoji.c: Emoji handling
*
* Copyright (C) 2017 Google, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your opti... | vuln | Safe | C/C++ |
var CommentsWindow=function(b,e,f,c,m,n){function v(){for(var J=O.getElementsByTagName("div"),F=0,H=0;H<J.length;H++)"none"!=J[H].style.display&&J[H].parentNode==O&&F++;t.style.display=0==F?"block":"none"}function d(J,F,H,S){function V(){F.removeChild(U);F.removeChild(X);W.style.display="block";M.style.display="block"}... | vuln | Safe | JavaScript |
const { strict: assert, AssertionError } = require('assert');
const {
JWK,
JWKS,
JWE,
errors: { JOSEError },
} = require('jose');
const { promisify } = require('util');
const cookie = require('cookie');
const onHeaders = require('on-headers');
const COOKIES = require('./cookies');
const { encryption: deriveKey ... | vuln | Vulnerable | JavaScript |
int ext4_punch_hole(struct inode *inode, loff_t offset, loff_t length)
{
struct super_block *sb = inode->i_sb;
ext4_lblk_t first_block, stop_block;
struct address_space *mapping = inode->i_mapping;
loff_t first_block_offset, last_block_offset;
handle_t *handle;
unsigned int credits;
int ret = 0;
if (!S_ISREG(i... | vuln | Safe | Unknown |
AP4_DataAtom::AP4_DataAtom(const AP4_MetaData::Value& value) :
AP4_Atom(AP4_ATOM_TYPE_DATA, AP4_ATOM_HEADER_SIZE),
m_DataType(DATA_TYPE_BINARY),
m_Source(NULL)
{
AP4_MemoryByteStream* memory = new AP4_MemoryByteStream();
AP4_Size payload_size = 8;
m_Source = memory;
switch (value.GetTyp... | vuln | Safe | C/C++ |
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2018-2019 OzzieIsaacs, cervinko, jkrehm, bodybybuddha, ok11,
# andy29485, idalin, Kyosfonica, wuqi, Kennyl, lemmsh,
# falgh1, grunjol, csitk... | vuln | Safe | Python |
MagickExport ssize_t FormatMagickCaption(Image *image,DrawInfo *draw_info,
const MagickBooleanType split,TypeMetric *metrics,char **caption,
ExceptionInfo *exception)
{
char
*p,
*q,
*s;
MagickBooleanType
status;
size_t
width;
ssize_t
i,
n;
q=draw_info->text;
s=(char *) NU... | vuln | Safe | C/C++ |
public void trackRequest(String requestDescriptor, long requestId) {
Preconditions.checkNotNull(requestDescriptor, "Attempting to track a null request descriptor.");
if (!tracingEnabled) {
return;
}
synchronized (lock) {
List<Long> requestIds = ongoingRequests.ge... | vuln | Safe | Java |
private int doDelete(TapConnectorContext tapConnectorContext, TapTable tapTable, List<TapRecordEvent> tapRecordEvents) throws Throwable {
if (CollectionUtils.isEmpty(tapRecordEvents)) {
return 0;
}
Collection<String> primaryKeys = tapTable.primaryKeys(true);
List<String> whereList = new ArrayList<>();
for ... | vuln | Safe | Java |
int ff_MPV_lowest_referenced_row(MpegEncContext *s, int dir)
{
int my_max = INT_MIN, my_min = INT_MAX, qpel_shift = !s->quarter_sample;
int my, off, i, mvs;
if (s->picture_structure != PICT_FRAME || s->mcsel) goto unhandled;
switch (s->mv_type) {
case MV_TYPE_16X16:
mvs = 1;
... | vuln | Safe | C/C++ |
int ssl3_check_cert_and_algorithm(SSL *s)
{
int i, idx;
long alg_k, alg_a;
EVP_PKEY *pkey = NULL;
SESS_CERT *sc;
#ifndef OPENSSL_NO_RSA
RSA *rsa;
#endif
#ifndef OPENSSL_NO_DH
DH *dh;
#endif
alg_k = s->s3->tmp.new_cipher->algorithm_mkey;
alg_a = s->s3->tmp.new_cipher->algorithm_auth;
... | vuln | Safe | Unknown |
static int decode_slice_luma(AVCodecContext *avctx, SliceContext *slice,
uint16_t *dst, int dst_stride,
const uint8_t *buf, unsigned buf_size,
const int16_t *qmat)
{
ProresContext *ctx = avctx->priv_data;
LOCAL_ALIGNED_16(int... | vuln | Vulnerable | C/C++ |
int coroutine_fn qemu_co_sendv(int sockfd, struct iovec *iov,
int len, int iov_offset)
{
int total = 0;
int ret;
while (len) {
ret = qemu_sendv(sockfd, iov, len, iov_offset + total);
if (ret < 0) {
if (errno == EAGAIN) {
qemu_corouti... | vuln | Vulnerable | C/C++ |
static void synth_block_fcb_acb(WMAVoiceContext *s, GetBitContext *gb,
int block_idx, int size,
int block_pitch_sh2,
const struct frame_type_desc *frame_desc,
float *excitation)
{
static c... | vuln | Safe | C/C++ |
@Override
public void setRuntimePermissionGrantStateByDeviceAdminFromParams(
String callerPackageName, AdminPermissionControlParams params,
AndroidFuture callback) {
checkStringNotEmpty(callerPackageName);
if (params.getGrantState() == ... | vuln | Vulnerable | Java |
static expr_ty
fstring_compile_expr(const char *expr_start, const char *expr_end,
struct compiling *c, const node *n)
{
PyCompilerFlags cf;
node *mod_n;
mod_ty mod;
char *str;
Py_ssize_t len;
const char *s;
PyObject *fstring_name;
assert(expr_end >= expr_start);
... | vuln | Safe | C/C++ |
bool RGWSwiftWebsiteHandler::is_web_dir() const
{
std::string subdir_name = url_decode(s->object.name);
/* Remove character from the subdir name if it is "/". */
if (subdir_name.empty()) {
return false;
} else if (subdir_name.back() == '/') {
subdir_name.pop_back();
if (subdir_name.empty()) {
... | vuln | Safe | Unknown |
@Override
public String getKeyName() {
return Keyboard.getKeyName(this.bind);
} | vuln | Vulnerable | Java |
private boolean isTargetOSUnixBased() {
if (System.getProperty("executionAddress").trim().equals("local")) {
// local execution
if (SystemUtils.IS_OS_WINDOWS) {
return false;
} else if (SystemUtils.IS_OS_LINUX || SystemUtils.IS_OS_MAC) {
return... | vuln | Vulnerable | Java |
static JSON_INLINE size_t num_buckets(hashtable_t *hashtable) | vuln | Safe | C/C++ |
switch (type) {
#ifdef ELFCORE
case ET_CORE:
phnum = elf_getu16(swap, elfhdr.e_phnum);
if (phnum > ms->elf_phnum_max)
return toomany(ms, "program", phnum);
flags |= FLAGS_IS_CORE;
if (dophn_core(ms, clazz, swap, fd,
(off_t)elf_getu(swap, elfhdr.e_phoff), phnum,
(size_t)elf_getu16(swap, elfhdr.e_... | vuln | Vulnerable | Unknown |
njs_vmcode_array(njs_vm_t *vm, u_char *pc)
{
uint32_t length;
njs_array_t *array;
njs_value_t *value;
njs_vmcode_array_t *code;
code = (njs_vmcode_array_t *) pc;
array = njs_array_alloc(vm, 0, code->length, NJS_ARRAY_SPARE);
if (njs_fast_path(array != NULL)) {
... | vuln | Safe | C/C++ |
@ReactProp(name = "snapToOffsets")
public void setSnapToOffsets(ReactScrollView view, @Nullable ReadableArray snapToOffsets) {
if (snapToOffsets == null) {
view.setSnapOffsets(null);
return;
}
DisplayMetrics screenDisplayMetrics = DisplayMetricsHolder.getScreenDisplayMetrics();
List<Integ... | vuln | Safe | Java |
GURL SiteInstance::GetSiteForURL(BrowserContext* browser_context,
const GURL& real_url) {
if (real_url.SchemeIs(kGuestScheme))
return real_url;
GURL url = SiteInstanceImpl::GetEffectiveURL(browser_context, real_url);
url::Origin origin = url::Origin::Create(url);
auto* pol... | vuln | Safe | C/C++ |
def ViewFile(request):
try:
print "[INFO] View iOS Files"
fil=request.GET['file']
typ=request.GET['type']
MD5=request.GET['md5']
mode=request.GET['mode']
m=re.match('[0-9a-f]{32}',MD5)
ext=fil.split('.')[-1]
f=re.search("plist|db|sqlitedb|sqlite|txt|m"... | vuln | Vulnerable | Python |
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this fi... | vuln | Vulnerable | Java |
protected function apiProcessSurvey($args)
{
$visitor = visitor_from_request();
// Get form values
$first_message = $args['message'];
$info = $args['info'];
$email = $args['email'];
$referrer = $args['referrer'];
// Verify group id
$group_id = 0;
... | vuln | Vulnerable | PHP |
handle_raw_data(char *packet, int len, struct query *q, int dns_fd, int tun_fd, int userid)
{
if (check_user_and_ip(userid, q) != 0) {
return;
}
/* Update query and time info for user */
users[userid].last_pkt = time(NULL);
memcpy(&(users[userid].q), q, sizeof(struct query));
/* copy to packet buffer, update ... | vuln | Vulnerable | Unknown |
package com.salesmanager.core.business.repositories.catalog.product.attribute;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import com.salesmanager.core.model.catalog.product.attribute.ProductAttribute;
public interface Pr... | vuln | Safe | Java |
int APP_CC
xrdp_wm_init(struct xrdp_wm *self)
{
int fd;
int index;
struct list *names;
struct list *values;
char *q;
const char *r;
char param[256];
char section_name[256];
char cfg_file[256];
char autorun_name[256];
g_writeln("in xrdp_wm_init: ");
load_xrdp_config(self... | vuln | Vulnerable | C/C++ |
MagickExport Image *MeanShiftImage(const Image *image,const size_t width,
const size_t height,const double color_distance,ExceptionInfo *exception)
{
#define MaxMeanShiftIterations 100
#define MeanShiftImageTag "MeanShift/Image"
CacheView
*image_view,
*mean_view,
*pixel_view;
Image
*mean_image... | vuln | Vulnerable | C/C++ |
RList *r_bin_ne_get_entrypoints(r_bin_ne_obj_t *bin) {
if (!bin->entry_table) {
return NULL;
}
RList *entries = r_list_newf (free);
if (!entries) {
return NULL;
}
RList *segments = r_bin_ne_get_segments (bin);
if (!segments) {
r_list_free (entries);
return NULL;
}
if (bin->ne_header->csEntryPoint) {
... | vuln | Vulnerable | C/C++ |
__u32 secure_tcp_sequence_number(__be32 saddr, __be32 daddr, | vuln | Safe | C/C++ |
static int atusb_read_reg(struct atusb *atusb, uint8_t reg)
{
struct usb_device *usb_dev = atusb->usb_dev;
int ret;
uint8_t value;
dev_dbg(&usb_dev->dev, "atusb: reg = 0x%x\n", reg);
ret = atusb_control_msg(atusb, usb_rcvctrlpipe(usb_dev, 0),
ATUSB_REG_READ, ATUSB_REQ_FROM_DEV,
0, reg, &value, 1, 1000);
... | vuln | Vulnerable | Unknown |
static long ec_device_ioctl_xcmd(struct cros_ec_dev *ec, void __user *arg)
{
long ret;
struct cros_ec_command u_cmd;
struct cros_ec_command *s_cmd;
if (copy_from_user(&u_cmd, arg, sizeof(u_cmd)))
return -EFAULT;
if ((u_cmd.outsize > EC_MAX_MSG_BYTES) ||
(u_cmd.insize > EC_MAX_MSG_BYTES))
return -EINVAL;... | vuln | Vulnerable | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.