code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
static int hnm_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame, AVPacket *avpkt)
{
AVFrame *frame = data;
Hnm4VideoContext *hnm = avctx->priv_data;
int ret;
uint16_t chunk_id;
if (avpkt->size < 8) {
av_log(avctx, AV_LOG_ERROR, "packet too small\n");... | vuln | Safe | C/C++ |
viewer: await getUserFromSessionToken(
context,
mutationInfo,
'viewer.user.',
objectId
),
};
} catch (e) {
parseGraphQLSchema.handleError(e);
}
}, | vuln | Safe | JavaScript |
static void imdct_c(MDCTContext *s, const FFTSample *input, FFTSample *tmp)
{
int k, n4, n2, n, j;
const uint16_t *revtab = s->fft.revtab;
const FFTSample *tcos = s->tcos;
const FFTSample *tsin = s->tsin;
const FFTSample *in1, *in2;
FFTComplex *z = (FFTComplex *)tmp;
n = 1 << s->nbits;
n... | 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 | Safe | Python |
snmp_ber_decode_length(unsigned char *buff, uint32_t *buff_len, uint8_t *length)
{
if(*buff_len == 0) {
return NULL;
}
*length = *buff++;
(*buff_len)--;
return buff;
} | vuln | Vulnerable | C/C++ |
static RList *symbols(RBinFile *bf) {
RList *res = r_list_newf ((RListFree)r_bin_symbol_free);
r_return_val_if_fail (res && bf->o && bf->o->bin_obj, res);
RCoreSymCacheElement *element = bf->o->bin_obj;
size_t i;
HtUU *hash = ht_uu_new0 ();
if (!hash) {
return res;
}
bool found = false;
for (i = 0; i < eleme... | vuln | Vulnerable | C/C++ |
func (hs *HTTPServer) getPluginAssets(c *models.ReqContext) {
pluginID := web.Params(c.Req)[":pluginId"]
plugin, exists := hs.pluginStore.Plugin(c.Req.Context(), pluginID)
if !exists {
c.JsonApiErr(404, "Plugin not found", nil)
return
}
// prepend slash for cleaning relative paths
requestedFile := filepath.C... | vuln | Safe | Go |
static int bdrv_rw_co(BlockDriverState *bs, int64_t sector_num, uint8_t *buf,
int nb_sectors, bool is_write, BdrvRequestFlags flags)
{
QEMUIOVector qiov;
struct iovec iov = {
.iov_base = (void *)buf,
.iov_len = nb_sectors * BDRV_SECTOR_SIZE,
};
qemu_iovec_init_exter... | vuln | Vulnerable | C/C++ |
int ssl3_get_client_hello(SSL *s)
{
int i, j, ok, al = SSL_AD_INTERNAL_ERROR, ret = -1, cookie_valid = 0;
unsigned int cookie_len;
long n;
unsigned long id;
unsigned char *p, *d;
SSL_CIPHER *c;
#ifndef OPENSSL_NO_COMP
unsigned char *q;
SSL_COMP *comp = NULL;
#endif
STACK_OF(SSL_CIPHE... | vuln | Safe | Unknown |
/* 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 | Safe | C/C++ |
static int snd_timer_user_open(struct inode *inode, struct file *file)
{
struct snd_timer_user *tu;
int err;
err = nonseekable_open(inode, file);
if (err < 0)
return err;
tu = kzalloc(sizeof(*tu), GFP_KERNEL);
if (tu == NULL)
return -ENOMEM;
spin_lock_init(&tu->qlock);
init_waitqueue_head(&tu->qchange_sle... | vuln | Vulnerable | Unknown |
static int svq1_decode_block_intra(GetBitContext *bitbuf, uint8_t *pixels,
ptrdiff_t pitch)
{
uint32_t bit_cache;
uint8_t *list[63];
uint32_t *dst;
const uint32_t *codebook;
int entries[6] = { 0 };
int i, j, m, n;
int stages;
unsigned mean;
unsigned... | vuln | Safe | C/C++ |
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 | Safe | C/C++ |
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... | vuln | Vulnerable | C/C++ |
@Override
public int checkSlicePermission(Uri uri, String callingPkg, String pkg, int pid, int uid,
String[] autoGrantPermissions) {
int userId = UserHandle.getUserId(uid);
if (pkg == null) {
for (String p : mContext.getPackageManager().getPackagesForUid(uid)) {
... | vuln | Safe | Java |
static uint64_t omap2_inth_read(void *opaque, target_phys_addr_t addr,
unsigned size)
{
struct omap_intr_handler_s *s = (struct omap_intr_handler_s *) opaque;
int offset = addr;
int bank_no, line_no;
struct omap_intr_handler_bank_s *bank = NULL;
if ((offset & 0xf80) =... | vuln | Safe | C/C++ |
LIR_Address* LIRGenerator::emit_array_address(LIR_Opr array_opr, LIR_Opr index_opr,
BasicType type) {
int offset_in_bytes = arrayOopDesc::base_offset_in_bytes(type);
LIR_Address* addr;
if (index_opr->is_constant()) {
int elem_size = type2aelembytes(type);
add... | vuln | Vulnerable | Unknown |
static int ext4_xattr_make_inode_space(handle_t *handle, struct inode *inode,
struct ext4_inode *raw_inode,
int isize_diff, size_t ifree,
size_t bfree, int *total_ino)
{
struct ext4_xattr_ibody_header *header = IHDR(inode, raw_inode);
struct ext4_xattr_entry *small_entry;
struct ext4... | vuln | Safe | C/C++ |
public DetectionReport buildDetectionReport(
TargetInfo targetInfo, CheckResult checkResult) {
NetworkService vulnerableNetworkService = checkResult.networkService();
return DetectionReport.newBuilder()
.setTargetInfo(targetInfo)
.setNetworkService(vulnerableNetworkService)
.setDet... | vuln | Safe | Java |
private static @NotNull Map<String, Supplier<SVGNode>> createNodeConstructorMap() {
Map<String, Supplier<SVGNode>> map = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
map.put(Anchor.TAG, Anchor::new);
map.put(Circle.TAG, Circle::new);
map.put(ClipPath.TAG, ClipPath::new);
map.put... | vuln | Safe | Java |
private ImmutableMap<SkyKey, SkyValue> batchPrefetch(boolean throwIfPreviouslyRequestedDepsUndone)
throws InterruptedException, UndonePreviouslyRequestedDeps {
ImmutableSet<SkyKey> excludedKeys =
evaluatorContext.getGraph().prefetchDeps(skyKey, oldDeps, previouslyRequestedDeps);
Collection<SkyKey>... | vuln | Safe | Java |
async def __call__(self, scope, receive, send):
if b"_trace=1" not in scope.get("query_string", b"").split(b"&"):
await self.app(scope, receive, send)
return
trace_start = time.perf_counter()
traces = []
accumulated_body = b""
size_limit_exceeded = False
... | vuln | Safe | Python |
static ut64 estimate_slide(RBinFile *bf, RDyldCache *cache, ut64 value_mask, ut64 value_add) {
ut64 slide = 0;
if (cache->n_hdr > 1) {
return slide;
}
ut64 *classlist = malloc (64);
if (!classlist) {
goto beach;
}
RListIter *iter;
RDyldBinImage *bin;
r_list_foreach (cache->bins, iter, bin) {
bool found_... | vuln | Safe | Unknown |
static void xen_ram_init(PCMachineState *pcms,
ram_addr_t ram_size, MemoryRegion **ram_memory_p)
{
MemoryRegion *sysmem = get_system_memory();
ram_addr_t block_len;
uint64_t user_lowmem = object_property_get_int(qdev_get_machine(),
... | vuln | Safe | C/C++ |
FLAC__bool read_metadata_vorbiscomment_(FLAC__StreamDecoder *decoder, FLAC__StreamMetadata_VorbisComment *obj, unsigned length)
{
FLAC__uint32 i;
FLAC__ASSERT(FLAC__bitreader_is_consumed_byte_aligned(decoder->private_->input));
/* read vendor string */
if (length >= 8) {
length -= 8; /* vendor string length + n... | vuln | Safe | C/C++ |
const qs = require("querystring");
const parse = require("url").parse;
const base64id = require("base64id");
const transports = require("./transports");
const EventEmitter = require("events").EventEmitter;
const Socket = require("./socket");
const debug = require("debug")("engine");
const cookieMod = require("cookie");... | vuln | Vulnerable | Java |
static int pico_ipv4_process_in(struct pico_stack *S, struct pico_protocol *self, struct pico_frame *f)
{
uint8_t option_len = 0;
int ret = 0;
struct pico_ipv4_hdr *hdr = (struct pico_ipv4_hdr *) f->net_hdr;
uint16_t max_allowed = (uint16_t) ((int)f->buffer_len - (f->net_hdr - f->buffer) - (int)PICO_SIZ... | vuln | Safe | C/C++ |
int qcrypto_cipher_setiv(QCryptoCipher *cipher,
const uint8_t *iv, size_t niv,
Error **errp)
{
QCryptoCipherNettle *ctx = cipher->opaque;
if (niv != ctx->niv) {
error_setg(errp, "Expected IV size %zu not %zu",
ctx->niv, niv);
r... | vuln | Vulnerable | C/C++ |
def _check_dataflow_job_state(self, job) -> bool:
"""
Helper method to check the state of one job in dataflow for this task if job failed raise exception.
:return: True if job is done.
:raise: Exception
"""
current_state = job["currentState"]
is_streaming = job.g... | vuln | Vulnerable | Python |
@ReactMethod
public void muteMyVideo(final boolean muted, Promise promise) {
ZoomSDK zoomSDK = ZoomSDK.getInstance();
if (!zoomSDK.isInitialized()) {
promise.reject("ERR_ZOOM_MEETING_CONTROL", "ZoomSDK has not been initialized successfully");
return;
}
final InMeetingService inMeetingSer... | vuln | Vulnerable | Java |
MagickExport void *AcquireQuantumMemory(const size_t count,const size_t quantum)
{
size_t
extent;
if (CheckMemoryOverflow(count,quantum) != MagickFalse)
return((void *) NULL);
extent=count*quantum;
return(AcquireMagickMemory(extent));
} | vuln | Vulnerable | C/C++ |
public String[] getIds() {
return ids;
} | vuln | Vulnerable | Java |
rsvg_new_filter (void)
{
RsvgFilter *filter;
filter = g_new (RsvgFilter, 1);
_rsvg_node_init (&filter->super, RSVG_NODE_TYPE_FILTER);
filter->filterunits = objectBoundingBox;
filter->primitiveunits = userSpaceOnUse;
filter->x = _rsvg_css_parse_length ("-10%");
filter->y = _rsvg_css_parse_le... | vuln | Safe | Unknown |
int mongo_env_read_socket( mongo *conn, void *buf, int len ) {
char *cbuf = buf;
while ( len ) {
int sent = recv( conn->sock, cbuf, len, 0 );
if ( sent == 0 || sent == -1 ) {
__mongo_set_error( conn, MONGO_IO_ERROR, NULL, WSAGetLastError() );
return MONGO_ERROR;
... | vuln | Vulnerable | C/C++ |
public boolean resetNativeUserCredentials(@Nonnull final String userUrn, @Nonnull final String password,
@Nonnull final String resetToken) {
Objects.requireNonNull(userUrn, "userUrn must not be null");
Objects.requireNonNull(password, "password must not be null");
Objects.requireNonNull(resetToken, "r... | vuln | Safe | Java |
static int scale_vector(int16_t *dst, const int16_t *vector, int length)
{
int bits, max = 0;
int i;
for (i = 0; i < length; i++)
max |= FFABS(vector[i]);
bits = normalize_bits(max, 15);
if (bits == 15)
for (i = 0; i < length; i++)
dst[i] = vector[i] * 0x7fff >> 3;
e... | vuln | Vulnerable | C/C++ |
@Override
protected void publishResults(CharSequence charSequence, FilterResults filterResults) {
filterItems = (List<YailDictionary>) filterResults.values;
// Usually GUI objects take up no screen space when set to invisible, but setting a CardView object to invisible
// was displaying an empty o... | vuln | Safe | Java |
TPM2B_NAME_Marshal(TPM2B_NAME *source, BYTE **buffer, INT32 *size)
{
UINT16 written = 0;
written += TPM2B_Marshal(&source->b, buffer, size);
return written;
} | vuln | Vulnerable | Unknown |
ldbm_back_bind(Slapi_PBlock *pb)
{
backend *be;
ldbm_instance *inst;
ber_tag_t method;
struct berval *cred;
struct ldbminfo *li;
struct backentry *e;
Slapi_Attr *attr;
Slapi_Value **bvals;
entry_address *addr;
back_txn txn = {NULL};
int rc = SLAPI_BIND_SUCCESS;
int result... | vuln | Vulnerable | C/C++ |
lyxml_parse_mem(struct ly_ctx *ctx, const char *data, int options)
{
FUN_IN;
const char *c = data;
unsigned int len;
struct lyxml_elem *root, *first = NULL, *next;
if (!ctx) {
LOGARG;
return NULL;
}
if (!data) {
/* nothing to parse */
return NULL;
}
re... | vuln | Safe | C/C++ |
@Override
public void startRecording(Context context) {
try {
if (fileRepository.hasAvailableSpace(context)) {
if (appRecorder.isPaused()) {
appRecorder.resumeRecording();
} else if (!appRecorder.isRecording()) {
if (audioPlayer.isPlaying() || audioPlayer.isPaused()) {
audioPlayer.stop();
... | vuln | Safe | Java |
@Override
public Object getObject() throws Exception {
if("cmd".equals(type)){
if("false".equals(exception)){
body = "java.lang.Runtime.getRuntime().exec(\"" +
body.replaceAll("\\\\","\\\\\\\\").replaceAll("\"", "\\\"") +
"\");";
... | vuln | Vulnerable | Java |
@Deprecated
String getProviderMimeType(Uri uri, int userId) {
mService.enforceNotIsolatedCaller("getProviderMimeType");
final String name = uri.getAuthority();
final int callingUid = Binder.getCallingUid();
final int callingPid = Binder.getCallingPid();
final int safeUserId =... | vuln | Safe | Java |
int ff_mpeg_ref_picture(MpegEncContext *s, Picture *dst, Picture *src)
{
int ret;
av_assert0(!dst->f->buf[0]);
av_assert0(src->f->buf[0]);
src->tf.f = src->f;
dst->tf.f = dst->f;
ret = ff_thread_ref_frame(&dst->tf, &src->tf);
if (ret < 0)
goto fail;
ret = update_picture_tables(ds... | vuln | Safe | C/C++ |
public boolean wantToDeclareWarOfPrevention(EmpireView v) {
if (v.embassy().atPeace())
{
return false;
}
Galaxy gal = galaxy();
if(empire.alliedWith(v.empId()))
return false;
float totalPotentialBombard = 0.0f;
for (int id=0;id<empire.sv.co... | vuln | Vulnerable | Java |
static void WritePixels(struct ngiflib_img * i, struct ngiflib_decode_context * context, const u8 * pixels, u16 n) {
u16 tocopy;
struct ngiflib_gif * p = i->parent;
while(n > 0) {
tocopy = (context->Xtogo < n) ? context->Xtogo : n;
if(!i->gce.transparent_flag) {
#ifndef NGIFLIB_INDEXED_ONLY
if(p->mode & NGI... | vuln | Vulnerable | C/C++ |
static void vtd_realize(DeviceState *dev, Error **errp)
{
PCMachineState *pcms = PC_MACHINE(qdev_get_machine());
PCIBus *bus = pcms->bus;
IntelIOMMUState *s = INTEL_IOMMU_DEVICE(dev);
X86IOMMUState *x86_iommu = X86_IOMMU_DEVICE(dev);
VTD_DPRINTF(GENERAL, "");
x86_iommu->type = TYPE_INTEL;
if... | vuln | Vulnerable | C/C++ |
static void do_safe_dpy_refresh(CPUState *cpu, run_on_cpu_data opaque)
{
DisplayChangeListener *dcl = opaque.host_ptr;
qemu_mutex_lock_iothread();
dcl->ops->dpy_refresh(dcl);
qemu_mutex_unlock_iothread();
} | vuln | Safe | C/C++ |
@Override
public ParceledListSlice<SessionInfo> getAllSessions(int userId) {
final int callingUid = Binder.getCallingUid();
mPermissionManager.enforceCrossUserPermission(
callingUid, userId, true, false, "getAllSessions");
final List<SessionInfo> result = new ArrayList<>();
... | vuln | Safe | Java |
static void gf_m2ts_process_pmt(GF_M2TS_Demuxer *ts, GF_M2TS_SECTION_ES *pmt, GF_List *sections, u8 table_id, u16 ex_table_id, u8 version_number, u8 last_section_number, u32 status)
{
u32 info_length, pos, desc_len, evt_type, nb_es,i;
u32 nb_sections;
u32 data_size;
u32 nb_hevc, nb_hevc_temp, nb_shvc, nb_shvc_temp,... | 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.
*/
package com.rebuild.core.service.query;
import cn.devezhao.commons.Calenda... | vuln | Vulnerable | Java |
cache_fill_missing(struct module_env* env, uint16_t qclass,
struct regional* region, struct delegpt* dp)
{
struct delegpt_ns* ns;
struct msgreply_entry* neg;
struct ub_packed_rrset_key* akey;
time_t now = *env->now;
for(ns = dp->nslist; ns; ns = ns->next) {
akey = rrset_cache_lookup(env->rrset_cache, ns->name,... | vuln | Safe | Unknown |
@Override
public void addPeriodicSync(Account account, String authority, Bundle extras,
long pollFrequency) {
Bundle.setDefusable(extras, true);
if (account == null) {
throw new IllegalArgumentException("Account must not be null");
}
if (Te... | vuln | Safe | Java |
/*
*
* Copyright 2019 Asylo 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 agree... | vuln | Vulnerable | C/C++ |
public Value handleCommandLegacy(ServerCommandSource source, String call, List<Integer> coords, String arg)
{
try
{
CarpetProfiler.ProfilerToken currentSection = CarpetProfiler.start_section(null, "Scarpet command", CarpetProfiler.TYPE.GENERAL);
Value res = callLegacy(source,... | vuln | Safe | Java |
@Override
@SuppressWarnings("unchecked")
public void addInformation(ItemStack aStack, EntityPlayer aPlayer, @SuppressWarnings("rawtypes") List aList, boolean aF3_H) {
super.addInformation(aStack, aPlayer, aList, aF3_H);
byte aMeta = UT.Code.bind4(ST.meta_(aStack));
mPlaceable.addInformation(aStack, aMeta, aPlay... | vuln | Vulnerable | Java |
package com.salesmanager.shop.model.catalog.product;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import com.salesmanager.shop.model.catalog.category.ReadableCategory;
import com.salesmanager.shop.model.catalog.manufacturer.ReadableManufacturer;
import com.salesmanager.shop.model.ca... | vuln | Vulnerable | Java |
static int decode_frame(AVCodecContext *avctx, void *data,
int *data_size, AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
C93DecoderContext * const c93 = avctx->priv_data;
AVFrame * const newpic = &c93->pictures[c93->currentpic];
AVFrame ... | vuln | Vulnerable | C/C++ |
/*
* Nextcloud Android client application
*
* @author Tobias Kaminsky
* Copyright (C) 2017 Tobias Kaminsky
* Copyright (C) 2017 Nextcloud GmbH.
*
* 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 Softw... | vuln | Safe | Java |
import logging
from pathlib import Path
from shutil import which
from elasticsearch.exceptions import RequestError
from flask import Flask
from flask_compress import Compress
from flask_login import LoginManager
from flask_wtf.csrf import CSRFProtect
from archivy import helpers
from archivy.api import api_bp
from arc... | vuln | Safe | Python |
void SSL_CTX_free(SSL_CTX *a)
{
int i;
if (a == NULL) return;
i=CRYPTO_add(&a->references,-1,CRYPTO_LOCK_SSL_CTX);
#ifdef REF_PRINT
REF_PRINT("SSL_CTX",a);
#endif
if (i > 0) return;
#ifdef REF_CHECK
if (i < 0)
{
fprintf(stderr,"SSL_CTX_free, bad reference count\n");
abort(); /* ok */
}
#endif
if (a->... | vuln | Safe | Unknown |
.factory('Alert', ['$rootScope', '$filter', function ($rootScope, $filter) {
return function (hdr, msg, cls, action, secondAlert, disableButtons, backdrop) {
var scope = $rootScope.$new(), alertClass, local_backdrop;
msg = $filter('sanitize')(msg);
if (secondAlert) {
$('#alertHe... | vuln | Safe | JavaScript |
static int wavpack_decode_block(AVCodecContext *avctx, int block_no,
void *data, int *got_frame_ptr,
const uint8_t *buf, int buf_size)
{
WavpackContext *wc = avctx->priv_data;
WavpackFrameContext *s;
void *samples = data;
int samplecount;
... | vuln | Vulnerable | C/C++ |
static hwaddr ppc_hash64_htab_lookup(CPUPPCState *env,
ppc_slb_t *slb, target_ulong eaddr,
ppc_hash_pte64_t *pte)
{
hwaddr pteg_off, pte_offset;
hwaddr hash;
uint64_t vsid, epnshift, epnmask, epn, ptem;
epnshift = (slb->vsid ... | vuln | Vulnerable | C/C++ |
static Image *ReadVIDImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
#define ClientName "montage"
char
**filelist,
*label,
**list;
Image
*image,
*images,
*montage_image,
*next_image,
*thumbnail_image;
ImageInfo
*read_info;
int
number_files;
MagickBoo... | vuln | Vulnerable | C/C++ |
static void serial_update_parameters(SerialState *s)
{
int speed, parity, data_bits, stop_bits, frame_size;
QEMUSerialSetParams ssp;
if (s->divider == 0)
return;
/* Start bit. */
frame_size = 1;
/* Parity bit. */
frame_size++;
if (s->lcr & 0x10)
p... | vuln | Vulnerable | C/C++ |
MOBI_RET mobi_parse_huff(MOBIHuffCdic *huffcdic, const MOBIPdbRecord *record) {
MOBIBuffer *buf = mobi_buffer_init_null(record->data, record->size);
if (buf == NULL) {
debug_print("%s\n", "Memory allocation failed");
return MOBI_MALLOC_FAILED;
}
char huff_magic[5];
mobi_buffer_getstr... | vuln | Vulnerable | Unknown |
PluginInstance::PluginInstance(PluginLib *plugin, const std::string &mime_type)
: plugin_(plugin),
npp_(0),
host_(PluginHost::Singleton()),
npp_functions_(plugin->functions()),
window_handle_(0),
windowless_(false),
transparent_(true),
webplugin_(0),
mime_type_(mime_t... | vuln | Vulnerable | C/C++ |
@Override
protected Iterator<PdfBoxPage> nextIterator(int count) {
int index = count - 1; // caution: count is one-based
try {
return (index < getNumberOfPages()) ? new SingletonIterator<>(getPage(index)) : null;
}
catch (PdfException pe) {
throw new PdfRuntimeE... | vuln | Safe | Java |
public static SAXParserFactory createSaxParserFactory()
{
final SAXParserFactory parserFactory = SAXParserFactory.newInstance();
try
{
parserFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
}
catch (SAXNotRecognizedException | SAXNotSupportedExcep... | vuln | Vulnerable | Java |
nextvar(
int *datalen,
const char **datap,
char **vname,
char **vvalue
)
{
const char *cp;
const char *np;
const char *cpend;
size_t srclen;
size_t len;
static char name[MAXVARLEN];
static char value[MAXVALLEN];
cp = *datap;
cpend = cp + *datalen;
/*
* Space past commas and white space
*/
while (c... | vuln | Vulnerable | C/C++ |
TfLiteStatus Prepare(KernelType kernel_type, TfLiteContext* context,
TfLiteNode* node) {
auto* params = reinterpret_cast<TfLiteConvParams*>(node->builtin_data);
OpData* data = reinterpret_cast<OpData*>(node->user_data);
bool has_bias = node->inputs->size == 3;
// Check number of inputs/out... | vuln | Vulnerable | Unknown |
import { FlowRouter } from 'meteor/ostrio:flow-router-extra'
import dayjs from 'dayjs'
import utc from 'dayjs/plugin/utc'
import customParseFormat from 'dayjs/plugin/customParseFormat'
import randomColor from 'randomcolor'
import { t } from '../../utils/i18n.js'
import {
emojify,
getUserSetting,
getGlobalSetting,... | vuln | Vulnerable | JavaScript |
static void pci_ich9_ahci_realize(PCIDevice *dev, Error **errp)
{
struct AHCIPCIState *d;
int sata_cap_offset;
uint8_t *sata_cap;
d = ICH_AHCI(dev);
ahci_realize(&d->ahci, DEVICE(dev), pci_get_address_space(dev), 6);
pci_config_set_prog_interface(dev->config, AHCI_PROGMODE_MAJOR_REV_1);
dev-... | vuln | Vulnerable | C/C++ |
void TestingPlatformSupport::cryptographicallyRandomValues(unsigned char* buffer, size_t length)
{
} | vuln | Vulnerable | Unknown |
@Override
public void removeGoal(Goal task)
{
this.availableGoals.stream().filter((goal) -> {
return goal.getGoal() == task;
}).filter(PrioritizedGoal::isRunning).forEach(PrioritizedGoal::stop);
this.availableGoals.removeIf((goal) -> {
return goal.getGoal() == tas... | vuln | Vulnerable | Java |
int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
const struct tcphdr *th, unsigned int len)
{
struct tcp_sock *tp = tcp_sk(sk);
struct inet_connection_sock *icsk = inet_csk(sk);
int queued = 0;
int res;
tp->rx_opt.saw_tstamp = 0;
switch (sk->sk_state) {
case TCP_CLOSE:
goto discard;
cas... | vuln | Vulnerable | C/C++ |
public Point findClosestPoint(CombatStack st, CombatStack tgt) {
if (!st.canMove())
return null;
//ail: We will always want to go as close as possible because this increases hit-chance
int targetDist = 1;
//ail: only repulsors will prevent us from doing so, if we don't have... | vuln | Safe | Java |
jbig2_sd_release(Jbig2Ctx *ctx, Jbig2SymbolDict *dict)
{
uint32_t i;
if (dict == NULL)
return;
for (i = 0; i < dict->n_symbols; i++)
if (dict->glyphs[i])
jbig2_image_release(ctx, dict->glyphs[i]);
jbig2_free(ctx->allocator, dict->glyphs);
jbig2_free(ctx->allocator, d... | vuln | Safe | C/C++ |
static void audit_inotify_unregister(struct list_head *in_list)
{
struct audit_parent *p, *n;
list_for_each_entry_safe(p, n, in_list, ilist) {
list_del(&p->ilist);
inotify_rm_watch(audit_ih, &p->wdata);
/* the put matching the get in audit_do_del_rule() */
put_inotify_watch(&p->wdata);
}
} | vuln | Vulnerable | Unknown |
static void vhost_virtqueue_stop(struct vhost_dev *dev,
struct VirtIODevice *vdev,
struct vhost_virtqueue *vq,
unsigned idx)
{
int vhost_vq_index = dev->vhost_ops->vhost_get_vq_index(dev, idx);
struct vho... | vuln | Safe | C/C++ |
/* Grammar subroutines needed by parser */
#include "Python.h"
#include "pgenheaders.h"
#include "grammar.h"
#include "token.h"
/* Return the DFA for the given type */
dfa *
Ta3Grammar_FindDFA(grammar *g, int type)
{
dfa *d;
#if 1
/* Massive speed-up */
d = &g->g_dfa[type - NT_OFFSET];
assert(d->d_t... | vuln | Vulnerable | Python |
messagesController.getConversation = async (req, res) => {
const cid = req.params.convoid
if (_.isUndefined(cid)) return handleError(res, 'Invalid Conversation ID!')
const content = {}
content.title = 'Messages'
content.nav = 'messages'
content.data = {}
content.data.user = req.user
content.data.common... | vuln | Safe | JavaScript |
void DownloadRequestLimiter::TabDownloadState::DidFinishNavigation(
content::NavigationHandle* navigation_handle) {
if (!navigation_handle->IsInMainFrame())
return;
if (status_ == ALLOW_ONE_DOWNLOAD ||
(status_ == PROMPT_BEFORE_DOWNLOAD &&
!navigation_handle->IsRendererInitiated())) {
No... | vuln | Vulnerable | C/C++ |
static int install_process_keyring(void)
{
struct cred *new;
int ret;
new = prepare_creds();
if (!new)
return -ENOMEM;
ret = install_process_keyring_to_cred(new);
if (ret < 0) {
abort_creds(new);
return ret;
}
return commit_creds(new);
} | vuln | Safe | Unknown |
static MagickBooleanType WritePALMImage(const ImageInfo *image_info,
Image *image,ExceptionInfo *exception)
{
MagickBooleanType
status;
MagickOffsetType
currentOffset,
offset,
scene;
MagickSizeType
cc;
PixelInfo
transpix;
QuantizeInfo
*quantize_info;
register ssize_t
x... | vuln | Vulnerable | C/C++ |
void HostPortAllocatorSession::OnSessionRequestDone(
void HostPortAllocatorSession::OnURLFetchComplete(
const net::URLFetcher* source) {
url_fetchers_.erase(source);
delete source;
if (source->GetResponseCode() != net::HTTP_OK) {
LOG(WARNING) << "Received error when allocating relay session: "
... | vuln | Safe | C/C++ |
//Copyright (c) 2016 Crystalline Technologies
//
// 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, modify, merge, pu... | vuln | Vulnerable | JavaScript |
def add_acl_usergroup(session, acl_role_id, user_group, name)
if (user_group == "user") or (user_group == "group")
stdout, stderr, retval = run_cmd(
session, PCS, "acl", user_group, "create", name.to_s, acl_role_id.to_s
)
if retval == 0
return ""
end
if not /^error: (user|group) #{name... | vuln | Vulnerable | Ruby |
private void createInflater() {
Project currentProject = ProjectManager.getInstance().getCurrentProject();
if (currentProject == null) {
exit(getString(R.string.error), "No project opened.");
return;
}
Module module = currentProject.getModule(mCurrentFile);
... | vuln | Safe | Java |
public synchronized @Nullable ConnectionDescriptor getConn(int i) {
if((i < 0) || (i >= mCurItems))
return null;
int pos = (firstPos() + i) % mSize;
return mItemsRing[pos];
} | vuln | Safe | Java |
@Override
public void read() {
if (!getFile().exists()) {
write();
return;
}
Map<String, Object> parsedYaml = YamlHelper.INSTANCE.readFile(getFile());
DropDownGui.setCurrentTheme(DropDownGui.getTheme((String)parsedYaml.get("Theme")));
} | vuln | Vulnerable | Java |
/*
* Copyright (c) 2008-2017, 2019-2020 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/LICENSE-2.0
*
* Unless required by applic... | vuln | Vulnerable | C/C++ |
package com.salesmanager.shop.model.catalog.product;
import java.io.Serializable;
/**
* Lightweight version of Persistable product
* @author carlsamson
*
*/
public class LightPersistableProduct implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
private String price;
... | vuln | Safe | Java |
static mf_t *open_mf_pattern(void *talloc_ctx, struct demuxer *d, char *filename)
{
struct mp_log *log = d->log;
int error_count = 0;
int count = 0;
mf_t *mf = talloc_zero(talloc_ctx, mf_t);
mf->log = log;
if (filename[0] == '@') {
struct stream *s = stream_create(filename + 1,
... | vuln | Safe | C/C++ |
get_matching_data(krb5_context context,
pkinit_plg_crypto_context plg_cryptoctx,
pkinit_req_crypto_context req_cryptoctx, X509 *cert,
pkinit_cert_matching_data **md_out)
{
krb5_error_code ret = ENOMEM;
pkinit_cert_matching_data *md = NULL;
krb5_principal... | vuln | Vulnerable | C/C++ |
static int epaf_read_header(AVFormatContext *s)
{
int le, sample_rate, codec, channels;
AVStream *st;
avio_skip(s->pb, 4);
if (avio_rl32(s->pb))
return AVERROR_INVALIDDATA;
le = avio_rl32(s->pb);
if (le && le != 1)
return AVERROR_INVALIDDATA;
if (le) {
sample_rate = a... | vuln | Vulnerable | C/C++ |
_XimAttributeToValue(
Xic ic,
XIMResourceList res,
CARD16 *data,
CARD16 data_len,
XPointer value,
BITMASK32 mode)
{
switch (res->resource_size) {
case XimType_SeparatorOfNestedList:
case XimType_NEST:
break;
case XimType_CARD8:
case XimType_CARD16:
case... | vuln | Safe | C/C++ |
static bool ieee80211_accept_frame(struct ieee80211_rx_data *rx)
{
struct ieee80211_sub_if_data *sdata = rx->sdata;
struct sk_buff *skb = rx->skb;
struct ieee80211_hdr *hdr = (void *)skb->data;
struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
u8 *bssid = ieee80211_get_bssid(hdr, skb->len, sdata->vif.t... | vuln | Vulnerable | Unknown |
TfLiteRegistration CopyOpRegistration() {
TfLiteRegistration reg = {nullptr, nullptr, nullptr, nullptr};
reg.prepare = [](TfLiteContext* context, TfLiteNode* node) {
// Set output size to input size
const TfLiteTensor* tensor0 = GetInput(context, node, 0);
TfLiteTensor* tensor1 = GetOutput(co... | vuln | Vulnerable | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.