code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
lyd_new_output(struct lyd_node *parent, const struct lys_module *module, const char *name)
{
const struct lys_node *snode = NULL, *siblings;
if ((!parent && !module) || !name) {
LOGARG;
return NULL;
}
siblings = lyd_new_find_schema(parent, module, 1);
if (!siblings) {
LOGAR... | vuln | Safe | Unknown |
dns_resolve_impl(edge_connection_t *exitconn, int is_resolve,
or_circuit_t *oncirc, char **hostname_out,
int *made_connection_pending_out)
{
cached_resolve_t *resolve;
cached_resolve_t search;
pending_connection_t *pending_connection;
const routerinfo_t *me;
tor_addr_t addr;
... | vuln | Safe | Unknown |
void ff_riff_write_info_tag(AVIOContext *pb, const char *tag, const char *str)
{
size_t len = strlen(str);
if (len > 0 && len < UINT32_MAX) {
len++;
ffio_wfourcc(pb, tag);
avio_wl32(pb, len);
avio_put_str(pb, str);
if (len & 1)
avio_w8(pb, 0);
}
} | vuln | Safe | C/C++ |
void ssl_cert_free(CERT *c)
{
int i;
if(c == NULL)
return;
i=CRYPTO_add(&c->references,-1,CRYPTO_LOCK_SSL_CERT);
#ifdef REF_PRINT
REF_PRINT("CERT",c);
#endif
if (i > 0) return;
#ifdef REF_CHECK
if (i < 0)
{
fprintf(stderr,"ssl_cert_free, bad reference count\n");
abort(); /* ok */
}
#endif
#ifndef... | vuln | Safe | Unknown |
static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
int *got_packet)
{
X264Context *x4 = ctx->priv_data;
x264_nal_t *nal;
int nnal, i, ret;
x264_picture_t pic_out = {0};
x264_picture_init( &x4->pic );
x4->pic.img.i_csp = x4->params.i_csp;
i... | vuln | Safe | C/C++ |
////////////////////////////////////////////////////////////////////////////
// **** WAVPACK **** //
// Hybrid Lossless Wavefile Compressor //
// Copyright (c) 1998 - 2019 David Bryant. //
// ... | vuln | Vulnerable | C/C++ |
def cat(path, identifier=nil)
p = CGI.escape(scm_iconv(@path_encoding, 'UTF-8', path))
hg 'rhcat', "-r#{CGI.escape(hgrev(identifier))}", '--', hgtarget(p) do |io|
io.binmode
io.read
end
rescue HgCommandAborted
nil # means not found
end | vuln | Safe | Ruby |
static int xan_decode_init(AVCodecContext *avctx)
{
XanContext *s = avctx->priv_data;
int i;
s->avctx = avctx;
if ((avctx->codec->id == CODEC_ID_XAN_WC3) &&
(s->avctx->palctrl == NULL)) {
av_log(avctx, AV_LOG_ERROR, " WC3 Xan video: palette expected.\n");
return -1;
}
av... | vuln | Safe | C/C++ |
static int tftp_session_allocate(Slirp *slirp, struct sockaddr_storage *srcsas,
struct tftp_t *tp)
{
struct tftp_session *spt;
int k;
for (k = 0; k < TFTP_SESSIONS_MAX; k++) {
spt = &slirp->tftp_sessions[k];
if (!tftp_session_in_use(spt))
goto found;
if ((... | vuln | Safe | C/C++ |
ipmi_fru_print(struct ipmi_intf * intf, struct sdr_record_fru_locator * fru)
{
char desc[17];
uint8_t bridged_request = 0;
uint32_t save_addr;
uint32_t save_channel;
int rc = 0;
if (!fru)
return __ipmi_fru_print(intf, 0);
/* Logical FRU Device
* dev_type == 0x10
* modifier
* 0x00 = IPMI FRU Inventory... | vuln | Vulnerable | Unknown |
@Override
public boolean convertToTranslucent(IBinder token, Bundle options) {
final SafeActivityOptions safeOptions = SafeActivityOptions.fromBundle(options);
final long origId = Binder.clearCallingIdentity();
try {
synchronized (mGlobalLock) {
final ActivityReco... | vuln | Vulnerable | Java |
@SuppressWarnings("UnstableApiUsage")
@Override
protected ModularUI buildUI(ModularUI.Builder builder, EntityPlayer player) {
WidgetGroup filterGroup = new WidgetGroup();
filterGroup.addWidget(new CycleButtonWidget(92, 43, 75, 18,
TransferMode.class, this::getTransferMode, this::... | vuln | Safe | Java |
public function show_screen_options() {
global $wp_meta_boxes;
if ( is_bool( $this->_show_screen_options ) )
return $this->_show_screen_options;
$columns = get_column_headers( $this );
$show_screen = ! empty( $wp_meta_boxes[ $this->id ] ) || $columns || $this->get_option( 'per_page' );
switch ( $this->... | vuln | Safe | PHP |
void constructOutlines(PdfDictionary outlineRoot, Map<String, PdfObject> names) {
if (outlineRoot == null) {
return;
}
PdfReader reader = getDocument().getReader();
final boolean isLenientLevel =
reader == null || StrictnessLevel.CONSERVATIVE.isStricter(reade... | vuln | Safe | Java |
# -*- 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 |
int am_read_post_data(request_rec *r, char **data, apr_size_t *length)
{
apr_size_t bytes_read;
apr_size_t bytes_left;
apr_size_t len;
long read_length;
int rc;
/* Prepare to receive data from the client. We request that apache
* dechunks data if it is chunked.
*/
rc = ap_setup_cl... | vuln | Vulnerable | C/C++ |
static int pin_sdma_pages(struct user_sdma_request *req,
struct user_sdma_iovec *iovec,
struct sdma_mmu_node *node,
int npages)
{
int pinned, cleared;
struct page **pages;
struct hfi1_user_sdma_pkt_q *pq = req->pq;
pages = kcalloc(npages, sizeof(*pages), GFP_KERNEL);
if (!pages)
return -ENOMEM;
... | vuln | Vulnerable | Unknown |
static int ipx_recvmsg(struct kiocb *iocb, struct socket *sock,
struct msghdr *msg, size_t size, int flags)
{
struct sock *sk = sock->sk;
struct ipx_sock *ipxs = ipx_sk(sk);
struct sockaddr_ipx *sipx = (struct sockaddr_ipx *)msg->msg_name;
struct ipxhdr *ipx = NULL;
struct sk_buff *skb;
int copied, rc;
lock_s... | vuln | Safe | C/C++ |
def task_failed_deps(args) -> None:
"""
Get task instance dependencies that were not met.
Returns the unmet dependencies for a task instance from the perspective of the
scheduler (i.e. why a task instance doesn't get scheduled and then queued by the
scheduler, and then run by an executor).
>>> ... | vuln | Vulnerable | Python |
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/*************************************************************
*
* MathJax/extensions/TeX/unicode.js
*
* Implements the \unicode extension to TeX to allow arbitrary unicode
* code points to be entered ... | vuln | Vulnerable | Java |
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
TF_LITE_ENSURE_EQ(context, NumInputs(node), 3);
TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1);
const TfLiteTensor* input;
TF_LITE_ENSURE_OK(context, GetInputSafe(context, node, kInputTensor, &input));
const TfLiteTensor* begin;
TF_LITE_ENSU... | vuln | Safe | C/C++ |
ArgParser::argOiMinHeight(char* parameter)
{
o.oi_min_height = QUtil::string_to_int(parameter);
} | vuln | Vulnerable | Unknown |
@Override
public void tick() {
if (this.moveTarget != null) {
if (this.moveTarget.isValid()) {
float accessDistance = 1.86f;
//when approaching a chest, open it visually
double distance = this.entity.getPositionVec().distanceTo(Math3DUtil.center(t... | vuln | Safe | Java |
R_API RBinJavaAttrInfo *r_bin_java_inner_classes_attr_new(RBinJavaObj *bin, ut8 *buffer, ut64 sz, ut64 buf_offset) {
RBinJavaClassesAttribute *icattr;
RBinJavaAttrInfo *attr = NULL;
RBinJavaCPTypeObj *obj;
ut32 i = 0;
ut64 offset = 0, curpos;
attr = r_bin_java_default_attr_new (bin, buffer, sz, buf_offset);
offs... | vuln | Vulnerable | C/C++ |
private void continueSearch() {
final String query = getSearchOwner() != null ? getSearchOwner().getSearchQuery() : "";
DataLoader.getInstance().load(getContext(), new DataLoaderListener<List<LogEntryListItem>>() {
@Override
public List<LogEntryListItem> onShouldLoad() {
... | vuln | Safe | Java |
hb_buffer_ensure_separate (hb_buffer_t *buffer, unsigned int size)
{
if (unlikely (!hb_buffer_ensure (buffer, size))) return FALSE;
if (buffer->out_info == buffer->info)
{
assert (buffer->have_output);
buffer->out_info = (hb_internal_glyph_info_t *) buffer->pos;
memcpy (buffer->out_info, buff... | vuln | Safe | C/C++ |
/*
* midi.c -- Midi Wavetable Processing library
*
* Copyright (C) WildMIDI Developers 2001-2016
*
* This file is part of WildMIDI.
*
* WildMIDI is free software: you can redistribute and/or modify the player
* under the terms of the GNU General Public License and you can redistribute
* and/or modify the libra... | vuln | Safe | C/C++ |
private void doFree(final DownloadLink link, final boolean resumable, final int maxchunks) throws Exception, PluginException {
if (link.getBooleanProperty(PROPERTY_DANGEROUS_FILE, false)) {
throw new PluginException(LinkStatus.ERROR_FATAL, "This file contains malicious software");
} else if ... | vuln | Vulnerable | Java |
static int mp3_read_probe(AVProbeData *p)
{
int max_frames, first_frames;
int fsize, frames, sample_rate;
uint32_t header;
uint8_t *buf, *buf2, *end;
AVCodecContext avctx;
if(id3v2_match(p->buf))
return AVPROBE_SCORE_MAX/2+1;
max_frames = 0;
buf = p->buf;
end = buf + FFMIN(4... | vuln | Vulnerable | C/C++ |
nbd_unlocked_opt_go (struct nbd_handle *h)
{
int err;
nbd_completion_callback c = { .callback = go_complete, .user_data = &err };
int r = nbd_unlocked_aio_opt_go (h, &c);
if (r == -1)
return r;
r = wait_for_option (h);
if (r == 0 && err) {
assert (nbd_internal_is_state_negotiating (get_next_state ... | vuln | Vulnerable | C/C++ |
package tyk
import (
"bytes"
"encoding/json"
"errors"
"io"
"io/ioutil"
"net/http"
"net/url"
"strings"
"sync"
"time"
logger "github.com/TykTechnologies/tyk-identity-broker/log"
"github.com/markbates/goth"
"github.com/sirupsen/logrus"
"gopkg.in/mgo.v2/bson"
)
var onceReloadTykApiLogger sync.Once
var log ... | vuln | Safe | Go |
void MediaStreamDispatcherHost::DoOpenDevice(
int32_t page_request_id,
const std::string& device_id,
blink::MediaStreamType type,
OpenDeviceCallback callback,
MediaDeviceSaltAndOrigin salt_and_origin) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (!MediaStreamManager::IsOriginAllowed(render_proce... | vuln | Vulnerable | Unknown |
static int nfc_genl_deactivate_target(struct sk_buff *skb,
struct genl_info *info)
{
struct nfc_dev *dev;
u32 device_idx, target_idx;
int rc;
if (!info->attrs[NFC_ATTR_DEVICE_INDEX] ||
!info->attrs[NFC_ATTR_TARGET_INDEX])
return -EINVAL;
device_idx = nla_get_u32(info->attrs[NFC_ATTR_DEVICE... | vuln | Safe | C/C++ |
const bootbox = require('bootbox');
require('../services/Requisitions');
require('../services/Synchronize');
/**
* @author Alejandro Galue <agalue@opennms.org>
* @copyright 2014 The OpenNMS Group, Inc.
*/
(function() {
'use strict';
const quickAddNodeView = require('../../views/quick-add-node.html');
const c... | vuln | Vulnerable | Java |
protected void doHead(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
if (legacyHeadHandling) {
NoBodyResponse response = new NoBodyResponse(resp);
doGet(req, response);
response.setContentLength();
} else {
doGet(r... | vuln | Safe | Java |
@Override
public void eject() {
// TODO: Uninject from players currently online to prevent protocol lib issues.
if (PaperChannelInjector.PAPER_INJECTION_METHOD) {
try {
PaperChannelInjector.removePaperChannelInitializeListener();
} catch (ReflectiveOperationEx... | vuln | Vulnerable | Java |
static void read_pnm_header(FILE *reader, struct pnm_header *ph)
{
int format, have_wh, end, ttype;
char idf[256], type[256];
char line[256];
if (fgets(line, 250, reader) == NULL)
{
fprintf(stderr,"\nWARNING: fgets return a NULL value");
return;
}
if(line[0] != 'P')
{
... | vuln | Vulnerable | C/C++ |
/*
* Copyright 2016 Red Hat, Inc. and/or its affiliates
* and other 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 License at
*
* http://www.apach... | vuln | Vulnerable | Java |
inbound_cap_ls (server *serv, char *nick, char *extensions_str,
const message_tags_data *tags_data)
{
char buffer[256]; /* buffer for requesting capabilities and emitting the signal */
gboolean want_cap = FALSE; /* format the CAP REQ string based on previous capabilities being requested or not */
gboolean want... | vuln | Safe | C/C++ |
void ImplPolygon::ImplSplit( sal_uInt16 nPos, sal_uInt16 nSpace, ImplPolygon const * pInitPoly )
{
//Can't fit this in :-(, throw ?
if (mnPoints + nSpace > USHRT_MAX)
return;
const sal_uInt16 nNewSize = mnPoints + nSpace;
const std::size_t nSpaceSize = static_cast<std::size_t>(nSpace) * si... | vuln | Vulnerable | C/C++ |
resolve_superior_type(const char *name, const char *mod_name, const struct lys_module *module,
const struct lys_node *parent, struct lys_tpdf **ret)
{
int i, j;
struct lys_tpdf *tpdf, *match;
int tpdf_size;
if (!mod_name) {
/* no prefix, try built-in types */
for (... | vuln | Vulnerable | C/C++ |
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2021 MinIO, Inc.
//
// This program 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 ... | vuln | Safe | Go |
protected UploadServer getOneServer() {
if (host == null || host.length() == 0) {
return null;
}
List<UploadIpGroup> ipGroups = null;
synchronized (this) {
ipGroups = ipGroupList;
}
if (ipGroups != null && ipGroups... | vuln | Safe | Java |
private void checkAuthorizedScripts(List<SelectionScript> scripts) {
updateAuthorizedScriptsSignatures();
if (authorizedSelectionScripts == null || scripts == null)
return;
for (SelectionScript script : scripts) {
checkContentAuthorization(script.fetchScript());
... | vuln | Vulnerable | Java |
javascript: function () {
var j = i, e;
if (input.charAt(j) === '~') { j++; e = true; } // Escaped strings
if (input.charAt(j) !== '`') { return; }
error("You are using JavaScript, which has been disabled.");
} | vuln | Safe | JavaScript |
parseuid(const char *s, uid_t *uid)
{
struct passwd *pw;
#if !defined(__linux__) && !defined(__NetBSD__)
const char *errstr = NULL;
#else
int status;
#endif
if ((pw = getpwnam(s)) != NULL) {
*uid = pw->pw_uid;
return 0;
}
#if !defined(__linux__) && !defined(__NetBSD__)
*uid = strtonu... | vuln | Safe | C/C++ |
package org.openmrs.module.htmlformentryui.page.controller.htmlform;
import org.apache.commons.lang.StringUtils;
import org.openmrs.Encounter;
import org.openmrs.api.AdministrationService;
import org.openmrs.module.emrapi.patient.PatientDomainWrapper;
import org.openmrs.module.htmlformentry.HtmlForm;
import org.openmr... | vuln | Safe | Java |
private Result<Object> verifyFile(String name, ResourceType type, MultipartFile file) {
Result<Object> result = new Result<>();
putMsg(result, Status.SUCCESS);
if (file != null) {
// file is empty
if (file.isEmpty()) {
logger.error("file is empty: {}", Reg... | vuln | Vulnerable | Java |
void CLua::init_libraries()
{
lua_stack_cleaner clean(state());
lua_pushcfunction(_state, lua_loadstring);
lua_setglobal(_state, "loadstring");
lua_pushnil(_state);
lua_setglobal(_state, "load");
// Open Crawl bindings
cluaopen_kills(_state);
cluaopen_you(_state);
cluaopen_item(_st... | vuln | Safe | Unknown |
@AttackVector(
vulnerabilityExposed = VulnerabilityType.SIMPLE_SSRF,
description = "FILE_URL_IF_NOT_FILE_PROTOCOL",
payload = "SSRF_PAYLOAD_LEVEL_2")
@VulnerableAppRequestMapping(value = LevelConstants.LEVEL_2, htmlTemplate = "LEVEL_1/SSRF")
public ResponseEntity<GenericVulne... | vuln | Vulnerable | Java |
AviaryScheddPlugin::processJob(const char *key,
const char *,
int )
{
PROC_ID id;
ClassAd *jobAd;
if (!IS_JOB(key)) return false;
id = getProcByString(key);
if (id.cluster <= 0 || id.proc < 0) {
dprintf(D_FULLDEBUG, "Failed to parse key: %s - skipping\n", key);
... | vuln | Safe | C/C++ |
/*
* 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 av_cold int libgsm_encode_init(AVCodecContext *avctx) {
if (avctx->channels > 1) {
av_log(avctx, AV_LOG_ERROR, "Mono required for GSM, got %d channels\n",
avctx->channels);
return -1;
}
if (avctx->sample_rate != 8000) {
av_log(avctx, AV_LOG_ERROR, "Sample rate 8... | vuln | Safe | C/C++ |
private static void onRestoreComplete(int returnCode, Context context, IntentSender target) {
Intent fillIn = new Intent();
fillIn.putExtra(PackageInstaller.EXTRA_STATUS,
PackageManager.installStatusToPublicStatus(returnCode));
try {
final BroadcastOptions options = B... | vuln | Safe | Java |
static size_t curl_write_header(char *data, size_t size, size_t nmemb, void *ctx)
{
php_curl *ch = (php_curl *) ctx;
php_curl_write *t = ch->handlers->write_header;
size_t length = size * nmemb;
TSRMLS_FETCH_FROM_CTX(ch->thread_ctx);
switch (t->method) {
case PHP_CURL_STDOUT:
/* Handle spec... | vuln | Safe | Unknown |
struct parsed_tag *
parse_tag(char **s, int internal)
{
struct parsed_tag *tag = NULL;
int tag_id;
char tagname[MAX_TAG_LEN], attrname[MAX_TAG_LEN];
char *p, *q;
int i, attr_id = 0, nattr;
/* Parse tag name */
q = (*s) + 1;
p = tagname;
if (*q == '/') {
*(p++) = *(q++);
SKIP_BLANK... | vuln | Vulnerable | C/C++ |
spnego_gss_context_time(
OM_uint32 *minor_status,
const gss_ctx_id_t context_handle,
OM_uint32 *time_rec)
{
OM_uint32 ret;
ret = gss_context_time(minor_status,
context_handle,
time_rec);
return (ret);
} | vuln | Vulnerable | C/C++ |
_gnutls_proc_x509_server_certificate (gnutls_session_t session,
uint8_t * data, size_t data_size)
{
int size, len, ret;
uint8_t *p = data;
cert_auth_info_t info;
gnutls_certificate_credentials_t cred;
ssize_t dsize = data_size;
int i;
gnutls_pcert_st *peer_certificate... | vuln | Vulnerable | Unknown |
function advancedFilterSearch($queue, $filter)
{
global $array_ged_packets;
global $array_ged_queues;
global $database_ged;
$datas = array();
if(!in_array($queue,$array_ged_queues)) { $queue=$array_ged_queues[0]; }
if($filter == "description"){
echo json_encode($datas);
return false;
}
$gedsql_result1=s... | vuln | Safe | PHP |
def render(self, name, value, attrs=None):
html = super(AdminURLFieldWidget, self).render(name, value, attrs)
if value:
value = force_text(self._format_value(value))
final_attrs = {'href': smart_urlquote(value)}
html = format_html(
'<p class="url">{0} ... | vuln | Safe | Python |
async def get_permissions(self, request):
identity_policy = request.config_dict.get('aiohttp_security_identity_policy')
identity = await identity_policy.identify(request)
if identity in self.user_map:
return [self.Access[p.upper()] for p in self.user_map[identity].permissions]
... | vuln | Safe | Python |
static void *dispatch_userdata(const JsonDispatch *p, void *userdata) {
/* When the the userdata pointer is passed in as NULL, then we'll just use the offset as a literal
* address, and convert it to a pointer. Note that might as well just add the offset to the NULL
* pointer, but UndefinedB... | vuln | Safe | C/C++ |
static void gen_addq_lo(DisasContext *s, TCGv_i64 val, int rlow)
{
TCGv_i64 tmp;
TCGv tmp2;
tmp = tcg_temp_new_i64();
tmp2 = load_reg(s, rlow);
tcg_gen_extu_i32_i64(tmp, tmp2);
tcg_temp_free_i32(tmp2);
tcg_gen_add_i64(val, val, tmp);
tcg_temp_free_i64(tmp);
} | vuln | Safe | C/C++ |
public static boolean isInRange (final ButtonID buttonID, final ButtonID firstButtonID, final int length)
{
return buttonID != null && ButtonID.get (firstButtonID, length - 1).ordinal () - buttonID.ordinal () >= 0;
} | vuln | Vulnerable | Java |
zsethalftone5(i_ctx_t *i_ctx_p)
{
os_ptr op = osp;
uint count;
gs_halftone_component *phtc = 0;
gs_halftone_component *pc;
int code = 0;
int j;
bool have_default;
gs_halftone *pht = 0;
gx_device_halftone *pdht = 0;
ref sprocs[GS_CLIENT_COLOR_MAX_COMPONENTS + 1];
ref tprocs[GS... | vuln | Safe | Unknown |
static Image *ReadOneDJVUImage(LoadContext* lc,const int pagenum,
const ImageInfo *image_info,ExceptionInfo *exception)
{
ddjvu_page_type_t
type;
ddjvu_pageinfo_t info;
ddjvu_message_t *message;
Image *image;
int logging;
int tag;
/* so, we know that the page is there! Get its dimensio... | vuln | Vulnerable | C/C++ |
void cipso_v4_doi_putdef(struct cipso_v4_doi *doi_def)
{
if (!doi_def)
return;
if (!refcount_dec_and_test(&doi_def->refcount))
return;
cipso_v4_cache_invalidate();
call_rcu(&doi_def->rcu, cipso_v4_doi_free_rcu);
} | vuln | Safe | Unknown |
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;
/* Check if we need to add a guard page to the stack */
if (check... | vuln | Vulnerable | Unknown |
static void qemu_input_queue_process(void *opaque)
{
struct QemuInputEventQueueHead *queue = opaque;
QemuInputEventQueue *item;
g_assert(!QTAILQ_EMPTY(queue));
item = QTAILQ_FIRST(queue);
g_assert(item->type == QEMU_INPUT_QUEUE_DELAY);
QTAILQ_REMOVE(queue, item, node);
queue_count--;
g_... | vuln | Safe | Unknown |
int ssl3_connect(SSL *s)
{
BUF_MEM *buf=NULL;
unsigned long Time=(unsigned long)time(NULL);
void (*cb)(const SSL *ssl,int type,int val)=NULL;
int ret= -1;
int new_state,state,skip=0;
RAND_add(&Time,sizeof(Time),0);
ERR_clear_error();
clear_sys_error();
if (s->info_callback != NULL)
cb=s->info_callback;
e... | vuln | Vulnerable | Unknown |
static void ioport_write(void *opaque, target_phys_addr_t addr,
uint64_t val, unsigned size)
{
PCIQXLDevice *d = opaque;
uint32_t io_port = addr;
qxl_async_io async = QXL_SYNC;
uint32_t orig_io_port = io_port;
if (d->guest_bug && !io_port == QXL_IO_RESET) {
return;
... | vuln | Vulnerable | C/C++ |
def get_signed_upload_url(path: str, force_download: bool = False) -> 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,
)
params = {... | vuln | Safe | Python |
@Nonnull
@Override
public ItemStack getCraftingResult(@Nonnull CraftingInventory inv)
{
ItemStack[] components = getComponents(inv);
ItemStack newContainer = ItemHandlerHelper.copyStackWithSize(components[containerIndex], 1);
IFluidHandlerItem handler = FluidUtil.getFluidHandler(newContainer).orElseThrow(Runti... | vuln | Vulnerable | Java |
@AttackVector(
vulnerabilityExposed = {
VulnerabilitySubType.UNRESTRICTED_FILE_UPLOAD,
VulnerabilitySubType.PERSISTENT_XSS,
VulnerabilitySubType.REFLECTED_XSS
},
description =
"UNRESTRICTED_FILE_UPLOAD_IF_FILE_NAME_N... | vuln | Safe | Java |
static void xen_read_physmap(XenIOState *state)
{
XenPhysmap *physmap = NULL;
unsigned int len, num, i;
char path[80], *value = NULL;
char **entries = NULL;
snprintf(path, sizeof(path),
"/local/domain/0/device-model/%d/physmap", xen_domid);
entries = xs_directory(state->xenstore, 0, ... | vuln | Safe | C/C++ |
static inline bool isMountable(const RemoteFsDevice::Details &d)
{
return RemoteFsDevice::constSshfsProtocol==d.url.scheme();
} | vuln | Safe | Unknown |
function _getHtmlHeaderColumn($title, $name, $pageName, $entityIds, $listorder, $orderdirection, $showColumn = true)
{
$str = '';
$entity = _getEntityString($entityIds);
if ($listorder == $name) {
if (($orderdirection == '') || ($orderdirection == 'down')) {
$str = "<a href='$pageName?{$... | vuln | Vulnerable | PHP |
int ndlz4_decompress(const uint8_t *input, int32_t input_len, uint8_t *output, int32_t output_len,
uint8_t meta, blosc2_dparams *dparams) {
BLOSC_UNUSED_PARAM(meta);
BLOSC_UNUSED_PARAM(dparams);
uint8_t *ip = (uint8_t *) input;
uint8_t *ip_limit = ip + input_len;
uint8_t *op = (uint8_t *... | vuln | Vulnerable | C/C++ |
// mkerrors.sh -m32
// Code generated by the command above; see README.md. DO NOT EDIT.
// +build 386,darwin
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -m32 _const.go
package unix
import "syscall"
const (
AF_APPLETALK = 0x10
AF_CCITT = 0xa
... | vuln | Vulnerable | Go |
static void ir2_decode_plane(Ir2Context *ctx, int width, int height, uint8_t *dst, int stride,
const uint8_t *table)
{
int i;
int j;
int out = 0;
int c;
int t;
while (out < width){
c = ir2_get_code(&ctx->gb);
if(c > 0x80) {
c -=... | vuln | Vulnerable | C/C++ |
int flb_parser_json_do(struct flb_parser *parser,
const char *in_buf, size_t in_size,
void **out_buf, size_t *out_size,
struct flb_time *out_time)
{
int i;
int skip;
int ret;
int slen;
int root_type;
int records;
double tmf... | vuln | Safe | C/C++ |
static void compute_frame_duration(int *pnum, int *pden, AVStream *st,
AVCodecParserContext *pc, AVPacket *pkt)
{
int frame_size;
*pnum = 0;
*pden = 0;
switch(st->codec.codec_type) {
case CODEC_TYPE_VIDEO:
if(st->time_base.num*1000 > st->time_base.den){
... | vuln | Vulnerable | C/C++ |
static Image *ReadDDSImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
Image
*image;
MagickBooleanType
status,
cubemap = MagickFalse,
volume = MagickFalse,
matte;
CompressionType
compression;
DDSInfo
dds_info;
DDSDecoder
*decoder;
size_t
n,
num_images... | vuln | Vulnerable | C/C++ |
static int parse_dsd_prop(AVFormatContext *s, AVStream *st, uint64_t eof)
{
AVIOContext *pb = s->pb;
char abss[24];
int hour, min, sec, i, ret, config;
int dsd_layout[6];
ID3v2ExtraMeta *id3v2_extra_meta;
while (avio_tell(pb) + 12 <= eof && !avio_feof(pb)) {
uint32_t tag = avio_rl32... | vuln | Safe | C/C++ |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | vuln | Vulnerable | C/C++ |
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
TF_LITE_ENSURE_EQ(context, NumInputs(node), 2);
TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1);
// Check type and shape of the input tensor
const TfLiteTensor* input = GetInput(context, node, kInputTensor);
TF_LITE_ENSURE(context, NumDimension... | vuln | Vulnerable | 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 | Safe | Python |
private BTreeElement snapshotAnElement(final String name, final RTObject instanceArg, final int indent) {
BTreeElement retval = null, element = null;
String rowString = "";
RTObject instance = instanceArg;
if (name.startsWith("temp$") || name.startsWith("parseTemp$")) {
return null;
}
for (... | 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 | Vulnerable | Java |
RList *r_bin_ne_get_relocs(r_bin_ne_obj_t *bin) {
RList *segments = bin->segments;
if (!segments) {
return NULL;
}
RList *entries = bin->entries;
if (!entries) {
return NULL;
}
RList *symbols = bin->symbols;
if (!symbols) {
return NULL;
}
ut16 *modref = calloc (bin->ne_header->ModRefs, sizeof (ut16));
... | vuln | Safe | C/C++ |
email_close(FILE *mailer)
{
char *temp;
mode_t prev_umask;
priv_state priv;
char *customSig;
if ( mailer == NULL ) {
return;
}
/* Want the letter to come from "condor" if possible */
priv = set_condor_priv();
customSig = NULL;
if ((customSig = param("EMAIL_SIGNATURE")) != NULL) {
... | vuln | Vulnerable | C/C++ |
// Author: Thomas Gambet
// (c) COPYRIGHT MIT, ERCIM and Keio, 2010.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.unicorn.response.impl;
import java.util.ArrayList;
import java.util.List;
import javax.json.JsonObject;
import org.w3c.unicorn.response.Context;
import org.w3c.... | vuln | Vulnerable | Java |
static int wddx_stack_destroy(wddx_stack *stack)
{
register int i;
if (stack->elements) {
for (i = 0; i < stack->top; i++) {
if (((st_entry *)stack->elements[i])->data
&& ((st_entry *)stack->elements[i])->type != ST_FIELD) {
zval_ptr_dtor(&((st_entry *)stack->elements[i])->data);
}
if (((st... | vuln | Safe | Unknown |
@Nullable
@VisibleForTesting
synchronized IFingerprint getHalInstance() {
if (mTestHalEnabled) {
// Enabling the test HAL for a single sensor in a multi-sensor HAL currently enables
// the test HAL for all sensors under that HAL. This can be updated in the future if
/... | vuln | Vulnerable | Java |
@Override
public int getLensColor(ItemStack stack, Level level) {
int storedColor = getStoredColor(stack);
if (storedColor == -1) {
return 0xFFFFFF;
}
if (storedColor == 16) {
if (level == null) {
return 0xFFFFFF;
}
return Mth.hsvToRgb(level.getGameTime() * 2 % 360 / 360F, 1F, 1F);
}
ret... | vuln | Safe | Java |
void av_force_cpu_flags(int arg){
if ( (arg & ( AV_CPU_FLAG_3DNOW |
AV_CPU_FLAG_3DNOWEXT |
AV_CPU_FLAG_MMXEXT |
AV_CPU_FLAG_SSE |
AV_CPU_FLAG_SSE2 |
AV_CPU_FLAG_SSE2SLOW |
AV_CPU_F... | vuln | Vulnerable | C/C++ |
status_t MPEG4Source::read(
MediaBuffer **out, const ReadOptions *options) {
Mutex::Autolock autoLock(mLock);
CHECK(mStarted);
if (mFirstMoofOffset > 0) {
return fragmentedRead(out, options);
}
*out = NULL;
int64_t targetSampleTimeUs = -1;
int64_t seekTimeUs;
ReadOptions::SeekMode mode;
if (options &... | vuln | Safe | C/C++ |
/******************************************************************************
*
* This file is provided under a dual BSD/GPLv2 license. When using or
* redistributing this file, you may do so under either license.
*
* GPL LICENSE SUMMARY
*
* Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved.
* ... | vuln | Vulnerable | C/C++ |
guestfs___first_line_of_file (guestfs_h *g, const char *filename)
{
char **lines = NULL; /* sic: not CLEANUP_FREE_STRING_LIST */
int64_t size;
char *ret;
/* Don't trust guestfs_head_n not to break with very large files.
* Check the file size is something reasonable first.
*/
size = guestfs_filesize (g,... | vuln | Safe | C/C++ |
int __init ip_rt_init(void)
{
void *idents_hash;
int cpu;
/* For modern hosts, this will use 2 MB of memory */
idents_hash = alloc_large_system_hash("IP idents",
sizeof(*ip_idents) + sizeof(*ip_tstamps),
0,
16, /* one bucket per 64 KB */
HASH_ZERO,
NULL,
... | vuln | Safe | Unknown |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.