code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
archive_write_disk_set_acls(struct archive *a, int fd, const char *name,
struct archive_acl *abstract_acl, __LA_MODE_T mode)
{
int ret = ARCHIVE_OK;
(void)mode; /* UNUSED */
if ((archive_acl_types(abstract_acl)
& ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) != 0) {
/* Solaris writes POSIX.1e access and default ACLs... | vuln | Vulnerable | C/C++ |
send(mail, done) {
// Sendmail strips this header line by itself
mail.message.keepBcc = true;
let envelope = mail.data.envelope || mail.message.getEnvelope();
let messageId = mail.message.messageId();
let args;
let sendmail;
let returned;
let transform;
... | vuln | Safe | JavaScript |
@Override
public void callSessionResumed(ImsCallProfile profile) {
TelephonyUtils.runWithCleanCallingIdentity(()-> {
if (mListener != null) {
mListener.callSessionResumed(ImsCallSession.this, profile);
}
}, mListenerExecutor);
} | vuln | Safe | Java |
static int tcos_decipher(sc_card_t *card, const u8 * crgram, size_t crgram_len, u8 * out, size_t outlen)
{
sc_context_t *ctx;
sc_apdu_t apdu;
u8 rbuf[SC_MAX_APDU_BUFFER_SIZE];
u8 sbuf[SC_MAX_APDU_BUFFER_SIZE];
tcos_data *data;
int tcos3, r;
assert(card != NULL && crgram != NULL && out != NULL);
ctx = card->ctx... | vuln | Vulnerable | C/C++ |
sfe_copy_data_fp (SNDFILE *outfile, SNDFILE *infile, int channels, int normalize)
{ static double data [BUFFER_LEN], max ;
sf_count_t frames, readcount, k ;
frames = BUFFER_LEN / channels ;
readcount = frames ;
sf_command (infile, SFC_CALC_SIGNAL_MAX, &max, sizeof (max)) ;
if (!isnormal (max)) /* neither zero, ... | vuln | Safe | Unknown |
public void broadcast(T t)
{
mLock.lock();
try
{
List<Listener<T>> listeners = new ArrayList<>(mListeners);
for(Listener listener: listeners)
{
listener.receive(t);
}
}
finally
{
mLock.unloc... | vuln | Safe | Java |
@Override
protected XrootdResponse<OpenRequest> doOnOpen(ChannelHandlerContext ctx, OpenRequest req)
{
/*
* TODO
*
* We ought to process this asynchronously to not block the calling thread during
* staging or queuing. We should also switch to an asynchronous reply mod... | vuln | Safe | Java |
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 insert starts... | vuln | Vulnerable | Unknown |
public String[] getPrjIds() {
return prjIds != null ? prjIds.clone() : null;
} | vuln | Safe | Java |
@app.route("/api/preferences/get/<key>")
def pref_get(key):
if get_user() is None:
return "Authentication required", 401
if key in get_preferences():
return Response(
json.dumps({'key': key, 'value': get_preferences()[key]}),
mimetype='application/json'
)
els... | vuln | Safe | Python |
static int exif_process_IFD_in_JPEG(image_info_type *ImageInfo, char *dir_start, char *offset_base, size_t IFDlength, size_t displacement, int section_index TSRMLS_DC)
{
int de;
int NumDirEntries;
int NextDirOffset;
#ifdef EXIF_DEBUG
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Process %s (x%04X(=%d))"... | vuln | Safe | Unknown |
public static boolean saveLinkList(HashMap<String, PortletInstitution> portletMap){
XStream xstream = XStreamHelper.createXStreamInstance();
xstream.alias("LinksPortlet", Map.class);
xstream.alias(ELEM_LINK, PortletLink.class);
xstream.alias(ELEM_INSTITUTION, PortletInstitution.class);
xstream.aliasAttribute(... | vuln | Vulnerable | Java |
def _create_3par_iscsi_host(self, hostname, iscsi_iqn, domain, persona_id):
"""Create a 3PAR host.
Create a 3PAR host, if there is already a host on the 3par using
the same iqn but with a different hostname, return the hostname
used by 3PAR.
"""
cmd = 'createhost -iscsi ... | vuln | Vulnerable | Python |
MagickExport MagickStatusType ParseMetaGeometry(const char *geometry,ssize_t *x,
ssize_t *y,size_t *width,size_t *height)
{
GeometryInfo
geometry_info;
MagickStatusType
flags;
size_t
former_height,
former_width;
/*
Ensure the image geometry is valid.
*/
assert(x != (ssize_t *) NULL)... | vuln | Vulnerable | C/C++ |
protected static Document loadXmlDoc(String uri) throws Exception {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.parse(uri);
return doc;
} | vuln | Vulnerable | Java |
/* 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 | C/C++ |
/*
* 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 | Safe | Java |
/*
* Copyright (c) 2012-2019 Belledonne Communications SARL.
*
* This file is part of belle-sip.
*
* 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 3 of the License, or
* (... | vuln | Safe | C/C++ |
public static function getUploadFileFromPost($siteID, $subDirectory, $id)
{
if (isset($_FILES[$id]))
{
if (!@file_exists($_FILES[$id]['tmp_name']))
{
// File was removed, accessed from another window, or no longer exists
return false;
... | vuln | Safe | PHP |
void SoftHEVC::setDecodeArgs(ivd_video_decode_ip_t *ps_dec_ip,
ivd_video_decode_op_t *ps_dec_op,
OMX_BUFFERHEADERTYPE *inHeader,
OMX_BUFFERHEADERTYPE *outHeader,
size_t timeStampIx) {
size_t sizeY = outputBufferWidth() * outputBufferHeight();
size_t sizeUV;
uint8_t *pBu... | vuln | Vulnerable | C/C++ |
void fslib_copy_libs(const char *full_path) {
assert(full_path);
if (arg_debug || arg_debug_private_lib)
printf(" fslib_copy_libs %s\n", full_path);
// if library/executable does not exist or the user does not have read access to it
// print a warning and exit the function.
if (access(full_path, R_OK)) {
i... | vuln | Vulnerable | Unknown |
protected function _joinPath($dir, $name) {
$sql = 'SELECT id FROM '.$this->tbf.' WHERE parent_id=\''.$dir.'\' AND name=\''.$this->db->real_escape_string($name).'\'';
if (($res = $this->query($sql)) && ($r = $res->fetch_assoc())) {
$this->updateCache($r['id'], $this->_stat($r['id']));
return $r['id'];
}
... | vuln | Safe | JavaScript |
R_API void r_core_fini(RCore *c) {
if (!c) {
return;
}
r_core_task_break_all (&c->tasks);
r_core_task_join (&c->tasks, NULL, -1);
r_core_wait (c);
/* TODO: it leaks as shit */
//update_sdb (c);
// avoid double free
r_list_free (c->ropchain);
r_event_free (c->ev);
free (c->cmdlog);
free (c->lastsearch);
R... | vuln | Safe | C/C++ |
@GuardedBy("mLock")
private @NonNull int[] setInitialGrantForNewImplicitPermissionsLocked(
@NonNull UidPermissionState origPs, @NonNull UidPermissionState ps,
@NonNull AndroidPackage pkg, @NonNull ArraySet<String> newImplicitPermissions,
@UserIdInt int userId, @NonNull int[] upda... | vuln | Safe | Java |
err_t verify_signed_hash(const struct RSA_public_key *k
, u_char *s, unsigned int s_max_octets
, u_char **psig
, size_t hash_len
, const u_char *sig_val, size_t sig_len)
{
unsigned int padlen;
/* actual exponent... | vuln | Safe | C/C++ |
extern int totem_config_read (
struct totem_config *totem_config,
const char **error_string,
uint64_t *warnings)
{
int res = 0;
char *str;
unsigned int ringnumber = 0;
int member_count = 0;
icmap_iter_t iter, member_iter;
const char *iter_key;
const char *member_iter_key;
char ringnumber_key[ICMAP_KEYNAME_MA... | vuln | Vulnerable | Unknown |
public function uploadCompanyLogo(CompanyLogoRequest $request)
{
$company = Company::find($request->header('company'));
$this->authorize('manage company', $company);
$data = json_decode($request->company_logo);
if ($data) {
$company = Company::find($request->header('co... | vuln | Safe | PHP |
private void setOptions() {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
ActivityManager am = Helper.getSystemService(getContext(), ActivityManager.class);
int class_mb = am.getMemoryClass();
int class_large_mb = am.getLargeMemoryClass();
... | vuln | Vulnerable | Java |
public PaginatedResult<ProjectCompact> getUserStarred(String userName, ProjectSortingStrategy sortingStrategy, RequestPagination pagination) {
getUserRequired(userName, usersDAO::getUser, User.class);
boolean canSeeHidden = getGlobalPermissions().has(Permission.SeeHidden);
List<ProjectCompact> p... | vuln | Safe | Java |
public TSet readSetBegin() throws TException {
return new TSet(readByte(), readI32());
} | vuln | Vulnerable | Java |
static int map_freeze(const union bpf_attr *attr)
{
int err = 0, ufd = attr->map_fd;
struct bpf_map *map;
struct fd f;
if (CHECK_ATTR(BPF_MAP_FREEZE))
return -EINVAL;
f = fdget(ufd);
map = __bpf_map_get(f);
if (IS_ERR(map))
return PTR_ERR(map);
if (map->map_type == BPF_MAP_TYPE_STRUCT_OPS ||
map_val... | vuln | Vulnerable | Unknown |
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */
/*
* md5_server.c -- Read one or more streams from the client and return
* MD5 sum of the payload.
*/
#include <assert.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/queue.h>
#i... | vuln | Vulnerable | C/C++ |
Set<String> allSources(String topic) {
Set<String> sources = new HashSet<>();
String source = replicationPolicy.topicSource(topic);
while (source != null) {
sources.add(source);
topic = replicationPolicy.upstreamTopic(topic);
source = replicationPolicy.topicSo... | vuln | Vulnerable | Java |
void janus_voicemail_setup_media(janus_plugin_session *handle) {
JANUS_LOG(LOG_INFO, "[%s-%p] WebRTC media is now available\n", JANUS_VOICEMAIL_PACKAGE, handle);
if(g_atomic_int_get(&stopping) || !g_atomic_int_get(&initialized))
return;
janus_mutex_lock(&sessions_mutex);
janus_voicemail_session *session = janus_v... | vuln | Safe | C/C++ |
int HeaderMapWrapper::luaGet(lua_State* state) {
const char* key = luaL_checkstring(state, 2);
const auto value =
Http::HeaderUtility::getAllOfHeaderAsString(headers_, Http::LowerCaseString(key));
if (value.result().has_value()) {
lua_pushlstring(state, value.result().value().data(), value.result().valu... | vuln | Safe | Unknown |
static int put_v4l2_ext_controls32(struct file *file,
struct v4l2_ext_controls __user *kp,
struct v4l2_ext_controls32 __user *up)
{
struct v4l2_ext_control32 __user *ucontrols;
struct v4l2_ext_control __user *kcontrols;
u32 count;
u32 n;
compat_caddr_t p;
if (!access_ok(VERIFY_WRITE, up, sizeof(*up... | vuln | Safe | Unknown |
void object_property_add_str(Object *obj, const char *name,
char *(*get)(Object *, Error **),
void (*set)(Object *, const char *, Error **),
Error **errp)
{
StringProperty *prop = g_malloc0(sizeof(*prop));
prop->get = get;
prop... | vuln | Vulnerable | C/C++ |
static void dec_sru(DisasContext *dc)
{
if (dc->format == OP_FMT_RI) {
LOG_DIS("srui r%d, r%d, %d\n", dc->r1, dc->r0, dc->imm5);
} else {
LOG_DIS("sru r%d, r%d, r%d\n", dc->r2, dc->r0, dc->r1);
}
if (!(dc->env->features & LM32_FEATURE_SHIFT)) {
if (dc->format == OP_FMT_RI) {
... | vuln | Vulnerable | C/C++ |
static int jsi_DbQuery(Jsi_Db *jdb, Jsi_CDataDb *dbopts, const char *query)
{
int k, cnt, erc = -1;
Jsi_CDataDb statbinds[] = {{}, {}};
if (!dbopts) dbopts = statbinds;
OptionBind ob = {.binds = dbopts};
Jsi_StructSpec *specPtr, *specs;
Jsi_Interp *interp = jdb->interp;
if (!query) query="";... | vuln | Safe | C/C++ |
table_regex_match(const char *string, const char *pattern)
{
regex_t preg;
int cflags = REG_EXTENDED|REG_NOSUB;
int ret;
if (strncmp(pattern, "(?i)", 4) == 0) {
cflags |= REG_ICASE;
pattern += 4;
}
if (regcomp(&preg, pattern, cflags) != 0)
return (0);
ret = regexec(&preg, string, 0, NULL, 0);
regfree(... | vuln | Safe | C/C++ |
function sanitizeShellString(str) {
let result = str;
result = result.replace(/>/g, "");
result = result.replace(/</g, "");
result = result.replace(/\*/g, "");
result = result.replace(/\?/g, "");
result = result.replace(/\[/g, "");
result = result.replace(/\]/g, "");
result = result.replace(/\|/g, "");
... | vuln | Vulnerable | JavaScript |
void Jp2Image::encodeJp2Header(const DataBuf& boxBuf,DataBuf& outBuf)
{
DataBuf output(boxBuf.size_ + iccProfile_.size_ + 100); // allocate sufficient space
int outlen = sizeof(Jp2BoxHeader) ; // now many bytes have we written to output?
int inlen = sizeof(Jp2BoxHeader) ; // how man... | vuln | Vulnerable | C/C++ |
void arm_sysctl_init(uint32_t base, uint32_t sys_id)
{
arm_sysctl_state *s;
int iomemtype;
s = (arm_sysctl_state *)qemu_mallocz(sizeof(arm_sysctl_state));
if (!s)
return;
s->base = base;
s->sys_id = sys_id;
iomemtype = cpu_register_io_memory(0, arm_sysctl_readfn,
... | vuln | Safe | C/C++ |
//
// Copyright 2021 The Sigstore Authors.
//
// 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 ... | vuln | Vulnerable | Go |
public T get() {
try {
return stage.toCompletableFuture().get();
} catch (ExecutionException ex) {
throw new ModelDBException(ex);
} catch (InterruptedException ex) {
// Restore interrupted state...
Thread.currentThread().interrupt();
throw new ModelDBException(ex);
}
} | vuln | Safe | Java |
static void
vty_self_insert_overwrite (struct vty *vty, char c)
{
vty_ensure (vty, vty->length + 1);
vty->buf[vty->cp++] = c;
if (vty->cp > vty->length)
vty->length++;
if ((vty->node == AUTH_NODE) || (vty->node == AUTH_ENABLE_NODE))
return;
vty_write (vty, &c, 1);
} | vuln | Vulnerable | C/C++ |
@Override
public void transform(ClassNode classNode, String name) {
for (MethodNode methodNode : classNode.methods) {
String methodName = mapMethodName(classNode, methodNode);
if (methodName.equals("removeTeam") || methodName.equals("func_96511_d")) {
methodNode.inst... | vuln | Vulnerable | Java |
QPDF::isEncrypted(int& R, int& P, int& V,
encryption_method_e& stream_method,
encryption_method_e& string_method,
encryption_method_e& file_method)
{
if (this->m->encp->encrypted)
{
QPDFObjectHandle trailer = getTrailer();
QPDFObjectHandle encrypt = traile... | vuln | Vulnerable | Unknown |
static MagickBooleanType WriteBMPImage(const ImageInfo *image_info,Image *image,
ExceptionInfo *exception)
{
BMPInfo
bmp_info;
const char
*option;
const StringInfo
*profile;
MagickBooleanType
have_color_info,
status;
MagickOffsetType
scene;
MemoryInfo
*pixel_info;
regis... | vuln | Safe | C/C++ |
cif_print_page(gx_device_printer *pdev, gp_file *prn_stream)
{ int line_size = gdev_mem_bytes_per_scan_line((gx_device *)pdev);
int lnum;
byte *in = (byte *)gs_malloc(pdev->memory, line_size, 1, "cif_print_page(in)");
char *s;
int scanline, scanbyte;
int length, start; /* length ... | vuln | Vulnerable | C/C++ |
static void mov_parse_stsd_video(MOVContext *c, AVIOContext *pb,
AVStream *st, MOVStreamContext *sc)
{
uint8_t codec_name[32] = { 0 };
int64_t stsd_start;
unsigned int len;
stsd_start = avio_tell(pb) - 16;
avio_rb16(pb);
avio_rb16(pb);
avio_rb32(pb);
... | vuln | Safe | C/C++ |
static inline void vc1_pred_mv_intfr(VC1Context *v, int n, int dmv_x, int dmv_y,
int mvn, int r_x, int r_y, uint8_t* is_intra, int dir)
{
MpegEncContext *s = &v->s;
int xy, wrap, off = 0;
int A[2], B[2], C[2];
int px = 0, py = 0;
int a_valid = 0, b_valid = 0, c_v... | vuln | Safe | C/C++ |
/* BGP attributes management routines.
* Copyright (C) 1996, 97, 98, 1999 Kunihiro Ishiguro
*
* This file is part of GNU Zebra.
*
* GNU Zebra 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 versi... | vuln | Vulnerable | C/C++ |
static int uhci_handle_td(UHCIState *s, UHCIQueue *q, uint32_t qh_addr,
UHCI_TD *td, uint32_t td_addr, uint32_t *int_mask)
{
int len = 0, max_len;
bool spd;
bool queuing = (q != NULL);
uint8_t pid = td->token & 0xff;
UHCIAsync *async = uhci_async_find_td(s, td_addr);
if... | vuln | Safe | C/C++ |
static void free_device_list(AVOpenCLDeviceList *device_list)
{
int i, j;
if (!device_list)
return;
for (i = 0; i < device_list->platform_num; i++) {
if (!device_list->platform_node[i])
continue;
for (j = 0; j < device_list->platform_node[i]->device_num; j++) {
... | vuln | Vulnerable | C/C++ |
package com.salesmanager.core.business.services.common.generic;
import java.io.Serializable;
import java.util.List;
import com.salesmanager.core.business.exception.ServiceException;
/**
* <p>Service racine pour la gestion des entités.</p>
*
* @param <T> type d'entité
*/
public interface SalesManagerEntityServic... | vuln | Safe | Java |
/* 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 | Vulnerable | Python |
long vorbis_book_decodev_add(codebook *book,float *a,oggpack_buffer *b,int n){
if(book->used_entries>0){
int i,j,entry;
float *t;
if(book->dim>8){
for(i=0;i<n;){
entry = decode_packed_entry_number(book,b);
if(entry==-1)return(-1);
t = book->valuelist+entry*book->dim;
... | vuln | Vulnerable | Unknown |
def _prepare_log_folder(self, directory: Path):
"""
Prepare the log folder and ensure its mode is as configured.
To handle log writing when tasks are impersonated, the log files need to
be writable by the user that runs the Airflow command and the user
that is impersonated. This... | vuln | Safe | Python |
@Inject(method = "clone",
at = @At(value = "FIELD", opcode = Opcodes.PUTFIELD, target = "Lnet/minecraft/entity/player/PlayerInventory;selectedSlot:I", shift = At.Shift.AFTER)
)
private void preventHotbarSelection(CallbackInfo ci) {
if (this.requiemLimiter != null && this.requiemLimiter.isSlotLoc... | vuln | Safe | Java |
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/browser/dom_storage/dom_storage_context_wrapper.h"
#include <string>
#include <vector>
#include "base/barrier_closure.h"
#include "bas... | vuln | Vulnerable | C/C++ |
static njs_int_t
njs_module_path(njs_vm_t *vm, const njs_str_t *dir, njs_module_info_t *info)
{
char *p;
size_t length;
njs_bool_t trail;
char src[NJS_MAX_PATH + 1];
trail = 0;
length = info->name.length;
if (dir != NULL) {
length += dir->length;
if (le... | vuln | Safe | C/C++ |
// Ogg Vorbis audio decoder - v1.16 - public domain
// http://nothings.org/stb_vorbis/
//
// Original version written by Sean Barrett in 2007.
//
// Originally sponsored by RAD Game Tools. Seeking implementation
// sponsored by Phillip Bennefall, Marc Andersen, Aaron Baker,
// Elias Software, Aras Pranckevicius, and Se... | vuln | Vulnerable | C/C++ |
static int bt_hci_name_req(struct bt_hci_s *hci, bdaddr_t *bdaddr)
{
struct bt_device_s *slave;
evt_remote_name_req_complete params;
int len;
for (slave = hci->device.net->slave; slave; slave = slave->next)
if (slave->page_scan && !bacmp(&slave->bd_addr, bdaddr))
break;
if (!slav... | vuln | Vulnerable | C/C++ |
int http_connect(int sockfd, const char *host, int port, AyProxyData *proxy)
{
/* step two : do proxy tunneling init */
char cmd[512];
char *inputline = NULL;
char *proxy_auth = NULL;
char debug_buff[512];
int remaining = sizeof(cmd) - 1;
remaining -= snprintf(cmd, sizeof(cmd), "CONNECT %s:%d HTTP/1.1\r\n", ho... | vuln | Vulnerable | C/C++ |
public function detach()
{
global $zdb, $hist;
try {
$update = $zdb->update(self::TABLE);
$update->set(
array('parent_group' => new Expression('NULL'))
)->where(
[self::PK => $this->id]
);
$edit = $zdb->exe... | vuln | Safe | PHP |
public void flushOutStream() {
if (disconnected || outStream == null || outStream.currentOffset == 0 || (session != null && !session.isActive())) {
return;
}
byte[] temp = new byte[outStream.currentOffset];
System.arraycopy(outStream.buffer, 0, temp, 0, temp.length);
// Packet packet = new Packet(-1, Type... | vuln | Safe | Java |
function V(u){return null!=u.Shadow?mxConstants.STYLE_SHADOW+"=1;":""} | vuln | Safe | JavaScript |
int unit_patch_contexts(Unit *u) {
CGroupContext *cc;
ExecContext *ec;
unsigned i;
int r;
assert(u);
/* Patch in the manager defaults into the exec and cgroup
* contexts, _after_ the rest of the settings have been
* initialized */
ec = unit_ge... | vuln | Safe | C/C++ |
ubpf_load_elf(struct ubpf_vm *vm, const void *elf, size_t elf_size, char **errmsg)
{
struct bounds b = { .base=elf, .size=elf_size };
void *text_copy = NULL;
int i;
const Elf64_Ehdr *ehdr = bounds_check(&b, 0, sizeof(*ehdr));
if (!ehdr) {
*errmsg = ubpf_error("not enough data for ELF header... | vuln | Safe | C/C++ |
static void do_subtitle_out(AVFormatContext *s,
OutputStream *ost,
InputStream *ist,
AVSubtitle *sub)
{
int subtitle_out_max_size = 1024 * 1024;
int subtitle_out_size, nb, i;
AVCodecContext *enc;
AVPacket pkt;
int64_... | vuln | Safe | C/C++ |
static void *sparc32_dma_init(target_phys_addr_t daddr, qemu_irq parent_irq,
void *iommu, qemu_irq *dev_irq)
{
DeviceState *dev;
SysBusDevice *s;
dev = qdev_create(NULL, "sparc32_dma");
qdev_prop_set_ptr(dev, "iommu_opaque", iommu);
qdev_init_nofail(dev);
s = sysbus... | vuln | Safe | C/C++ |
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2017, 2019 Nicira, Inc.
*
* 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/LICEN... | vuln | Safe | C/C++ |
SSH_PACKET_CALLBACK(ssh_packet_dh_reply){
int rc;
(void)type;
(void)user;
SSH_LOG(SSH_LOG_PROTOCOL,"Received SSH_KEXDH_REPLY");
if (session->session_state != SSH_SESSION_STATE_DH ||
session->dh_handshake_state != DH_STATE_INIT_SENT){
ssh_set_error(session,SSH_FATAL,"ssh_packet_dh_reply called in wrong... | vuln | Safe | C/C++ |
void ResourceTracker::CleanupInstanceData(PP_Instance instance,
bool delete_instance) {
DLOG_IF(ERROR, !CheckIdType(instance, PP_ID_TYPE_INSTANCE))
<< instance << " is not a PP_Instance.";
InstanceMap::iterator found = instance_map_.find(instance);
if (found == inst... | vuln | Safe | C/C++ |
void ensureFits(long numOfAdditionalOps) {
if (size >= opBuffer.length - numOfAdditionalOps) {
int newLength = opBuffer.length;
while (size >= newLength - numOfAdditionalOps) {
newLength *= 2;
}
opBuffer = Arrays.copyOf(opBuffer, newLength);
... | vuln | Vulnerable | Java |
public JavaCompilerService getCompiler(Project project, JavaModule module) {
List<Module> dependencies = new ArrayList<>();
if (project != null) {
dependencies.addAll(project.getDependencies(module));
}
Set<File> paths = new HashSet<>();
paths.addAll(module.getJavaF... | vuln | Vulnerable | Java |
static void cmd_capabilities(char *keyword __attribute__((unused)))
{
const char *mechlist;
int mechcount = 0;
prot_printf(nntp_out, "101 Capability list follows:\r\n");
prot_printf(nntp_out, "VERSION 2\r\n");
if (nntp_authstate || (config_serverinfo == IMAP_ENUM_SERVERINFO_ON)) {
prot_printf(nntp... | vuln | Vulnerable | Unknown |
// Copyright 2014 The Gogs Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package cmd
import (
"crypto/tls"
"fmt"
"io"
"net"
"net/http"
"net/http/fcgi"
"os"
"path/filepath"
"strings"
"github.com/go-macaron/binding"
"git... | vuln | Safe | Go |
/* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICENSE. */
/*
* lsquic_trans_params.c
*/
#include <assert.h>
#include <errno.h>
#include <inttypes.h>
#include <limits.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#ifndef WIN32
#include <arpa/inet.h>
#include <sys/socket.h>
#else
#inc... | vuln | Safe | C/C++ |
void iothread_stop(IOThread *iothread)
{
if (!iothread->ctx || iothread->stopping) {
return;
}
iothread->stopping = true;
aio_notify(iothread->ctx);
if (atomic_read(&iothread->main_loop)) {
g_main_loop_quit(iothread->main_loop);
}
qemu_thread_join(&iothread->thread);
} | vuln | Vulnerable | C/C++ |
handle_raw_ping(struct query *q, int dns_fd, int userid)
{
if (check_authenticated_user_and_ip(userid, q) != 0) {
return;
}
if (!users[userid].authenticated_raw) return;
/* Update query and time info for user */
users[userid].last_pkt = time(NULL);
memcpy(&(users[userid].q), q, sizeof(struct query));
if (deb... | vuln | Safe | Unknown |
txBoolean fxProxyDefineOwnProperty(txMachine* the, txSlot* instance, txID id, txIndex index, txSlot* slot, txFlag mask)
{
txBoolean result;
mxProxyDeclarations(_defineProperty);
if (function) {
/* THIS */
mxPushSlot(handler);
/* FUNCTION */
mxPushSlot(function);
mxCall();
/* ARGUMENTS */
mxPushSlot(tar... | vuln | Safe | C/C++ |
void MediaStreamDispatcherHost::CancelRequest(int page_request_id) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
media_stream_manager_->CancelRequest(render_process_id_, render_frame_id_,
requester_id_, page_request_id);
} | vuln | Safe | C/C++ |
bool extractPages (const char *srcFileName, const char *destFileName) {
char pathName[1024];
GooString *gfileName = new GooString (srcFileName);
PDFDoc *doc = new PDFDoc (gfileName, NULL, NULL, NULL);
if (!doc->isOk()) {
error(errSyntaxError, -1, "Could not extract page(s) from damaged file ('{0:s}')", ... | vuln | Vulnerable | C/C++ |
main(
int argc,
char ** argv)
{
#ifdef GNUTAR
int i;
char *e;
char *dbf;
char *cmdline;
GPtrArray *array = g_ptr_array_new();
gchar **strings;
char **new_argv;
char **env;
#endif
int good_option;
if (argc > 1 && argv[1] && g_str_equal(argv[1], "--version")) {
printf("r... | vuln | Safe | Unknown |
// Copyright (c) 2020 WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
//
// WSO2 Inc. licenses this file to you 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/licens... | vuln | Vulnerable | Java |
public boolean getShouldShowLM_Nametag(){
if (!getPDCLock()) return true;
try {
return !getPDC().has(main.namespaced_keys.denyLM_Nametag, PersistentDataType.INTEGER);
}
finally {
releasePDCLock();
}
} | vuln | Safe | Java |
static int do_anonymous_page(struct vm_fault *vmf)
{
struct vm_area_struct *vma = vmf->vma;
struct mem_cgroup *memcg;
struct page *page;
pte_t entry;
/* File mapping without ->vm_ops ? */
if (vma->vm_flags & VM_SHARED)
return VM_FAULT_SIGBUS;
/*
* Use pte_alloc() instead of pte_alloc_map(). We can't run
... | vuln | Safe | Unknown |
static void imx_serial_write(void *opaque, hwaddr offset,
uint64_t value, unsigned size)
{
IMXSerialState *s = (IMXSerialState *)opaque;
unsigned char ch;
DPRINTF("write(offset=0x%" HWADDR_PRIx ", value = 0x%x) to %s\n",
offset, (unsigned int)value, s->chr ? s->chr->... | vuln | Vulnerable | C/C++ |
public void setPlayerHeadPose(PlayerEntity player, Pose pose) {
PlayerEntityAcc acc = (PlayerEntityAcc) player;
if (acc.getHeadPose() == null) {
acc.markVR();
}
acc.getHeadPose().set(pose);
if (player instanceof ClientPlayerEntity) {
PacketByteBuf buf = P... | vuln | Vulnerable | Java |
static BOOL rfx_process_message_tileset(RFX_CONTEXT* context, RFX_MESSAGE* message, wStream* s,
UINT16* pExpectedBlockType)
{
BOOL rc;
size_t close_cnt = 0;
BYTE quant;
RFX_TILE* tile;
UINT32* quants;
UINT16 subtype, numTiles;
UINT32 blockLen;
UINT32 blockType;
UINT32 ti... | vuln | Vulnerable | C/C++ |
void scsi_req_cancel_async(SCSIRequest *req, Notifier *notifier)
{
trace_scsi_req_cancel(req->dev->id, req->lun, req->tag);
if (notifier) {
notifier_list_add(&req->cancel_notifiers, notifier);
scsi_req_ref(req);
scsi_req_dequeue(req);
req->io_canceled = true;
if (req->aiocb) {
bl... | vuln | Vulnerable | C/C++ |
float16 float32_to_float16(float32 a, flag ieee STATUS_PARAM)
{
flag aSign;
int_fast16_t aExp;
uint32_t aSig;
uint32_t mask;
uint32_t increment;
int8 roundingMode;
int maxexp = ieee ? 15 : 16;
bool rounding_bumps_exp;
bool is_tiny = false;
a = float32_squash_input_denormal(a STAT... | vuln | Safe | C/C++ |
static ssize_t runtime_pm_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct device_link *link = to_devlink(dev);
return sprintf(buf, "%d\n", !!(link->flags & DL_FLAG_PM_RUNTIME));
} | vuln | Vulnerable | Unknown |
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
switch (yytype)
{
case 16: /* tokens */
#line 94 "hex_grammar.y" /* yacc.c:1257 */
{ yr_re_node_destroy(((*yyvaluep).re_node)); }
#line 1023 "hex_grammar.c" /* yacc.c:1257 */
break;
case 17: /* token_sequence */
#line 95 "hex_grammar.y" /* yacc.... | vuln | Vulnerable | C/C++ |
def get_conn(self) -> Jira:
if not self.client:
self.log.debug("Creating Jira client for conn_id: %s", self.jira_conn_id)
verify = True
if not self.jira_conn_id:
raise AirflowException("Failed to create jira client. no jira_conn_id provided")
con... | vuln | Safe | Python |
static int coroutine_fn bdrv_mirror_top_flush(BlockDriverState *bs)
{
return bdrv_co_flush(bs->backing->bs); | vuln | Vulnerable | C/C++ |
var fs = require('fs')
var path = require('path')
var request = require('teeny-request').teenyRequest
var urlgrey = require('urlgrey')
var jsYaml = require('js-yaml')
var walk = require('ignore-walk')
var execSync = require('child_process').execSync
var detectProvider = require('./detect')
var version = 'v' + require... | vuln | Safe | JavaScript |
var tag = function tag(tagName, attrsMap, content, contentIsEscaped) {
var safeTagName = htmlEscape(tagName);
var attrsHTML = !is.array(attrsMap) ? attrs(attrsMap) : attrsMap.reduce(function (html, map) {
return html + attrs(map);
}, '');
var safeContent = contentIsEscaped ? content : htmlEscape... | vuln | Safe | JavaScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.