code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
void brcmf_rx_frame(struct device *dev, struct sk_buff *skb, bool handle_event)
{
struct brcmf_if *ifp;
struct brcmf_bus *bus_if = dev_get_drvdata(dev);
struct brcmf_pub *drvr = bus_if->drvr;
brcmf_dbg(DATA, "Enter: %s: rxp=%p\n", dev_name(dev), skb);
if (brcmf_rx_hdrpull(drvr, skb, &ifp))
return;
if (brcmf_... | vuln | Safe | Unknown |
public void sendPacket(World world, RayTraceResult rayTraceResult, @Nullable LivingEntity shooter, SpellContext spellContext, SpellStats spellStats,BlockRayTraceResult blockResult, Entity hitEntity){
spellContext.setCanceled(true);
if(spellContext.getCurrentIndex() >= spellContext.getSpell().recipe.size... | vuln | Vulnerable | Java |
// +build tools
package fosite
import (
_ "github.com/gorilla/websocket"
_ "github.com/mattn/goveralls"
_ "github.com/ory/go-acc"
)
| vuln | Vulnerable | Go |
static libspdm_return_t libspdm_handle_response_not_ready(libspdm_context_t *spdm_context,
const uint32_t *session_id,
size_t *response_size,
void... | vuln | Safe | C/C++ |
@MainThread
void start(@Nonnull Fragment fragment, @Nullable UICallback callback) {
if (!minecraft.isSameThread()) {
throw new IllegalStateException("Not called from main thread");
}
minecraft.setScreen(new SimpleScreen(this, fragment, callback));
} | vuln | Safe | Java |
int net_init_tap(const NetClientOptions *opts, const char *name,
NetClientState *peer)
{
const NetdevTapOptions *tap;
int fd, vnet_hdr = 0, i = 0, queues;
const char *script = NULL;
const char *downscript = NULL;
const char *vhostfdname;
char ifname[128];
assert(opts->... | vuln | Vulnerable | C/C++ |
struct udev_device *udev_monitor_receive_device(struct udev_monitor *udev_monitor)
{
struct udev_device *udev_device;
struct msghdr smsg;
struct iovec iov;
char cred_msg[CMSG_SPACE(sizeof(struct ucred))];
struct cmsghdr *cmsg;
struct ucred *cred;
char buf[4096];
size_t bufpos;
int devpath_set = 0;
int subsyst... | vuln | Vulnerable | Unknown |
from __future__ import absolute_import
import cgi
import email.utils
import json
import logging
import mimetypes
import os
import platform
import re
import shutil
import sys
from pip._vendor import requests, urllib3
from pip._vendor.cachecontrol import CacheControlAdapter
from pip._vendor.cachecontrol.caches import F... | vuln | Safe | Python |
static const struct usb_cdc_union_desc *
ims_pcu_get_cdc_union_desc(struct usb_interface *intf)
{
const void *buf = intf->altsetting->extra;
size_t buflen = intf->altsetting->extralen;
struct usb_cdc_union_desc *union_desc;
if (!buf) {
dev_err(&intf->dev, "Missing descriptor data\n");
return NULL;
}
if (!bu... | vuln | Vulnerable | Unknown |
rsvg_new_filter_primitive_specular_lighting (void)
{
RsvgFilterPrimitiveSpecularLighting *filter;
filter = g_new (RsvgFilterPrimitiveSpecularLighting, 1);
_rsvg_node_init (&filter->super.super);
filter->super.in = g_string_new ("none");
filter->super.result = g_string_new ("none");
filter->super... | vuln | Vulnerable | Unknown |
static int decode_rle(AVCodecContext *avctx, AVFrame *p, GetByteContext *gbc,
int step)
{
int i, j;
int offset = avctx->width * step;
uint8_t *outdata = p->data[0];
for (i = 0; i < avctx->height; i++) {
int size, left, code, pix;
uint8_t *out = outdata;
int ... | vuln | Vulnerable | C/C++ |
int
scandir(const char *dir, struct dirent ***namelist,
int (*select) (const struct dirent *),
int (*compar) (const struct dirent **, const struct dirent **))
{
DIR *d = opendir(dir);
struct dirent *current;
struct dirent **names;
int count = 0;
int pos = 0;
int result = -1;
... | vuln | Safe | C/C++ |
PackLinuxElf64::check_pt_dynamic(Elf64_Phdr const *const phdr)
{
upx_uint64_t t = get_te64(&phdr->p_offset), s = sizeof(Elf64_Dyn) + t;
upx_uint64_t filesz = get_te64(&phdr->p_filesz), memsz = get_te64(&phdr->p_memsz);
if (s < t || (upx_uint64_t)file_size < s
|| (7 & t) || (0xf & (filesz | memsz)) // ... | vuln | Vulnerable | Unknown |
/* 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 | Safe | Python |
static void coroutine_fn v9fs_lcreate(void *opaque)
{
int32_t dfid, flags, mode;
gid_t gid;
ssize_t err = 0;
ssize_t offset = 7;
V9fsString name;
V9fsFidState *fidp;
struct stat stbuf;
V9fsQID qid;
int32_t iounit;
V9fsPDU *pdu = opaque;
v9fs_string_init(&name);
err = pdu_... | vuln | Safe | C/C++ |
DeepTiledInputFile::initialize ()
{
if (_data->partNumber == -1)
if (_data->header.type() != DEEPTILE)
throw IEX_NAMESPACE::ArgExc ("Expected a deep tiled file but the file is not deep tiled.");
if(_data->header.version()!=1)
{
THROW(IEX_NAMESPACE::ArgExc, "Version " << _data->heade... | vuln | Vulnerable | Unknown |
dtls1_reassemble_fragment(SSL *s, struct hm_header_st* msg_hdr, int *ok)
{
hm_fragment *frag = NULL;
pitem *item = NULL;
int i = -1, is_complete;
unsigned char seq64be[8];
unsigned long frag_len = msg_hdr->frag_len, max_len;
if ((msg_hdr->frag_off+frag_len) > msg_hdr->msg_len)
goto err;
/* Determine maximum... | vuln | Vulnerable | Unknown |
static void disas_ldst_reg_imm9(DisasContext *s, uint32_t insn,
int opc,
int size,
int rt,
bool is_vector)
{
int rn = extract32(insn, 5, 5);
int imm9 = sextract32(insn, 12, 9);
int... | vuln | Safe | C/C++ |
ipf_extract_frags_from_batch(struct ipf *ipf, struct dp_packet_batch *pb,
ovs_be16 dl_type, uint16_t zone, long long now,
uint32_t hash_basis)
{
const size_t pb_cnt = dp_packet_batch_size(pb);
int pb_idx; /* Index in a packet batch. */
struct dp_pack... | vuln | Safe | C/C++ |
ssize_t nbd_send_request(int csock, struct nbd_request *request)
{
uint8_t buf[4 + 4 + 8 + 8 + 4];
cpu_to_be32w((uint32_t*)buf, NBD_REQUEST_MAGIC);
cpu_to_be32w((uint32_t*)(buf + 4), request->type);
cpu_to_be64w((uint64_t*)(buf + 8), request->handle);
cpu_to_be64w((uint64_t*)(buf + 16), request->fro... | vuln | Safe | C/C++ |
/* nbdkit
* Copyright (C) 2013-2019 Red Hat Inc.
*
* 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 copyright
* notice, this list of conditions and the f... | vuln | Safe | C/C++ |
static int alloc_refcount_block(BlockDriverState *bs,
int64_t cluster_index, void **refcount_block)
{
BDRVQcow2State *s = bs->opaque;
unsigned int refcount_table_index;
int64_t ret;
BLKDBG_EVENT(bs->file, BLKDBG_REFBLOCK_ALLOC);
refcount_table_index = cluster_ind... | vuln | Safe | C/C++ |
/**
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* <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 the
* <a href="http://www.apache... | vuln | Vulnerable | Java |
void __vma_link_rb(struct mm_struct *mm, struct vm_area_struct *vma,
struct rb_node **rb_link, struct rb_node *rb_parent)
{
/* Update tracking information for the gap following the new vma. */
if (vma->vm_next)
vma_gap_update(vma->vm_next);
else
mm->highest_vm_end = vma->vm_end;
/*
* vma->vm_prev wasn't kn... | vuln | Vulnerable | Unknown |
void
mwifiex_set_uap_rates(struct mwifiex_uap_bss_param *bss_cfg,
struct cfg80211_ap_settings *params)
{
struct ieee_types_header *rate_ie;
int var_offset = offsetof(struct ieee80211_mgmt, u.beacon.variable);
const u8 *var_pos = params->beacon.head + var_offset;
int len = params->beacon.head_len - var_offse... | vuln | Vulnerable | C/C++ |
CHAT_DCC_REC *dcc_chat_create(IRC_SERVER_REC *server,
CHAT_DCC_REC *chat,
const char *nick, const char *arg)
{
CHAT_DCC_REC *dcc;
dcc = g_new0(CHAT_DCC_REC, 1);
dcc->orig_type = dcc->type = DCC_CHAT_TYPE;
dcc->mirc_ctcp = settings_get_bool("dcc_mirc_ctcp");
dcc->id = dcc_chat_get_new_id(n... | vuln | Safe | Unknown |
static av_cold int ipvideo_decode_init(AVCodecContext *avctx)
{
IpvideoContext *s = avctx->priv_data;
s->avctx = avctx;
s->is_16bpp = avctx->bits_per_coded_sample == 16;
avctx->pix_fmt = s->is_16bpp ? AV_PIX_FMT_RGB555 : AV_PIX_FMT_PAL8;
ff_hpeldsp_init(&s->hdsp, avctx->flags);
s->last_frame ... | vuln | Vulnerable | C/C++ |
static void do_free_publickey(struct rsa_public_key *key)
{
crypto_bignum_free(&key->e);
crypto_bignum_free(&key->n);
} | vuln | Safe | C/C++ |
int ipc_addid(struct ipc_ids *ids, struct kern_ipc_perm *new, int size)
{
kuid_t euid;
kgid_t egid;
int id;
int next_id = ids->next_id;
if (size > IPCMNI)
size = IPCMNI;
if (ids->in_use >= size)
return -ENOSPC;
idr_preload(GFP_KERNEL);
spin_lock_init(&new->lock);
new->deleted = false;
rcu_read_lock()... | vuln | Safe | C/C++ |
static int decode_ext_header(Wmv2Context *w){
MpegEncContext * const s= &w->s;
GetBitContext gb;
int fps;
int code;
if(s->avctx->extradata_size<4) return -1;
init_get_bits(&gb, s->avctx->extradata, 32);
fps = get_bits(&gb, 5);
s->bit_rate = get_bits(&gb, 11)*1024;
... | vuln | Safe | C/C++ |
@Override
public void
onTabSelected (@NonNull TabLayout.Tab tab) {
final var opened = mPagerAdapter.getOpenedFile (tab.getPosition ());
if (opened != null && opened.file != null && opened.fragment != null) {
mCurrentFragment = opened.fragment;
mCurrentFile = opened.file;
... | vuln | Safe | Java |
int ff_put_wav_header(AVFormatContext *s, AVIOContext *pb,
AVCodecParameters *par, int flags)
{
int bps, blkalign, bytespersec, frame_size;
int hdrsize;
int64_t hdrstart = avio_tell(pb);
int waveformatextensible;
uint8_t temp[256];
uint8_t *riff_extradata = temp;
... | vuln | Vulnerable | C/C++ |
public static void getImports(String name, ArrayList<String> arrayList) {
for (int i = 0; i < cachedCustomComponents.size(); i++) {
HashMap<String, Object> component = cachedCustomComponents.get(i);
if (component != null) {
Object componentVarName = component.get("varName... | vuln | Safe | Java |
static int handle_primary_tcp_pkt(NetFilterState *nf,
Connection *conn,
Packet *pkt)
{
struct tcphdr *tcp_pkt;
tcp_pkt = (struct tcphdr *)pkt->transport_header;
if (trace_event_get_state_backends(TRACE_COLO_FILTER_REWRITER_DEBUG)) {
... | vuln | Safe | C/C++ |
int rsa_rsaes_pkcs1_v15_decrypt( rsa_context *ctx,
int (*f_rng)(void *, unsigned char *, size_t),
void *p_rng,
int mode, size_t *olen,
const unsigned char *input,
... | vuln | Safe | Unknown |
protected void checkTarget() {
if (this.isKnockback()) {
return;
}
if (this.followTarget != null && !this.followTarget.closed && this.followTarget.isAlive() && this.followTarget.canBeFollowed()) {
return;
}
Vector3 target = this.target;
if (!(tar... | vuln | Safe | Java |
gdm_session_start_reauthentication (GdmSession *session,
GPid pid_of_caller,
uid_t uid_of_caller)
{
GdmSessionConversation *conversation = session->priv->session_conversation;
g_return_if_fail (conversation != NULL);
... | vuln | Vulnerable | Unknown |
# -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2021, Shuup Commerce Inc. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
from django.http.response import HttpResponseRedirect
from shuup.... | vuln | Vulnerable | Python |
static int decode_pic_timing(HEVCSEIContext *s, GetBitContext *gb, const HEVCParamSets *ps,
void *logctx)
{
HEVCSEIPictureTiming *h = &s->picture_timing;
HEVCSPS *sps;
if (!ps->sps_list[s->active_seq_parameter_set_id])
return(AVERROR(ENOMEM));
sps = (HEVCSPS*)ps->sps... | vuln | Vulnerable | C/C++ |
av_cold void ff_h264dsp_init(H264DSPContext *c, const int bit_depth,
const int chroma_format_idc)
{
#undef FUNC
#define FUNC(a, depth) a ## _ ## depth ## _c
#define ADDPX_DSP(depth) \
c->h264_add_pixels4_clear = FUNC(ff_h264_add_pixels4, depth);\
c->h264_add_pixels8_clear = FUNC(ff_... | vuln | Vulnerable | C/C++ |
public static File createTempFile(File targetFile) throws IOException {
final String targetName = targetFile.getName();
final int extensionIndex = targetName.lastIndexOf(".");
String filename = targetName.substring(0, extensionIndex);
for (int i=filename.length(); i<3; i++){
... | vuln | Vulnerable | Java |
def _create_paramiko_client(self, base_url):
logging.getLogger("paramiko").setLevel(logging.WARNING)
self.ssh_client = paramiko.SSHClient()
base_url = urllib.parse.urlparse(base_url)
self.ssh_params = {
"hostname": base_url.hostname,
"port": base_url.port,
... | vuln | Safe | Python |
/*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org
*
* 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 the rights
* to use, copy,... | vuln | Vulnerable | Java |
static int vmd_read_header(AVFormatContext *s,
AVFormatParameters *ap)
{
VmdDemuxContext *vmd = (VmdDemuxContext *)s->priv_data;
ByteIOContext *pb = &s->pb;
AVStream *st;
unsigned int toc_offset;
unsigned char *raw_frame_table;
int raw_frame_table_size;
offset_t cu... | vuln | Vulnerable | C/C++ |
@Override
public ItemStack extractItem(int slot, int amount, boolean simulate) {
TransportedItemStack transported = this.beltInventory.getStackAtOffset(offset);
if (transported == null)
return ItemStack.EMPTY;
amount = Math.min(amount, transported.stack.getCount());
ItemStack extracted = simulate ? transpo... | vuln | Vulnerable | Java |
public void performTest()
throws Exception
{
KeyFactory ecFact = KeyFactory.getInstance("EC", "BC");
KeyPair keyPair = new KeyPair(ecFact.generatePublic(new X509EncodedKeySpec(p256_1_pub)), ecFact.generatePrivate(new PKCS8EncodedKeySpec(p256_1_pri)));
doTestNoParams("ECIES with P-2... | vuln | Vulnerable | Java |
void receive_xattr(int f, struct file_struct *file)
{
static item_list temp_xattr = EMPTY_ITEM_LIST;
int count, num;
#ifdef HAVE_LINUX_XATTRS
int need_sort = 0;
#else
int need_sort = 1;
#endif
int ndx = read_varint(f);
if (ndx < 0 || (size_t)ndx > rsync_xal_l.count) {
rprintf(FERROR, "receive_xattr: xa index %... | vuln | Vulnerable | C/C++ |
static int dx2_decode_slice_5x5(GetBitContext *gb, AVFrame *frame,
int line, int left, uint8_t lru[3][8],
int is_565)
{
int x, y;
int r, g, b;
int width = frame->width;
int stride = frame->linesize[0];
uint8_t *dst = frame->data[0]... | vuln | Vulnerable | C/C++ |
package api
import (
"errors"
"net/http"
"code.cloudfoundry.org/lager"
"github.com/concourse/concourse/atc/db"
)
type TeamScopedHandlerFactory struct {
logger lager.Logger
teamFactory db.TeamFactory
}
func NewTeamScopedHandlerFactory(
logger lager.Logger,
teamFactory db.TeamFactory,
) *TeamScopedHandl... | vuln | Vulnerable | Go |
uint32_t pci_default_read_config(PCIDevice *d,
uint32_t address, int len)
{
uint32_t val = 0;
memcpy(&val, d->config + address, len);
return le32_to_cpu(val);
} | vuln | Safe | C/C++ |
create_surface_from_thumbnail_data (guchar *data,
gint width,
gint height,
gint rowstride)
{
guchar *cairo_pixels;
gint cairo_stride;
cairo_surface_t *surface;
int j;
surface = cairo_image_surface_create (CAIRO_FORMAT_RGB24, width, height);
if (cairo_surface_status (s... | vuln | Safe | C/C++ |
ATPostAlterTypeCleanup(List **wqueue, AlteredTableInfo *tab, LOCKMODE lockmode)
{
ObjectAddress obj;
ListCell *def_item;
ListCell *oid_item;
/*
* Re-parse the index and constraint definitions, and attach them to the
* appropriate work queue entries. We do this before dropping because in
* the case of a F... | vuln | Safe | Unknown |
psutil_disk_partitions(PyObject *self, PyObject *args) {
FILE *file;
struct mnttab mt;
PyObject *py_dev = NULL;
PyObject *py_mountp = NULL;
PyObject *py_tuple = NULL;
PyObject *py_retlist = PyList_New(0);
if (py_retlist == NULL)
return NULL;
file = fopen(MNTTAB, "rb");
if (... | vuln | Safe | Unknown |
/**
* @file tree_data.c
* @author Radek Krejci <rkrejci@cesnet.cz>
* @brief Manipulation with libyang data structures
*
* 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.
* ... | vuln | Vulnerable | C/C++ |
@Override
public void callSessionMayHandover(int srcNetworkType, int targetNetworkType) {
if (mListener != null) {
TelephonyUtils.runWithCleanCallingIdentity(()->
mListener.callSessionMayHandover(ImsCallSession.this, srcNetworkType,
tar... | vuln | Vulnerable | Java |
public void forEachActor(Level world, BiConsumer<MovementBehaviour, MovementContext> callBack) {
for (MutablePair<StructureBlockInfo, MovementContext> pair : actors)
callBack.accept(AllMovementBehaviours.getBehaviour(pair.getLeft().state), pair.getRight());
} | vuln | Vulnerable | Java |
/*
* linux/fs/lockd/svclock.c
*
* Handling of server-side locks, mostly of the blocked variety.
* This is the ugliest part of lockd because we tread on very thin ice.
* GRANT and CANCEL calls may get stuck, meet in mid-flight, etc.
* IMNSHO introducing the grant callback into the NLM protocol was one
* of the wo... | vuln | Vulnerable | C/C++ |
static int jp2_find_codestream(Jpeg2000DecoderContext *s)
{
uint32_t atom_size, atom, atom_end;
int search_range = 10;
while (search_range
&&
bytestream2_get_bytes_left(&s->g) >= 8) {
atom_size = bytestream2_get_be32u(&s->g);
atom = bytestream2_get_be32u(&s->g);
... | vuln | Vulnerable | C/C++ |
@Override
public <B extends BlockStateHolder<B>> boolean setBlock(BlockVector3 location, B block) throws WorldEditException {
if (toolUse && block.getBlockType().getMaterial().isAir()) {
world.simulateBlockMine(location);
return true;
} else {
// Can't be an inlin... | vuln | Vulnerable | Java |
errno_t sssctl_logs_remove(struct sss_cmdline *cmdline,
struct sss_tool_ctx *tool_ctx,
void *pvt)
{
struct sssctl_logs_opts opts = {0};
errno_t ret;
/* Parse command line. */
struct poptOption options[] = {
{"delete", 'd', POPT_ARG_NONE, &op... | vuln | Vulnerable | Unknown |
tgs_build_reply(astgs_request_t priv,
hdb_entry_ex *krbtgt,
krb5_enctype krbtgt_etype,
const krb5_keyblock *replykey,
int rk_is_subkey,
krb5_ticket *ticket,
const char **e_text,
AuthorizationData **auth_data,
const struct sockaddr *from_addr)
{
krb5_context context = priv->context;
krb5_kdc_conf... | vuln | Vulnerable | Unknown |
void VaapiVideoDecodeAccelerator::VaapiH264Accelerator::FillVAPicture(
VAPictureH264* va_pic,
scoped_refptr<H264Picture> pic) {
VASurfaceID va_surface_id = VA_INVALID_SURFACE;
if (!pic->nonexisting) {
scoped_refptr<VaapiDecodeSurface> dec_surface =
H264PictureToVaapiDecodeSurface(pic);
... | vuln | Vulnerable | C/C++ |
static int rdn_rename_callback(struct ldb_request *req, struct ldb_reply *ares)
{
struct ldb_context *ldb;
struct rename_context *ac;
struct ldb_request *mod_req;
const char *rdn_name;
const struct ldb_schema_attribute *a = NULL;
const struct ldb_val *rdn_val_p;
struct ldb_val rdn_val;
struct ldb_message *msg;
... | vuln | Safe | Unknown |
[H],"{1} ago"));F.setAttribute("title",J.toLocaleDateString()+" "+J.toLocaleTimeString())}function k(J){var F=document.createElement("img");F.className="geCommentBusyImg";F.src=IMAGE_PATH+"/spin.gif";J.appendChild(F);J.busyImg=F}function l(J){J.style.border="1px solid red";J.removeChild(J.busyImg)}function p(J){J.style... | vuln | Safe | JavaScript |
save_config(
struct recvbuf *rbufp,
int restrict_mask
)
{
char reply[128];
#ifdef SAVECONFIG
char filespec[128];
char filename[128];
char fullpath[512];
const char savedconfig_eq[] = "savedconfig=";
char savedconfig[sizeof(savedconfig_eq) + sizeof(filename)];
time_t now;
int fd;
FILE *fptr;
#endif
if (RES... | vuln | Vulnerable | C/C++ |
public static void unzip(String zipFilePath, String targetPath, boolean safeUnzip) throws IOException {
targetPath = getCanonicalPath(new File(targetPath));
ZipFile zipFile = new ZipFile(zipFilePath);
try {
Enumeration<?> entryEnum = zipFile.entries();
while (entryEnum.ha... | vuln | Vulnerable | Java |
PUBLIC int espLoadApp(HttpRoute *route)
{
#if !ME_STATIC
EspRoute *eroute;
eroute = route->eroute;
if (!eroute->skipApps) {
MprJson *preload, *item;
cchar *errMsg, *source;
char *kind;
int i;
/*
Note: the config parser pauses G... | vuln | Safe | C/C++ |
// mkerrors.sh -Wall -Werror -static -I/tmp/include -fsigned-char
// Code generated by the command above; see README.md. DO NOT EDIT.
// +build arm64,linux
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -Wall -Werror -static -I/tmp/include -fsigned-char _const.go
package unix
import "syscall"
... | vuln | Vulnerable | Go |
static int asn1_template_noexp_d2i(ASN1_VALUE **val,
const unsigned char **in, long len,
const ASN1_TEMPLATE *tt, char opt,
ASN1_TLC *ctx)
{
int flags, aclass;
int ret;
ASN1_VALUE *tval;
const unsign... | vuln | Vulnerable | Unknown |
void rgb24tobgr32(const uint8_t *src, uint8_t *dst, long src_size)
{
long i;
for(i=0; 3*i<src_size; i++)
{
dst[4*i + 0] = src[3*i + 2];
dst[4*i + 1] = src[3*i + 1];
dst[4*i + 2] = src[3*i + 0];
dst[4*i + 3] = 0;
}
} | vuln | Safe | C/C++ |
static void unpin_rcv_pages(struct hfi1_filedata *fd,
struct tid_user_buf *tidbuf,
struct tid_rb_node *node,
unsigned int idx,
unsigned int npages,
bool mapped)
{
struct page **pages;
struct hfi1_devdata *dd = fd->uctxt->dd;
if (mapped) {
pci_unmap_single(dd->pcidev, node->dma_a... | vuln | Vulnerable | Unknown |
def __call__(self, value, system):
if 'request' in system:
request = system['request']
mime, encoding = mimetypes.guess_type(value['filename'])
request.response_content_type = mime
if encoding:
request.response_encoding = encoding
f ... | vuln | Vulnerable | Python |
changed_common(
linenr_T lnum,
colnr_T col,
linenr_T lnume,
long xtra)
{
win_T *wp;
tabpage_T *tp;
int i;
int cols;
pos_T *p;
int add;
// mark the buffer as modified
changed();
#ifdef FEAT_EVAL
may_record_change(lnum, col, lnume, xtra);
#endif
#ifdef FEAT_DIFF
... | vuln | Safe | Unknown |
/*
* Copyright (c) 2018. Abstrium SAS <team (at) pydio.com>
* This file is part of Pydio Cells.
*
* Pydio Cells is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
... | vuln | Vulnerable | Go |
/**
* 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 |
static int r_jwe_aesgcm_key_unwrap(jwe_t * jwe, jwa_alg alg, jwk_t * jwk, int x5u_flags) {
int ret, res;
unsigned char iv[96] = {0}, * key = NULL, cipherkey[64] = {0}, tag[128] = {0}, tag_b64url[256] = {0};
size_t iv_len = 0, key_len = 0, cipherkey_len = 0, tag_b64url_len = 0, tag_len = gnutls_cipher_get_tag_size... | vuln | Vulnerable | C/C++ |
public static InputStream newInstance(InputStream in, long len, boolean close) throws IOException
{
final Path tmpfile;
if (FileSystems.getDefault().supportedFileAttributeViews().contains("posix")) //$NON-NLS-1$
{
final var attr = PosixFilePermissions.asFileAttribute(PosixFilePermissions.fromString("rwxr-x---... | vuln | Safe | Java |
private void updateJoystickButtonState(ControllerButton controllerButton) throws JoystickException {
try {
boolean value = currentController.isButtonPressed(controllerButton);
JoystickControl button = Utils.getJoystickButtonFromControllerButton(controllerButton);
joystickStat... | vuln | Safe | Java |
public void readNbt(NbtCompound nbt) {
super.readNbt(nbt);
this.lastVibrationFrequency = nbt.getInt("last_vibration_frequency");
this.echoBubblesLeft = nbt.getInt("echoBubblesLeft");
this.bubbleTicks = IntArrayList.wrap(nbt.getIntArray("bubbleTicksLeft"));
this.bubbleSizes = IntA... | vuln | Safe | Java |
static void sbr_hf_g_filt_c(int (*Y)[2], const int (*X_high)[40][2],
const SoftFloat *g_filt, int m_max, intptr_t ixh)
{
int m;
int64_t accu;
for (m = 0; m < m_max; m++) {
int64_t r = 1LL << (22-g_filt[m].exp);
accu = (int64_t)X_high[m][ixh][0] * ((g_filt[m].mant + ... | vuln | Vulnerable | C/C++ |
function mci_account_get_array_by_id( $p_user_id ) {
$t_result = array();
$t_result['id'] = $p_user_id;
if( user_exists( $p_user_id ) ) {
$t_result['name'] = user_get_field( $p_user_id, 'username' );
$t_dummy = user_get_field( $p_user_id, 'realname' );
if( !empty( $t_dummy ) ) {
$t_result['real_name'] = $... | vuln | Vulnerable | PHP |
static jboolean enableNative(JNIEnv* env, jobject obj) {
ALOGV("%s:",__FUNCTION__);
jboolean result = JNI_FALSE;
if (!sBluetoothInterface) return result;
int ret = sBluetoothInterface->enable();
result = (ret == BT_STATUS_SUCCESS || ret == BT_STATUS_DONE) ? JNI_TRUE : JNI_FALSE;
return re... | vuln | Vulnerable | C/C++ |
z2grestore(i_ctx_t *i_ctx_p)
{
if (!restore_page_device(igs, gs_gstate_saved(igs)))
return gs_grestore(igs);
return push_callout(i_ctx_p, "%grestorepagedevice");
} | vuln | Vulnerable | C/C++ |
int ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
compat_sigset_t *set, struct pt_regs *regs)
{
struct rt_sigframe __user *frame;
struct exec_domain *ed = current_thread_info()->exec_domain;
void __user *restorer;
int err = 0;
/* __copy_to_user optimizes that into a single 8 byte store ... | vuln | Safe | Unknown |
public void load(Box area) {
World world = dynamicsWorld.getWorld();
Map<BlockPos, BlockState> blockList = getBlockList(world, area);
blockList.forEach((blockPos, blockState) -> {
float friction = 1.5f;
if (blockState.getBlock() instanceof IceBlock) {
fr... | vuln | Vulnerable | Java |
@Override
public void onViewBound(View view) {
super.onViewBound(view);
int padding = Utils.getDefaultPadding();
SettingsAPI sets = PluginManager.plugins.get("CustomTimestamps").sets;
Context context = view.getContext();
LinearLayout layout = (Linear... | vuln | Safe | Java |
messageAddArgument(message *m, const char *arg)
{
int offset;
char *p;
assert(m != NULL);
if(arg == NULL)
return; /* Note: this is not an error condition */
while(isspace(*arg))
arg++;
if(*arg == '\0')
/* Empty argument? Probably a broken mail client... */
return;
cli_dbgmsg("messageAddArgument, arg... | vuln | Vulnerable | C/C++ |
package com.salesmanager.core.business.modules.cms.product;
import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.net.FileNameMap;
import java.net.URLConnection;
import... | vuln | Safe | Java |
cid_parse_font_matrix( CID_Face face,
CID_Parser* parser )
{
CID_FaceDict dict;
FT_Face root = (FT_Face)&face->root;
FT_Fixed temp[6];
FT_Fixed temp_scale;
if ( parser->num_dict >= 0 && parser->num_dict < face->cid.num_dicts )
{
FT_Matri... | vuln | Safe | Unknown |
import hashlib
import math
import operator
from decimal import Decimal
from vyper import ast as vy_ast
from vyper.abi_types import ABI_Tuple
from vyper.address_space import MEMORY, STORAGE
from vyper.ast.validation import validate_call_args
from vyper.codegen.abi_encoder import abi_encode
from vyper.codegen.context im... | vuln | Vulnerable | Python |
private boolean canBind(Type<?> type) {
if (! type.getUnderlyingClass().isPresent()) {
return false;
}
Class<?> clazz = type.getUnderlyingClass().get();
boolean hasNoArgConstructor =
Arrays.stream(clazz.getConstructors()).anyMatch(constructor -> constructor.... | vuln | Safe | Java |
static int virtio_net_load(QEMUFile *f, void *opaque, int version_id)
{
VirtIONet *n = opaque;
VirtIODevice *vdev = VIRTIO_DEVICE(n);
int ret, i, link_down;
if (version_id < 2 || version_id > VIRTIO_NET_VM_VERSION)
return -EINVAL;
ret = virtio_load(vdev, f);
if (ret) {
return r... | vuln | Vulnerable | Unknown |
// mkerrors.sh -Wall -Werror -static -I/tmp/include
// Code generated by the command above; see README.md. DO NOT EDIT.
// +build mips64le,linux
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go
package unix
import "syscall"
const (
B1000000 ... | vuln | Vulnerable | Go |
func cmdGet(args *docopt.Args, client *tuf.Client) error {
if _, err := client.Update(); err != nil && !tuf.IsLatestSnapshot(err) {
return err
}
target := util.NormalizeTarget(args.String["<target>"])
file, err := ioutil.TempFile("", "go-tuf")
if err != nil {
return err
}
tmp := tmpFile{file}
if err := clie... | vuln | Vulnerable | Go |
public static String clearColorReset(String text) {
int startIndex = 0;
int endIndex = text.length();
while (text.indexOf(COLOR_RESET_PHRASE, startIndex) == startIndex) {
startIndex += 2;
}
while (text.lastIndexOf(COLOR_RESET_PHRASE, endIndex - 1) == endIndex - 2) {... | vuln | Vulnerable | Java |
const cheerio = require('cheerio');
const { puppeteerGet, renderDesc } = require('./utils');
const config = require('@/config').value;
module.exports = async (ctx) => {
const pub = ctx.params.pub;
const jrn = ctx.params.jrn;
const host = `https://${pub}.scitation.org`;
const jrnlUrl = `${host}/toc/${jr... | vuln | Vulnerable | JavaScript |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | vuln | Safe | C/C++ |
def get_signed_upload_url(path: str) -> str:
client = boto3.client(
"s3",
aws_access_key_id=settings.S3_KEY,
aws_secret_access_key=settings.S3_SECRET_KEY,
region_name=settings.S3_REGION,
endpoint_url=settings.S3_ENDPOINT_URL,
)
return client.generate_presigned_url(
... | vuln | Vulnerable | Python |
static void ide_init1(IDEBus *bus, int unit)
{
static int drive_serial = 1;
IDEState *s = &bus->ifs[unit];
s->bus = bus;
s->unit = unit;
s->drive_serial = drive_serial++;
s->io_buffer_total_len = IDE_DMA_BUF_SECTORS*512 + 4;
s->io_buffer = qemu_memalign(2048, s->io_buffer_total_len);
... | vuln | Safe | C/C++ |
static int handle_alloc(BlockDriverState *bs, uint64_t guest_offset,
uint64_t *host_offset, uint64_t *bytes, QCowL2Meta **m)
{
BDRVQcowState *s = bs->opaque;
int l2_index;
uint64_t *l2_table;
uint64_t entry;
unsigned int nb_clusters;
int ret;
uint64_t alloc_cluster_offset;
trace_qcow... | vuln | Vulnerable | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.