code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
static ssize_t
bsg_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
{
struct bsg_device *bd = file->private_data;
ssize_t bytes_written;
int ret;
dprintk("%s: write %Zd bytes\n", bd->name, count);
if (unlikely(segment_eq(get_fs(), KERNEL_DS)))
return -EINVAL;
bsg_set_block(bd, fil... | vuln | Safe | C/C++ |
ImagingSgiRleDecode(Imaging im, ImagingCodecState state, UINT8 *buf, Py_ssize_t bytes) {
UINT8 *ptr;
SGISTATE *c;
int err = 0;
int status;
/* size check */
if (im->xsize > INT_MAX / im->bands || im->ysize > INT_MAX / im->bands) {
state->errcode = IMAGING_CODEC_MEMORY;
return -1;... | vuln | Safe | Unknown |
private function buildWhereClause(Select $select)
{
global $zdb, $login;
try {
if ($this->filters->email_filter == self::FILTER_W_EMAIL) {
$select->where('email_adh != \'\'');
}
if ($this->filters->email_filter == self::FILTER_WO_EMAIL) {
... | vuln | Vulnerable | PHP |
public PropertyImpl getLatestHistoryProperty(final String upicNo) {
final PropertyImpl property = (PropertyImpl) propPerServ.find(
"from PropertyImpl prop where prop.basicProperty.upicNo = ? and prop.status = 'H' order by prop.id desc",
upicNo);
return property;
} | vuln | Vulnerable | Java |
static int64_t alloc_clusters_noref(BlockDriverState *bs, int64_t size)
{
BDRVQcowState *s = bs->opaque;
int i, nb_clusters, refcount;
nb_clusters = size_to_clusters(s, size);
retry:
for(i = 0; i < nb_clusters; i++) {
int64_t next_cluster_index = s->free_cluster_index++;
refcount = get_r... | vuln | Vulnerable | C/C++ |
@app.route('/get_markets')
def get_markets():
asset_id = request.args.get('asset_id')
if not isObject(asset_id):
ws.send('{"id":1, "method":"call", "params":[0,"lookup_asset_symbols",[["' + asset_id + '"], 0]]}')
result_l = ws.recv()
j_l = json.loads(result_l)
asset_id = j_l["re... | vuln | Safe | Python |
void WebGL2RenderingContextBase::texSubImage2D(GLenum target,
GLint level,
GLint xoffset,
GLint yoffset,
GLsizei width,
... | vuln | Safe | C/C++ |
static unsigned int find_best(struct vf_instance *vf){
int is_format_okay = vf_next_query_format(vf, IMGFMT_YV12);
if ((is_format_okay & VFCAP_CSP_SUPPORTED_BY_HW) || (is_format_okay & VFCAP_CSP_SUPPORTED))
return IMGFMT_YV12;
else
return 0;
} | vuln | Safe | C/C++ |
BOOL rdp_decrypt(rdpRdp* rdp, STREAM* s, int length, UINT16 securityFlags)
{
BYTE cmac[8];
BYTE wmac[8];
if (rdp->settings->EncryptionMethods == ENCRYPTION_METHOD_FIPS)
{
UINT16 len;
BYTE version, pad;
BYTE* sig;
if (stream_get_left(s) < 12)
return FALSE;
stream_read_UINT16(s, len); /* 0x10 */
str... | vuln | Safe | C/C++ |
/**
* Add a data array to the table, creating DOM node etc. This is the parallel to
* _fnGatherData, but for adding rows from a Javascript source, rather than a
* DOM source.
* @param {object} oSettings dataTables settings object
* @param {array} aData data array to be added
* @param {node} [nTr] TR element to... | vuln | Vulnerable | JavaScript |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2016-2020 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | vuln | Safe | Python |
struct vfsmount *clone_private_mount(const struct path *path)
{
struct mount *old_mnt = real_mount(path->mnt);
struct mount *new_mnt;
if (IS_MNT_UNBINDABLE(old_mnt))
return ERR_PTR(-EINVAL);
new_mnt = clone_mnt(old_mnt, path->dentry, CL_PRIVATE);
if (IS_ERR(new_mnt))
return ERR_CAST(new_mnt);
/* Longterm m... | vuln | Vulnerable | C/C++ |
import json
import logging
import os
import pathlib
import re
from typing import Dict, Mapping, NoReturn, Optional, Sequence
from vault_cli import client, exceptions
logger = logging.getLogger(__name__)
_replaced_by_underscore = re.compile(r"[/\- ]")
_allowed_named = re.compile(r"[A-Z0-9_]+")
def _normalize(name: ... | vuln | Vulnerable | Python |
package user_admin
import (
"context"
"fmt"
"net/mail"
"strings"
"time"
"unicode"
"github.com/answerdev/answer/internal/base/pager"
"github.com/answerdev/answer/internal/base/reason"
"github.com/answerdev/answer/internal/entity"
"github.com/answerdev/answer/internal/schema"
"github.com/answerdev/answer/int... | vuln | Vulnerable | Go |
/**
* Copyright (c) 2006-2012, JGraph Ltd
*/
/**
* Construcs a new sidebar for the given editor.
*/
function Sidebar(editorUi, container)
{
this.editorUi = editorUi;
this.container = container;
this.palettes = new Object();
this.taglist = new Object();
this.lastCreated = 0;
this.showTooltips = true;
this.gra... | vuln | Vulnerable | Java |
public static void consume(UpdateRitualPacket packet, Supplier<NetworkEvent.Context> ctx) {
ctx.get().enqueueWork(() -> {
assert ctx.get().getDirection() == NetworkDirection.PLAY_TO_CLIENT;
World world = ForbiddenArcanus.proxy.getClientWorld();
if (world == null || !(world.... | vuln | Safe | Java |
/*
* mm/rmap.c - physical to virtual reverse mappings
*
* Copyright 2001, Rik van Riel <riel@conectiva.com.br>
* Released under the General Public License (GPL).
*
* Simple, low overhead reverse mapping scheme.
* Please try to keep this thing as modular as possible.
*
* Provides methods for unmapping each kind... | vuln | Vulnerable | C/C++ |
private Map<String, String> readRemoved() throws IOException {
final Map<String, String> r = new HashMap<>();
try (InputStream in = getClass().getResourceAsStream("/removed")) {
if (in != null) {
// cols are item name, version when removed
Processor.readCompSet(in, cols -> r.put(cols[0], c... | vuln | Safe | Java |
static int pci_rocker_init(PCIDevice *dev)
{
Rocker *r = to_rocker(dev);
const MACAddr zero = { .a = { 0, 0, 0, 0, 0, 0 } };
const MACAddr dflt = { .a = { 0x52, 0x54, 0x00, 0x12, 0x35, 0x01 } };
static int sw_index;
int i, err = 0;
r->worlds[ROCKER_WORLD_TYPE_OF_DPA] = of_dpa_world_alloc(r)... | vuln | Safe | C/C++ |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | vuln | Safe | C/C++ |
static inline void elf_core_copy_regs(target_elf_gregset_t *regs,
const CPUSH4State *env)
{
int i;
for (i = 0; i < 16; i++) {
(*regs[i]) = tswapreg(env->gregs[i]);
}
(*regs)[TARGET_REG_PC] = tswapreg(env->pc);
(*regs)[TARGET_REG_PR] = tswapreg(env->pr);
... | vuln | Vulnerable | C/C++ |
static int n_tty_ioctl(struct tty_struct *tty, struct file *file,
unsigned int cmd, unsigned long arg)
{
struct n_tty_data *ldata = tty->disc_data;
int retval;
switch (cmd) {
case TIOCOUTQ:
return put_user(tty_chars_in_buffer(tty), (int __user *) arg);
case TIOCINQ:
down_write(&tty->termios_rwsem);
... | vuln | Vulnerable | Unknown |
static __u8 *sp_report_fixup(struct hid_device *hdev, __u8 *rdesc,
unsigned int *rsize)
{
if (*rsize >= 112 && rdesc[104] == 0x26 && rdesc[105] == 0x80 &&
rdesc[106] == 0x03) {
hid_info(hdev, "fixing up Sunplus Wireless Desktop report descriptor\n");
rdesc[105] = rdesc[110] = 0x03;
rdesc[106] = rdesc[111] =... | vuln | Safe | C/C++ |
Mat_VarReadNextInfo4(mat_t *mat)
{
int M,O,data_type,class_type;
mat_int32_t tmp;
long nBytes;
size_t readresult;
matvar_t *matvar = NULL;
union {
mat_uint32_t u;
mat_uint8_t c[4];
} endian;
if ( mat == NULL || mat->fp == NULL )
return NULL;
el... | vuln | Safe | C/C++ |
exsltCryptoRc4EncryptFunction (xmlXPathParserContextPtr ctxt, int nargs) {
int key_len = 0, key_size = 0;
int str_len = 0, bin_len = 0, hex_len = 0;
xmlChar *key = NULL, *str = NULL, *padkey = NULL;
xmlChar *bin = NULL, *hex = NULL;
xsltTransformContextPtr tctxt = NULL;
if (nargs != 2) {
... | vuln | Vulnerable | C/C++ |
FastHufDecoder::FastHufDecoder
(const char *&table,
int numBytes,
int minSymbol,
int maxSymbol,
int rleSymbol)
:
_rleSymbol (rleSymbol),
_numSymbols (0),
_minCodeLength (255),
_maxCodeLength (0),
_idToSymbol (0)
{
//
// List of symbols that we find with non-zero code ... | vuln | Vulnerable | Unknown |
void get_checksum2(char *buf, int32 len, char *sum)
{
md_context m;
switch (xfersum_type) {
case CSUM_MD5: {
uchar seedbuf[4];
md5_begin(&m);
if (proper_seed_order) {
if (checksum_seed) {
SIVALu(seedbuf, 0, checksum_seed);
md5_update(&m, seedbuf, 4);
}
md5_update(&m, (uchar *)buf, len);
}... | vuln | Safe | Unknown |
public static void parseTownUnclaimCommand(Player player, String[] split) throws TownyException {
if (split.length == 1 && split[0].equalsIgnoreCase("?")) {
HelpMenu.TOWN_UNCLAIM.send(player);
return;
}
Resident resident = getResidentOrThrow(player.getUniqueId());
Town town = getTownFromResidentOrThrow(r... | vuln | Safe | Java |
static void mptsas_free_request(MPTSASRequest *req)
{
if (req->sreq != NULL) {
req->sreq->hba_private = NULL;
scsi_req_unref(req->sreq);
req->sreq = NULL;
}
qemu_sglist_destroy(&req->qsg);
g_free(req);
} | vuln | Safe | Unknown |
public void deleteKeys(){
deletePrivateFile(PUBLIC_KEY_FILENAME);
deletePrivateFile(PWD_SALT_FILENAME);
deletePrivateFile(SK_NONCE_FILENAME);
deletePrivateFile(PRIVATE_KEY_FILENAME);
deletePrivateFile(SERVER_PUBLIC_KEY_FILENAME);
} | vuln | Vulnerable | Java |
@Listener
public void onWalkingUpdate(EventUpdateWalkingPlayer event) {
final Minecraft mc = Minecraft.getMinecraft();
if (mc.player == null || mc.world == null)
return;
switch (event.getStage()) {
case PRE:
// place position reset
if ... | vuln | Vulnerable | Java |
int fscrypt_get_crypt_info(struct inode *inode)
int fscrypt_get_encryption_info(struct inode *inode)
{
struct fscrypt_info *crypt_info;
struct fscrypt_context ctx;
struct crypto_skcipher *ctfm;
const char *cipher_str;
int keysize;
u8 *raw_key = NULL;
int res;
if (inode->i_crypt_info)
return 0;
res =... | vuln | Safe | C/C++ |
static void removeduplicateobjs(fz_context *ctx, pdf_document *doc, pdf_write_state *opts)
{
int num, other;
int xref_len = pdf_xref_len(ctx, doc);
for (num = 1; num < xref_len; num++)
{
/* Only compare an object to objects preceding it */
for (other = 1; other < num; other++)
{
pdf_obj *a, *b;
int new... | vuln | Vulnerable | Unknown |
public String uploadFile(
String artifactPath, HttpServletRequest request, Long partNumber, String uploadId)
throws ModelDBException, IOException {
try (RefCountedS3Client client = s3Client.getRefCountedClient()) {
Boolean exist = doesBucketExist(bucketName);
if (!exist) {
throw new ... | vuln | Vulnerable | Java |
int vnc_tight_send_framebuffer_update(VncState *vs, int x, int y,
int w, int h)
{
vs->tight.type = VNC_ENCODING_TIGHT;
return tight_send_framebuffer_update(vs, x, y, w, h);
} | vuln | Vulnerable | Unknown |
static Image *ReadRLEImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
#define SkipLinesOp 0x01
#define SetColorOp 0x02
#define SkipPixelsOp 0x03
#define ByteDataOp 0x05
#define RunDataOp 0x06
#define EOFOp 0x07
char
magick[12];
Image
*image;
IndexPacket
index;
int
op... | vuln | Vulnerable | Unknown |
/*
* Copyright (c) 1997-2008 Kungliga Tekniska Högskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of ... | vuln | Vulnerable | C/C++ |
gnutls_pcert_deinit (gnutls_pcert_st *pcert)
{
gnutls_pubkey_deinit(pcert->pubkey);
pcert->pubkey = NULL;
_gnutls_free_datum(&pcert->cert);
} | vuln | Safe | Unknown |
/* $OpenBSD: sshd.c,v 1.476 2016/09/28 16:33:07 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
* All rights reserved
* This program is the ssh daemon. It listens for connections from clients,
* and performs authentication, ... | vuln | Safe | C/C++ |
# -*- coding: utf-8 -*-
# rdiffweb, A web interface to rdiff-backup repositories
# Copyright (C) 2012-2021 rdiffweb contributors
#
# This program 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 ... | vuln | Vulnerable | Python |
private int hasNonVanillaEnchant(MethodNode method) {
int curLine = -1;
int foundLine = -1;
for (AbstractInsnNode abstractInsnNode : method.instructions) {
if (abstractInsnNode instanceof MethodInsnNode) {
MethodInsnNode methodInsnNode = (MethodInsnNode) abstractInsnNode;
if (methodIn... | vuln | Safe | Java |
/*!
* socket.io-node
* Copyright(c) 2011 LearnBoost <dev@learnboost.com>
* MIT Licensed
*/
/**
* Module dependencies.
*/
var fs = require('fs')
, url = require('url')
, tty = require('tty')
, util = require('./util')
, store = require('./store')
, client = require('socket.io-client')
, transports = ... | vuln | Vulnerable | JavaScript |
static void property_set_enum(Object *obj, Visitor *v, void *opaque,
const char *name, Error **errp)
{
EnumProperty *prop = opaque;
int value;
visit_type_enum(v, &value, prop->strings, NULL, name, errp);
prop->set(obj, value, errp);
} | vuln | Vulnerable | C/C++ |
static inline void bt_hci_event_complete_read_local_name(struct bt_hci_s *hci)
{
read_local_name_rp params;
params.status = HCI_SUCCESS;
memset(params.name, 0, sizeof(params.name));
if (hci->device.lmp_name)
pstrcpy(params.name, sizeof(params.name), hci->device.lmp_name);
bt_hci_event_comple... | vuln | Safe | C/C++ |
INST_HANDLER (cpse) { // CPSE Rd, Rr
int r = (buf[0] & 0xf) | ((buf[1] & 0x2) << 3);
int d = ((buf[0] >> 4) & 0xf) | ((buf[1] & 0x1) << 4);
RAnalOp next_op;
// calculate next instruction size (call recursively avr_op_analyze)
// and free next_op's esil string (we dont need it now)
avr_op_analyze (anal,
&next_... | vuln | Vulnerable | Unknown |
static int read_directory(BDRVVVFATState* s, int mapping_index)
{
mapping_t* mapping = array_get(&(s->mapping), mapping_index);
direntry_t* direntry;
const char* dirname = mapping->path;
int first_cluster = mapping->begin;
int parent_index = mapping->info.dir.parent_mapping_index;
mapping_t* par... | vuln | Vulnerable | C/C++ |
static int __tail_onwire_len(int front_len, int middle_len, int data_len,
bool secure)
{
BUG_ON(front_len < 0 || front_len > CEPH_MSG_MAX_FRONT_LEN ||
middle_len < 0 || middle_len > CEPH_MSG_MAX_MIDDLE_LEN ||
data_len < 0 || data_len > CEPH_MSG_MAX_DATA_LEN);
if (!front_len && !middle_len && ... | vuln | Safe | C/C++ |
bool CTransaction::DisconnectInputs(CTxDB& txdb)
{
// Relinquish previous transactions' spent pointers
if (!IsCoinBase())
{
BOOST_FOREACH(const CTxIn& txin, vin)
{
COutPoint prevout = txin.prevout;
// Get prev txindex from disk
CTxIndex txindex;
... | vuln | Vulnerable | C/C++ |
static int mov_read_colr(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
AVStream *st;
char color_parameter_type[5] = { 0 };
int color_primaries, color_trc, color_matrix;
if (c->fc->nb_streams < 1)
return 0;
st = c->fc->streams[c->fc->nb_streams - 1];
avio_read(pb, color_parameter_type, ... | vuln | Vulnerable | C/C++ |
static void xen_irq_init(unsigned irq)
{
struct irq_info *info;
#ifdef CONFIG_SMP
/* By default all event channels notify CPU#0. */
cpumask_copy(irq_get_affinity_mask(irq), cpumask_of(0));
#endif
info = kzalloc(sizeof(*info), GFP_KERNEL);
if (info == NULL)
panic("Unable to allocate metadata for IRQ%d\n", irq);
... | vuln | Vulnerable | Unknown |
/*
* The AFFLIB page abstraction.
* Distributed under the Berkeley 4-part license
*/
#include "affconfig.h"
#include "afflib.h"
#include "afflib_i.h"
/* af_read_sizes:
* Get the page sizes if they are set in the file.
*/
void af_read_sizes(AFFILE *af)
{
af_get_seg(af,AF_SECTORSIZE,&af->image_sectorsize,0,0)... | vuln | Safe | C/C++ |
Status ModularFrameDecoder::DecodeGroup(const Rect& rect, BitReader* reader,
int minShift, int maxShift,
const ModularStreamId& stream,
bool zerofill,
PassesDec... | vuln | Safe | Unknown |
static uint64_t kvmppc_read_int_cpu_dt(const char *propname)
{
char buf[PATH_MAX], *tmp;
union {
uint32_t v32;
uint64_t v64;
} u;
FILE *f;
int len;
if (kvmppc_find_cpu_dt(buf, sizeof(buf))) {
return -1;
}
tmp = g_strdup_printf("%s/%s", buf, propname);
f = fope... | vuln | Safe | C/C++ |
static MagickBooleanType WritePDBImage(const ImageInfo *image_info,Image *image)
{
const char
*comment;
int
bits;
MagickBooleanType
status;
PDBImage
pdb_image;
PDBInfo
pdb_info;
QuantumInfo
*quantum_info;
register const PixelPacket
*p;
register ssize_t
x;
regist... | vuln | Safe | C/C++ |
static int vol_prc_lib_release(effect_handle_t handle)
{
struct listnode *node, *temp_node_next;
vol_listener_context_t *context = NULL;
vol_listener_context_t *recv_contex = (vol_listener_context_t *)handle;
int status = -1;
bool recompute_flag = false;
int active_stream_count = 0;
A... | vuln | Vulnerable | C/C++ |
@Override
public Empire bestVictim() {
if(bestVictim != null)
{
return bestVictim;
}
float highestScore = 0;
Empire archEnemy = null;
for(Empire emp : empire.contactedEmpires())
{
if(!empire.inShipRange(emp.id))
{
... | vuln | Safe | Java |
xps_begin_opacity(xps_document *doc, const fz_matrix *ctm, const fz_rect *area,
char *base_uri, xps_resource *dict,
char *opacity_att, fz_xml *opacity_mask_tag)
{
float opacity;
if (!opacity_att && !opacity_mask_tag)
return;
opacity = 1;
if (opacity_att)
opacity = fz_atof(opacity_att);
if (opacity_mask_ta... | vuln | Safe | C/C++ |
static int mp3_write_packet(AVFormatContext *s, AVPacket *pkt)
{
MP3Context *mp3 = s->priv_data;
if (pkt->stream_index == mp3->audio_stream_idx) {
if (mp3->pics_to_write) {
AVPacketList *pktl = av_mallocz(sizeof(*pktl));
if (!pktl)
return AVERROR(ENOM... | vuln | Vulnerable | C/C++ |
const Cluster* Segment::GetNext(const Cluster* pCurr)
if (idx >= 0) {
assert(m_clusterCount > 0);
assert(idx < m_clusterCount);
assert(pCurr == m_clusters[idx]);
++idx;
if (idx >= m_clusterCount)
return &m_eos; // caller will LoadCluster as desired
Cluster* const pNext = m_cluster... | vuln | Safe | C/C++ |
public void dump(DataOutputStream file) throws IOException {
file.writeShort(poolSize);
for (int i = 1; i < poolSize; i++)
if (pool[i] != null)
pool[i].dump(file);
} | vuln | Vulnerable | Java |
static struct desc_struct *get_desc(unsigned short sel)
static bool get_desc(struct desc_struct *out, unsigned short sel)
{
struct desc_ptr gdt_desc = {0, 0};
unsigned long desc_base;
#ifdef CONFIG_MODIFY_LDT_SYSCALL
if ((sel & SEGMENT_TI_MASK) == SEGMENT_LDT) {
bool success = false;
struct ldt_struct *l... | vuln | Safe | C/C++ |
static void
block_insert(
oparg_T *oap,
char_u *s,
int b_insert,
struct block_def *bdp)
{
int ts_val;
int count = 0; // extra spaces to replace a cut TAB
int spaces = 0; // non-zero if cutting a TAB
colnr_T offset; // pointer along new line
colnr_T startcol; // column where i... | vuln | Safe | C/C++ |
package v1
import (
"context"
"errors"
v1 "github.com/authzed/authzed-go/proto/authzed/api/v1"
grpcmw "github.com/grpc-ecosystem/go-grpc-middleware"
grpcvalidate "github.com/grpc-ecosystem/go-grpc-middleware/validator"
"github.com/jzelinskie/stringz"
"github.com/rs/zerolog/log"
"github.com/shopspring/decimal"... | vuln | Vulnerable | Go |
public ResponseEntity<Resource> fetch(@PathVariable String key) {
LitemallStorage litemallStorage = litemallStorageService.findByKey(key);
if (key == null) {
return ResponseEntity.notFound().build();
}
if(key.contains("../")){
return ResponseEntity.badRequest().bu... | vuln | Safe | Java |
@Override
public Optional<AuthState> currentAuthState(final HttpServletRequest request) {
LOGGER.debug("currentAuthState");
AuthStateImpl authState = getAuthState(request);
// Now we can check if we're logged in somehow (session or certs) and build the response accordingly
if (authS... | vuln | Vulnerable | Java |
static int selinux_bprm_set_creds(struct linux_binprm *bprm)
{
const struct task_security_struct *old_tsec;
struct task_security_struct *new_tsec;
struct inode_security_struct *isec;
struct common_audit_data ad;
struct selinux_audit_data sad = {0,};
struct inode *inode = bprm->file->f_path.dentry->d_inode;
int r... | vuln | Safe | Unknown |
int extract_or_test_files(__G) /* return PK-type error code */
__GDEF
{
unsigned i, j;
zoff_t cd_bufstart;
uch *cd_inptr;
int cd_incnt;
ulg filnum=0L, blknum=0L;
int reached_end;
#ifndef SFX
int no_endsig_found;
#endif
int error, error_in_archive=PK_COOL;
int *fn_matched=NULL... | vuln | Safe | Unknown |
package config
import (
"fmt"
"github.com/libp2p/go-libp2p-core/crypto"
"github.com/libp2p/go-libp2p-core/host"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p-core/sec"
"github.com/libp2p/go-libp2p-core/sec/insecure"
csms "github.com/libp2p/go-conn-security-multistream"
)
// SecC is a s... | vuln | Vulnerable | Go |
/************************************************************************
* edit.c
* nodau console note taker
* Copyright (C) Lisa Milne 2010-2013 <lisa@ltmnet.com>
*
* edit.c 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 Softwa... | vuln | Safe | C/C++ |
#include "common/http/http1/codec_impl.h"
#include <cstdint>
#include <memory>
#include <string>
#include "envoy/buffer/buffer.h"
#include "envoy/http/header_map.h"
#include "envoy/network/connection.h"
#include "common/common/enum_to_int.h"
#include "common/common/fmt.h"
#include "common/common/stack_array.h"
#incl... | vuln | Vulnerable | C/C++ |
public static String dumpResources(KylinConfig kylinConfig, Collection<String> dumpList) throws IOException {
File tmp = Files.createTempFile("kylin_job_meta", "").toFile();
FileUtils.forceDelete(tmp); // we need a directory, so delete the file first
File metaDir = new File(tmp, "meta");
... | vuln | Safe | Java |
private static void correctGenotypePloidy(final GenotypeBuilder builder, final Genotype g, final int ploidy,
final Allele refAllele) {
final ArrayList<Allele> alleles = new ArrayList<>(g.getAlleles());
Utils.validate(alleles.size() <= ploidy, "Encountered ge... | vuln | Vulnerable | Java |
def listAllUsers(usernamePrefix: String): Action[Unit] = GetAction { request =>
// Authorization check: Is a member? Add MemberGetAction?
request.theMember
val json = listAllUsersImpl(usernamePrefix, request)
OkSafeJson(json)
}
SECURITY // user listing disabled? [8FKU2A4] | vuln | Vulnerable | Scala |
ssize_t nbd_wr_syncv(QIOChannel *ioc,
struct iovec *iov,
size_t niov,
size_t length,
bool do_read)
{
ssize_t done = 0;
Error *local_err = NULL;
struct iovec *local_iov = g_new(struct iovec, niov);
struct iovec *local_iov... | vuln | Vulnerable | C/C++ |
public String[] getChannelMemberByName(String name, String type) {
SQLiteDatabase database = dbHelper.getReadableDatabase();
List<String> userIds = new ArrayList<String>();
Cursor cursor = database.rawQuery("Select cu.userId from channel c JOIN channel_User_X cu on c.channelKey = cu.channelKey w... | vuln | Vulnerable | Java |
@SuppressWarnings("PMD.AvoidCatchingGenericException")
private void handleDownload(final CommandSender sender, final String... args) {
if (!(sender instanceof ConsoleCommandSender)) {
sendMessage(sender, "console_only");
return;
}
if (args.length < 5) {
se... | vuln | Safe | Java |
static int mov_text_decode_close(AVCodecContext *avctx)
{
MovTextContext *m = avctx->priv_data;
mov_text_cleanup_ftab(m);
mov_text_cleanup(m);
return 0;
} | vuln | Safe | C/C++ |
/*
* 32-bit Digest parameter name parser
*
* Copyright (C) 2001-2003 FhG Fokus
*
* This file is part of opensips, a free SIP server.
*
* opensips 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... | vuln | Safe | C/C++ |
static char *expandRequestTokens(HttpConn *conn, char *str)
{
HttpRx *rx;
HttpTx *tx;
HttpRoute *route;
MprBuf *buf;
HttpLang *lang;
char *tok, *cp, *key, *value, *field, *header, *defaultValue, *state, *v, *p;
assert(conn);
assert(str);
rx = conn->rx;
... | vuln | Vulnerable | C/C++ |
int avformat_network_init(void)
{
#if CONFIG_NETWORK
int ret;
ff_network_inited_globally = 1;
if ((ret = ff_network_init()) < 0)
return ret;
if ((ret = ff_tls_init()) < 0)
return ret;
#endif
return 0;
} | vuln | Safe | C/C++ |
/**
* Copyright (c) 2006-2017, JGraph Ltd
* Copyright (c) 2006-2017, Gaudenz Alder
*/
(function()
{
/**
* Version
*/
EditorUi.VERSION = '@DRAWIO-VERSION@';
/**
* Overrides compact UI setting.
*/
EditorUi.compactUi = uiTheme != 'atlas';
/**
* Overrides default grid color for dark mode
*/
if (Edit... | vuln | Safe | Java |
bool IsSupported(const NodeDef* node) const override {
return IsAnyMul(*node) && node->input(0) == node->input(1);
} | vuln | Vulnerable | Unknown |
QPDFPageData::QPDFPageData(std::string const& filename,
QPDF* qpdf,
char const* range) :
filename(filename),
qpdf(qpdf),
orig_pages(qpdf->getAllPages())
{
try
{
this->selected_pages =
QUtil::parse_numrange(range, this->orig_pa... | vuln | Vulnerable | Unknown |
static int gather_pid_metadata(
char* context[_CONTEXT_MAX],
char **comm_fallback,
struct iovec *iovec, size_t *n_iovec) {
/* We need 27 empty slots in iovec!
*
* Note that if we fail on oom later on, we do not roll-back changes to the iovec str... | vuln | Safe | Unknown |
void
free_buf_options(
buf_T *buf,
int free_p_ff)
{
if (free_p_ff)
{
clear_string_option(&buf->b_p_fenc);
clear_string_option(&buf->b_p_ff);
clear_string_option(&buf->b_p_bh);
clear_string_option(&buf->b_p_bt);
}
#ifdef FEAT_FIND_ID
clear_string_option(&buf->b_p_def);
clear_string_optio... | vuln | Safe | C/C++ |
/*
* IPv6 library code, needed by static components when full IPv6 support is
* not configured or static. These functions are needed by GSO/GRO implementation.
*/
#include <linux/export.h>
#include <net/ip.h>
#include <net/ipv6.h>
#include <net/ip6_fib.h>
#include <net/addrconf.h>
#include <net/secure_seq.h>
#inclu... | vuln | Safe | C/C++ |
void ClientSession::OnConnectionClosed(
protocol::ConnectionToClient* connection) {
DCHECK_EQ(connection_.get(), connection);
scoped_refptr<ClientSession> self = this;
event_handler_->OnSessionClosed(this);
Disconnect();
} | vuln | Vulnerable | C/C++ |
void TextTrackCue::setEndTime(double value) {
if (end_time_ == value || value < 0)
return;
CueWillChange();
end_time_ = value;
CueDidChange(kCueMutationAffectsOrder);
} | vuln | Vulnerable | C/C++ |
static int md_http_challenge_pr(request_rec *r)
{
apr_bucket_brigade *bb;
const md_srv_conf_t *sc;
const char *name, *data;
md_reg_t *reg;
int configured;
apr_status_t rv;
if (r->parsed_uri.path
&& !strncmp(ACME_CHALLENGE_PREFIX, r->parsed_uri.path, sizeof(ACME_CHALLENGE_PREFIX... | vuln | Safe | Unknown |
/*
* The MIT License
*
* Copyright (c) 2004-2010, Sun Microsystems, Inc., Kohsuke Kawaguchi
* Copyright (c) 2016, CloudBees 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 wi... | vuln | Safe | Java |
send_display_mode (GdmSession *self,
GdmSessionConversation *conversation)
{
GdmSessionDisplayMode mode;
mode = gdm_session_get_display_mode (self);
gdm_dbus_worker_call_set_session_display_mode (conversation->worker_proxy,
... | vuln | Vulnerable | Unknown |
static int add_metadata_from_side_data(AVCodecContext *avctx, AVFrame *frame)
{
int size, ret = 0;
const uint8_t *side_metadata;
const uint8_t *end;
side_metadata = av_packet_get_side_data(avctx->pkt,
AV_PKT_DATA_STRINGS_METADATA, &size);
if (!side_metadat... | vuln | Safe | 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 | Vulnerable | JavaScript |
def on_moved
Log.add_info(request, params.inspect)
return unless request.post?
location_id = params[:id]
SqlHelper.validate_token([location_id])
if location_id.blank?
location = Location.get_for(@login_user)
if location.nil?
location = Location.new
location.user_id = @... | vuln | Safe | Ruby |
static int append_ia5(STACK_OF(OPENSSL_STRING) **sk, const ASN1_IA5STRING *email)
{
char *emtmp;
/* First some sanity checks */
if (email->type != V_ASN1_IA5STRING)
return 1;
if (email->data == NULL || email->length == 0)
return 1;
if (memchr(email->data, 0, email->length) != NULL)
... | vuln | Safe | Unknown |
// SPDX-License-Identifier: GPL-2.0
/*
* Virtio-based remote processor messaging bus
*
* Copyright (C) 2011 Texas Instruments, Inc.
* Copyright (C) 2011 Google, Inc.
*
* Ohad Ben-Cohen <ohad@wizery.com>
* Brian Swetland <swetland@google.com>
*/
#define pr_fmt(fmt) "%s: " fmt, __func__
#include <linux/dma-mapp... | vuln | Safe | C/C++ |
static int get_client_hello(SSL *s)
{
int i, n;
unsigned long len;
unsigned char *p;
STACK_OF(SSL_CIPHER) *cs; /* a stack of SSL_CIPHERS */
STACK_OF(SSL_CIPHER) *cl; /* the ones we want to use */
STACK_OF(SSL_CIPHER) *prio, *allow;
int z;
/*
* This is a bit of a hack to check f... | vuln | Vulnerable | Unknown |
/*
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator p... | vuln | Vulnerable | Java |
def get_recipe_from_file(self, file):
recipe_xml = file
recipe = Recipe.objects.create(
name=recipe_xml.find('title').text.strip(),
created_by=self.request.user, internal=True, space=self.request.space)
if recipe_xml.find('preptime') is not None and recipe_xml.find('pre... | vuln | Safe | Python |
static void gen_rfi(DisasContext *ctx)
{
#if defined(CONFIG_USER_ONLY)
gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);
#else
if (unlikely(ctx->pr)) {
gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);
return;
}
gen_update_cfar(ctx, ctx->nip);
gen_helper_rfi(cpu_env);
gen... | vuln | Vulnerable | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.