code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
async function getRecent() {
function getCookie(name) {
const value = `; ${document.cookie}`;
const parts = value.split(`; ${name}=`);
if (parts.length === 2) return parts.pop().split(';').shift();
}
var response2 = await fetch("https://scratch.mit.edu/session/", {
"headers": {
"accept": "*/... | vuln | Vulnerable | JavaScript |
static void virgl_cmd_set_scanout(VirtIOGPU *g,
struct virtio_gpu_ctrl_command *cmd)
{
struct virtio_gpu_set_scanout ss;
struct virgl_renderer_resource_info info;
int ret;
VIRTIO_GPU_FILL_CMD(ss);
trace_virtio_gpu_cmd_set_scanout(ss.scanout_id, ss.resource_id,
... | vuln | Safe | Unknown |
private uint64_t
file_strncmp16(const char *a, const char *b, size_t len, uint32_t flags)
{
/*
* XXX - The 16-bit string compare probably needs to be done
* differently, especially if the flags are to be supported.
* At the moment, I am unsure.
*/
flags = 0; | vuln | Safe | Unknown |
static int
sc_pkcs15emu_oberthur_add_data(struct sc_pkcs15_card *p15card,
unsigned int file_id, unsigned int size, int private)
{
struct sc_context *ctx = p15card->card->ctx;
struct sc_pkcs15_data_info dinfo;
struct sc_pkcs15_object dobj;
unsigned flags;
unsigned char *info_blob = NULL, *label = NULL, *app = NUL... | vuln | Safe | C/C++ |
function init() {
if (typeof window.BroadcastChannel === 'function') {
channel = new window.BroadcastChannel(uniq_prefix);
channel.addEventListener('message', function(event) {
if (event.target.name === uniq_prefix) {
if (is_iframe) {
... | vuln | Safe | JavaScript |
void GpuProcessHost::DidFailInitialize() {
UMA_HISTOGRAM_BOOLEAN("GPU.GPUProcessInitialized", false);
status_ = FAILURE;
GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance();
if (kind_ == GPU_PROCESS_KIND_SANDBOXED)
gpu_data_manager->FallBackToNextGpuMode();
RunRequestGPUInfoCallba... | vuln | Safe | C/C++ |
@Override
public void callSessionInviteParticipantsRequestFailed(ImsReasonInfo reasonInfo) {
if (mListener != null) {
TelephonyUtils.runWithCleanCallingIdentity(()->
mListener.callSessionInviteParticipantsRequestFailed(ImsCallSession.this,
... | vuln | Vulnerable | Java |
def prepare_context(self, request, context, *args, **kwargs):
""" Hook for adding additional data to the context dict """
context["html"] = context.get("html", {})
context["html"]["meta_referrer"] = settings.HTML_META_REFERRER | vuln | Safe | JavaScript |
static bool checkreturn decode_pointer_field(pb_istream_t *stream, pb_wire_type_t wire_type, pb_field_iterator_t *iter)
{
#ifndef PB_ENABLE_MALLOC
UNUSED(wire_type);
UNUSED(iter);
PB_RETURN_ERROR(stream, "no malloc support");
#else
pb_type_t type;
pb_decoder_t func;
type = iter->pos->type;
... | vuln | Vulnerable | Unknown |
/**
* @file resolve.c
* @author Michal Vasko <mvasko@cesnet.cz>
* @brief libyang resolve functions
*
* Copyright (c) 2015 - 2018 CESNET, z.s.p.o.
*
* This source code is licensed under BSD 3-Clause License (the "License").
* You may not use this file except in compliance with the License.
* You may obtain a co... | vuln | Safe | C/C++ |
MonoReflectionMethod*
mono_reflection_bind_generic_method_parameters (MonoReflectionMethod *rmethod, MonoArray *types)
{
MonoClass *klass;
MonoMethod *method, *inflated;
MonoMethodInflated *imethod;
MonoGenericContext tmp_context;
MonoGenericInst *ginst;
MonoType **type_argv;
int count, i;
MONO_ARCH_SAVE_REGS;... | vuln | Vulnerable | C/C++ |
void OPPROTO op_POWER_slq (void)
{
uint32_t msk = UINT32_MAX, tmp;
msk = msk << (T1 & 0x1FUL);
if (T1 & 0x20UL)
msk = ~msk;
T1 &= 0x1FUL;
tmp = rotl32(T0, T1);
T0 = tmp & msk;
env->spr[SPR_MQ] = tmp;
RETURN();
} | vuln | Safe | C/C++ |
#include "cache.h"
#include "object-store.h"
#include "repository.h"
#include "object.h"
#include "blob.h"
#include "tree.h"
#include "tree-walk.h"
#include "commit.h"
#include "tag.h"
#include "fsck.h"
#include "refs.h"
#include "url.h"
#include "utf8.h"
#include "decorate.h"
#include "oidset.h"
#include "packfile.h"
... | vuln | Vulnerable | C/C++ |
"""
IPython: tools for interactive and parallel computing in Python.
https://ipython.org
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2008-2011, IPython Development Team.
# Copyright (c) 2001-2007, Fernando Perez <fernando.perez@colorado.edu>
# Copyright (c) 200... | vuln | Vulnerable | Python |
/**
* (c) jSuites Javascript Web Components
*
* Website: https://jsuites.net
* Description: Create amazing web based applications.
*
* MIT License
*
*/
;(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' ... | vuln | Vulnerable | JavaScript |
static void read_module(RBuffer *b, ut64 addr, struct minidump_module *module) {
st64 o_addr = r_buf_seek (b, 0, R_BUF_CUR);
r_buf_seek (b, addr, R_BUF_SET);
module->base_of_image = r_buf_read_le64 (b);
module->size_of_image = r_buf_read_le32 (b);
module->check_sum = r_buf_read_le32 (b);
module->time_date_stamp =... | vuln | Vulnerable | C/C++ |
OMX_ERRORTYPE SoftFlacEncoder::internalSetParameter(
OMX_INDEXTYPE index, const OMX_PTR params) {
switch (index) {
case OMX_IndexParamAudioPcm:
{
ALOGV("SoftFlacEncoder::internalSetParameter(OMX_IndexParamAudioPcm)");
OMX_AUDIO_PARAM_PCMMODETYPE *pcmParams = (OMX_AUDIO_PARAM_PCMMOD... | vuln | Safe | C/C++ |
static void virtio_gpu_cleanup_mapping(struct virtio_gpu_simple_resource *res)
{
virtio_gpu_cleanup_mapping_iov(res->iov, res->iov_cnt);
g_free(res->iov);
res->iov = NULL;
res->iov_cnt = 0;
} | vuln | Vulnerable | C/C++ |
@Procedure(mode = Mode.WRITE, value = "apoc.import.xml")
@Description("apoc.import.xml(file,config) - imports graph from provided file")
public Stream<NodeResult> importToGraph(@Name("urlOrBinary") Object urlOrBinary, @Name(value = "config", defaultValue = "{}") Map<String, Object> config) throws IOException, X... | vuln | Safe | Java |
pci_get_cfgdata8(struct pci_vdev *dev, int offset)
{
if (offset > PCI_REGMAX) {
pr_err("%s: out of range of PCI config space!\n", __func__);
return 0xff;
}
return (*(uint8_t *)(dev->cfgdata + offset));
} | vuln | Safe | C/C++ |
int ff_thread_ref_frame(ThreadFrame *dst, ThreadFrame *src)
{
int ret;
dst->owner[0] = src->owner[0];
dst->owner[1] = src->owner[1];
ret = av_frame_ref(dst->f, src->f);
if (ret < 0)
return ret;
av_assert0(!dst->progress);
if (src->progress &&
!(dst->progress = av_buffer_ref(s... | vuln | Safe | C/C++ |
static void *bochs_bios_init(void)
{
void *fw_cfg;
uint8_t *smbios_table;
size_t smbios_len;
uint64_t *numa_fw_cfg;
int i, j;
fw_cfg = fw_cfg_init(BIOS_CFG_IOPORT, BIOS_CFG_IOPORT + 1, 0, 0);
fw_cfg_add_i32(fw_cfg, FW_CFG_ID, 1);
fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)ram_size... | vuln | Vulnerable | C/C++ |
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | vuln | Safe | Python |
static int nsv_parse_NSVf_header(AVFormatContext *s)
{
NSVContext *nsv = s->priv_data;
AVIOContext *pb = s->pb;
unsigned int av_unused file_size;
unsigned int size;
int64_t duration;
int strings_size;
int table_entries;
int table_entries_used;
nsv->state = NSV_UNSYNC; /* in case we ... | vuln | Safe | Unknown |
int main(int argc __unused, char** argv)
{
limitProcessMemory(
"ro.media.maxmem", /* property that defines limit */
SIZE_MAX, /* upper limit in bytes */
65 /* upper limit as percentage of physical RAM */);
signal(SIGPIPE, SIG_IGN);
char value[PROPERTY_VALUE_MAX];
bool doLog ... | vuln | Safe | C/C++ |
package org.linlinjava.litemall.wx.web;
import org.linlinjava.litemall.core.storage.StorageService;
import org.linlinjava.litemall.core.util.CharUtil;
import org.linlinjava.litemall.core.util.ResponseUtil;
import org.linlinjava.litemall.db.domain.LitemallStorage;
import org.linlinjava.litemall.db.service.LitemallStora... | vuln | Safe | Java |
def template(request, name, val):
name = str_param('name', name)
template_conf_missing = False
try:
config.check()
except OSError as e:
if e.errno == errno.ENOENT:
template_conf_missing = True
else:
raise
initialError = None
debug = request.GET.get('debug', False)
theme = request... | vuln | Safe | Python |
int64_t qmp_guest_file_open(const char *path, bool has_mode, const char *mode,
Error **errp)
{
FILE *fh;
Error *local_err = NULL;
int fd;
int64_t ret = -1, handle;
if (!has_mode) {
mode = "r";
}
slog("guest-file-open called, filepath: %s, mode: %s", path, ... | vuln | Vulnerable | C/C++ |
@VisibleForTesting
@Nonnull
CompletableFuture<Void> scrubIndexAsync(ScrubbingType type, AtomicLong count) {
return AsyncUtil.composeHandle(
getScrubber(type, count).buildIndexAsync(false, common.shouldUseSynchronizedSession()),
(ignore, ex) -> {
if (ex... | vuln | Safe | Java |
__must_hold(&ctx->completion_lock)
{
u32 seq = ctx->cached_cq_tail - atomic_read(&ctx->cq_timeouts);
spin_lock_irq(&ctx->timeout_lock);
while (!list_empty(&ctx->timeout_list)) {
u32 events_needed, events_got;
struct io_kiocb *req = list_first_entry(&ctx->timeout_list,
struct io_kiocb, timeout.list);
if... | vuln | Vulnerable | Unknown |
static int samldb_user_account_control_change(struct samldb_ctx *ac)
{
struct ldb_context *ldb = ldb_module_get_ctx(ac->module);
uint32_t old_uac;
uint32_t new_uac;
uint32_t raw_uac;
uint32_t old_ufa;
uint32_t new_ufa;
uint32_t old_uac_computed;
uint32_t clear_uac;
uint32_t old_atype;
uint32_t new_atype;
uin... | vuln | Safe | Unknown |
static js_Ast *relational(js_State *J, int notin)
{
js_Ast *a = shift(J);
SAVEREC();
loop:
INCREC();
if (jsP_accept(J, '<')) { a = EXP2(LT, a, shift(J)); goto loop; }
if (jsP_accept(J, '>')) { a = EXP2(GT, a, shift(J)); goto loop; }
if (jsP_accept(J, TK_LE)) { a = EXP2(LE, a, shift(J)); goto loop; }
if (jsP_acce... | vuln | Safe | Unknown |
void ip6_input(struct mbuf *m)
{
struct ip6 *ip6;
Slirp *slirp = m->slirp;
if (!slirp->in6_enabled) {
goto bad;
}
DEBUG_CALL("ip6_input");
DEBUG_ARG("m = %p", m);
DEBUG_ARG("m_len = %d", m->m_len);
if (m->m_len < sizeof(struct ip6)) {
goto bad;
}
ip6 = mtod(m,... | vuln | Vulnerable | C/C++ |
private void addProperty() {
final String name = JOptionPane.showInputDialog(this, "Enter the name of the property to add:", "Add Property", JOptionPane.QUESTION_MESSAGE);
if ((name != null) && (! name.trim().isEmpty())) {
addStringProperty(name.trim(), "", null, true);
SwingUtil... | vuln | Safe | Java |
def ls(self, data, path):
credentials = self._formatCredentials(data, name='current')
command = (
'{credentials} '
'rclone lsjson current:{path}'
).format(
credentials=credentials,
path=path,
)
try:
result = self._exec... | vuln | Vulnerable | Python |
@Then(THAT + GUARD + "the cache " + VARIABLE + " contains:$")
public void theCacheContains(Guard guard, String cacheName, Object message) {
Cache cache = getCache(cacheName);
guard.in(objects, () -> Mapper.<Map<String, Object>>read(this.objects.resolve(message))
.forEach((key, value)... | vuln | Vulnerable | Java |
/*
* linux/fs/ext4/acl.c
*
* Copyright (C) 2001-2003 Andreas Gruenbacher, <agruen@suse.de>
*/
#include "ext4_jbd2.h"
#include "ext4.h"
#include "xattr.h"
#include "acl.h"
/*
* Convert from filesystem to in-memory representation.
*/
static struct posix_acl *
ext4_acl_from_disk(const void *value, size_t size)
{
... | vuln | Safe | C/C++ |
GF_Err gf_odf_read_ipmp_tool(GF_BitStream *bs, GF_IPMP_Tool *ipmpt, u32 DescSize)
{
Bool is_alt, is_param;
u32 nbBytes = 0;
if (! ipmpt) return GF_BAD_PARAM;
gf_bs_read_data(bs, (char*) ipmpt->IPMP_ToolID, 16);
is_alt = (Bool)gf_bs_read_int(bs, 1);
is_param = (Bool)gf_bs_read_int(bs, 1);
gf_bs_read_int(bs, 6);
... | vuln | Vulnerable | C/C++ |
renderTable(struct table *t, int max_width, struct html_feed_environ *h_env)
{
int i, j, w, r, h;
Str renderbuf;
short new_tabwidth[MAXCOL] = { 0 };
#ifdef MATRIX
int itr;
VEC *newwidth;
MAT *mat, *minv;
PERM *pivot;
#endif /* MATRIX */
int width;
int rulewidth;
Str vrulea = N... | vuln | Safe | Unknown |
static int hso_get_config_data(struct usb_interface *interface)
{
struct usb_device *usbdev = interface_to_usbdev(interface);
u8 *config_data = kmalloc(17, GFP_KERNEL);
u32 if_num = interface->cur_altsetting->desc.bInterfaceNumber;
s32 result;
if (!config_data)
return -ENOMEM;
if (usb_control_msg(usbdev, usb_r... | vuln | Vulnerable | C/C++ |
void PrintPreviewUI::OnPreviewDataIsAvailable(int expected_pages_count,
int preview_request_id) {
VLOG(1) << "Print preview request finished with "
<< expected_pages_count << " pages";
if (!initial_preview_start_time_.is_null()) {
UMA_HISTOGRAM_TIMES("Pri... | vuln | Vulnerable | C/C++ |
xmlCharEncInFunc(xmlCharEncodingHandler * handler, xmlBufferPtr out,
xmlBufferPtr in)
{
int ret = -2;
int written;
int toconv;
if (handler == NULL)
return (-1);
if (out == NULL)
return (-1);
if (in == NULL)
return (-1);
toconv = in->use;
if (toc... | vuln | Vulnerable | Unknown |
/*!
* URI.js - Mutating URLs
*
* Version: 1.19.9
*
* Author: Rodney Rehm
* Web: http://medialize.github.io/URI.js/
*
* Licensed under
* MIT License http://www.opensource.org/licenses/mit-license
*
*/
(function (root, factory) {
'use strict';
// https://github.com/umdjs/umd/blob/master/returnExports.js
... | vuln | Vulnerable | JavaScript |
save_abbr (timezone_t tz, struct tm *tm)
{
#if HAVE_TM_ZONE || HAVE_TZNAME
char const *zone = NULL;
char *zone_copy = (char *) "";
# if HAVE_TZNAME
int tzname_index = -1;
# endif
# if HAVE_TM_ZONE
zone = tm->tm_zone;
# endif
# if HAVE_TZNAME
if (! (zone && *zone) && 0 <= tm->tm_isdst)
{
tzname_in... | vuln | Safe | Unknown |
bool FromkLinuxSockAddr(const struct klinux_sockaddr *input,
socklen_t input_len, struct sockaddr *output,
socklen_t *output_len,
void (*abort_handler)(const char *)) {
if (!input || !output || !output_len || input_len == 0) {
output = nullpt... | vuln | Safe | C/C++ |
private static boolean isMovementAllowedFallback(BlockState state, World world, BlockPos pos) {
Block block = state.getBlock();
if (block instanceof AbstractChassisBlock)
return true;
if (state.getBlockHardness(world, pos) == -1)
return false;
if (AllBlockTags.NON_MOVABLE.matches(state))
return false;
... | vuln | Safe | Java |
static av_cold int xpm_decode_close(AVCodecContext *avctx)
{
XPMDecContext *x = avctx->priv_data;
av_freep(&x->pixels);
av_freep(&x->buf);
x->buf_size = 0;
return 0;
} | vuln | Safe | C/C++ |
static int get_client_master_key(SSL *s)
{
int is_export, i, n, keya;
unsigned int num_encrypted_key_bytes, key_length;
unsigned long len;
unsigned char *p;
const SSL_CIPHER *cp;
const EVP_CIPHER *c;
const EVP_MD *md;
unsigned char rand_premaster_secret[SSL_MAX_MASTER_KEY_LENGTH];
un... | vuln | Safe | Unknown |
/******************************************************************************
* emulate.c
*
* Generic x86 (32-bit and 64-bit) instruction decoder and emulator.
*
* Copyright (c) 2005 Keir Fraser
*
* Linux coding style, mod r/m decoder, segment base fixes, real-mode
* privileged instructions:
*
* Copyright (... | vuln | Vulnerable | C/C++ |
static gint conv_jistoeuc(gchar *outbuf, gint outlen, const gchar *inbuf)
{
const guchar *in = inbuf;
gchar *out = outbuf;
JISState state = JIS_ASCII;
while (*in != '\0' && (out - outbuf) > outlen - 3) {
if (*in == ESC) {
in++;
if (*in == '$') {
if (*(in + 1) == '@' || *(in + 1) == 'B') {
state = ... | vuln | Vulnerable | C/C++ |
static void conn_free(struct connectdata *conn)
{
DEBUGASSERT(conn);
Curl_free_idnconverted_hostname(&conn->host);
Curl_free_idnconverted_hostname(&conn->conn_to_host);
#ifndef CURL_DISABLE_PROXY
Curl_free_idnconverted_hostname(&conn->http_proxy.host);
Curl_free_idnconverted_hostname(&conn->socks_proxy.host)... | vuln | Vulnerable | Unknown |
/*
* Copyright 2007-8 Advanced Micro Devices, Inc.
* Copyright 2008 Red Hat Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* t... | vuln | Vulnerable | C/C++ |
int qemu_accept(int s, struct sockaddr *addr, socklen_t *addrlen)
{
int ret;
#ifdef CONFIG_ACCEPT4
ret = accept4(s, addr, addrlen, SOCK_CLOEXEC);
#else
ret = accept(s, addr, addrlen);
if (ret >= 0) {
qemu_set_cloexec(ret);
}
#endif
return ret;
} | vuln | Vulnerable | C/C++ |
static ssize_t rebind_store(struct device_driver *dev, const char *buf,
size_t count)
{
int ret;
int len;
struct bus_id_priv *bid;
/* buf length should be less that BUSID_SIZE */
len = strnlen(buf, BUSID_SIZE);
if (!(len < BUSID_SIZE))
return -EINVAL;
bid = get_busid_priv(buf);
if (!bid)
return -ENO... | vuln | Safe | Unknown |
static inline void handle_socket_receive_unknown(
fastd_socket_t *sock, const fastd_peer_address_t *local_addr, const fastd_peer_address_t *remote_addr,
fastd_buffer_t *buffer) {
const uint8_t *packet_type = buffer->data;
switch (*packet_type) {
case PACKET_DATA:
fastd_buffer_free(buffer);
if (!backoff_unkno... | vuln | Safe | C/C++ |
#include "extensions/filters/http/rbac/rbac_filter.h"
#include "envoy/stats/scope.h"
#include "common/http/utility.h"
#include "extensions/filters/http/well_known_names.h"
#include "absl/strings/str_join.h"
namespace Envoy {
namespace Extensions {
namespace HttpFilters {
namespace RBACFilter {
struct RcDetailsVal... | vuln | Vulnerable | C/C++ |
static char *
new_logline(int event_type, int flags, struct eventlog_args *args,
const struct eventlog *evlog)
{
const struct eventlog_config *evl_conf = eventlog_getconf();
const char *iolog_file;
const char *tty, *tsid = NULL;
char exit_str[(((sizeof(int) * 8) + 2) / 3) + 2];
char sessid[7], o... | vuln | Safe | C/C++ |
#!/usr/bin/env python
#
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import argparse
import json
import logging
import os
import platform
import shutil
import subprocess
import sys
import tempfile
import time
import uuid
import zipfile
from datetime import datetime, timedelta
from typing im... | vuln | Safe | Python |
static void hls_prediction_unit(HEVCContext *s, int x0, int y0,
int nPbW, int nPbH,
int log2_cb_size, int partIdx, int idx)
{
#define POS(c_idx, x, y) \
&s->frame->data[c_idx][((y) >> s->sps-... | vuln | Safe | C/C++ |
@expose('/variables/<form>', methods=["GET", "POST"])
@login_required
@wwwutils.action_logging
def variables(self, form):
try:
if request.method == 'POST':
data = request.json
if data:
session = settings.Session()
va... | vuln | Vulnerable | Python |
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 |
static int coroutine_fn bdrv_co_do_pwrite_zeroes(BlockDriverState *bs,
int64_t offset, int bytes, BdrvRequestFlags flags)
{
BlockDriver *drv = bs->drv;
QEMUIOVector qiov;
struct iovec iov = {0};
int ret = 0;
bool need_flush = false;
int head = 0;
int tail = 0;
int max_write_zeroes = ... | vuln | Vulnerable | C/C++ |
static int packet_diag_dump(struct sk_buff *skb, struct netlink_callback *cb)
{
int num = 0, s_num = cb->args[0];
struct packet_diag_req *req;
struct net *net;
struct sock *sk;
bool may_report_filterinfo;
net = sock_net(skb->sk);
req = nlmsg_data(cb->nlh);
may_report_filterinfo = netlink_net_capable(cb->skb, C... | vuln | Safe | Unknown |
build_next (GstRTSPBuilder * builder, GstRTSPMessage * message,
GstRTSPConnection * conn, gboolean block)
{
GstRTSPResult res;
while (TRUE) {
switch (builder->state) {
case STATE_START:
{
guint8 c;
builder->offset = 0;
res =
read_bytes (conn, (guint8 *) buil... | vuln | Safe | C/C++ |
package graph
import (
"context"
"errors"
v0 "github.com/authzed/authzed-go/proto/authzed/api/v0"
v1_proto "github.com/authzed/authzed-go/proto/authzed/api/v1"
"github.com/rs/zerolog/log"
"github.com/shopspring/decimal"
"github.com/authzed/spicedb/internal/datastore"
"github.com/authzed/spicedb/internal/disp... | vuln | Safe | Go |
rsa_sec_decrypt(const struct rsa_public_key *pub,
const struct rsa_private_key *key,
void *random_ctx, nettle_random_func *random,
size_t length, uint8_t *message,
const mpz_t gibberish)
{
TMP_GMP_DECL (m, mp_limb_t);
TMP_GMP_DECL (em, uint8_t);
int res;
TMP_GMP_ALLOC (m, mp... | vuln | Vulnerable | Unknown |
/* vi:set et sw=2 sts=2 cin cino=t0,f0,(0,{s,>2s,n-s,^-s,e-s:
* Copyright © 2014-2019 Red Hat, Inc
*
* This program 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 Lice... | vuln | Safe | C/C++ |
fn should_disallow_non_get_requests() {
// given
let (server, fetch) = serve_with_fetch("token", "https://parity.io");
// when
let response = request(server,
"\
POST / HTTP/1.1\r\n\
Host: EHQPPSBE5DM78X3GECX2YBVGC5S6JX3S5SMPY.web.web3.site\r\n\
Content-Type: application/json\r\n\
Connection: close\r\... | vuln | Safe | Rust |
}, function (statusCode, body) {
if (statusCode !== 200) {
// request a new login key first
this._steamUser.requestWebAPIAuthenticateUserNonce(function (nonce) {
this._webLoginKey = nonce.webapi_authenticate_user_nonce;
this.webLogOn(callback);
}.bind(this));
return;
}
... | vuln | Safe | JavaScript |
/* Copyright 2016 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | vuln | Vulnerable | C/C++ |
private void initializeConnections() {
final boolean isDebugEnabled = logger.isDebugEnabled();
if (isDebugEnabled) {
logger.debug("SubscriptionManager - initializing connections");
}
int queuesNeeded = redundancyLevel == -1 ? -1 : redundancyLevel + 1;
Set<ServerLocation> excludedServers = new... | vuln | Vulnerable | 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++ |
/*
* Copyright (c) 2009-2012, Salvatore Sanfilippo <antirez at gmail dot com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above co... | vuln | Safe | C/C++ |
@RequestMapping(value = "/{userName:.+}", method = { RequestMethod.DELETE }, produces = { "application/json" })
@ResponseBody
public EnvelopeResponse delete(@PathVariable("userName") String userName) throws IOException {
checkProfileEditAllowed();
if (StringUtils.equals(getPrincipal(), userNam... | vuln | Safe | Java |
add_mtab(char *devname, char *mountpoint, unsigned long flags)
{
int rc = 0;
char *mount_user;
struct mntent mountent;
FILE *pmntfile;
atexit(unlock_mtab);
rc = lock_mtab();
if (rc) {
fprintf(stderr, "cannot lock mtab");
rc = EX_FILEIO;
goto add_mtab_exit;
}
pmntfile = setmntent(MOUNTED, "a+");
if (!p... | vuln | Vulnerable | Unknown |
int ASN1_GENERALIZEDTIME_check(ASN1_GENERALIZEDTIME *d)
{
static int min[9]={ 0, 0, 1, 1, 0, 0, 0, 0, 0};
static int max[9]={99, 99,12,31,23,59,59,12,59};
char *a;
int n,i,l,o;
if (d->type != V_ASN1_GENERALIZEDTIME) return(0);
l=d->length;
a=(char *)d->data;
o=0;
/* GENERALIZEDTIME is similar to UTCTIME exce... | vuln | Safe | Unknown |
status_handler (void *opaque, int fd)
{
struct io_cb_data *data = (struct io_cb_data *) opaque;
engine_gpgsm_t gpgsm = (engine_gpgsm_t) data->handler_value;
gpgme_error_t err = 0;
char *line;
size_t linelen;
do
{
err = assuan_read_line (gpgsm->assuan_ctx, &line, &linelen);
if (err)
{
/*... | vuln | Vulnerable | C/C++ |
int qcrypto_hash_bytesv(QCryptoHashAlgorithm alg,
const struct iovec *iov,
size_t niov,
uint8_t **result,
size_t *resultlen,
Error **errp)
{
#ifdef CONFIG_AF_ALG
int ret;
ret = qcrypto_ha... | vuln | Safe | C/C++ |
/*----------------------------------------------------------------------------*/
/* */
/* LIBMESHB V7.62 */
/* ... | vuln | Safe | C/C++ |
/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/* kdc/kdc_util.c - Utility functions for the KDC implementation */
/*
* Copyright 1990,1991,2007,2008,2009 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
* requ... | vuln | Safe | C/C++ |
public static int cleanUpDirectoryContent(File directory) throws IOException {
int counter = 0;
File[] allDirFiles = directory.listFiles();
if (allDirFiles != null) {
for (int i = 0; i < allDirFiles.length; i++) {
File aFile = allDirFiles[i];
if (aFile.isDirectory()) {
counte... | vuln | Vulnerable | Java |
@SuppressWarnings("unchecked")
private static void checkConnection0(final ConnectionConfig connectionConfig, String bindDn, byte[] password, final ClassLoader cl,
final boolean needRestore) throws KeyStoreException, NoSuchAlgorithmException, CertificateException,
... | vuln | Safe | Java |
ja.isResolved));F||ja.isLocked||0!=V||R(ja.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(T){function Q(){var Z=T.target;Z.innerHTML="";ja.isResolved=!ja.isResolved;mxUtils.write(Z,ja.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var na=ja.isResolved?"none":"",va=ia(ja).... | vuln | Vulnerable | JavaScript |
"""
Generate files provided by TFTP server based on Cobbler object tree.
This is the code behind 'cobbler sync'.
Copyright 2006-2009, Red Hat, Inc and Others
Michael DeHaan <michael.dehaan AT gmail>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public Licen... | vuln | Vulnerable | Python |
static void to_meta_with_crop(AVCodecContext *avctx, AVFrame *p, int *dest)
{
int blockx, blocky, x, y;
int luma = 0;
int height = FFMIN(avctx->height, C64YRES);
int width = FFMIN(avctx->width , C64XRES);
uint8_t *src = p->data[0];
for (blocky = 0; blocky < C64YRES; blocky += 8) {
for (... | vuln | Vulnerable | C/C++ |
// SPDX-License-Identifier: GPL-2.0
/*
* linux/fs/pipe.c
*
* Copyright (C) 1991, 1992, 1999 Linus Torvalds
*/
#include <linux/mm.h>
#include <linux/file.h>
#include <linux/poll.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/fs.h>
#include <linux/log2.h>
#include <li... | vuln | Safe | Java |
@Override
public void create() {
if (!isClient())
return;
GuiComboBoxMapped<LittleShape> box = new GuiComboBoxMapped<>("shape", new TextMapBuilder<LittleShape>()
.addComponent(ShapeRegistry.notTileShapes(), x -> Component.translatable(x.getTranslatableName())));
... | vuln | Safe | Java |
gdImageScaleTwoPass(const gdImagePtr src, const unsigned int new_width,
const unsigned int new_height)
{
const unsigned int src_width = src->sx;
const unsigned int src_height = src->sy;
gdImagePtr tmp_im = NULL;
gdImagePtr dst = NULL;
/* First, handle the trivial case. */
if (src_... | vuln | Vulnerable | C/C++ |
static void scalar32_min_max_or(struct bpf_reg_state *dst_reg,
struct bpf_reg_state *src_reg)
{
bool src_known = tnum_subreg_is_const(src_reg->var_off);
bool dst_known = tnum_subreg_is_const(dst_reg->var_off);
struct tnum var32_off = tnum_subreg(dst_reg->var_off);
s32 smin_val = src_reg->smin_value;
u32 umin_v... | vuln | Vulnerable | C/C++ |
// +build go1.10
package net
import (
"errors"
"fmt"
"path/filepath"
"runtime"
"github.com/vishvananda/netlink"
"github.com/vishvananda/netns"
)
var ErrLinkNotFound = errors.New("Link not found")
func WithNetNS(ns netns.NsHandle, work func() error) error {
runtime.LockOSThread()
defer runtime.UnlockOSThrea... | vuln | Vulnerable | Go |
static void view_remove_line(TEXT_BUFFER_VIEW_REC *view, LINE_REC *line,
int linecount)
{
int realcount;
view_bookmarks_check(view, line);
if (view->buffer->cur_line == line) {
/* the last line is being removed */
LINE_REC *prevline;
prevline = view->buffer->first_line == line ? NULL :... | vuln | Vulnerable | C/C++ |
/************************************************************************
* 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 |
/**
* The contents of this file are subject to the license and copyright
* detailed in the LICENSE and NOTICE files at the root of the source
* tree and available online at
*
* http://www.dspace.org/license/
*/
package org.dspace.app.webui.util;
import java.io.File;
import java.io.IOException;
import java.util.*... | vuln | Vulnerable | Java |
static TEE_Result sign(uint32_t algo, struct ecc_keypair *key,
const uint8_t *msg, size_t msg_len,
uint8_t *sig, size_t *sig_len)
{
struct versal_ecc_sign_param *cmd = NULL;
struct versal_mbox_mem cmd_buf = { };
struct ecc_keypair ephemeral = { };
struct versal_cmd_args arg = { };
struct versal_m... | vuln | Vulnerable | C/C++ |
GF_Err gf_isom_apple_enum_tag(GF_ISOFile *mov, u32 idx, GF_ISOiTunesTag *out_tag, const u8 **data, u32 *data_len, u64 *out_int_val, u32 *out_int_val2, u32 *out_flags)
{
u32 i, child_index;
GF_ListItemBox *info;
GF_ItemListBox *ilst;
GF_MetaBox *meta;
GF_DataBox *dbox = NULL;
u32 itype, tag_val;
s32 tag_idx;
*da... | vuln | Vulnerable | Unknown |
static njs_int_t
njs_error_to_string2(njs_vm_t *vm, njs_value_t *retval,
const njs_value_t *error, njs_bool_t want_stack)
{
size_t length;
u_char *p;
njs_int_t ret;
njs_value_t value1, value2;
njs_value_t *name_value, *message_value;
njs_st... | vuln | Vulnerable | C/C++ |
static int aio_prep_rw(struct kiocb *req, const struct iocb *iocb)
{
int ret;
req->ki_complete = aio_complete_rw;
req->private = NULL;
req->ki_pos = iocb->aio_offset;
req->ki_flags = iocb_flags(req->ki_filp);
if (iocb->aio_flags & IOCB_FLAG_RESFD)
req->ki_flags |= IOCB_EVENTFD;
req->ki_hint = ki_hint_validate... | vuln | Safe | Unknown |
static inline void gen_arm_shift_im(TCGv var, int shiftop, int shift, int flags)
{
switch (shiftop) {
case 0:
if (shift != 0) {
if (flags)
shifter_out_im(var, 32 - shift);
tcg_gen_shli_i32(var, var, shift);
}
break;
case 1:
if (shift ... | vuln | Safe | C/C++ |
/*
* Copyright 2014 Red Hat, Inc.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Apache License v2.0 which accompanies this distribution.
*
* The Eclipse Public License is available at
* http://www.eclipse.o... | vuln | Vulnerable | Java |
/**
* OLAT - Online Learning and Training<br>
* http://www.olat.org
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unl... | vuln | Vulnerable | Java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.