code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
static struct sshsk_provider *
sshsk_open(const char *path)
{
struct sshsk_provider *ret = NULL;
uint32_t version;
if (path == NULL || *path == '\0') {
error("No FIDO SecurityKeyProvider specified");
return NULL;
}
if ((ret = calloc(1, sizeof(*ret))) == NULL) {
error_f("calloc failed");
return NULL;
}
i... | vuln | Safe | C/C++ |
static int l2tp_ip6_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len)
{
struct inet_sock *inet = inet_sk(sk);
struct ipv6_pinfo *np = inet6_sk(sk);
struct sockaddr_l2tpip6 *addr = (struct sockaddr_l2tpip6 *) uaddr;
struct net *net = sock_net(sk);
__be32 v4addr = 0;
int addr_type;
int err;
if (add... | vuln | Safe | C/C++ |
static uint64_t virtio_pci_common_read(void *opaque, hwaddr addr,
unsigned size)
{
VirtIOPCIProxy *proxy = opaque;
VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus);
uint32_t val = 0;
int i;
switch (addr) {
case VIRTIO_PCI_COMMON_DFSELECT:
val... | vuln | Vulnerable | C/C++ |
@Override
protected void init(Context context) {
// Workaround for b/120550382, an external app can cause the launcher process to start for
// a work profile user which we do not support. Disable the application immediately when we
// detect this to be the case.
UserManager um = (Use... | vuln | Vulnerable | Java |
static bool ldm_frag_add (const u8 *data, int size, struct list_head *frags)
{
struct frag *f;
struct list_head *item;
int rec, num, group;
BUG_ON (!data || !frags);
if (size < 2 * VBLK_SIZE_HEAD) {
ldm_error("Value of size is to small.");
return false;
}
group = get_unaligned_be32(data + 0x08);
rec = ... | vuln | Vulnerable | C/C++ |
static void virtqueue_map_desc(unsigned int *p_num_sg, hwaddr *addr, struct iovec *iov,
unsigned int max_num_sg, bool is_write,
hwaddr pa, size_t sz)
{
unsigned num_sg = *p_num_sg;
assert(num_sg <= max_num_sg);
if (!sz) {
error_report("vi... | vuln | Vulnerable | C/C++ |
void ASessionDescription::getFormatType(
size_t index, unsigned long *PT,
AString *desc, AString *params) const {
AString format;
getFormat(index, &format);
const char *lastSpacePos = strrchr(format.c_str(), ' ');
CHECK(lastSpacePos != NULL);
char *end;
unsigned long x = strtoul(lastSpacePos + 1, &end, ... | vuln | Safe | C/C++ |
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/ory/fosite/handler/oauth2 (interfaces: AccessTokenStorage)
// Package internal is a generated GoMock package.
package internal
import (
context "context"
reflect "reflect"
gomock "github.com/golang/mock/gomock"
fosite "github.com/ory/fosite"
)
//... | vuln | Safe | Go |
async def issue_command(params: models.IssueCommand):
issuer = guild.get_member(params.issue_as)
if issuer is None:
raise ExecutionError(f"User {params.issue_as} is not in the server.")
msg_obj = df_cache.get_msg_obj()
if msg_obj is None:
r... | vuln | Safe | Python |
public void setShouldShowNotification(boolean val) {
mService.setShouldShowNotification(val);
} | vuln | Vulnerable | Java |
z.y,t.width/L,t.height/L,"fillColor=none;strokeColor=red;")}));c.actions.addAction("testCheckFile",mxUtils.bind(this,function(){var t=null!=c.pages&&null!=c.getCurrentFile()?c.getCurrentFile().getAnonymizedXmlForPages(c.pages):"";t=new TextareaDialog(c,"Paste Data:",t,function(z){if(0<z.length)try{var L=function(J){fun... | vuln | Safe | JavaScript |
/*******************************************************************************
* This file is part of OpenNMS(R).
*
* Copyright (C) 2002-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 |
@Override
public AuthenticationContext authenticate(RequestContext requestContext) throws APISecurityException {
if (requestContext.getMatchedAPI() == null) {
log.debug("API Key Authentication failed");
throw new APISecurityException(APIConstants.StatusCodes.UNAUTHENTICATED.getCode()... | vuln | Safe | Java |
int fcntl_dirnotify(int fd, struct file *filp, unsigned long arg)
{
struct dnotify_struct *dn;
struct dnotify_struct *odn;
struct dnotify_struct **prev;
struct inode *inode;
fl_owner_t id = current->files;
int error = 0;
if ((arg & ~DN_MULTISHOT) == 0) {
dnotify_flush(filp, id);
return 0;
}
if (!dir_notif... | vuln | Vulnerable | Unknown |
void svhandler_flash_erase_sector(void) {
uint32_t sector = _param_1;
// Do not allow firmware to erase bootstrap or bootloader sectors.
if ((sector == FLASH_BOOTSTRAP_SECTOR) ||
(sector >= FLASH_BOOT_SECTOR_FIRST && sector <= FLASH_BOOT_SECTOR_LAST)) {
return;
}
// Unlock flash.
flash_clear_sta... | vuln | Vulnerable | Unknown |
long ContentEncoding::ParseEncryptionEntry(long long start, long long size,
IMkvReader* pReader,
ContentEncryption* encryption) {
assert(pReader);
assert(encryption);
long long pos = start;
const long long stop = start + size;
while (pos < stop) {
long long id, size;
const long status = ParseElementHeader(... | vuln | Safe | C/C++ |
static int er_supported(ERContext *s)
{
if(s->avctx->hwaccel && s->avctx->hwaccel->decode_slice ||
!s->cur_pic.f ||
s->cur_pic.field_picture
)
return 0;
return 1;
} | vuln | Safe | C/C++ |
xsltAddKey(xsltStylesheetPtr style, const xmlChar *name,
const xmlChar *nameURI, const xmlChar *match,
const xmlChar *use, xmlNodePtr inst) {
xsltKeyDefPtr key;
xmlChar *pattern = NULL;
int current, end, start, i = 0;
if ((style == NULL) || (name == NULL) || (match == NULL) || (use == NULL))
r... | vuln | Vulnerable | Unknown |
int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
const ASN1_ITEM *it,
int tag, int aclass, char opt, ASN1_TLC *ctx)
{
int rv;
rv = asn1_item_embed_d2i(pval, in, len, it, tag, aclass, opt, ctx, 0);
if (rv <= 0)
ASN1_item_ex_free(pva... | vuln | Safe | Unknown |
@Override
public void removeOnAssociationsChangedListener(IOnAssociationsChangedListener listener,
int userId) {
enforceCallerCanInteractWithUserId(getContext(), userId);
enforceCallerCanManageCompanionDevice(
getContext(), "removeOnAssociationsChanged... | vuln | Vulnerable | Java |
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/ory/fosite (interfaces: TokenEndpointHandler)
// Package internal is a generated GoMock package.
package internal
import (
context "context"
reflect "reflect"
gomock "github.com/golang/mock/gomock"
fosite "github.com/ory/fosite"
)
// MockTokenEnd... | vuln | Vulnerable | Go |
def apply(operations)
operations.inject(self) do |builder, (name, argument)|
if argument == true || argument == nil
builder.send(name)
elsif argument.is_a?(Array)
builder.send(name, *argument)
elsif argument.is_a?(Hash)
builder.send(name, **argument)
e... | vuln | Vulnerable | Ruby |
/*
* 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 | Safe | Java |
async def get_file(
self,
url: str,
output_stream: BinaryIO,
max_size: Optional[int] = None,
headers: Optional[RawHeaders] = None,
is_allowed_content_type: Optional[Callable[[bytes], bool]] = None,
) -> Tuple[int, Dict[bytes, List[bytes]], str, int]:
"""GETs a... | vuln | Safe | Python |
static void qmp_input_type_str(Visitor *v, char **obj, const char *name,
Error **errp)
{
QmpInputVisitor *qiv = to_qiv(v);
QObject *qobj = qmp_input_get_object(qiv, name, true);
if (!qobj || qobject_type(qobj) != QTYPE_QSTRING) {
error_setg(errp, QERR_INVALID_PARAMETER... | vuln | Vulnerable | C/C++ |
function readDocType(xmlData, i){
const entities = {};
if( xmlData[i + 3] === 'O' &&
xmlData[i + 4] === 'C' &&
xmlData[i + 5] === 'T' &&
xmlData[i + 6] === 'Y' &&
xmlData[i + 7] === 'P' &&
xmlData[i + 8] === 'E')
{
i = i+9;
let angleBrack... | vuln | Safe | JavaScript |
void scramble(FILE* keyFile){
for (int j = 0; j < 16; ++j)
{
char temp = 0;
for (int i = 0; i < 256; ++i)
{
scrambleAsciiTables[j][i] = i;
}
if (keyFile != NULL){
int size;
char extractedString[BUFFER_SIZE] = "";
while((size = fread(extractedString, 1, BUFFER_SIZE, keyFile)) > 0){
for (int... | vuln | Vulnerable | C/C++ |
static void wsdl_soap_binding_body(sdlCtx* ctx, xmlNodePtr node, char* wsdl_soap_namespace, sdlSoapBindingFunctionBody *binding, HashTable* params)
{
xmlNodePtr body, trav;
xmlAttrPtr tmp;
trav = node->children;
while (trav != NULL) {
if (node_is_equal_ex(trav, "body", wsdl_soap_namespace)) {
body = trav;
... | vuln | Safe | Unknown |
@Override
public boolean init() {
if (!super.init()) {
return false;
}
try {
setSerializer(TransformerFactory.newInstance().newTransformer());
setDomImplentation(
XmlParserFactoryProducer.createSecureDocBuilderFactory()
.newDocumentBuilder()
.getDO... | vuln | Vulnerable | Java |
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible 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 3 of the License, or
# (at your option) any lat... | vuln | Safe | Python |
public static void startPushService() {
SharedPreferences preferences = MessagesController.getGlobalNotificationsSettings();
boolean enabled;
if (preferences.contains("pushService")) {
enabled = preferences.getBoolean("pushService", true);
} else {
enabled = Messa... | vuln | Safe | Java |
static int zerocodec_decode_frame(AVCodecContext *avctx, void *data,
int *data_size, AVPacket *avpkt)
{
ZeroCodecContext *zc = avctx->priv_data;
AVFrame *pic = avctx->coded_frame;
AVFrame *prev_pic = &zc->previous_frame;
z_stream *zstream = &zc->zstream;
... | vuln | Vulnerable | C/C++ |
static void tun_net_init(struct net_device *dev)
{
struct tun_struct *tun = netdev_priv(dev);
switch (tun->flags & TUN_TYPE_MASK) {
case TUN_TUN_DEV:
dev->netdev_ops = &tun_netdev_ops;
/* Point-to-Point TUN Device */
dev->hard_header_len = 0;
dev->addr_len = 0;
dev->mtu = 1500;
/* Zero header length *... | vuln | Vulnerable | C/C++ |
private static void checkAndExtractEntry(InputStream zipStream, ZipEntry zipEntry, Path targetFolder) throws IOException {
if (!Files.exists(targetFolder)) {
try {
Files.createDirectories(targetFolder);
} catch (IOException e) {
throw new IOException("Can'... | vuln | Vulnerable | Java |
void scheduleEnroll(int sensorId, @NonNull IBinder token, @NonNull byte[] hardwareAuthToken,
int userId, @NonNull IFingerprintServiceReceiver receiver,
@NonNull String opPackageName, @FingerprintManager.EnrollReason int enrollReason,
@NonNull FingerprintStateCallback fingerprintState... | vuln | Safe | Java |
// Don't wait for the whole page to be loaded.
// (include script at the bottom of the page.)
var Pagination = new function() {
this.init = function(processHash, document_containers, setHash) {
// For each pagination node
var containers = new Array();
// Create new containers Array after each i... | vuln | Safe | JavaScript |
static int flac_probe(AVProbeData *p)
{
if (p->buf_size < 4 || memcmp(p->buf, "fLaC", 4))
return 0;
return AVPROBE_SCORE_MAX/2;
} | vuln | Safe | C/C++ |
public MutablePartPose getLocatorPose(String locatorIdentifier){
return this.pose.get(locatorIdentifier);
} | vuln | Vulnerable | Java |
mrb_vm_exec(mrb_state *mrb, struct RProc *proc, mrb_code *pc)
{
/* mrb_assert(mrb_proc_cfunc_p(proc)) */
mrb_irep *irep = proc->body.irep;
mrb_value *pool = irep->pool;
mrb_sym *syms = irep->syms;
mrb_code i;
int ai = mrb_gc_arena_save(mrb);
struct mrb_jmpbuf *prev_jmp = mrb->jmp;
struct mrb_jmpbuf c_jm... | vuln | Safe | C/C++ |
local block_state deflate_rle(s, flush)
deflate_state *s;
int flush;
{
int bflush; /* set if current block must be flushed */
uInt prev; /* byte at distance one to match */
Bytef *scan, *strend; /* scan goes up to strend for length of run */
for (;;) {
/* Make... | vuln | Vulnerable | Unknown |
Jpeg2000TgtNode *ff_j2k_tag_tree_init(int w, int h)
{
int pw = w, ph = h;
Jpeg2000TgtNode *res, *t, *t2;
int32_t tt_size;
tt_size = tag_tree_size(w, h);
t = res = av_mallocz_array(tt_size, sizeof(*t));
if (!res)
return NULL;
while (w > 1 || h > 1) {
int i, j;
pw = w;
... | vuln | Safe | C/C++ |
# -*- coding: utf-8 -*-
""" This module provides the backend Flask server used by psiTurk. """
from __future__ import generator_stop
import os
import sys
import datetime
import logging
from random import choice
import user_agents
import requests
import re
import json
from jinja2 import TemplateNotFound
from collections... | vuln | Safe | Python |
pkcs11dh_parse(dst_key_t *key, isc_lex_t *lexer, dst_key_t *pub) {
dst_private_t priv;
isc_result_t ret;
int i;
pk11_object_t *dh = NULL;
CK_ATTRIBUTE *attr;
isc_mem_t *mctx;
UNUSED(pub);
mctx = key->mctx;
/* read private key file */
ret = dst__privstruct_parse(key, DST_ALG_DH, lexer, mctx, &priv);
if (ret... | vuln | Vulnerable | Unknown |
static void do_video_out(AVFormatContext *s,
OutputStream *ost,
AVFrame *next_picture,
double sync_ipts)
{
int ret, format_video_sync;
AVPacket pkt;
AVCodecContext *enc = ost->enc_ctx;
AVCodecContext *mux_enc = ost->st->codec;
... | vuln | Vulnerable | C/C++ |
processLastResort(struct module_qstate* qstate, struct iter_qstate* iq,
struct iter_env* ie, int id)
{
struct delegpt_ns* ns;
int query_count = 0;
verbose(VERB_ALGO, "No more query targets, attempting last resort");
log_assert(iq->dp);
if(!can_have_last_resort(qstate->env, iq->dp->name, iq->dp->namelen,
iq->qc... | vuln | Vulnerable | Unknown |
void qmp_block_set_io_throttle(const char *device, int64_t bps, int64_t bps_rd,
int64_t bps_wr,
int64_t iops,
int64_t iops_rd,
int64_t iops_wr,
bool has_bps_max,
... | vuln | Safe | C/C++ |
int bnep_add_connection(struct bnep_connadd_req *req, struct socket *sock)
{
struct net_device *dev;
struct bnep_session *s, *ss;
u8 dst[ETH_ALEN], src[ETH_ALEN];
int err;
BT_DBG("");
baswap((void *) dst, &l2cap_pi(sock->sk)->chan->dst);
baswap((void *) src, &l2cap_pi(sock->sk)->chan->src);
/* session ... | vuln | Vulnerable | C/C++ |
package session
import (
"context"
"encoding/json"
"errors"
"fmt"
"math"
"math/rand"
"net"
"net/http"
"os"
"time"
oidc "github.com/coreos/go-oidc"
"github.com/dgrijalva/jwt-go/v4"
log "github.com/sirupsen/logrus"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"github.com/argoproj/argo... | vuln | Vulnerable | Go |
@Override
public char charAt(final int index) {
// Temporarily disabled due to a rare condition upstream when we take this message
// and run it in a runnable, then this is still being evaluated past limit and it fails
//
//if (System.currentTimeMillis() > futureTimestampLimit)
// throw new RegexTimeoutExce... | vuln | Vulnerable | Java |
Status GetFirstDimensionSize(OpKernelContext* context, INDEX_TYPE* result) {
const Tensor first_partition_tensor =
context->input(kFirstPartitionInputIndex);
const RowPartitionType first_partition_type = row_partition_types_[0];
switch (first_partition_type) {
case RowPartitionType::FIRST_DIM_... | vuln | Vulnerable | C/C++ |
void pl181_init(uint32_t base, BlockDriverState *bd,
qemu_irq irq0, qemu_irq irq1)
{
int iomemtype;
pl181_state *s;
s = (pl181_state *)qemu_mallocz(sizeof(pl181_state));
iomemtype = cpu_register_io_memory(0, pl181_readfn,
pl181_writefn, s);
cpu_... | vuln | Safe | C/C++ |
R_API int r_io_bank_read_from_submap_at(RIO *io, const ut32 bankid, ut64 addr, ut8 *buf, int len) {
r_return_val_if_fail (io, -1);
RIOBank *bank = r_io_bank_get (io, bankid);
if (!bank) {
return 0;
}
if (!len) {
return 0;
}
RRBNode *node;
if (bank->last_used && r_io_submap_contain (((RIOSubMap *)bank->last_... | vuln | Vulnerable | C/C++ |
static int read_naa_id(const uint8_t *p, uint64_t *p_wwn)
{
int i;
if ((p[1] & 0xF) == 3) {
if (p[3] != 8) {
return -EINVAL;
}
*p_wwn = ldq_be_p(p + 4);
return 0;
}
if ((p[1] & 0xF) == 8) {
if (p[3] < 20 || memcmp(&p[4], "naa.", 4)) {... | vuln | Vulnerable | C/C++ |
/*
Copyright (C) 2002-2010 Karl J. Runge <runge@karlrunge.com>
All rights reserved.
This file is part of x11vnc.
x11vnc 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 2 of the License, or ... | vuln | Vulnerable | C/C++ |
public static void consume(UpdateRitualPacket packet, Supplier<NetworkEvent.Context> ctx) {
ctx.get().enqueueWork(() -> {
assert ctx.get().getDirection() == NetworkDirection.PLAY_TO_CLIENT;
World world = Minecraft.getInstance().world;
if (world == null || !(world.getTileEnt... | vuln | Vulnerable | Java |
static void cmd_parse_status(struct ImapData *idata, char *s)
{
char *value = NULL;
struct Buffy *inc = NULL;
struct ImapMbox mx;
struct ImapStatus *status = NULL;
unsigned int olduv, oldun;
unsigned int litlen;
short new = 0;
short new_msg_count = 0;
char *mailbox = imap_next_word(s);
/* We need ... | vuln | Vulnerable | C/C++ |
int Reverb_command(effect_handle_t self,
uint32_t cmdCode,
uint32_t cmdSize,
void *pCmdData,
uint32_t *replySize,
void *pReplyData){
android::ReverbContext * pContext = (android::ReverbContext *) self;
int retsize;
LVREV_ControlParams_st ActiveParams; /* Current control Parameter... | vuln | Vulnerable | C/C++ |
/**
* Copyright (c) 2006-2017, JGraph Ltd
* Copyright (c) 2006-2017, Gaudenz Alder
*/
//Add a closure to hide the class private variables without changing the code a lot
(function ()
{
var _token = null;
window.GitHubClient = function(editorUi, authName)
{
DrawioClient.call(this, editorUi, authName || 'ghauth');
... | vuln | Safe | JavaScript |
proxy_list_slots (Proxy *py, Mapping *mappings, unsigned int n_mappings)
{
CK_FUNCTION_LIST_PTR *f;
CK_FUNCTION_LIST_PTR funcs;
CK_SLOT_ID_PTR slots;
CK_ULONG i, count;
unsigned int j;
CK_RV rv = CKR_OK;
for (f = py->inited; *f; ++f) {
funcs = *f;
assert (funcs != NULL);
slots = NULL;
/* Ask module for... | vuln | Safe | Unknown |
/**
* Copyright (c) 2006-2012, JGraph Ltd
*/
/**
* Constructs a new graph editor
*/
EditorUi = function(editor, container, lightbox)
{
mxEventSource.call(this);
this.destroyFunctions = [];
this.editor = editor || new Editor();
this.container = container || document.body;
var graph = this.editor.graph;
gra... | vuln | Safe | Java |
pixReadFromTiffStream(TIFF *tif)
{
char *text;
l_uint8 *linebuf, *data, *rowptr;
l_uint16 spp, bps, photometry, tiffcomp, orientation, sample_fmt;
l_uint16 *redmap, *greenmap, *bluemap;
l_int32 d, wpl, bpl, comptype, i, j, k, ncolors, rval, gval, bval, aval;
l_int32 xres, yres, tiffbpl, packedbpl, half... | vuln | Vulnerable | C/C++ |
from decimal import Decimal
from typing import Dict, List, Optional, Tuple, Union
from ..account import events as account_events
from ..account.models import User
from ..order.models import Fulfillment, FulfillmentLine, Order, OrderLine
from ..payment.models import Payment
from . import OrderEvents, OrderEventsEmails
... | vuln | Vulnerable | Python |
uint64_t HELPER(get_cp_reg64)(CPUARMState *env, void *rip)
{
const ARMCPRegInfo *ri = rip;
return ri->readfn(env, ri);
} | vuln | Vulnerable | C/C++ |
@SuppressLint("MissingPermission")
private synchronized void nextRequest(final boolean force) {
if (force && operationInProgress) {
operationInProgress = awaitingRequest != null;
}
if (operationInProgress || initInProgress) {
return;
}
final BluetoothDevice bluetoothDevice = this.bluetoothDevice;
/... | vuln | Vulnerable | Java |
int ip_check_mc_rcu(struct in_device *in_dev, __be32 mc_addr, __be32 src_addr, u8 proto)
{
struct ip_mc_list *im;
struct ip_mc_list __rcu **mc_hash;
struct ip_sf_list *psf;
int rv = 0;
mc_hash = rcu_dereference(in_dev->mc_hash);
if (mc_hash) {
u32 hash = hash_32((__force u32)mc_addr, MC_HASH_SZ_LOG);
for (i... | vuln | Safe | C/C++ |
static int mov_create_chapter_track(AVFormatContext *s, int tracknum)
{
MOVMuxContext *mov = s->priv_data;
MOVTrack *track = &mov->tracks[tracknum];
AVPacket pkt = { .stream_index = tracknum, .flags = AV_PKT_FLAG_KEY };
int i, len;
uint8_t chapter_properties[43] = { 0, 0, 0, 0, 0, 0, 0, 1, };
... | vuln | Vulnerable | C/C++ |
unsigned char *ssl_add_serverhello_tlsext(SSL *s, unsigned char *buf, unsigned char *limit)
{
int extdatalen=0;
unsigned char *orig = buf;
unsigned char *ret = buf;
#ifndef OPENSSL_NO_NEXTPROTONEG
int next_proto_neg_seen;
#endif
/* don't add extensions for SSLv3, unless doing secure renegotiation */
if (s->vers... | vuln | Vulnerable | Unknown |
PHP_METHOD(Phar, addFile)
{
char *fname, *localname = NULL;
size_t fname_len, localname_len = 0;
php_stream *resource;
zval zresource;
PHAR_ARCHIVE_OBJECT();
if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|s", &fname, &fname_len, &localname, &localname_len) == FAILURE) {
return;
}
#if PHP_API_VERSION < 201004... | vuln | Safe | Unknown |
jbig2_sd_list_referred(Jbig2Ctx *ctx, Jbig2Segment *segment)
{
int index;
Jbig2Segment *rsegment;
Jbig2SymbolDict **dicts;
int n_dicts = jbig2_sd_count_referred(ctx, segment);
int dindex = 0;
dicts = jbig2_new(ctx, Jbig2SymbolDict *, n_dicts);
if (dicts == NULL) {
jbig2_error(... | vuln | Vulnerable | C/C++ |
public static Mercury createMercuryWithClassPath(Project project, boolean toNamed) {
Mercury m = new Mercury();
m.setGracefulClasspathChecks(true);
m.setSourceCompatibility(Constants.MERCURY_SOURCE_VERSION);
for (File file : project.getConfigurations().getByName(Constants.Configurations.LOADER_DEPENDENCIES).ge... | vuln | Vulnerable | Java |
/*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This 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
* th... | vuln | Safe | Java |
static void find_motion(DeshakeContext *deshake, uint8_t *src1, uint8_t *src2,
int width, int height, int stride, Transform *t)
{
int x, y;
IntMotionVector mv = {0, 0};
int counts[128][128];
int count_max_value = 0;
int contrast;
int pos;
double *angles = av_malloc(si... | vuln | Safe | C/C++ |
/*
* JBoss, Home of Professional Open Source.
* Copyright 2017 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* 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 Licen... | vuln | Vulnerable | Java |
static unsigned int
hash_link_ref(const uint8_t *link_ref, size_t length)
{
size_t i;
unsigned int hash = 0;
for (i = 0; i < length; ++i)
hash = tolower(link_ref[i]) + (hash << 6) + (hash << 16) - hash;
return hash;
} | vuln | Vulnerable | C/C++ |
public synchronized void configureRequestHeaders(HttpServletRequest originalRequest, HttpRequestBase proxyRequest,
boolean localProxy, String targetServiceName) {
final StringBuilder headersLog = logger.isTraceEnabled()
? new StringBuilder("Request Headers:\n========================... | vuln | Safe | Java |
function preprocessRFC2822(s) {
// Remove comments and folding whitespace and replace multiple-spaces with a single space
return s
.replace(/\([^()]*\)|[\n\t]/g, " ")
.replace(/(\s\s+)/g, " ")
.trim();
} | vuln | Safe | JavaScript |
static inline bool isValid(const RemoteFsDevice::Details &d)
{
return d.isLocalFile() || RemoteFsDevice::constSshfsProtocol==d.url.scheme() ||
RemoteFsDevice::constSambaProtocol==d.url.scheme() || RemoteFsDevice::constSambaAvahiProtocol==d.url.scheme();
} | vuln | Vulnerable | Unknown |
kadm5_modify_principal(void *server_handle,
kadm5_principal_ent_t entry, long mask)
{
int ret, ret2, i;
kadm5_policy_ent_rec pol;
krb5_boolean have_pol = FALSE;
krb5_db_entry *kdb;
krb5_tl_data *tl_data_orig;
osa_princ... | vuln | Vulnerable | C/C++ |
/* +------------------------------------+
* | Inspire Internet Relay Chat Daemon |
* +------------------------------------+
*
* InspIRCd: (C) 2002-2010 InspIRCd Development Team
* See: http://wiki.inspircd.org/Credits
*
* This program is free but copyrighted software; see
* the fil... | vuln | Vulnerable | C/C++ |
@Override
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
if (request == null || request.getUrl() == null) {
return true;
}
Uri url = request.getUrl();
if (url.getScheme() != null && url.... | vuln | Safe | Java |
/*
* (Tentative) USB Audio Driver for ALSA
*
* Mixer control part
*
* Copyright (c) 2002 by Takashi Iwai <tiwai@suse.de>
*
* Many codes borrowed from audio.c by
* Alan Cox (alan@lxorguk.ukuu.org.uk)
* Thomas Sailer (sailer@ife.ee.ethz.ch)
*
*
* This program is free software; you can redist... | vuln | Safe | C/C++ |
import namedavatar from 'namedavatar'
import { i18nReady, t } from './i18n.js'
import { Globalsettings } from '../api/globalsettings/globalsettings.js'
const clientTimecards = new Mongo.Collection('clientTimecards')
function getGlobalSetting(name) {
return Globalsettings.findOne({ name }) ? Globalsettings.findOne({... | vuln | Vulnerable | JavaScript |
from Products.CMFCore.URLTool import URLTool as BaseTool
from Products.CMFCore.utils import getToolByName
from AccessControl import ClassSecurityInfo
from App.class_init import InitializeClass
from Products.CMFPlone.PloneBaseTool import PloneBaseTool
from posixpath import normpath
from urlparse import urlparse, urljoi... | vuln | Vulnerable | Python |
static inline int xsave_state_booting(struct xsave_struct *fx, u64 mask)
{
u32 lmask = mask;
u32 hmask = mask >> 32;
int err = 0;
WARN_ON(system_state != SYSTEM_BOOTING);
if (boot_cpu_has(X86_FEATURE_XSAVES))
asm volatile("1:"XSAVES"\n\t"
"2:\n\t"
xstate_fault
: "D" (fx), "m" (*fx), "a" (lmask), ... | vuln | Safe | Unknown |
/* xfrm_user.c: User interface to configure xfrm engine.
*
* Copyright (C) 2002 David S. Miller (davem@redhat.com)
*
* Changes:
* Mitsuru KANDA @USAGI
* Kazunori MIYAZAWA @USAGI
* Kunihiro Ishiguro <kunihiro@ipinfusion.com>
* IPv6 support
*
*/
#include <linux/crypto.h>
#include <linux/module.h>
#include ... | vuln | Safe | C/C++ |
void ChromotingHost::PauseSession(bool pause) {
if (!context_->network_message_loop()->BelongsToCurrentThread()) {
context_->network_message_loop()->PostTask(
FROM_HERE, base::Bind(&ChromotingHost::PauseSession, this, pause));
return;
}
ClientList::iterator client;
for (client = clients_.b... | vuln | Safe | C/C++ |
static int query_formats(AVFilterGraph *graph, AVClass *log_ctx)
{
int i, j, ret;
int scaler_count = 0, resampler_count = 0;
int count_queried = 0;
int count_merged = 0;
int count_already_merged = 0;
int count_delayed = 0;
for (i = 0; i < graph->nb_filters; i++) {
... | vuln | Vulnerable | C/C++ |
/**********************************************************************
* gost_ec_keyx.c *
* *
* Copyright (c) 2005-2013 Cryptocom LTD *
* Copyright (c) 2018,2020 Dmi... | vuln | Vulnerable | C/C++ |
#!/usr/bin/env python2
# vim:fileencoding=utf-8
# License: GPLv3 Copyright: 2015, Kovid Goyal <kovid at kovidgoyal.net>
from __future__ import absolute_import, division, print_function, unicode_literals
import cPickle
import hashlib
import random
import shutil
import sys
import zipfile
from json import load as load_j... | vuln | Safe | Python |
def cli_node_list() -> None:
"""Lists all nodes in the default configuration directories."""
# FIXME: use package 'table' for this.
click.echo("\nName"+(21*" ")+"System/User")
click.echo("-" * 70)
configs, f1 = NodeContext.available_configurations(system_folders=True)
for config in configs:
... | vuln | Safe | Python |
static int rc4_hmac_md5_set_ctx_params(void *vctx, const OSSL_PARAM params[])
{
PROV_RC4_HMAC_MD5_CTX *ctx = (PROV_RC4_HMAC_MD5_CTX *)vctx;
const OSSL_PARAM *p;
size_t sz;
if (params == NULL)
return 1;
p = OSSL_PARAM_locate_const(params, OSSL_CIPHER_PARAM_KEYLEN);
if (p != NULL) {
... | vuln | Vulnerable | Unknown |
private Void saveOntologyInternal() throws OWLOntologyStorageException {
for (OntologySaveDescriptor descriptor : saveDescriptors) {
try {
OWLOntology ontology = descriptor.getOntology();
OntologyIRIShortFormProvider sfp = new OntologyIRIShortFormProvider();
... | vuln | Safe | Java |
import configparser
from flask import Flask, render_template, session, request, flash, redirect, url_for, Response, abort, jsonify, send_file
import socket
import os
import random
import copy
from flask_sqlalchemy import SQLAlchemy, Model
import gspread
from oauth2client.service_account import ServiceAccountCredential... | vuln | Vulnerable | Python |
static void get_nb10(ut8* dbg_data, SCV_NB10_HEADER* res) {
const int nb10sz = 16;
memcpy (res, dbg_data, nb10sz);
res->file_name = (ut8*) strdup ((const char*) dbg_data + nb10sz);
} | vuln | Vulnerable | Unknown |
public Tier getTier() {
if (this.tier == null) {
// fetch by name, fallback to the first tier
if (this.harvestTier != null) {
this.tier = TierSortingRegistry.byName(harvestTier);
}
if (this.tier == null) {
TConstruct.LOG.error("Failed to find tool tier by name " + harvestTier... | vuln | Safe | Java |
@POST
@Path(OBJECT_PARAM)
@Consumes(MediaType.WILDCARD)
public Response initiateMultipartUpload(
@HeaderParam("Authorization") final String authorization,
@HeaderParam(S3Constants.S3_CONTENT_TYPE_HEADER) final String contentType,
@PathParam("bucket") final String bucket,
@PathParam("object... | vuln | Safe | Java |
ofputil_pull_ofp11_buckets(struct ofpbuf *msg, size_t buckets_length,
enum ofp_version version, struct ovs_list *buckets)
{
struct ofp11_bucket *ob;
uint32_t bucket_id = 0;
ovs_list_init(buckets);
while (buckets_length > 0) {
struct ofputil_bucket *bucket;
str... | vuln | Safe | Unknown |
def verify(self, data):
credentials = self._formatCredentials(data, name='current')
command = [
'rclone',
'lsjson',
'current:',
]
try:
result = self._execute(command, credentials)
return {
'result': True,
... | vuln | Safe | Python |
void do_ddiv (void)
{
if (T1 != 0) {
int64_t arg0 = (int64_t)T0;
int64_t arg1 = (int64_t)T1;
if (arg0 == ((int64_t)-1 << 63) && arg1 == (int64_t)-1) {
env->LO[0][env->current_tc] = arg0;
env->HI[0][env->current_tc] = 0;
} else {
lldiv_t res = lldiv... | vuln | Safe | C/C++ |
function shibboleth_login_form() {
$login_url = add_query_arg('action', 'shibboleth');
$login_url = remove_query_arg('reauth', $login_url);
echo '<p id="shibboleth_login"><a href="' . $login_url . '">' . __('Login with Shibboleth', 'shibboleth') . '</a></p>';
} | vuln | Vulnerable | PHP |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.