code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
zlib_advance(struct zlib *zlib, png_uint_32 nbytes)
/* Read nbytes compressed bytes; the stream will be initialized if required.
* Bytes are always being reread and errors are fatal. The return code is as
* follows:
*
* -1: saw the "too far back" error
* 0: ok, keep going
* 1: saw Z... | vuln | Safe | C/C++ |
/*!
Copyright (c) REBUILD <https://getrebuild.com/> and/or its owners. All rights reserved.
rebuild is dual-licensed under commercial and open source licenses (GPLv3).
See LICENSE and COMMERCIAL in the project root for license information.
*/
// ~~ 图片/文档预览
const TYPE_DOCS = ['.doc', '.docx', '.rtf', '.xls', '.xlsx',... | vuln | Safe | Java |
@Override
public void bakeConfig(boolean reload)
{
// TODO Auto-generated method stub
} | vuln | Vulnerable | Java |
static void vrend_renderer_init_blit_ctx(struct vrend_blitter_ctx *blit_ctx)
{
struct virgl_gl_ctx_param ctx_params;
int i;
if (blit_ctx->initialised) {
vrend_clicbs->make_current(0, blit_ctx->gl_context);
return;
}
blit_ctx->initialised = true;
ctx_params.shared = true;
ctx_param... | vuln | Safe | Unknown |
static int decode_slice_thread(AVCodecContext *avctx, void *arg, int jobnr, int threadnr)
{
ProresContext *ctx = avctx->priv_data;
SliceContext *slice = &ctx->slices[jobnr];
const uint8_t *buf = slice->data;
AVFrame *pic = ctx->frame;
int i, hdr_size, qscale, log2_chroma_blocks_per_mb;
int luma_... | vuln | Vulnerable | C/C++ |
static unsigned int xdr_set_page_base(struct xdr_stream *xdr,
unsigned int base, unsigned int len)
{
unsigned int pgnr;
unsigned int maxlen;
unsigned int pgoff;
unsigned int pgend;
void *kaddr;
maxlen = xdr->buf->page_len;
if (base >= maxlen) {
base = maxlen;
maxlen = 0;
} else
maxlen -= base;
... | vuln | Vulnerable | C/C++ |
protected function generateVerifyCode()
{
if ($this->minLength > $this->maxLength) {
$this->maxLength = $this->minLength;
}
if ($this->minLength < 3) {
$this->minLength = 3;
}
if ($this->maxLength > 20) {
$this->maxLength = 20;
}
... | vuln | Safe | PHP |
var getExtTemplates = function(isSearch)
{
list.style.display = 'none';
searchBox.style.display = 'none';
div.style.left = '30px';
setActiveTab(isSearch? -1 : 1); //deselect all of them if isSearch
if (oldTemplates == null)
{
oldTemplates = templates;
}
div.scrollTop = 0;... | vuln | Vulnerable | JavaScript |
public static ServerXml load(String filename) throws Exception {
logger.info("ServerXml: Parsing " + filename);
ServerXml serverXml = new ServerXml();
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
... | vuln | Vulnerable | Java |
static ssize_t total_time_ms_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct wakeup_source *ws = dev_get_drvdata(dev);
ktime_t active_time;
ktime_t total_time = ws->total_time;
if (ws->active) {
active_time = ktime_sub(ktime_get(), ws->last_time);
total_time = ktime_add(total_... | vuln | Safe | Unknown |
void* TFE_HandleToDLPack(TFE_TensorHandle* h, TF_Status* status) {
const Tensor* tensor = GetTensorFromHandle(h, status);
TF_DataType data_type = static_cast<TF_DataType>(tensor->dtype());
TensorReference tensor_ref(*tensor); // This will call buf_->Ref()
auto* tf_dlm_tensor_ctx = new TfDlManagedTensorCtx(ten... | vuln | Vulnerable | C/C++ |
function Response(options) {
options = options || {};
this.body = options.body || {};
this.headers = {};
this.status = 200;
// Store the headers in lower case.
for (var field in options.headers) {
if (Object.prototype.hasOwnProperty.call(options.headers, field)) {
this.headers[field.toLowerCase(... | vuln | Safe | JavaScript |
private static void enableAntiCrash() {
enableAntiCrash = getBoolean("settings.anti-crash", true);
} | vuln | Vulnerable | Java |
static int em_call(struct x86_emulate_ctxt *ctxt)
{
int rc;
long rel = ctxt->src.val;
ctxt->src.val = (unsigned long)ctxt->_eip;
rc = jmp_rel(ctxt, rel);
if (rc != X86EMUL_CONTINUE)
return rc;
return em_push(ctxt);
} | vuln | Safe | C/C++ |
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
auto* params =
reinterpret_cast<TfLiteFullyConnectedParams*>(node->builtin_data);
OpData* data = reinterpret_cast<OpData*>(node->user_data);
const TfLiteTensor* input;
TF_LITE_ENSURE_OK(context, GetInputSafe(context, node, kInputTensor, &input... | vuln | Safe | C/C++ |
static int http_connect(URLContext *h, const char *path, const char *hoststr,
const char *auth, int *new_location)
{
HTTPContext *s = h->priv_data;
int post, err, ch;
char line[1024], *q;
char *auth_b64;
int auth_b64_len = (strlen(auth) + 2) / 3 * 4 + 1;
int64_t off = s->... | vuln | Safe | C/C++ |
package main
import (
"context"
"encoding/json"
"errors"
"fmt"
"html/template"
"net"
"net/http"
"net/url"
"regexp"
"strings"
"time"
"github.com/justinas/alice"
ipapi "github.com/oauth2-proxy/oauth2-proxy/v7/pkg/apis/ip"
middlewareapi "github.com/oauth2-proxy/oauth2-proxy/v7/pkg/apis/middleware"
"github... | vuln | Vulnerable | Go |
@Override
public Element[] supStreamFeatures(final XMPPResourceConnection session) {
// If session does not exist, just return null, we don't provide features
// for non-existen stream, the second condition means that the TLS
// has not been yet completed for the user connection.
if ((session != null) && (ses... | vuln | Safe | Java |
async function groupChat() {
const tokenValidation = await AuthTokenValidation
.findOneAsync({ connectionId: this.connection.id });
if (!tokenValidation || tokenValidation.validationStatus !== ValidationStates.VALIDATED) {
Logger.warn(`Publishing GroupChat was requested by unauth connection ${this.connecti... | vuln | Safe | JavaScript |
onErr?: (resp: A) => V) { | vuln | Safe | Scala |
/*
* Copyright (C) 2014 Daniel-Constantin Mierla (asipto.com)
*
* This file is part of kamailio, a free SIP server.
*
* Kamailio is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the L... | vuln | Safe | C/C++ |
NetworkInterface::NetworkInterface() { init(); } | vuln | Vulnerable | C/C++ |
int GetU16BE (const unsigned int& nPos, bool *pbSuccess)
{
//*pbSuccess = true;
if ( m_nLen < 2 || nPos > (m_nLen - 2) )
{
*pbSuccess = false;
return 0;
}
int nRes = m_sFile[ nPos ];
nRes = (nRes <<... | vuln | Safe | C/C++ |
Str
process_button(struct parsed_tag *tag)
{
Str tmp = NULL;
char *p, *q, *r, *qq = "";
int qlen, v;
if (cur_form_id < 0) {
char *s = "<form_int method=internal action=none>";
tmp = process_form(parse_tag(&s, TRUE));
}
if (tmp == NULL)
tmp = Strnew();
p = "submit";
... | vuln | Safe | C/C++ |
static sPAPRDIMMState *spapr_recover_pending_dimm_state(sPAPRMachineState *ms,
PCDIMMDevice *dimm)
{
sPAPRDRConnector *drc;
PCDIMMDeviceClass *ddc = PC_DIMM_GET_CLASS(dimm);
MemoryRegion *mr = ddc->get_memory_region(dimm);
uint64_t size = memory_re... | vuln | Safe | C/C++ |
spnego_gss_wrap_iov_length(OM_uint32 *minor_status,
gss_ctx_id_t context_handle,
int conf_req_flag,
gss_qop_t qop_req,
int *conf_state,
gss_iov_buffer_desc *iov,
int iov_count)
{
OM_uint32 ret;
spnego_gss_ctx_id_t sc = (spnego_gss_ctx_id_t)context_handle;
if (sc->ctx_handle == GS... | vuln | Safe | C/C++ |
GC_debug_malloc_atomic_uncollectable(size_t lb, GC_EXTRA_PARAMS)
{
void * result =
GC_malloc_atomic_uncollectable(lb + UNCOLLECTABLE_DEBUG_BYTES);
if (result == 0) {
GC_err_printf("GC_debug_malloc_atomic_uncollectable(%lu)"
" returning NULL (%s:%d)\n", (unsigned long)lb,... | vuln | Vulnerable | Unknown |
/**
* <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 | Safe | Java |
static int mqtt_read_message_chunk(struct mqtt_client *client,
struct buf_ctx *buf, u32_t length)
{
u32_t remaining;
int len;
/* In case all data requested has already been buffered, return. */
if (length <= (buf->end - buf->cur)) {
return 0;
}
/* Calculate how much data we need to read from the transp... | vuln | Safe | C/C++ |
static int get_S2prot(CPUARMState *env, int s2ap, int xn)
{
int prot = 0;
if (s2ap & 1) {
prot |= PAGE_READ;
}
if (s2ap & 2) {
prot |= PAGE_WRITE;
}
if (!xn) {
if (arm_el_is_aa64(env, 2) || prot & PAGE_READ) {
prot |= PAGE_EXEC;
}
}
return prot... | vuln | Safe | C/C++ |
/* 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 |
@Override
public void onPreExecute() {
Common.setFinishStatus(false);
Common.isCancelled(false);
Common.isBuilding(true);
Common.setStatus(null);
Intent apkTasks = new Intent(activity, APKTasksActivity.class);
ac... | vuln | Safe | Java |
static bool freelist_state_initialize(union freelist_init_state *state,
struct kmem_cache *cachep,
unsigned int count)
{
bool ret;
unsigned int rand;
/* Use best entropy available to define a random shift */
rand = get_random_int();
/* Use a random state if the pre-computed list is not available */
if (... | vuln | Safe | Unknown |
@Override
protected void digestSpellPart(Map<String, Integer> partCounts, int position, AbstractSpellPart spellPart, List<SpellValidationError> validationErrors) {
// Count the glyph
if (partCounts.containsKey(spellPart.tag)) {
partCounts.put(spellPart.tag, partCounts.get(spellPart.tag) ... | vuln | Vulnerable | Java |
void ahci_init(AHCIState *s, DeviceState *qdev, AddressSpace *as, int ports)
{
qemu_irq *irqs;
int i;
s->as = as;
s->ports = ports;
s->dev = g_malloc0(sizeof(AHCIDevice) * ports);
ahci_reg_init(s);
memory_region_init_io(&s->mem, OBJECT(qdev), &ahci_mem_ops, s,
... | vuln | Vulnerable | C/C++ |
void APar_ExtractDetails(FILE *isofile, uint8_t optional_output) {
char uint32_buffer[5];
Trackage track = {0};
AtomicInfo *mvhdAtom = APar_FindAtom("moov.mvhd", false, VERSIONED_ATOM, 0);
if (mvhdAtom != NULL) {
APar_ExtractMovieDetails(uint32_buffer, isofile, mvhdAtom);
fprintf(stdout,
"M... | vuln | Vulnerable | C/C++ |
private void addASurfaceTransactionCallback() {
HardwareRenderer.ASurfaceTransactionCallback callback = (nativeTransactionObj,
nativeSurfaceControlObj,
frameNr) -> {
if (... | vuln | Safe | Java |
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"
import atexit
import base64
import functools
import logging
import logging.config
i... | vuln | Vulnerable | Python |
var CommentsWindow=function(b,f,l,d,t,u){function E(){for(var H=N.getElementsByTagName("div"),F=0,J=0;J<H.length;J++)"none"!=H[J].style.display&&H[J].parentNode==N&&F++;K.style.display=0==F?"block":"none"}function c(H,F,J,R){function W(){F.removeChild(U);F.removeChild(Y);V.style.display="block";O.style.display="block"}... | vuln | Vulnerable | JavaScript |
@Override
protected IActivityManager create() {
final IBinder orig = ServiceManager.getService(Context.ACTIVITY_SERVICE);
final IBinder b = orig == null ? null : new ActivityManagerProxyProvider().provide(orig);
final IActivityManager am = IAct... | vuln | Safe | Java |
static gboolean
resolve_op_end (FlatpakTransaction *self,
FlatpakTransactionOperation *op,
const char *checksum,
GFile *sideload_path,
GBytes *metadata_bytes,
GError **error)
{
g_autoptr(GBytes) old_metadata_bytes = NULL;
old_metadata_... | vuln | Safe | C/C++ |
// app.js
'use strict';
var $ = require('jquery');
var Backbone = require('backbone');
Backbone.$ = $;
var Marionette = require('backbone.marionette');
var Radio = require('backbone.radio');
if (window.__agent) {
window.__agent.start(Backbone, Marionette);
}
var LayoutView = require('./views/layout.js');
var router... | vuln | Safe | JavaScript |
# Generated by Django 2.2.9 on 2020-01-31 10:22
from django.db import migrations
import markdownx.models
class Migration(migrations.Migration):
dependencies = [
('part', '0025_auto_20191118_2316'),
]
operations = [
migrations.AlterField(
model_name='part',
name='... | vuln | Vulnerable | Python |
static int pci_cirrus_vga_initfn(PCIDevice *dev)
{
PCICirrusVGAState *d = DO_UPCAST(PCICirrusVGAState, dev, dev);
CirrusVGAState *s = &d->cirrus_vga;
PCIDeviceClass *pc = PCI_DEVICE_GET_CLASS(dev);
int16_t device_id = pc->device_id;
if (s->vga.vram_size_mb != 4 && s->vga.vram_size_mb != 8... | vuln | Safe | C/C++ |
static int __sys_sendmsg(struct socket *sock, struct msghdr __user *msg,
struct msghdr *msg_sys, unsigned flags,
struct used_address *used_address)
{
struct compat_msghdr __user *msg_compat =
(struct compat_msghdr __user *)msg;
struct sockaddr_storage address;
struct iovec iovstack[UIO_FASTIOV], *iov = ... | vuln | Vulnerable | C/C++ |
>(values: Ts, utils: U, meta: M | undefined) {
const result: Record<PropertyKey, unknown> = {};
/* eslint-disable functional/no-loop-statement, functional/no-conditional-statement -- using a loop here is more performant. */
for (const key of getKeys(values)) {
const propValues = [];
for (const value of... | vuln | Safe | JavaScript |
#ifndef WIN32
#include "UserTerminalRouter.hpp"
#include "ETerminal.pb.h"
namespace et {
UserTerminalRouter::UserTerminalRouter(
shared_ptr<PipeSocketHandler> _socketHandler,
const SocketEndpoint &_routerEndpoint)
: socketHandler(_socketHandler) {
serverFd = *(socketHandler->listen(_routerEndpoint).begi... | vuln | Vulnerable | C/C++ |
create_face_from_contents (FontLoadJob *job,
gchar **contents,
GError **error)
{
FT_Error ft_error;
FT_Face retval;
ft_error = FT_New_Memory_Face (job->library,
(const FT_Byte *) job->face_contents,
... | vuln | Safe | Unknown |
ParseNameValue(const char * buffer, int bufsize,
struct NameValueParserData * data)
{
struct xmlparser parser;
data->l_head = NULL;
data->portListing = NULL;
data->portListingLength = 0;
/* init xmlparser object */
parser.xmlstart = buffer;
parser.xmlsize = bufsize;
parser.data = data;
par... | vuln | Vulnerable | C/C++ |
static char *sanitize_cookie_path(const char *cookie_path)
{
size_t len;
char *new_path = strdup(cookie_path);
if(!new_path)
return NULL;
/* some stupid site sends path attribute with '"'. */
if(new_path[0] == '\"') {
memmove((void *)new_path, (const void *)(new_path + 1), strlen(new_path));
}
if... | vuln | Vulnerable | C/C++ |
ModuleExport size_t RegisterRLEImage(void)
{
MagickInfo
*entry;
entry=AcquireMagickInfo("RLE","RLE","Utah Run length encoded image");
entry->decoder=(DecodeImageHandler *) ReadRLEImage;
entry->magick=(IsImageFormatHandler *) IsRLE;
entry->flags^=CoderAdjoinFlag;
(void) RegisterMagickInfo(entry);
retu... | vuln | Vulnerable | Unknown |
static void vfio_vga_probe_nvidia_3d0_quirk(VFIOPCIDevice *vdev)
{
VFIOQuirk *quirk;
VFIONvidia3d0Quirk *data;
if (!vfio_pci_is(vdev, PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID) ||
!vdev->bars[1].region.size) {
return;
}
quirk = g_malloc0(sizeof(*quirk));
quirk->data = data = g_malloc0(siz... | vuln | Safe | C/C++ |
static int hls_slice_data_wpp(HEVCContext *s, const uint8_t *nal, int length)
{
HEVCLocalContext *lc = s->HEVClc;
int *ret = av_malloc_array(s->sh.num_entry_point_offsets + 1, sizeof(int));
int *arg = av_malloc_array(s->sh.num_entry_point_offsets + 1, sizeof(int));
int offset;
int startheader, cmpt ... | vuln | Vulnerable | C/C++ |
start_pass_merged_upsample(j_decompress_ptr cinfo)
{
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
/* Mark the spare buffer empty */
upsample->spare_full = FALSE;
/* Initialize total-height counter for detecting bottom of image */
upsample->rows_to_go = cinfo->output_height;
} | vuln | Vulnerable | Unknown |
public String[] getWatcherUserId() {
return watcherUserId != null ? watcherUserId.clone() : null;
} | vuln | Safe | Java |
static void
output_TEXT (Dwg_Object *obj)
{
Dwg_Data *dwg = obj->parent;
Dwg_Entity_TEXT *text = obj->tio.entity->tio.TEXT;
char *escaped;
const char *fontfamily;
BITCODE_H style_ref = text->style;
Dwg_Object *o = style_ref ? dwg_ref_object_silent (dwg, style_ref) : NULL;
Dwg_Object_STYLE *style = o ? o->... | vuln | Safe | C/C++ |
bool
ExprResolveLhs(struct xkb_context *ctx, const ExprDef *expr,
const char **elem_rtrn, const char **field_rtrn,
ExprDef **index_rtrn)
{
switch (expr->expr.op) {
case EXPR_IDENT:
*elem_rtrn = NULL;
*field_rtrn = xkb_atom_text(ctx, expr->ident.ident);
*inde... | vuln | Vulnerable | C/C++ |
def update
if @application.update(application_params)
flash[:notice] = I18n.t(:notice, scope: i18n_scope(:update))
respond_to do |format|
format.html { redirect_to oauth_application_url(@application) }
format.json { render json: @application }
end
else
re... | vuln | Vulnerable | Ruby |
@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
int id = item.getItemId();
if (id == R.id.action_refresh_details) {
refreshDetails();
} else if (id == R.id.action_toggle_blocking) { // Components
if (mainModel != null) new Thread(() -> mainMo... | vuln | Vulnerable | Java |
static int hevc_init(AVCodecParserContext *s)
{
HEVCContext *h = &((HEVCParseContext *)s->priv_data)->h;
h->HEVClc = av_mallocz(sizeof(HEVCLocalContext));
if (!h->HEVClc)
return AVERROR(ENOMEM);
h->skipped_bytes_pos_size = INT_MAX;
return 0;
} | vuln | Safe | C/C++ |
isis_print_is_reach_subtlv(netdissect_options *ndo,
const uint8_t *tptr, u_int subt, u_int subl,
const char *ident)
{
u_int te_class,priority_level,gmpls_switch_cap;
union { /* int to float conversion buffer for several subTLVs */
float f... | vuln | Safe | C/C++ |
public static String encrypt(String strToEncrypt) {
if (strToEncrypt == null) {
return null;
}
try {
Cipher cipher = Cipher.getInstance("AES/CFB/PKCS5Padding");
final SecretKeySpec secretKey = new SecretKeySpec(key, "AES");
cipher.init(Cipher.ENCRY... | vuln | Safe | Java |
public boolean skipTutorial() {
if (getLocation().onTutorialIsland() && this.getWorld().getServer().getConfig().SHOW_TUTORIAL_SKIP_OPTION) {
if (inCombat()) {
message("You cannot do that whilst fighting!");
return false;
}
if (isBusy()) {
return false;
}
if (getCache().hasKey("tutorial")) {... | vuln | Safe | Java |
static void realize(DeviceState *d, Error **errp)
{
sPAPRDRConnector *drc = SPAPR_DR_CONNECTOR(d);
sPAPRDRConnectorClass *drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc);
Object *root_container;
char link_name[256];
gchar *child_name;
Error *err = NULL;
DPRINTFN("drc realize: %x", drck->get_index(d... | vuln | Vulnerable | C/C++ |
package defaults
import (
"time"
)
const (
// these requests take at _least_ two minutes at the moment.
ProvideTimeout = time.Minute * 3
ProvSearchDelay = time.Second
// Number of concurrent workers in decision engine that process requests to the blockstore
BitswapEngineBlockstoreWorkerCount = 128
// the tot... | vuln | Safe | Go |
struct dns_rrs *dns_get_rrs_start(struct dns_packet *packet, dns_rr_type type, int *count)
{
unsigned short start = 0;
struct dns_head *head = &packet->head;
/* get rrs count by rrs type */
switch (type) {
case DNS_RRS_QD:
*count = head->qdcount;
start = packet->questions;
break;
case DNS_RRS_AN:
*count ... | vuln | Safe | C/C++ |
function compression_test() {
?>
<script type="text/javascript">
var compressionNonce = <?php echo wp_json_encode( wp_create_nonce( 'update_can_compress_scripts' ) ); ?>;
var testCompression = {
get : function(test) {
var x;
if ( window.XMLHttpRequest ) {
x = new XMLHttpRequest();
} else {
try{x=n... | vuln | Safe | PHP |
@Override
public void execute(OperatingContext operatingContext) throws TriggerException {
final String chainName = actionContext.getConfigId() + ":" + operatingContext.getAction().getName();
final List<String> tschain = checkTriggerChain(chainName);
if (tschain == null) return;
thi... | vuln | Vulnerable | Java |
private void initAudioPlayer(WaveDrawable waveDrawable, View play, View pause) {
if (mAudioPlayer != null) {
return;
}
final MessageActivity activity = (MessageActivity) getActivity();
if (activity == null) {
return;
}
AudioManager audioManager =... | vuln | Safe | Java |
broadcast: function(event, data) {
if (channel) {
channel.postMessage({name: event, data: serialize(data)});
} else {
set(event, to_json(data));
// clean up localstorage
setTimeout(function() {
remove(event);
... | vuln | Safe | JavaScript |
/*
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholiqu... | vuln | Safe | C/C++ |
int ff_wma_init(AVCodecContext * avctx, int flags2)
{
WMACodecContext *s = avctx->priv_data;
int i;
float *window;
float bps1, high_freq;
volatile float bps;
int sample_rate1;
int coef_vlc_table;
if( avctx->sample_rate<=0 || avctx->sample_rate>50000
|| avctx->channels<=0 || avct... | vuln | Safe | C/C++ |
@Override
public void onStop() {
Log.d(LOG_TAG, "Stream Fragment Stopped");
super.onStop();
if (!castingViewVisible && !audioViewVisible && player != null) {
player.pause();
}
if (Util.SDK_INT > 23) {
releasePlayer();
}
} | vuln | Safe | Java |
static ssize_t __nfs4_get_acl_uncached(struct inode *inode, void *buf, size_t buflen)
{
struct page *pages[NFS4ACL_MAXPAGES] = {NULL, };
struct nfs_getaclargs args = {
.fh = NFS_FH(inode),
.acl_pages = pages,
.acl_len = buflen,
};
struct nfs_getaclres res = {
.acl_len = buflen,
};
struct rpc_message msg =... | vuln | Vulnerable | C/C++ |
@Method(0x800eac58L)
public static DeffPart getDeffPart(final int flags) {
final MrgFile deff = deffManager_800c693c.deffPackage_5a8;
final Function<Value, ? extends DeffPart> ctor = switch(flags >>> 24) {
case 0 -> DeffPart.LmbType::new;
case 1, 2 -> DeffPart.AnimatedTmdType::new;
case 3 -... | vuln | Safe | Java |
void qemu_set_log_filename(const char *filename, Error **errp)
{
char *pidstr;
g_free(logfilename);
pidstr = strstr(filename, "%");
if (pidstr) {
if (pidstr[1] != 'd' || strchr(pidstr + 2, '%')) {
error_setg(errp, "Bad logfile format: %s", filename);
return;
... | vuln | Safe | C/C++ |
import json
from io import BytesIO
import requests
import validators
from cookbook.helper.ingredient_parser import IngredientParser
from cookbook.integration.integration import Integration
from cookbook.models import Ingredient, Recipe, Step
class RecipeSage(Integration):
def get_recipe_from_file(self, file):
... | vuln | Safe | Python |
@Deprecated
default boolean authenticateHttpRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
try {
AuthenticationState authenticationState = newHttpAuthState(request);
String role = authenticateAsync(authenticationState.getAuthDataSource()).get();
... | vuln | Safe | Java |
function dol_print_error($db='',$error='')
{
global $conf,$langs,$argv;
global $dolibarr_main_prod;
$out = '';
$syslog = '';
// Si erreur intervenue avant chargement langue
if (! $langs)
{
require_once DOL_DOCUMENT_ROOT .'/core/class/translate.class.php';
$langs = new Translate('', $conf);
$langs->load("... | vuln | Vulnerable | PHP |
QPDF_Array::getItem(int n) const
{
if ((n < 0) || (n >= QIntC::to_int(this->items.size())))
{
throw std::logic_error(
"INTERNAL ERROR: bounds error accessing QPDF_Array element");
}
return this->items.at(QIntC::to_size(n));
} | vuln | Safe | Unknown |
@Override
public void create() {
GuiComboBoxMapped<LittleShape> box = new GuiComboBoxMapped<>("shape", new TextMapBuilder<LittleShape>()
.addComponent(ShapeRegistry.notTileShapes(), x -> Component.translatable(x.getTranslatableName())));
box.select(ItemLittleHammer.getShape(tool.get(... | vuln | Vulnerable | Java |
@Override
public @NonNull Set<AuthenticationHandler> getAuthenticationHandlers(final AuthenticationTransaction transaction) {
val handlers = getAuthenticationHandlers();
LOGGER.debug("Candidate/Registered authentication handlers for this transaction are [{}]", handlers);
val handlerResolvers... | vuln | Safe | Java |
public void onClick(EntityPlayer player, boolean rightClick, BlockPos pos, ItemStack stack) {
if (!stack.hasTagCompound())
stack.setTagCompound(new NBTTagCompound());
if (rightClick) {
stack.getTagCompound().setIntArray("pos2", new int[] { pos.getX(), pos.getY(), pos.getZ() });
... | vuln | Safe | Java |
int qemu_bh_poll(void)
{
QEMUBH *bh, **bhp;
int ret;
ret = 0;
for (bh = first_bh; bh; bh = bh->next) {
if (!bh->deleted && bh->scheduled) {
bh->scheduled = 0;
if (!bh->idle)
ret = 1;
bh->idle = 0;
bh->cb(bh->opaque);
}
}... | vuln | Safe | C/C++ |
/*
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2005-2022
*
* This file is part of GPAC / MPEG2-TS sub-project
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as publishe... | vuln | Vulnerable | C/C++ |
@ModifyArg(
method = "getOccupiedSlotWithRoomForStack",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/entity/player/PlayerInventory;canStackAddMore(Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/ItemStack;)Z",
ordinal = 1
),
index = 0
)
... | vuln | Safe | Java |
getDownloadUrl(fileId, accessToken) {
return `${Shopware.Context.api.apiPath}/_action/${this.getApiBasePath()}/` +
`file/download?fileId=${fileId}&accessToken=${accessToken}`;
} | vuln | Vulnerable | JavaScript |
/* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICENSE. */
/*
* Parsing routines shared by all IETF QUIC versions.
*/
#include <assert.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include <sys/queue.h>
#include <sys/types.h>
#include <openssl/rand.h>
#include "lsquic_types.h"
#inc... | vuln | Safe | C/C++ |
public final function setAction($strAction) {
$this->strAction = htmlspecialchars(trim($strAction), ENT_QUOTES, "UTF-8", false);
} | vuln | Safe | PHP |
#!/usr/bin/python -tt
# 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 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that ... | vuln | Vulnerable | Python |
static void stub_disconnect(struct usb_device *udev)
{
struct stub_device *sdev;
const char *udev_busid = dev_name(&udev->dev);
struct bus_id_priv *busid_priv;
int rc;
dev_dbg(&udev->dev, "Enter disconnect\n");
busid_priv = get_busid_priv(udev_busid);
if (!busid_priv) {
BUG();
return;
}
sdev = dev_get_d... | vuln | Safe | Unknown |
public static void earlyLoad(String name) {
try {
Class.forName(name, true, Launch.classLoader);
}
catch(Exception error) {
Client.LOGGER.error("Could not early load " + name + ". This may cause further issues.");
}
} | vuln | Safe | Java |
static void vga_reset(void *opaque)
{
VGAState *s = (VGAState *) opaque;
s->lfb_addr = 0;
s->lfb_end = 0;
s->map_addr = 0;
s->map_end = 0;
s->lfb_vram_mapped = 0;
s->bios_offset = 0;
s->bios_size = 0;
s->sr_index = 0;
memset(s->sr, '\0', sizeof(s->sr));
s->gr_index = 0;
m... | vuln | Vulnerable | C/C++ |
/* radare2 - LGPL - Copyright 2018-2022 - pancake, mrmacete, keegan */
#include <r_types.h>
#include <r_util.h>
#include <r_lib.h>
#include <r_bin.h>
#include <r_core.h>
#include <r_io.h>
#include <ht_pu.h>
// #include "../format/mach0/mach0_defines.h"
#define R_BIN_MACH064 1
#include "../format/mach0/mach0.h"
#includ... | vuln | Vulnerable | C/C++ |
plain(void)
{
int err;
err = plain_hash();
if (err) {
pr_warn("plain 'p' does not appear to be hashed\n");
failed_tests++;
return;
}
err = plain_format();
if (err) {
pr_warn("hashing plain 'p' has unexpected format\n");
failed_tests++;
}
} | vuln | Safe | Unknown |
QPDF::parse_xrefEntry(std::string const& line,
qpdf_offset_t& f1, int& f2, char& type)
{
// is_space and is_digit both return false on '\0', so this will
// not overrun the null-terminated buffer.
char const* p = line.c_str();
// Skip zero or more spaces. There aren't supposed to ... | vuln | Vulnerable | Unknown |
"""An extensible library for opening URLs using a variety of protocols
The simplest way to use this module is to call the urlopen function,
which accepts a string containing a URL or a Request object (described
below). It opens the URL and returns the results as file-like
object; the returned object has some extra me... | vuln | Vulnerable | Python |
list_restrict4(
restrict_u * res,
struct info_restrict ** ppir
)
{
struct info_restrict * pir;
if (res->link != NULL)
list_restrict4(res->link, ppir);
pir = *ppir;
pir->addr = htonl(res->u.v4.addr);
if (client_v6_capable)
pir->v6_flag = 0;
pir->mask = htonl(res->u.v4.mask);
pir->count = htonl(res->cou... | vuln | Vulnerable | Unknown |
FileReaderLoader::FileReaderLoader(ReadType read_type,
FileReaderLoaderClient* client)
: read_type_(read_type),
client_(client),
handle_watcher_(FROM_HERE, mojo::SimpleWatcher::ArmingPolicy::AUTOMATIC), | vuln | Safe | C/C++ |
public static int getSquirrelKills(Player player) {
return SQUIRREL_KILLS_COMPONENT.get().get(player).getKills();
} | vuln | Vulnerable | Java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.