code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2012-2019 cervinko, idalin, SiphonSquirrel, ouzklcn, akushsky,
# OzzieIsaacs, bodybybuddha, jkrehm, matthazinski, janeczku
#
# This program is free software: you can ... | vuln | Safe | Python |
check_compat_entry_size_and_hooks(struct compat_ipt_entry *e,
struct xt_table_info *newinfo,
unsigned int *size,
const unsigned char *base,
const unsigned char *limit,
const unsigned int *hook_entries,
const unsigned int *underflows,
const char *name)
{
struct xt_entry_match *... | vuln | Safe | Unknown |
@SubscribeEvent
public void renderEnd(RenderTickEvent event) {
if (event.phase == Phase.END)
for (LittleLevelEntity animation : entities)
animation.getRenderManager().isInSight = null;
} | vuln | Vulnerable | Java |
ipv4_sanity_check(const struct ip_header *nh, size_t size,
int *ip_lenp, uint16_t *tot_lenp)
{
int ip_len;
uint16_t tot_len;
if (OVS_UNLIKELY(size < IP_HEADER_LEN)) {
return false;
}
ip_len = IP_IHL(nh->ip_ihl_ver) * 4;
if (OVS_UNLIKELY(ip_len < IP_HEADER_LEN || size ... | vuln | Vulnerable | Unknown |
inline bool operator ==(const MaskedIP& l, const MaskedIP& r) {
auto shift = std::max((l.v6 ? 128 : 32) - l.prefix,
(r.v6 ? 128 : 32) - r.prefix);
ceph_assert(shift > 0);
return (l.addr >> shift) == (r.addr >> shift);
} | vuln | Vulnerable | Unknown |
pack_unpack_internal(VALUE str, VALUE fmt, int mode)
{
#define hexdigits ruby_hexdigits
char *s, *send;
char *p, *pend;
VALUE ary;
char type;
long len;
AVOID_CC_BUG long tmp_len;
int star;
#ifdef NATINT_PACK
int natint; /* native integer */
#endif
int signed_p, integer_size, bigend... | vuln | Safe | Unknown |
@Override
public void tick() {
getWorldServer().profiler.startSection("playerCubeMapTick");
long currentTime = this.getWorldServer().getTotalWorldTime();
getWorldServer().profiler.startSection("addPendingPlayers");
if (!pendingPlayerAdd.isEmpty()) {
// copy in case playe... | vuln | Safe | Java |
public static void processAttackTownRequest(Town townOfAttackingPlayer,
Nation nationOfAttackingPlayer,
Block block,
TownBlock townBlock,
Town defendingTown) thr... | vuln | Vulnerable | Java |
function vT(){vT=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function l(e,t,n){return Object.definePropert... | vuln | Vulnerable | JavaScript |
from pathlib import Path
from urllib.parse import unquote
import base64
import json, os, requests, time, pytz, pymongo
from shutil import rmtree
from requests.exceptions import ConnectionError
from os.path import join, exists
from django.shortcuts import render
from django.core.serializers import serialize
from django.... | vuln | Vulnerable | Python |
ast_for_suite(struct compiling *c, const node *n)
{
/* suite: simple_stmt | NEWLINE [TYPE_COMMENT NEWLINE] INDENT stmt+ DEDENT */
asdl_seq *seq;
stmt_ty s;
int i, total, num, end, pos = 0;
node *ch;
if (TYPE(n) != func_body_suite) {
REQ(n, suite);
}
total = num_stmts(n);
se... | vuln | Safe | C/C++ |
void mobi_buffer_move(MOBIBuffer *buf, const int offset, const size_t len) {
size_t aoffset = (size_t) abs(offset);
unsigned char *source = buf->data + buf->offset;
if (offset >= 0) {
if (buf->offset + aoffset + len > buf->maxlen) {
debug_print("%s", "End of buffer\n");
buf->... | vuln | Safe | Unknown |
object: function (schema) {
var o = {};
var prop = schema.properties || {};
for (var key in prop) {
if (Object.prototype.hasOwnProperty.call(prop, key)) {
if (prop[key].optional === true && _rand.bool() === true) {
continue;
}
if (key !== '*') {
o[key] = this.generate(prop[key])... | vuln | Safe | JavaScript |
setTemplates: function() {
var iconHTML = '';
if (this.options.suggestionIcon !== '') {
iconHTML = '<span class="fa-' + this.options.suggestionIcon + ' icon"></span>';
}
// suggestions
if (this.options.fields.length) {
this.sug... | vuln | Safe | JavaScript |
def karma_add(name):
karma = karma_ask(name)
db = db_connect()
cursor = db.cursor()
if karma is None:
try:
cursor.execute('''
INSERT INTO people(name,karma,shame) VALUES(%(name)s,1,0)
''', name)
db.commit()
logger.debug('Inserte... | vuln | Safe | Python |
private boolean isSyntheticPasswordBasedCredentialLocked(int userId) {
if (userId == USER_FRP) {
final int type = mStorage.readPersistentDataBlock().type;
return type == PersistentData.TYPE_SP || type == PersistentData.TYPE_SP_WEAVER;
}
long protectorId = getCurrentLskfBa... | vuln | Safe | Java |
'use strict';
/**
* Teedy application.
*/
angular.module('docs',
// Dependencies
['ui.router', 'ui.bootstrap', 'dialog', 'ngProgress', 'monospaced.qrcode', 'yaru22.angular-timeago', 'ui.validate',
'ui.sortable', 'restangular', 'ngSanitize', 'ngTouch', 'colorpicker.module', 'ngFileUpload', 'pascalprecht... | vuln | Safe | Java |
from django.contrib import admin
import import_export.widgets as widgets
from import_export.admin import ImportExportModelAdmin
from import_export.fields import Field
from InvenTree.admin import InvenTreeResource
from part.models import Part
from .models import (Company, ManufacturerPart, ManufacturerPartAttachment,... | vuln | Safe | Python |
static Image *ReadAVSImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
Image
*image;
MagickBooleanType
status;
MemoryInfo
*pixel_info;
register PixelPacket
*q;
register ssize_t
x;
register unsigned char
*p;
size_t
height,
width;
ssize_t
count,
y... | vuln | Safe | Unknown |
private void ensureTopicsAreReady() throws IOException {
log.info("Waiting for consumers to be ready");
// This is work around the fact that there's no way to have a consumer ready in Kafka without first publishing
// some message on the topic, which will then trigger the partitions assignment t... | vuln | Vulnerable | Java |
/*
* Copyright © 2015-2018 Aeneas Rekkas <aeneas+oss@aeneas.io>
*
* 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... | vuln | Safe | Go |
'use strict';
(function () {
function parseURL (text) {
var xml = new window.DOMParser().parseFromString(text, 'text/xml')
var tag = xml.getElementsByTagName('Key')[0]
return decodeURI(tag.childNodes[0].nodeValue)
}
function waitForAllFiles (form) {
if (window.uploading !== 0) {
setTimeout... | vuln | Vulnerable | Python |
void svhandler_flash_erase_sector(void) {
uint8_t sector = _param_1;
// Verify requested sector is allowed.
if (!allow_svhandler_flash_sector_num(sector)) return;
// Unlock flash.
flash_clear_status_flags();
flash_unlock();
// Erase the sector.
flash_erase_sector(sector, FLASH_CR_PROGRAM_X32);
// ... | vuln | Safe | Unknown |
@Override
public void execute(ServiceTask task) {
if (connection.isClosed()) {
// prevents QUIT、CLOSE_STMT from losing cumulative
if (task.getOrgData().length > 4 && (task.getOrgData()[4] == MySQLPacket.COM_QUIT || task.getOrgData()[4] == MySQLPacket.COM_STMT_CLOSE)) {
... | vuln | Safe | Java |
int ssl3_send_client_key_exchange(SSL *s)
{
unsigned char *p;
int n;
unsigned long alg_k;
#ifndef OPENSSL_NO_RSA
unsigned char *q;
EVP_PKEY *pkey=NULL;
#endif
#ifndef OPENSSL_NO_KRB5
KSSL_ERR kssl_err;
#endif /* OPENSSL_NO_KRB5 */
#ifndef OPENSSL_NO_ECDH
EC_KEY *clnt_ecdh = NULL;
const EC_POINT *srvr_ecpoint =... | vuln | Vulnerable | Unknown |
static int send_jpeg_rect(VncState *vs, int x, int y, int w, int h, int quality)
{
struct jpeg_compress_struct cinfo;
struct jpeg_error_mgr jerr;
struct jpeg_destination_mgr manager;
pixman_image_t *linebuf;
JSAMPROW row[1];
uint8_t *buf;
int dy;
if (surface_bytes_per_pixel(vs->vd->ds) ... | vuln | Vulnerable | Unknown |
def _modify_3par_iscsi_host(self, hostname, iscsi_iqn):
# when using -add, you can not send the persona or domain options
command = ['createhost', '-iscsi', '-add', hostname, iscsi_iqn]
self.common._cli_run(command) | vuln | Safe | Python |
static av_cold int libopus_decode_init(AVCodecContext *avc)
{
struct libopus_context *opus = avc->priv_data;
int ret, channel_map = 0, gain_db = 0, nb_streams, nb_coupled;
uint8_t mapping_arr[8] = { 0, 1 }, *mapping;
if (avc->channels <= 0) {
av_log(avc, AV_LOG_WARNING,
"Invalid n... | vuln | Safe | C/C++ |
static int local_utimensat(FsContext *s, V9fsPath *fs_path,
const struct timespec *buf)
{
char *buffer;
int ret;
char *path = fs_path->data;
buffer = rpath(s, path);
ret = qemu_utimens(buffer, buf);
g_free(buffer);
return ret;
} | vuln | Vulnerable | C/C++ |
static void qxl_send_events(PCIQXLDevice *d, uint32_t events)
{
uint32_t old_pending;
uint32_t le_events = cpu_to_le32(events);
trace_qxl_send_events(d->id, events);
assert(qemu_spice_display_is_running(&d->ssd));
old_pending = __sync_fetch_and_or(&d->ram->int_pending, le_events);
if ((old_pendi... | vuln | Vulnerable | C/C++ |
static void musb_packet(MUSBState *s, MUSBEndPoint *ep,
int epnum, int pid, int len, USBCallback cb, int dir)
{
int ret;
int idx = epnum && dir;
int ttype;
ttype = epnum ? (ep->type[idx] >> 4) & 3 : 0;
ep->timeout[dir] = musb_timeout(ttype,
ep->type[idx] >> 6... | vuln | Safe | C/C++ |
static int connect_to_master(THD* thd, MYSQL* mysql, Master_info* mi,
bool reconnect, bool suppress_warnings)
{
int slave_was_killed= 0;
int last_errno= -2; // impossible error
ulong err_count=0;
char llbuff[22];
char password[MAX_PASSWORD_LENGTH + 1];
... | vuln | Safe | C/C++ |
TORRENT_TEST(unepected_eof2)
{
char b[] = "l2:..0"; // expected ':' delimiter instead of EOF
bdecode_node e;
error_code ec;
int pos;
int ret = bdecode(b, b + sizeof(b)-1, e, ec, &pos);
TEST_EQUAL(ret, -1);
TEST_EQUAL(pos, 6);
TEST_EQUAL(ec, error_code(bdecode_errors::unexpected_eof));
printf("%s\n", print_ent... | vuln | Safe | Unknown |
int64_t TensorByteSize(const TensorProto& t) {
// num_elements returns -1 if shape is not fully defined.
int64_t num_elems = TensorShape(t.tensor_shape()).num_elements();
return num_elems < 0 ? -1 : num_elems * DataTypeSize(t.dtype());
} | vuln | Vulnerable | C/C++ |
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "device/gamepad/gamepad_monitor.h"
#include <utility>
#include "base/memory/ptr_util.h"
#include "device/gamepad/gamepad_service.h"
#includ... | vuln | Safe | C/C++ |
static int dx2_decode_slice_410(GetBitContext *gb, AVFrame *frame,
int line, int left,
uint8_t lru[3][8])
{
int x, y, i, j;
int width = frame->width;
int ystride = frame->linesize[0];
int ustride = frame->linesize[1];
int vstride = fr... | vuln | Safe | C/C++ |
public void close() {
if (context != 0L) {
ALC11.alcDestroyContext(context);
checkAlError();
}
if (device != 0L) {
ALC11.alcCloseDevice(device);
checkAlError();
}
context = 0;
device = 0;
} | vuln | Vulnerable | Java |
grub_username_get (char buf[], unsigned buf_size)
{
unsigned cur_len = 0;
int key;
while (1)
{
key = grub_getkey ();
if (key == '\n' || key == '\r')
break;
if (key == '\e')
{
cur_len = 0;
break;
}
if (key == '\b')
{
if (cur_len)
{
cur_len--;
grub_pri... | vuln | Safe | C/C++ |
int inet_sk_rebuild_header(struct sock *sk)
{
struct inet_sock *inet = inet_sk(sk);
struct rtable *rt = (struct rtable *)__sk_dst_check(sk, 0);
__be32 daddr;
struct ip_options_rcu *inet_opt;
int err;
/* Route is OK, nothing to do. */
if (rt)
return 0;
/* Reroute. */
rcu_read_lock();
inet_opt = rcu_derefer... | vuln | Safe | Unknown |
static int unix_dgram_sendmsg(struct kiocb *kiocb, struct socket *sock,
struct msghdr *msg, size_t len)
{
struct sock_iocb *siocb = kiocb_to_siocb(kiocb);
struct sock *sk = sock->sk;
struct net *net = sock_net(sk);
struct unix_sock *u = unix_sk(sk);
struct sockaddr_un *sunaddr=msg->msg_name;
struct sock ... | vuln | Safe | Unknown |
def _executor_internal_inner(self, host, module_name, module_args, inject, port, is_chained=False, complex_args=None):
''' decides how to invoke a module '''
# late processing of parameterized sudo_user (with_items,..)
if self.sudo_user_var is not None:
self.sudo_user = template.tem... | vuln | Vulnerable | Python |
public boolean isSealed() {
return ClassAccessor.isSealed(type);
} | vuln | Safe | Java |
private static void setDocumentContent(IDocument document, IStorage storage, String encoding, IProgressMonitor monitor, boolean skipUTF8BOM) throws CoreException {
Reader in= null;
InputStream contentStream= storage.getContents();
try {
if (skipUTF8BOM) {
for (int i= 0; i < 3; i++)
if (contentStream.... | vuln | Safe | Java |
int rpmPackageFilesInstall(rpmts ts, rpmte te, rpmfiles files,
rpmpsm psm, char ** failedFile)
{
FD_t payload = rpmtePayload(te);
rpmfi fi = NULL;
rpmfs fs = rpmteGetFileStates(te);
rpmPlugins plugins = rpmtsPlugins(ts);
int rc = 0;
int fx = -1;
int fc = rpmfilesFC(files);
... | vuln | Safe | C/C++ |
ft_var_readpackedpoints( FT_Stream stream,
FT_UInt *point_cnt )
{
FT_UShort *points;
FT_Int n;
FT_Int runcnt;
FT_Int i;
FT_Int j;
FT_Int first;
FT_Memory memory = stream->memory;
FT_Error error = TT_Err_Ok;
FT_UNUSED( erro... | vuln | Safe | Unknown |
void AppCache::RemoveEntry(const GURL& url) {
auto found = entries_.find(url);
DCHECK(found != entries_.end());
cache_size_ -= found->second.response_size();
entries_.erase(found);
} | vuln | Vulnerable | C/C++ |
void fp6_read_bin(fp6_t a, const uint8_t *bin, int len) {
if (len != 6 * RLC_FP_BYTES) {
RLC_THROW(ERR_NO_BUFFER);
return;
}
fp2_read_bin(a[0], bin, 2 * RLC_FP_BYTES);
fp2_read_bin(a[1], bin + 2 * RLC_FP_BYTES, 2 * RLC_FP_BYTES);
fp2_read_bin(a[2], bin + 4 * RLC_FP_BYTES, 2 * RLC_FP_BYTES);
} | vuln | Vulnerable | C/C++ |
def render(self, name, value, attrs=None, renderer=None, **kwargs):
"""Render all textareas with correct plural labels."""
unit = value
values = unit.get_target_plurals()
lang = unit.translation.language
plural = unit.translation.plural
tabindex = self.attrs["tabindex"]
... | vuln | Vulnerable | Python |
static MagickOffsetType TIFFSeekCustomStream(const MagickOffsetType offset,
const int whence,void *user_data)
{
PhotoshopProfile
*profile;
profile=(PhotoshopProfile *) user_data;
switch (whence)
{
case SEEK_SET:
default:
{
if (offset < 0)
return(-1);
profile->offset=offset... | vuln | Vulnerable | C/C++ |
void ipc_rcu_getref(void *ptr)
int ipc_rcu_getref(void *ptr)
{
return atomic_inc_not_zero(&container_of(ptr, struct ipc_rcu_hdr, data)->refcount);
} | vuln | Safe | C/C++ |
long ssl3_ctrl(SSL *s, int cmd, long larg, void *parg)
{
int ret=0;
#if !defined(OPENSSL_NO_DSA) || !defined(OPENSSL_NO_RSA)
if (
#ifndef OPENSSL_NO_RSA
cmd == SSL_CTRL_SET_TMP_RSA ||
cmd == SSL_CTRL_SET_TMP_RSA_CB ||
#endif
#ifndef OPENSSL_NO_DSA
cmd == SSL_CTRL_SET_TMP_DH ||
cmd == SSL_CTRL_SE... | vuln | Vulnerable | Unknown |
flac_read_loop (SF_PRIVATE *psf, unsigned len)
{ FLAC_PRIVATE* pflac = (FLAC_PRIVATE*) psf->codec_data ;
FLAC__StreamDecoderState state ;
pflac->pos = 0 ;
pflac->len = len ;
pflac->remain = len ;
state = FLAC__stream_decoder_get_state (pflac->fsd) ;
if (state > FLAC__STREAM_DECODER_END_OF_STREAM)
{ psf_log_pri... | vuln | Safe | C/C++ |
@Override
public Iterator<KeyValueFrequency> iterator() {
List<Iterator<KeyValueFrequency>> iters = new ArrayList<>(splits.size() + key2Frequency.size());
splits.stream().map(file -> {
DataInputStream dataInput = null;
try {
InputStream input = inputStreamFunction.apply(new FileInputStream... | vuln | Safe | Java |
private void internalCreateSubscriptionForNonPartitionedTopic(
AsyncResponse asyncResponse, String subscriptionName,
MessageIdImpl targetMessageId, boolean authoritative, boolean replicated,
Map<String, String> properties) {
boolean isAllowAutoTopicCreation = pulsar().getBro... | vuln | Vulnerable | Java |
/*******************************************************************************
* This file is part of OpenNMS(R).
*
* Copyright (C) 2009-2014 The OpenNMS Group, Inc.
* OpenNMS(R) is Copyright (C) 1999-2014 The OpenNMS Group, Inc.
*
* OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc.
*
* OpenNMS(... | vuln | Safe | Java |
static inline void RENAME(yuv2rgb555_2)(SwsContext *c, const uint16_t *buf0,
const uint16_t *buf1, const uint16_t *ubuf0,
const uint16_t *ubuf1, const uint16_t *vbuf0,
const uint16_t *vbuf1, const uin... | vuln | Vulnerable | C/C++ |
package io.onedev.server.migration;
import com.google.common.base.Preconditions;
import com.thoughtworks.xstream.core.JVM;
import io.onedev.commons.bootstrap.Bootstrap;
import io.onedev.commons.utils.ExplicitException;
import io.onedev.commons.utils.FileUtils;
import io.onedev.commons.utils.StringUtils;
import io.oned... | vuln | Vulnerable | Java |
def ebp_v1tov2(ebp_paths, shared_config={}, quiet=False):
"""Translate error budget policies to v2 and put into shared config
Args:
ebp_paths (list): List of error budget policies file paths.
shared_config (dict): Shared config to add exporters to.
quiet (bool): Quiet mode.
Returns... | vuln | Vulnerable | Python |
check_compat_entry_size_and_hooks(struct compat_ip6t_entry *e,
struct xt_table_info *newinfo,
unsigned int *size,
const unsigned char *base,
const unsigned char *limit,
const unsigned int *hook_entries,
const unsigned int *underflows,
const char *name)
{
struct xt_entry_match ... | vuln | Safe | C/C++ |
static void bfq_idle_slice_timer_body(struct bfq_queue *bfqq)
{
struct bfq_data *bfqd = bfqq->bfqd;
enum bfqq_expiration reason;
unsigned long flags;
spin_lock_irqsave(&bfqd->lock, flags);
bfq_clear_bfqq_wait_request(bfqq);
if (bfqq != bfqd->in_service_queue) {
spin_unlock_irqrestore(&bfqd->lock, flags);
re... | vuln | Vulnerable | Unknown |
@Packet
public void onFlying(WrappedInFlyingPacket packet, long now) {
if(!packet.isPos() || now - data.creation < 800L || ((now - data.playerInfo.lastRespawn < 500L
|| data.playerInfo.moveTicks == 0) && lastFlag.isPassed(12))
|| data.playerInfo.creative || data.playerInfo.ca... | vuln | Safe | Java |
static qemu_irq *vpb_sic_init(uint32_t base, qemu_irq *parent, int irq)
{
vpb_sic_state *s;
qemu_irq *qi;
int iomemtype;
s = (vpb_sic_state *)qemu_mallocz(sizeof(vpb_sic_state));
if (!s)
return NULL;
qi = qemu_allocate_irqs(vpb_sic_set_irq, s, 32);
s->base = base;
s->parent = par... | vuln | Safe | C/C++ |
void ff_convert_matrix(MpegEncContext *s, int (*qmat)[64],
uint16_t (*qmat16)[2][64],
const uint16_t *quant_matrix,
int bias, int qmin, int qmax, int intra)
{
FDCTDSPContext *fdsp = &s->fdsp;
int qscale;
int shift = 0;
for (qscale = qm... | vuln | Safe | C/C++ |
public function executeQuery()
{
if ($this->query !== null) {
$this->query
->offset($this->offset)
->limit($this->limit)
->orderBy($this->order, $this->direction);
if ($this->formatter !== null) {
return $this->formatte... | vuln | Vulnerable | PHP |
addWell: function(data) {
var minX,
maxX,
minY,
maxY;
// first filter for well-samples that have positions
data = data.filter(function(ws){ return ws.position !== undefined; });
// Only show pa... | vuln | Safe | JavaScript |
# confire.conf
# A simple configuration module for Confire
#
# Author: Benjamin Bengfort <ben@cobrain.com>
# Created: Tue May 20 22:19:11 2014 -0400
#
# Copyright (C) 2013 Cobrain Company
# For license information, see LICENSE.txt
#
# ID: conf.py [] ben@cobrain.com $
"""
Confire class for specifying Confire specifi... | vuln | Vulnerable | Python |
static git_commit_list_node **alloc_parents(
git_revwalk *walk, git_commit_list_node *commit, size_t n_parents)
{
size_t bytes;
if (n_parents <= PARENTS_PER_COMMIT)
return (git_commit_list_node **)((char *)commit + sizeof(git_commit_list_node));
if (git__multiply_sizet_overflow(&bytes, n_parents, sizeof(git_com... | vuln | Safe | Unknown |
static int hid_copy_transfer_data(int sub_api, struct usbi_transfer *itransfer, uint32_t io_size) {
struct libusb_transfer *transfer = USBI_TRANSFER_TO_LIBUSB_TRANSFER(itransfer);
struct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev);
struct windows_transfer_priv *transfer_priv = usbi_transfer_get_os_pr... | vuln | Vulnerable | C/C++ |
static struct pending_op *acquire_write(struct external_chrc *chrc,
struct bt_att *att,
struct gatt_db_attribute *attrib,
unsigned int id,
const uint8_t *value, size_t len)
{
struct pending_op *op;
bool acquiring = !queue_isempty(chrc->pending_writes);
op = pending_write_new(att, chrc->pending_w... | vuln | Safe | Unknown |
@Nullable
public ItemStack getJournal() {
return this.getJournalData() == null ? null : this.getJournalData().getJournal();
} | vuln | Safe | Java |
static int parse_cube(AVFilterContext *ctx, FILE *f)
{
LUT3DContext *lut3d = ctx->priv;
char line[MAX_LINE_SIZE];
float min[3] = {0.0, 0.0, 0.0};
float max[3] = {1.0, 1.0, 1.0};
while (fgets(line, sizeof(line), f)) {
if (!strncmp(line, "LUT_3D_SIZE ", 12)) {
int i, j, k;
... | vuln | Vulnerable | C/C++ |
long ContentEncoding::ParseCompressionEntry(long long start, long long size,
IMkvReader* pReader,
ContentCompression* compression) {
assert(pReader);
assert(compression);
long long pos = start;
const long long stop = start ... | vuln | Safe | Unknown |
void ocall_malloc(size_t size, uint8_t **ret) {
unsafe_ocall_malloc(size, ret);
// Guard against overwriting enclave memory
assert(sgx_is_outside_enclave(*ret, size) == 1);
sgx_lfence();
} | vuln | Safe | C/C++ |
int ff_htmlmarkup_to_ass(void *log_ctx, AVBPrint *dst, const char *in)
{
char *param, buffer[128], tmp[128];
int len, tag_close, sptr = 1, line_start = 1, an = 0, end = 0;
SrtStack stack[16];
int closing_brace_missing = 0;
stack[0].tag[0] = 0;
strcpy(stack[0].param[PARAM_SIZE], "{\\fs}");
... | vuln | Vulnerable | C/C++ |
/**
* Copyright (c) 2006-2016, JGraph Ltd
* Copyright (c) 2006-2016, Gaudenz Alder
*/
package com.mxgraph.online;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import... | vuln | Safe | Java |
def _validate_source(source: str, run_id: str) -> None:
if is_local_uri(source):
if run_id:
store = _get_tracking_store()
run = store.get_run(run_id)
source = pathlib.Path(local_file_uri_to_path(source)).resolve()
run_artifact_dir = pathlib.Path(local_file_uri... | vuln | Vulnerable | Python |
int ff_lzf_uncompress(GetByteContext *gb, uint8_t **buf, int64_t *size)
{
int ret = 0;
uint8_t *p = *buf;
int64_t len = 0;
while (bytestream2_get_bytes_left(gb) > 2) {
uint8_t s = bytestream2_get_byte(gb);
if (s < LZF_LITERAL_MAX) {
s++;
if (s > *size - len) ... | vuln | Safe | C/C++ |
uint8_t *
copyn_utf8_str(const uint8_t *src, uint32_t *pos, int *str_len, int limit)
{
*str_len = 0;
uint8_t *dest = NULL;
int max;
// remaining length must > 2 for a valid length
if (limit < 2)
return NULL;
max = limit + *pos;
NNI_GET16(src + (*pos), *str_len);
*pos = (*pos) + 2;
if (*str_len > ... | vuln | Safe | C/C++ |
public static void onInitializeClient() {
bugFixDescriptionCache = new BugFixDescriptionCache();
if (Debugify.configWasDirty) {
Debugify.logger.info("Re-caching descriptions because json doesn't match config.");
bugFixDescriptionCache.trySave();
} else {
if (... | vuln | Safe | Java |
eval_lambda(
char_u **arg,
typval_T *rettv,
evalarg_T *evalarg,
int verbose) // give error messages
{
int evaluate = evalarg != NULL
&& (evalarg->eval_flags & EVAL_EVALUATE);
typval_T base = *rettv;
int ret;
rettv->v_type = VAR_UNKNOWN;
if (**arg == '{')
{
// ->{l... | vuln | Safe | C/C++ |
void do_POWER_maskg (void)
{
uint32_t ret;
if ((uint32_t)T0 == (uint32_t)(T1 + 1)) {
ret = -1;
} else {
ret = (((uint32_t)(-1)) >> ((uint32_t)T0)) ^
(((uint32_t)(-1) >> ((uint32_t)T1)) >> 1);
if ((uint32_t)T0 > (uint32_t)T1)
ret = ~ret;
}
T0 = ret;
} | vuln | Vulnerable | C/C++ |
static int dtls1_preprocess_fragment(SSL *s, struct hm_header_st *msg_hdr)
{
size_t frag_off, frag_len, msg_len;
msg_len = msg_hdr->msg_len;
frag_off = msg_hdr->frag_off;
frag_len = msg_hdr->frag_len;
/* sanity checking */
if ((frag_off + frag_len) > msg_len) {
SSLerr(SSL_F_DTLS1_PREPR... | vuln | Vulnerable | Unknown |
@Override
public ActionResult useOnBlock(ItemUsageContext c) {
if(c.shouldCancelInteraction()) {
if(!c.getWorld().isClient) {
BlockPos pos = c.getBlockPos();
BlockState state = c.getWorld().getBlockState(pos);
if(state.isIn(StorageTags.REMOTE_ACTIVATE)) {
ItemStack stack = c.getStack();
if(!... | vuln | Safe | Java |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | vuln | Safe | C/C++ |
mxEvent.consume(ua))},Za=U.actions.get("zoomIn"),cb=U.actions.get("zoomOut"),Ja=U.actions.get("resetView");Q=U.actions.get("fullscreen");var Ua=U.actions.get("undo"),$a=U.actions.get("redo"),z=X("",Ua.funct,null,mxResources.get("undo")+" ("+Ua.shortcut+")",Ua,Editor.undoImage),L=X("",$a.funct,null,mxResources.get("redo... | vuln | Vulnerable | JavaScript |
direct_io_worker(int rw, struct kiocb *iocb, struct inode *inode,
const struct iovec *iov, loff_t offset, unsigned long nr_segs,
unsigned blkbits, get_block_t get_block, dio_iodone_t end_io,
struct dio *dio)
{
unsigned long user_addr;
unsigned long flags;
int seg;
ssize_t ret = 0;
ssize_t ret2;
size_t bytes... | vuln | Safe | Unknown |
static int ocfs2_prepare_page_for_write(struct inode *inode, u64 *p_blkno,
struct ocfs2_write_ctxt *wc,
struct page *page, u32 cpos,
loff_t user_pos, unsigned user_len,
int new)
{
int ret;
unsigned int map_from = 0, map_to = 0;
unsigned int cluster_start, cluster_end;
unsigned int user_data_from... | vuln | Safe | Unknown |
ArgParser::argKeepFilesOpenThreshold(char* parameter)
{
o.keep_files_open_threshold =
static_cast<size_t>(QUtil::string_to_int(parameter));
} | vuln | Vulnerable | Unknown |
public static boolean canPlayerUseBlock(Player player, Block block, boolean justCheck) {
if (Conf.playersWhoBypassAllProtection.contains(player.getName()))
return true;
FPlayer me = FPlayers.getInstance().getByPlayer(player);
if (me.isAdminBypassing())
return true;
... | vuln | Safe | Java |
TEST_F(AllowMissingInAndOfOrListTest, GoodAndBadJwts) {
EXPECT_CALL(mock_cb_, onComplete(Status::Ok));
// Use the token with example.com issuer for x-other.
auto headers =
Http::TestRequestHeaderMapImpl{{kExampleHeader, GoodToken}, {kOtherHeader, GoodToken}};
context_ = Verifier::createContext(headers, pa... | vuln | Vulnerable | Unknown |
void Browser::ClearUnloadState(TabContents* tab) {
void Browser::ClearUnloadState(TabContents* tab, bool process_now) {
if (is_attempting_to_close_browser_) {
RemoveFromSet(&tabs_needing_before_unload_fired_, tab);
RemoveFromSet(&tabs_needing_unload_fired_, tab);
if (process_now) {
ProcessPending... | vuln | Safe | C/C++ |
//========================================================================
//
// CharCodeToUnicode.cc
//
// Copyright 2001-2003 Glyph & Cog, LLC
//
//========================================================================
#include <aconf.h>
#ifdef USE_GCC_PRAGMAS
#pragma implementation
#endif
#include <stdio.h>
#in... | vuln | Vulnerable | C/C++ |
/* Copyright 2018 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 | Vulnerable | C/C++ |
/*
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2016 The PHP Group |
+---------... | vuln | Vulnerable | C/C++ |
/*
* Copyright 2017 - 2018 Anton Tananaev (anton@traccar.org)
*
* 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 b... | vuln | Vulnerable | Java |
int s390_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs,
int cpuid, void *opaque)
{
S390CPU *cpu = S390_CPU(cs);
int r;
r = s390x_write_elf64_notes("CORE", f, cpu, cpuid, opaque, note_core);
if (r) {
return r;
}
return s390x_write_elf64_notes("LI... | vuln | Safe | C/C++ |
static void php_snmp_error(zval *object, const char *docref, int type, const char *format, ...)
{
va_list args;
php_snmp_object *snmp_object = NULL;
if (object) {
snmp_object = Z_SNMP_P(object);
if (type == PHP_SNMP_ERRNO_NOERROR) {
memset(snmp_object->snmp_errstr, 0, sizeof(snmp_object->snmp_errstr));
} e... | vuln | Safe | Unknown |
const convict = function convict(def, opts) {
// TODO: Rename this `rv` variable (supposedly "return value") into something
// more meaningful.
const rv = {
/**
* Gets the array of process arguments, using the override passed to the
* convict function or process.argv if no override was passed.
... | vuln | Safe | JavaScript |
var profiles = []
// Attempts to send a test email by POSTing to /campaigns/
function sendTestEmail() {
var headers = [];
$.each($("#headersTable").DataTable().rows().data(), function (i, header) {
headers.push({
key: unescapeHtml(header[0]),
value: unescapeHtml(header[1]),
... | vuln | Vulnerable | Go |
static int i2r_pci(X509V3_EXT_METHOD *method, PROXY_CERT_INFO_EXTENSION *pci,
BIO *out, int indent)
{
BIO_printf(out, "%*sPath Length Constraint: ", indent, "");
if (pci->pcPathLengthConstraint)
i2a_ASN1_INTEGER(out, pci->pcPathLengthConstraint);
else
BIO_printf(out, "infi... | vuln | Vulnerable | Unknown |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.