code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
f.setCellStyles(mxConstants.STYLE_ROTATION,Number(I.value),[e[t]])}}finally{f.getModel().endUpdate()}});O.className="geBtn gePrimaryBtn";mxEvent.addListener(m,"keypress",function(t){13==t.keyCode&&O.click()});n=document.createElement("div");n.style.marginTop="20px";n.style.textAlign="right";b.editor.cancelFirst?(n.appe... | vuln | Safe | JavaScript |
/* eslint eqeqeq: 0 */
/* eslint no-use-before-define: 0 */
/**
* Baobab Helpers
* ===============
*
* Miscellaneous helper functions.
*/
import {Monkey, MonkeyDefinition} from './monkey';
import type from './type';
const hasOwnProp = {}.hasOwnProperty;
/**
* Function returning the index of the first element of... | vuln | Vulnerable | JavaScript |
static int ivi_init_tiles(IVIBandDesc *band, IVITile *ref_tile,
int p, int b, int t_height, int t_width)
{
int x, y;
IVITile *tile = band->tiles;
for (y = 0; y < band->height; y += t_height) {
for (x = 0; x < band->width; x += t_width) {
tile->xpos = x;
... | vuln | Safe | C/C++ |
/*
* linux/kernel/exit.c
*
* Copyright (C) 1991, 1992 Linus Torvalds
*/
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/sched/autogroup.h>
#include <linux/sched/mm.h>
#include <linux/sched/stat.h>
#include <linux/sched/task.h>
#include <linux/sched/task_stack.h>
#include <linux/sched/cputime.h>
#i... | vuln | Safe | C/C++ |
static void parse_type_number(Visitor *v, const char *name, double *obj,
Error **errp)
{
StringInputVisitor *siv = to_siv(v);
char *endp = (char *) siv->string;
double val;
errno = 0;
if (siv->string) {
val = strtod(siv->string, &endp);
}
if (!siv->strin... | vuln | Vulnerable | C/C++ |
static int sdp_parse_fmtp_config_h264(AVStream * stream,
PayloadContext * h264_data,
char *attr, char *value)
{
AVCodecContext *codec = stream->codec;
assert(codec->codec_id == CODEC_ID_H264);
assert(h264_data != NULL);
if (!str... | vuln | Vulnerable | C/C++ |
static void pcnet_transmit(PCNetState *s)
{
hwaddr xmit_cxda = 0;
int count = CSR_XMTRL(s)-1;
int add_crc = 0;
int bcnt;
s->xmit_pos = -1;
if (!CSR_TXON(s)) {
s->csr[0] &= ~0x0008;
return;
}
s->tx_busy = 1;
txagain:
if (pcnet_tdte_poll(s)) {
struct pcnet_TM... | vuln | Vulnerable | C/C++ |
protected void normalise() {
// Check that all tile entities for which the chunk contains data are actually there
for (Iterator<TileEntity> i = getTileEntities().iterator(); i.hasNext(); ) {
final TileEntity tileEntity = i.next();
final Set<Integer> blockIds = LEGACY_TILE_ENTITY_... | vuln | Safe | Java |
void mp_encode_lua_table_as_array(lua_State *L, mp_buf *buf, int level) {
#if LUA_VERSION_NUM < 502
size_t len = lua_objlen(L,-1), j;
#else
size_t len = lua_rawlen(L,-1), j;
#endif
mp_encode_array(L,buf,len);
luaL_checkstack(L, 1, "in function mp_encode_lua_table_as_array");
for (j = 1; j <= len; j... | vuln | Safe | C/C++ |
cJSON *cJSON_CreateIntArray( int64_t *numbers, int count )
{
int i;
cJSON *n = 0, *p = 0, *a = cJSON_CreateArray();
for ( i = 0; a && i < count; ++i ) {
n = cJSON_CreateInt( numbers[i] );
if ( ! i )
a->child = n;
else
suffix_object( p, n );
p = n;
}
return a;
} | vuln | Vulnerable | C/C++ |
protected void stopScanningAndPopErrorDialog(ERROR_DIALOG_TYPE type) {
dismissDialogs();
// Throws error dialog.
final FragmentManager fragmentManager = getSupportFragmentManager();
if (fragmentManager.isDestroyed() || fragmentManager.isStateSaved()) {
return;
}
... | vuln | Safe | Java |
static int vpc_create(const char *filename, QEMUOptionParameter *options)
{
uint8_t buf[1024];
struct vhd_footer* footer = (struct vhd_footer*) buf;
struct vhd_dyndisk_header* dyndisk_header =
(struct vhd_dyndisk_header*) buf;
int fd, i;
uint16_t cyls;
uint8_t heads;
uint8_t secs_per... | vuln | Vulnerable | C/C++ |
void IndexedDBTransaction::Abort(const IndexedDBDatabaseError& error) {
IDB_TRACE1("IndexedDBTransaction::Abort", "txn.id", id());
DCHECK(!processing_event_queue_);
if (state_ == FINISHED)
return;
UMA_HISTOGRAM_ENUMERATION("WebCore.IndexedDB.TransactionAbortReason",
ExceptionCod... | vuln | Safe | C/C++ |
@Override
public void showSystemUIPartially() {
if (isFullscreen) {
final Window window = getParentActivity().getWindow();
window.setStatusBarColor(Color.TRANSPARENT);
window.setNavigationBarColor(Color.TRANSPARENT);
final int visibility = View.SYSTEM_UI_FLAG_... | vuln | Vulnerable | Java |
rsvg_cairo_pop_render_stack (RsvgDrawingCtx * ctx)
{
RsvgCairoRender *render = RSVG_CAIRO_RENDER (ctx->render);
cairo_t *child_cr = render->cr;
RsvgClipPath *lateclip = NULL;
cairo_surface_t *surface = NULL;
RsvgState *state = rsvg_current_state (ctx);
gboolean nest;
if (rsvg_current_state ... | vuln | Safe | Unknown |
xmlParseStartTag(xmlParserCtxtPtr ctxt) {
const xmlChar *name;
const xmlChar *attname;
xmlChar *attvalue;
const xmlChar **atts = ctxt->atts;
int nbatts = 0;
int maxatts = ctxt->maxatts;
int i;
if (RAW != '<') return(NULL);
NEXT1;
name = xmlParseName(ctxt);
if (name == NULL)... | vuln | Vulnerable | C/C++ |
HWNDMessageHandler::HWNDMessageHandler(HWNDMessageHandlerDelegate* delegate)
: delegate_(delegate),
fullscreen_handler_(new FullscreenHandler),
weak_factory_(this),
waiting_for_close_now_(false),
remove_standard_frame_(false),
use_system_default_icon_(false),
restore_focus_when_e... | vuln | Vulnerable | C/C++ |
def handle(_name, cfg, cloud, log, args):
if len(args) != 0:
# if run from command line, and give args, wipe the chpasswd['list']
password = args[0]
if 'chpasswd' in cfg and 'list' in cfg['chpasswd']:
del cfg['chpasswd']['list']
else:
password = util.get_cfg_option_st... | vuln | Safe | Python |
imap_auth_res_t imap_auth_cram_md5 (IMAP_DATA* idata, const char* method)
{
char ibuf[LONG_STRING*2], obuf[LONG_STRING];
unsigned char hmac_response[MD5_DIGEST_LEN];
int len;
int rc;
if (!mutt_bit_isset (idata->capabilities, ACRAM_MD5))
return IMAP_AUTH_UNAVAIL;
mutt_message _("Authenticating (CRAM-MD... | vuln | Vulnerable | C/C++ |
function escapeShellArg(arg) {
return arg.replace(/'/g, `'\\''`);
} | vuln | Vulnerable | JavaScript |
int ff_mpv_reallocate_putbitbuffer(MpegEncContext *s, size_t threshold, size_t size_increase)
{
if ( s->pb.buf_end - s->pb.buf - (put_bits_count(&s->pb)>>3) < threshold
&& s->slice_context_count == 1
&& s->pb.buf == s->avctx->internal->byte_buffer) {
int lastgob_pos = s->ptr_lastgob - s->p... | vuln | Safe | C/C++ |
static int hiddev_open(struct inode *inode, struct file *file)
{
struct hiddev_list *list;
struct usb_interface *intf;
struct hid_device *hid;
struct hiddev *hiddev;
int res;
intf = usbhid_find_interface(iminor(inode));
if (!intf)
return -ENODEV;
hid = usb_get_intfdata(intf);
hiddev = hid->hiddev;
if (!(l... | vuln | Safe | C/C++ |
bool ChanPage(CWebSock& WebSock, CTemplate& Tmpl, CIRCNetwork* pNetwork, CChan* pChan = NULL) {
CSmartPtr<CWebSession> spSession = WebSock.GetSession();
Tmpl.SetFile("add_edit_chan.tmpl");
CUser* pUser = pNetwork->GetUser();
if (!pUser) {
WebSock.PrintErrorPage("That user doesn't exist");
return true;
... | vuln | Vulnerable | Unknown |
/*
* An async IO implementation for Linux
* Written by Benjamin LaHaise <bcrl@kvack.org>
*
* Implements an efficient asynchronous io interface.
*
* Copyright 2000, 2001, 2002 Red Hat, Inc. All Rights Reserved.
*
* See ../COPYING for licensing terms.
*/
#include <linux/kernel.h>
#include <linux/init.h>
#includ... | vuln | Safe | C/C++ |
public ProtoArray build() {
checkNotNull(progressiveBalancesMode, "Progressive balances mode must be supplied");
checkNotNull(currentEpoch, "Current epoch must be supplied");
checkNotNull(justifiedCheckpoint, "Justified checkpoint must be supplied");
checkNotNull(finalizedCheckpoint, "finalized checkpoi... | vuln | Vulnerable | Java |
void rose_stop_timer(struct sock *sk)
{
sk_stop_timer(sk, &rose_sk(sk)->timer);
} | vuln | Safe | Unknown |
@Override
protected void encode(ChannelHandlerContext ctx, ByteBuf uncompressed, ByteBuf out) throws Exception {
if (finished) {
out.writeBytes(uncompressed);
return;
}
int len = uncompressed.readableBytes();
if (len == 0) {
return;
}
... | vuln | Safe | Java |
public void persistToken(Token token) {
final var key = token.getId().asMerkle();
final var mutableToken = tokens.get().getForModify(key);
mapModelChangesToMutable(token, mutableToken);
final var treasury = mutableToken.treasury();
if (token.hasMintedUniqueTokens()) {
persistMinted(token.mintedUniqueToken... | vuln | Safe | Java |
public static boolean isLanguageEnabled(@NotNull String locale) {
// Either all languages are enabled or, we auto-enable English: Addons that only
// have english translations and/or are missing a translation for the enabled
// language(s) on this server need to be able to inject their english
// tranlations.
... | vuln | Vulnerable | Java |
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2018-2019 OzzieIsaacs, cervinko, jkrehm, bodybybuddha, ok11,
# andy29485, idalin, Kyosfonica, wuqi, Kennyl, lemmsh,
# falgh1, grunjol, csitk... | vuln | Safe | JavaScript |
@Nullable
public static Object convertFromLua(Lua L, Class<?> clazz, int index)
throws IllegalArgumentException {
Lua.LuaType type = L.type(index);
if (type == Lua.LuaType.NIL) {
if (clazz.isPrimitive()) {
throw new IllegalArgumentException("Primitive not acce... | vuln | Safe | Java |
ram_addr_t qemu_ram_alloc_from_ptr(ram_addr_t size, void *host,
MemoryRegion *mr)
{
RAMBlock *new_block;
size = TARGET_PAGE_ALIGN(size);
new_block = g_malloc0(sizeof(*new_block));
new_block->mr = mr;
new_block->offset = find_ram_offset(size);
if (host) {
... | vuln | Safe | C/C++ |
/*
* kernel/sched/core.c
*
* Kernel scheduler and related syscalls
*
* Copyright (C) 1991-2002 Linus Torvalds
*
* 1996-12-23 Modified by Dave Grothe to fix bugs in semaphores and
* make semaphores SMP safe
* 1998-11-19 Implemented schedule_timeout() and related stuff
* by Andrea Arcangeli
* 2002-01... | vuln | Safe | C/C++ |
// Copyright (c) the JPEG XL Project 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 "lib/extras/codec_apng.h"
// Parts of this code are taken from apngdis, which has the following license:
/* APNG Disassembler 2.8
*
*... | vuln | Vulnerable | C/C++ |
static njs_int_t
njs_json_stringify_iterator(njs_vm_t *vm, njs_json_stringify_t *stringify,
njs_value_t *object)
{
u_char *p;
int64_t size, length;
njs_int_t ret;
njs_chb_t chain;
njs_value_t *key, *value, index, wrapper;
njs_object_t *obj;
... | vuln | Safe | C/C++ |
private void eliminateSelfLoops(Collection<CFANode> pNodes) throws InterruptedException {
List<CFANode> toAdd = new ArrayList<>();
for (CFANode node : pNodes) {
this.shutdownNotifier.shutdownIfNecessary();
for (CFAEdge edge : CFAUtils.leavingEdges(node)) {
CFANode successor = edge.getSucces... | vuln | Vulnerable | Java |
private void createWorkers() {
// Create thread for checking and scheduling flush job
ThreadFactory flushThreadFactory =
new ThreadFactoryBuilder().setNameFormat("ingest-flush-thread").build();
this.flushWorker = Executors.newSingleThreadScheduledExecutor(flushThreadFactory);
this.flushWorker.sc... | vuln | Safe | Java |
void PacketReader::getLabelFromContent(const vector<uint8_t>& content, uint16_t& frompos, string& ret, int recurs)
{
if(recurs > 100) // the forward reference-check below should make this test 100% obsolete
throw MOADNSException("Loop");
// it is tempting to call reserve on ret, but it turns out it creates a m... | vuln | Safe | Unknown |
ASC_destroyAssociation(T_ASC_Association ** association)
{
OFCondition cond = EC_Normal;
/* don't worry if already destroyed */
if (association == NULL) return EC_Normal;
if (*association == NULL) return EC_Normal;
if ((*association)->DULassociation != NULL) {
ASC_dropAssociation(*associat... | vuln | Vulnerable | C/C++ |
/* Copyright 2018 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 |
private static Stream<Path> searchPotentialJavaExecutables() throws IOException {
List<Stream<Path>> javaExecutables = new ArrayList<>();
switch (OperatingSystem.CURRENT_OS) {
case WINDOWS:
javaExecutables.add(queryJavaHomesInRegistryKey("HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSo... | vuln | Safe | Java |
/*
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2000-2012
* All rights reserved
*
* This file is part of GPAC / Media Tools sub-project
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser Gene... | vuln | Safe | C/C++ |
int64 CSteamNetworkConnectionBase::SNP_SendMessage( CSteamNetworkingMessage *pSendMessage, SteamNetworkingMicroseconds usecNow, bool *pbThinkImmediately )
{
int cbData = (int)pSendMessage->m_cbSize;
// Assume we won't want to wake up immediately
if ( pbThinkImmediately )
*pbThinkImmediately = false;
// Check if... | vuln | Safe | Unknown |
public SAXReader(String xmlReaderClassName) throws SAXException {
if (xmlReaderClassName != null) {
this.xmlReader = XMLReaderFactory
.createXMLReader(xmlReaderClassName);
}
} | vuln | Vulnerable | Java |
private void newRequest(ChannelHandlerContext ctx, HttpRequest nettyRequest) throws Exception {
if (!nettyRequest.decoderResult().isSuccess()) {
LOGGER.debug("Failed to decode HTTP request.", nettyRequest.decoderResult().cause());
sendError(ctx, HttpResponseStatus.BAD_REQUEST);
return;
}
... | vuln | Safe | Java |
/*
* Copyright (c) 2004-2021, University of Oslo
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
* list of cond... | vuln | Vulnerable | Java |
static int bdrv_check_byte_request(BlockDriverState *bs, int64_t offset,
size_t size)
{
int64_t len;
if (size > INT_MAX) {
return -EIO;
}
if (!bdrv_is_inserted(bs))
return -ENOMEDIUM;
if (bs->growable)
return 0;
len = bdrv_getlength(bs);... | vuln | Safe | C/C++ |
bool qemu_net_queue_flush(NetQueue *queue)
{
while (!QTAILQ_EMPTY(&queue->packets)) {
NetPacket *packet;
int ret;
packet = QTAILQ_FIRST(&queue->packets);
QTAILQ_REMOVE(&queue->packets, packet, entry);
ret = qemu_net_queue_deliver(queue,
pa... | vuln | Vulnerable | C/C++ |
/*
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator p... | vuln | Safe | Java |
const got = require('@/utils/got');
const cheerio = require('cheerio');
const { isValidHost } = require('@/utils/valid-host');
module.exports = async (ctx) => {
const language = ctx.params.language || 'www';
const username = ctx.params.username;
const sort = ctx.params.sort || 'mr';
const link = `https... | vuln | Safe | JavaScript |
static jobject Bitmap_createFromParcel(JNIEnv* env, jobject, jobject parcel) {
if (parcel == NULL) {
SkDebugf("-------- unparcel parcel is NULL\n");
return NULL;
}
android::Parcel* p = android::parcelForJavaObject(env, parcel);
const bool isMutable = p->readInt32() != 0;
const SkColorType colorType =... | vuln | Safe | C/C++ |
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */
/*
* lsquic_full_conn.c -- A "full" connection object has full functionality
*/
#include <assert.h>
#include <errno.h>
#include <inttypes.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#ifndef WIN32
#include <netinet/in.h>
#inc... | vuln | Vulnerable | C/C++ |
/*
* Copyright 2017-2019 original 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 agre... | vuln | Vulnerable | Java |
static int xwd_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame, AVPacket *avpkt)
{
AVFrame *p = data;
const uint8_t *buf = avpkt->data;
int i, ret, buf_size = avpkt->size;
uint32_t version, header_size, vclass, ncolors;
uint32_t xoffset, be, bpp, lsize, rsi... | vuln | Safe | C/C++ |
/* Copyright 2017 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++ |
public void addEntity(DataTypeProvider provider, Function<DataTypeProvider, Entity> parser) {
this.executor.execute(() -> attempt(() -> {
Entity ent = parser.apply(provider);
entities.put(ent.getId(), ent);
ent.registerOnLocationChange((oldPos, newPos) -> {
C... | vuln | Safe | Java |
$user = db_fetch_cell_prepared('SELECT username FROM user_auth WHERE id = ?', array($check['user']), 'username');
form_alternate_row('line' . $check['id']);
$name = get_data_source_title($check['datasource']);
$title = $name;
if (strlen($name) > 50) {
$name = substr($name, 0, 50);
}
form_selectabl... | vuln | Safe | PHP |
/*-------------------------------------------------------------------------
*
* selfuncs.c
* Selectivity functions and index cost estimation functions for
* standard operators and index access methods.
*
* Selectivity routines are registered in the pg_operator catalog
* in the "oprrest" and "oprjoin" att... | vuln | Safe | C/C++ |
void create_empty_file_as_root(const char *fname, mode_t mode) {
assert(fname);
mode &= 07777;
struct stat s;
if (stat(fname, &s)) {
if (arg_debug)
printf("Creating empty %s file\n", fname);
/* coverity[toctou] */
// don't fail if file already exists. This can be the case in a race
// condition, when tw... | vuln | Safe | Unknown |
async function respond(request, options, manifest, state) {
/** URL but stripped from the potential `/__data.json` suffix and its search param */
let url = new URL(request.url);
if (options.csrf_check_origin) {
const forbidden =
is_form_content_type(request) &&
(request.method === 'POST' ||
request.met... | vuln | Safe | JavaScript |
public static void rebootSafeMode(final Context context, boolean confirm) {
UserManager um = (UserManager) context.getSystemService(Context.USER_SERVICE);
if (um.hasUserRestriction(UserManager.DISALLOW_SAFE_BOOT)) {
return;
}
mReboot = true;
mRebootCustom = false;
... | vuln | Safe | Java |
int hfsplus_rename_cat(u32 cnid,
struct inode *src_dir, struct qstr *src_name,
struct inode *dst_dir, struct qstr *dst_name)
{
struct super_block *sb = src_dir->i_sb;
struct hfs_find_data src_fd, dst_fd;
hfsplus_cat_entry entry;
int entry_size, type;
int err;
dprint(DBG_CAT_MOD, "rename_cat: %u... | vuln | Vulnerable | C/C++ |
psutil_net_if_addrs(PyObject* self, PyObject* args) {
struct ifaddrs *ifaddr, *ifa;
int family;
PyObject *py_retlist = PyList_New(0);
PyObject *py_tuple = NULL;
PyObject *py_address = NULL;
PyObject *py_netmask = NULL;
PyObject *py_broadcast = NULL;
PyObject *py_ptp = NULL;
if (py_... | vuln | Vulnerable | C/C++ |
static int noise(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, const char *args,
uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size, int keyframe){
unsigned int *state= bsfc->priv_data;
int amount= args ? atoi(args) : (*state % 10001+1);
... | vuln | Safe | C/C++ |
/**
* OpenKM, Open Document Management System (http://www.openkm.com)
* Copyright (c) 2006-2016 Paco Avila & Josep Llort
* <p>
* No bytes were intentionally harmed during the development of this application.
* <p>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the ... | vuln | Safe | Java |
private boolean validateCSRFToken(RequestEvent event) {
boolean isValid = true;
if (event.getRequestContext().isValidateCSRFToken()) {
for (CSRFTokenValidator validator : Services.get(CSRFTokenValidator.class)) {
if (!validator.isTokenValid(event.getRequest())) {
... | vuln | Vulnerable | Java |
def check_gui_status_of_nodes(session, nodes, check_mutuality=false, timeout=10)
options = {}
options[:check_auth_only] = '' if not check_mutuality
threads = []
not_authorized_nodes = []
online_nodes = []
offline_nodes = []
nodes = nodes.uniq.sort
nodes.each { |node|
threads << Thread.new {
c... | vuln | Vulnerable | Ruby |
// SPDX-License-Identifier: LGPL-2.1
/*
*
* Copyright (C) International Business Machines Corp., 2002,2011
* Author(s): Steve French (sfrench@us.ibm.com)
*
*/
#include <linux/fs.h>
#include <linux/net.h>
#include <linux/string.h>
#include <linux/sched/mm.h>
#include <linux/sched/signal.h>
#include <linux/list... | vuln | Safe | C/C++ |
public static void startTaskNotificationAlarm(Context context) {
AlarmManager alarmMgr = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
Intent intent = new Intent(context, TaskNotificationService.class);
PendingIntent alarmIntent = PendingIntent.getService(
context,
1414,
intent,
Bui... | vuln | Safe | Java |
perf_event_parse_addr_filter(struct perf_event *event, char *fstr,
struct list_head *filters)
{
struct perf_addr_filter *filter = NULL;
char *start, *orig, *filename = NULL;
substring_t args[MAX_OPT_ARGS];
int state = IF_STATE_ACTION, token;
unsigned int kernel = 0;
int ret = -EINVAL;
orig = fstr = kstr... | vuln | Safe | C/C++ |
static void encode_block(NellyMoserEncodeContext *s, unsigned char *output, int output_size)
{
PutBitContext pb;
int i, j, band, block, best_idx, power_idx = 0;
float power_val, coeff, coeff_sum;
float pows[NELLY_FILL_LEN];
int bits[NELLY_BUF_LEN], idx_table[NELLY_BANDS];
float cand[NELLY_BANDS]... | vuln | Vulnerable | C/C++ |
status_t BnHDCP::onTransact(
uint32_t code, const Parcel &data, Parcel *reply, uint32_t flags) {
switch (code) {
case HDCP_SET_OBSERVER:
{
CHECK_INTERFACE(IHDCP, data, reply);
sp<IHDCPObserver> observer =
interface_cast<IHDCPObserver>(data.readStrongBinder());
r... | vuln | Safe | C/C++ |
// A Config object provides information about how a specific app is
// configured.
// mount is the URL for the root of the API; includes http, domain, etc.
import AppCache from './cache';
import SchemaCache from './Controllers/SchemaCache';
import DatabaseController from './Controllers/DatabaseController';
import net ... | vuln | Safe | JavaScript |
static FLAC__StreamDecoderWriteStatus
sf_flac_write_callback (const FLAC__StreamDecoder * UNUSED (decoder), const FLAC__Frame *frame, const int32_t * const buffer [], void *client_data)
{ SF_PRIVATE *psf = (SF_PRIVATE*) client_data ;
FLAC_PRIVATE* pflac = (FLAC_PRIVATE*) psf->codec_data ;
pflac->frame = frame ;
pfl... | vuln | Safe | C/C++ |
static int smb2_calc_max_out_buf_len(struct ksmbd_work *work,
unsigned short hdr2_len,
unsigned int out_buf_len)
{
int free_len;
if (out_buf_len > work->conn->vals->max_trans_size)
return -EINVAL;
free_len = (int)(work->response_sz -
(get_rfc1002_len(work->response_buf) + 4)) -
hdr2_len;
... | vuln | Vulnerable | C/C++ |
$this->run('rm', '-r', '--end-of-options', $item);
}
return $this;
} | vuln | Safe | PHP |
jbig2_find_changing_element(const byte *line, int x, int w)
jbig2_find_changing_element(const byte *line, uint32_t x, uint32_t w)
{
int a, b;
if (line == 0)
return (int)w;
if (x == MINUS1) {
a = 0;
x = 0;
} else {
}
while (x < w) {
b = getbit(line, x);
... | vuln | Safe | C/C++ |
/*
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2017 The PHP Group |
+---------... | vuln | Vulnerable | C/C++ |
static void recv_generator(char *fname, struct file_struct *file, int ndx,
int itemizing, enum logcode code, int f_out)
{
static const char *parent_dirname = "";
static struct file_struct *prior_dir_file = NULL;
/* Missing dir not created due to --dry-run; will still be scanned. */
static struct file_struct *... | vuln | Safe | Unknown |
/* SORT command and helper functions.
*
* Copyright (c) 2009-2012, Salvatore Sanfilippo <antirez at gmail dot com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions o... | vuln | Safe | C/C++ |
static void new_audio_stream(AVFormatContext *oc, int file_idx)
{
AVStream *st;
AVOutputStream *ost;
AVCodec *codec= NULL;
AVCodecContext *audio_enc;
enum CodecID codec_id = CODEC_ID_NONE;
st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0);
if (!st) {... | vuln | Safe | C/C++ |
static struct task_struct *copy_process(unsigned long clone_flags,
unsigned long stack_start,
unsigned long stack_size,
int __user *child_tidptr,
struct pid *pid,
int trace)
{
int retval;
struct task_struct *p;
if ((clone_flags & (CLONE_NEWNS|CLONE_FS)) == (CLONE_NEWNS|CLONE_FS))
return... | vuln | Safe | C/C++ |
@Override
public ActionResultType onItemUse(ItemUseContext ctx) {
World world = ctx.getWorld();
ItemStack stack = ctx.getItem();
PlayerEntity plr = ctx.getPlayer();
BlockPos pos = ctx.getPos();
if(!world.isRemote) {
ServerWorld serverWorld = (ServerWorld) world;
... | vuln | Safe | Java |
int bn_ham(const bn_t a) {
int c = 0;
for (int i = 0; i < bn_bits(a); i++) {
c += bn_get_bit(a, i);
}
return c;
} | vuln | Vulnerable | C/C++ |
@Override
public void callSessionMayHandover(int srcNetworkType, int targetNetworkType) {
TelephonyUtils.runWithCleanCallingIdentity(()-> {
if (mListener != null) {
mListener.callSessionMayHandover(ImsCallSession.this, srcNetworkType,
t... | vuln | Safe | Java |
static Jsi_RC BooleanConstructor(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
Jsi_Value **ret, Jsi_Func *funcPtr)
{
if (Jsi_FunctionIsConstructor(funcPtr)) {
int nv = 0;
if (Jsi_ValueGetLength(interp, args) > 0) {
Jsi_Value *v = Jsi_ValueArrayIndex(interp, args, 0);
... | vuln | Vulnerable | C/C++ |
def driver(self) -> str | None:
"""Driver from init param if given; else try to find one in connection extra."""
extra_driver = self.connection_extra_lower.get("driver")
if extra_driver:
if self._allow_driver_extra:
self._driver = extra_driver
else:
... | vuln | Safe | Python |
static void readline_hist_add(ReadLineState *rs, const char *cmdline)
{
char *hist_entry, *new_entry;
int idx;
if (cmdline[0] == '\0')
return;
new_entry = NULL;
if (rs->hist_entry != -1) {
hist_entry = rs->history[rs->hist_entry];
idx = rs->hist_entry;
if (strcmp(hist_entry, cmdline) == 0) {
... | vuln | Safe | C/C++ |
/*****************************************************************
|
| AP4 - MetaData
|
| Copyright 2002-2008 Axiomatic Systems, LLC
|
|
| This file is part of Bento4/AP4 (MP4 Atom Processing Library).
|
| Unless you have obtained Bento4 under a difference license,
| this version of Bento4 is Bento4|GPL... | vuln | Safe | C/C++ |
private void updateItems() {
if (receivedItems) return;
for (Slot s : chest.inventorySlots.inventorySlots) {
ItemStack stack = s.getStack();
if (stack.isEmpty() || !stack.hasDisplayName()) continue;
if (stack.getItem() == Items.NAME_TAG) {
receivedI... | vuln | Safe | Java |
v3d_submit_cl_ioctl(struct drm_device *dev, void *data,
struct drm_file *file_priv)
{
struct v3d_dev *v3d = to_v3d_dev(dev);
struct v3d_file_priv *v3d_priv = file_priv->driver_priv;
struct drm_v3d_submit_cl *args = data;
struct v3d_bin_job *bin = NULL;
struct v3d_render_job *render;
struct ww_acquire_ctx ac... | vuln | Vulnerable | C/C++ |
/*
Copyright 2017 The Kubernetes 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 agreed to in writing, ... | vuln | Safe | Go |
int socket_connect(SocketAddress *addr, Error **errp,
NonBlockingConnectHandler *callback, void *opaque)
{
QemuOpts *opts;
int fd;
opts = qemu_opts_create_nofail(&socket_optslist);
switch (addr->kind) {
case SOCKET_ADDRESS_KIND_INET:
inet_addr_to_opts(opts, addr->inet);
... | vuln | Safe | C/C++ |
int orangefs_set_acl(struct inode *inode, struct posix_acl *acl, int type)
{
struct orangefs_inode_s *orangefs_inode = ORANGEFS_I(inode);
int error = 0;
void *value = NULL;
size_t size = 0;
const char *name = NULL;
switch (type) {
case ACL_TYPE_ACCESS:
name = XATTR_NAME_POSIX_ACL_ACCESS;
if (acl) {
umode... | vuln | Vulnerable | C/C++ |
# -*- coding: utf-8 -*-
# Copyright 2014 OpenMarket Ltd
#
# 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 l... | vuln | Safe | Python |
function getFileLink(file) {
var file_name = highlight(file.name, filter_terms);
return (
'<a data-nodrag="true" href="' +
getFileUrl(file) +
'" title="' +
file.description +
'"><i class="fas fa-paperclip extra-card... | vuln | Vulnerable | JavaScript |
bool CmdLine::store( const std::vector<std::string>& argv,
boost::program_options::options_description& visible,
boost::program_options::options_description& hidden,
boost::program_options::positional_options_description& positional,
... | vuln | Vulnerable | Unknown |
#ifndef JSI_LITE_ONLY
#ifndef JSI_AMALGAMATION
#include "jsiInt.h"
#endif
// SCOPESTRS
Jsi_ScopeStrs *jsi_ScopeStrsNew()
{
Jsi_ScopeStrs *ret = (Jsi_ScopeStrs *)Jsi_Calloc(1, sizeof(*ret));
return ret;
}
void jsi_ScopeStrsFree(Jsi_Interp *interp, Jsi_ScopeStrs *ss)
{
if (!ss) return;
int i;
for (... | vuln | Safe | C/C++ |
saveCurrentNode: function () {
if (this.currentNode) {
if (this.currentNode != "root") {
this.currentNode.applyData();
} else {
// save root node data
var items = this.rootPanel.queryBy(function(item) {
if (item == this... | vuln | Safe | JavaScript |
/*
* client_example_control.c
*
* How to control a device ... intended to be used with server_example_control
*/
#include "iec61850_client.h"
#include "hal_thread.h"
#include <stdlib.h>
#include <stdio.h>
static void commandTerminationHandler(void *parameter, ControlObjectClient connection)
{
LastApplError... | vuln | Vulnerable | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.