code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
@WorkerThread
public static void persistBitmapAndStartActivity(Context context, Bitmap bitmap, Rect crop,
Intent intent, BiFunction<Uri, Intent, Intent[]> uriToIntentMap, String tag) {
Intent[] intents = uriToIntentMap.apply(getImageUri(bitmap, crop, context, tag), intent);
try {
... | vuln | Safe | Java |
@Override
public void breakBlock(@Nonnull World worldIn, @Nonnull BlockPos pos, @Nonnull IBlockState state) {
FluidPipeNet net = getWorldPipeNet(worldIn).getNetFromPos(pos);
TileEntityFluidPipe pipe = (TileEntityFluidPipe) getPipeTileEntity(worldIn, pos);
// get and remove all fluids of the ... | vuln | Safe | Java |
static int parse_times(void *log_ctx, int64_t **times, int *nb_times,
const char *times_str)
{
char *p;
int i, ret = 0;
char *times_str1 = av_strdup(times_str);
char *saveptr = NULL;
if (!times_str1)
return AVERROR(ENOMEM);
#define FAIL(err) ret = err; goto end
*nb... | vuln | Safe | C/C++ |
public function get_info($object_id, $table_name = '')
{
$table = $table_name ? Dba::escape($table_name) : Dba::escape(strtolower(get_class($this)));
$object_id = (int) $object_id;
// Make sure we've got a real id
if ($object_id < 1) {
return array();
}
... | vuln | Safe | PHP |
/* 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 | Vulnerable | C/C++ |
@SuppressWarnings("ResultOfMethodCallIgnored")
public static byte[] createTransformer(String transformedName, byte[] bytes, Multimap<String, PatcherTransformer> transformerMap, Logger logger) {
if (bytes == null) return null;
Collection<PatcherTransformer> transformers = transformerMap.get(transfor... | vuln | Vulnerable | Java |
static int svc_listen(struct socket *sock,int backlog)
{
DEFINE_WAIT(wait);
struct sock *sk = sock->sk;
struct atm_vcc *vcc = ATM_SD(sock);
int error;
pr_debug("svc_listen %p\n",vcc);
lock_sock(sk);
/* let server handle listen on unbound sockets */
if (test_bit(ATM_VF_SESSION,&vcc->flags)) {
error = -EINVAL;... | vuln | Safe | Unknown |
/*
* This file is part of Espruino, a JavaScript interpreter for Microcontrollers
*
* Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk>
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http... | vuln | Safe | C/C++ |
static const struct nfsd4_layout_ops *
nfsd4_layout_verify(struct svc_export *exp, unsigned int layout_type)
{
if (!exp->ex_layout_types) {
dprintk("%s: export does not support pNFS\n", __func__);
return NULL;
}
if (layout_type >= LAYOUT_TYPE_MAX ||
!(exp->ex_layout_types & (1 << layout_type))) {
dprintk... | vuln | Safe | C/C++ |
import os
import subprocess
import logging
import time
import argparse
import datetime
from traitlets import Integer, default
from traitlets.config import Configurable
from functools import partial
def execute_cmd(cmd, **kwargs):
"""
Call given command, yielding output line by line
"""
yield '$ {}\n'.... | vuln | Safe | Python |
/*
* CUSE: Character device in Userspace
*
* Copyright (C) 2008-2009 SUSE Linux Products GmbH
* Copyright (C) 2008-2009 Tejun Heo <tj@kernel.org>
*
* This file is released under the GPLv2.
*
* CUSE enables character devices to be implemented from userland much
* like FUSE allows filesystems. On initializati... | vuln | Safe | C/C++ |
static Image *ReadFAXImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
Image
*image;
MagickBooleanType
status;
/*
Open image file.
*/
assert(image_info != (const ImageInfo *) NULL);
assert(image_info->signature == MagickSignature);
if (image_info->debug != MagickFalse)
(void)... | vuln | Safe | C/C++ |
DOMWindow* CreateWindow(const String& url_string,
const AtomicString& frame_name,
const String& window_features_string,
LocalDOMWindow& calling_window,
LocalFrame& first_frame,
LocalFrame& opener_fram... | vuln | Vulnerable | C/C++ |
listener_ref_entry_remove_for_connection (GSListener *listener,
int entry_type,
const char *connection)
{
gboolean removed;
GHashTable *hash;
GHashTableIter iter;
GSListenerRefEntry *entry;
... | vuln | Safe | Unknown |
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2020 - Raw Material Software Limited
JUCE is an open source library subject to commercial or open-source
licensing.
The code included in this file is provided under ... | vuln | Vulnerable | C/C++ |
static gboolean
export_desktop_file (const char *app,
const char *branch,
const char *arch,
GKeyFile *metadata,
const char * const *previous_ids,
int parent_fd,
... | vuln | Safe | C/C++ |
async function clearUsersInfoForRequester(meetingId, requesterUserId) {
try {
const numberAffected = await UserInfos.removeAsync({ meetingId });
if (numberAffected) {
Logger.info(`Cleared User Infos requested by user=${requesterUserId}`);
}
} catch (err) {
Logger.info(`Error on clearing User ... | vuln | Safe | JavaScript |
static int ppc_hash64_pte_prot(PowerPCCPU *cpu,
ppc_slb_t *slb, ppc_hash_pte64_t pte)
{
CPUPPCState *env = &cpu->env;
unsigned pp, key;
int prot = 0;
key = !!(msr_pr ? (slb->vsid & SLB_VSID_KP)
: (slb->vsid & SLB_VSID_KS));
pp = (pte.pte1 & HPTE64_R_P... | vuln | Safe | C/C++ |
static void ivshmem_read(void *opaque, const uint8_t *buf, int size)
{
IVShmemState *s = opaque;
int incoming_fd, tmp_fd;
int guest_max_eventfd;
long incoming_posn;
if (fifo8_is_empty(&s->incoming_fifo) && size == sizeof(incoming_posn)) {
memcpy(&incoming_posn, buf, size);
} else {
... | vuln | Safe | C/C++ |
private void affectBlocksInAABB(AxisAlignedBB box) {
for (BlockPos pos : WorldUtil.getAllInBB(box)) {
BlockState state = world.getBlockState(pos);
Block block = state.getBlock();
// TODO: The "explosion" parameter can't actually be null
if (!block.isAir(state, world, pos) && block.getExplosionResistance(... | vuln | Safe | Java |
void PPB_Buffer_Proxy::OnMsgCreate(
PP_Instance instance,
uint32_t size,
HostResource* result_resource,
ppapi::proxy::SerializedHandle* result_shm_handle) {
result_shm_handle->set_null_shmem();
HostDispatcher* dispatcher = HostDispatcher::GetForInstance(instance);
if (!dispatcher)
return;
... | vuln | Safe | Unknown |
static MagickBooleanType WriteDPXImage(const ImageInfo *image_info,
Image *image)
{
const char
*value;
const StringInfo
*profile;
DPXInfo
dpx;
MagickBooleanType
status;
MagickOffsetType
offset;
MagickStatusType
flags;
GeometryInfo
geometry_info;
QuantumInfo
*quan... | vuln | Vulnerable | C/C++ |
public function delete()
{
return $this->filesystem->deleteDir($this->path);
} | vuln | Vulnerable | JavaScript |
static ssize_t _hostfs_pread(
oe_fd_t* desc,
void* buf,
size_t count,
oe_off_t offset)
{
ssize_t ret = -1;
file_t* file = _cast_file(desc);
/*
* According to the POSIX specification, when the count is greater
* than SSIZE_MAX, the result is implementation-defined. OE raises an
... | vuln | Safe | Unknown |
private static boolean moveOutOfSuperSubScript(EditorState editorState) {
MathComponent cursorFieldLeft = editorState.getCurrentField().getArgument(
editorState.getCurrentOffset() - 1);
MathComponent cursorFieldRight = editorState.getCurrentField().getArgument(
editorState.getCurrentOffset());
MathContain... | vuln | Vulnerable | Java |
latin_ptr2len(char_u *p)
{
return *p == NUL ? 0 : 1;
} | vuln | Safe | Unknown |
static void wait_for_child_to_die(void *ctx)
{
REQUEST *request = ctx;
rad_assert(request->magic == REQUEST_MAGIC);
remove_from_request_hash(request);
/*
* If it's still queued (waiting for a thread to pick it
* up) OR, it's running AND there's still a child thread
* handling it, THEN delay some more.
*/
... | vuln | Safe | C/C++ |
_gnutls_server_name_recv_params (gnutls_session_t session,
const opaque * data, size_t _data_size)
{
int i;
const unsigned char *p;
uint16_t len, type;
ssize_t data_size = _data_size;
int server_names = 0;
if (session->security_parameters.entity == GNUTLS_SERVER)
{
DECR_LENGTH_RET (data_size... | vuln | Safe | C/C++ |
static void print_header(void)
{
if (!cgi_waspost()) {
printf("Expires: 0\r\n");
}
printf("Content-type: text/html\r\n\r\n");
if (!include_html("include/header.html")) {
printf("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2//EN\">\n");
printf("<HTML>\n<HEAD>\n<TITLE>Samba Web Administration Tool</TITLE>\n</HE... | vuln | Vulnerable | Unknown |
/* JAI-Ext - OpenSource Java Advanced Image Extensions Library
* http://www.geo-solutions.it/
* Copyright 2018 GeoSolutions
*
* 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
* ... | vuln | Vulnerable | Java |
int
nfs3svc_decode_writeargs(struct svc_rqst *rqstp, __be32 *p,
struct nfsd3_writeargs *args)
{
unsigned int len, v, hdr, dlen;
u32 max_blocksize = svc_max_payload(rqstp);
struct kvec *head = rqstp->rq_arg.head;
struct kvec *tail = rqstp->rq_arg.tail;
p = decode_fh(p, &args->fh);
if (!p)
return 0;
p = xd... | vuln | Safe | C/C++ |
static int mxpeg_decode_frame(AVCodecContext *avctx,
void *data, int *got_frame,
AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
MXpegDecodeContext *s = avctx->priv_data;
MJpegDecodeContext *jpg = &s->jpg;
const uin... | vuln | Safe | C/C++ |
/*
Copyright 2018-2020 Accenture Technology
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 la... | vuln | Safe | Java |
function lazyLoadCustomEmoji(element: HTMLElement): void {
const img = createElement('img', CLASS_CUSTOM_EMOJI) as HTMLImageElement;
if (element.dataset.emoji) {
img.src = element.dataset.emoji;
element.innerText = '';
element.appendChild(img);
}
} | vuln | Vulnerable | JavaScript |
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2021 DBeaver Corp and others
*
* 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/LICE... | vuln | Vulnerable | Java |
wc_any_to_ucs(wc_wchar_t cc)
{
int f;
wc_uint16 *map = NULL;
wc_uint32 map_size = 0x80;
wc_map *map2;
f = WC_CCS_INDEX(cc.ccs);
switch (WC_CCS_TYPE(cc.ccs)) {
case WC_CCS_A_CS94:
if (cc.ccs == WC_CCS_US_ASCII)
return cc.code;
if (f < WC_F_ISO_BASE || f > WC_F_CS94_END)
return WC... | vuln | Vulnerable | C/C++ |
@Override
public void fillData(SnowstormMorph morph)
{
super.fillData(morph);
Set<String> keys = new HashSet<String>();
BedrockScheme scheme = this.morph.getEmitter().scheme;
for (String key : this.morph.variables.keySet())
{
... | vuln | Safe | Java |
import dayjs from 'dayjs'
import utc from 'dayjs/plugin/utc'
import { saveAs } from 'file-saver'
import { FlowRouter } from 'meteor/ostrio:flow-router-extra'
import { NullXlsx } from '@neovici/nullxlsx'
import bootstrap from 'bootstrap'
import { i18nReady, t } from '../../utils/i18n.js'
import Timecards from '../../api... | vuln | Vulnerable | JavaScript |
#include <errno.h>
#include <poll.h>
#include <signal.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <unistd.h>
int main(int argc, char *argv[]) {
(void)argc;
const char *usage = "Usage: seatd-launch [option... | vuln | Vulnerable | C/C++ |
/*
Copyright (C) 2010 ABRT team
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 th... | vuln | Vulnerable | C/C++ |
private void onInput(PlayerEntity player) {
if (KeyBindings.toolConfig.consumeClick()) {
DraconicNetwork.sendOpenItemConfig(false);
}
// else if (KeyBindings.hudConfig.isPressed()) {
//// Minecraft.getInstance().displayGuiScreen(new GuiHudConfig());
//
// }
... | vuln | Vulnerable | Java |
/*
* VC3/DNxHD decoder.
* Copyright (c) 2007 SmartJog S.A., Baptiste Coudurier <baptiste dot coudurier at smartjog dot com>
* Copyright (c) 2011 MirriAd Ltd
* Copyright (c) 2015 Christophe Gisquet
*
* 10 bit support added by MirriAd Ltd, Joseph Artsimovich <joseph@mirriad.com>
* Slice multithreading and MB inter... | vuln | Safe | 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 |
@WorkerThread
@GuardedBy("blockerLocker")
public boolean setAppOpMode(AppDetailsAppOpItem appOpItem, @AppOpsManager.Mode int mode) {
if (mIsExternalApk) return false;
boolean isSuccessful = false;
try {
isSuccessful = appOpItem.setAppOp(mPackageInfo, mAppOpsService, mode);
... | vuln | Vulnerable | Java |
POWERPC_FAMILY(POWER9)(ObjectClass *oc, void *data)
{
DeviceClass *dc = DEVICE_CLASS(oc);
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
CPUClass *cc = CPU_CLASS(oc);
dc->fw_name = "PowerPC,POWER9";
dc->desc = "POWER9";
dc->props = powerpc_servercpu_properties;
pcc->pvr_match = ppc_pvr_match_... | vuln | Safe | C/C++ |
double parse_number_or_die(const char *context, const char *numstr, int type, double min, double max)
{
char *tail;
const char *error;
double d = av_strtod(numstr, &tail);
if (*tail)
error= "Expected number for %s but found: %s\n";
else if (d < min || d > max)
error= "The value for %... | vuln | Safe | C/C++ |
/* vi:set ts=8 sts=4 sw=4 noet:
*
* VIM - Vi IMproved by Bram Moolenaar
*
* Do ":help uganda" in Vim to read copying and usage conditions.
* Do ":help credits" in Vim to see a list of people who contributed.
* See README.txt for an overview of the Vim source code.
*/
/*
* quickfix.c: functions for quickfix mo... | vuln | Safe | C/C++ |
static void virgl_cmd_get_capset(VirtIOGPU *g,
struct virtio_gpu_ctrl_command *cmd)
{
struct virtio_gpu_get_capset gc;
struct virtio_gpu_resp_capset *resp;
uint32_t max_ver, max_size;
VIRTIO_GPU_FILL_CMD(gc);
virgl_renderer_get_cap_set(gc.capset_id, &max_ver,
... | vuln | Vulnerable | C/C++ |
public static @NetworkStatsAccess.Level int checkAccessLevel(
Context context, int callingUid, String callingPackage) {
final DevicePolicyManagerInternal dpmi = LocalServices.getService(
DevicePolicyManagerInternal.class);
final TelephonyManager tm = (TelephonyManager)
... | vuln | Vulnerable | Java |
public static void init() {
EnvironmentExecutor.didSetup(EnvironmentType.COMMON, () -> () -> {
// when the server config is changes, we need to synchronize it again.
if (EnvironmentManager.isDedicatedServer()) {
COMMON.notify(() -> NetworkManager.sendToAll(new UpdateConte... | vuln | Vulnerable | Java |
handleSequelizeMethod(smth, tableName, factory, options, prepend) {
if (smth instanceof Utils.Json) {
return super.handleSequelizeMethod(smth, tableName, factory, options, prepend);
}
if (smth instanceof Utils.Cast) {
if (/timestamp/i.test(smth.type)) {
smth.type = 'datetime';
}
... | vuln | Safe | JavaScript |
public void deleteById(Integer id) {
databaseTypeDao.selectOptionalById(id).ifPresent(data -> {
if (DatabaseTypes.has(data.getDatabaseType())) {
throw DomainErrors.MUST_NOT_MODIFY_SYSTEM_DEFAULT_DATABASE_TYPE.exception();
}
databaseTypeDao.deleteById(id);
... | vuln | Vulnerable | Java |
def audit_log(self, dag_id: str, session: Session = NEW_SESSION):
dag = get_airflow_app().dag_bag.get_dag(dag_id, session=session)
dag_model = DagModel.get_dagmodel(dag_id, session=session)
if not dag:
flash(f'DAG "{dag_id}" seems to be missing from DagBag.', "error")
ret... | vuln | Safe | Python |
@SubscribeEvent
public void worldTick(final TickEvent.WorldTickEvent evt) {
World world = evt.world;
if (!world.isRemote() && evt.phase == TickEvent.Phase.END) {
for (TileEntity tileEntity : world.loadedTileEntityList) {
PolymorphApi.common().getRecipeData(tileEntity)
.ifPresent(IT... | vuln | Vulnerable | Java |
package com.salesmanager.shop.admin.model.customer.attribute;
import java.io.Serializable;
import java.util.List;
import com.salesmanager.shop.model.entity.ShopEntity;
public class CustomerOption extends ShopEntity implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
privat... | vuln | Vulnerable | Java |
static void rf_host_ver(void)
{
char *buf = (char *)cur_slot->readbuf;
int major = 3, minor = 3;
int remote_major, remote_minor;
char ver_msg[12];
if ( strncmp(buf, "RFB ", 4) != 0 || !isdigit(buf[4]) ||
!isdigit(buf[4]) || !isdigit(buf[5]) || !isdigit(buf[6]) ||
buf[7] != '.' || !isdigit(buf[8... | vuln | Vulnerable | C/C++ |
static void ssl3_take_mac(SSL *s)
{
const char *sender;
int slen;
if (s->state & SSL_ST_CONNECT)
{
sender=s->method->ssl3_enc->server_finished_label;
sender=s->method->ssl3_enc->client_finished_label;
slen=s->method->ssl3_enc->client_finished_label_len... | vuln | Vulnerable | Unknown |
find_user_by_ip(uint32_t ip)
{
int ret;
int i;
ret = -1;
for (i = 0; i < usercount; i++) {
if (users[i].active && !users[i].disabled &&
users[i].last_pkt + 60 > time(NULL) &&
ip == users[i].tun_ip) {
ret = i;
break;
}
}
return ret;
} | vuln | Vulnerable | Unknown |
def build_filter_params
@conditions = "state in('published', 'withdrawn')"
if params[:search]
@search = params[:search]
if @search[:published_at] and %r{(\d\d\d\d)-(\d\d)} =~ @search[:published_at]
@conditions += " AND published_at LIKE '%#{@search[:published_at]}%'"
end
if @se... | vuln | Vulnerable | Ruby |
# Natural Language Toolkit: Punkt sentence tokenizer
#
# Copyright (C) 2001-2021 NLTK Project
# Algorithm: Kiss & Strunk (2006)
# Author: Willy <willy@csse.unimelb.edu.au> (original Python port)
# Steven Bird <stevenbird1@gmail.com> (additions)
# Edward Loper <edloper@gmail.com> (rewrite)
# Joel... | vuln | Safe | Python |
rfbClientConnectionGone(rfbClientPtr cl)
{
#ifdef LIBVNCSERVER_HAVE_LIBJPEG
int i;
#endif
LOCK(rfbClientListMutex);
if (cl->prev)
cl->prev->next = cl->next;
else
cl->screen->clientHead = cl->next;
if (cl->next)
cl->next->prev = cl->prev;
if(cl->sock>0)
close(cl->sock)... | vuln | Vulnerable | Unknown |
public Loader<Cursor> getSearchCursorLoader(final String searchString, final String[] userIdArray, final Integer parentGroupKey, final String pinnedContactUserId) {
return new CursorLoader(context, null, null, null, null, MobiComDatabaseHelper.DISPLAY_NAME + " asc") {
@Override
public C... | vuln | Vulnerable | Java |
private Dictionary readDictionary(SeekableByteChannel file, long dictionaryPageOffset) throws IOException {
file.position(dictionaryPageOffset);
final InputStream inputStream = Channels.newInputStream(file);
final PageHeader pageHeader = Util.readPageHeader(inputStream);
if (pageHeader.g... | vuln | Vulnerable | Java |
@Override
public void validateReaderContext(ReaderContext readerContext, TransportRequest request) {
if (readerContext.scrollContext() != null) {
final Authentication originalAuth = readerContext.getFromContext(AuthenticationField.AUTHENTICATION_KEY);
if (false == securityContext.can... | vuln | Safe | Java |
c+";"))}}),mxUtils.bind(this,function(){var n=null;A.getModel().beginUpdate();try{n=A.insertVertex(A.getDefaultParent(),null,c,A.snap(e),A.snap(g),1,1,"text;"+(k?"html=1;":"")),A.updateCellSize(n),A.fireEvent(new mxEventObject("textInserted","cells",[n]))}finally{A.getModel().endUpdate()}A.setSelectionCell(n)}))}else{c... | vuln | Vulnerable | JavaScript |
@Override
public void setConfiguration(RadioManager.BandConfig config) {
synchronized (mLock) {
checkNotClosedLocked();
mPlaceHolderConfig = Objects.requireNonNull(config, "config cannot be null");
}
Slogf.i(TAG, "Ignoring setConfiguration - not applicable for broadca... | vuln | Vulnerable | Java |
static bool blit_region_is_unsafe(struct CirrusVGAState *s,
int32_t pitch, int32_t addr)
{
if (pitch < 0) {
int64_t min = addr
+ ((int64_t)s->cirrus_blt_height-1) * pitch;
int32_t max = addr
+ s->cirrus_blt_width;
if (min < 0 || max >... | vuln | Vulnerable | C/C++ |
static struct glfs *qemu_gluster_glfs_init(BlockdevOptionsGluster *gconf,
Error **errp)
{
struct glfs *glfs;
int ret;
int old_errno;
GlusterServerList *server;
glfs = glfs_new(gconf->volume);
if (!glfs) {
goto out;
}
for (server = gconf-... | vuln | Safe | C/C++ |
ins_compl_next_buf(buf_T *buf, int flag)
{
static win_T *wp = NULL;
if (flag == 'w') // just windows
{
if (buf == curbuf || wp == NULL) // first call for this flag/expansion
wp = curwin;
while ((wp = (wp->w_next != NULL ? wp->w_next : firstwin)) != curwin
&& wp->w_buffer->b_scanned)
;
buf ... | vuln | Vulnerable | Unknown |
gboolean
flatpak_dir_deploy (FlatpakDir *self,
const char *origin,
FlatpakDecomposed *ref,
const char *checksum_or_latest,
const char * const * subpaths,
const char * const * previous_ids,
... | vuln | Safe | C/C++ |
/*
* Builtin "git clone"
*
* Copyright (c) 2007 Kristian Høgsberg <krh@redhat.com>,
* 2008 Daniel Barkalow <barkalow@iabervon.org>
* Based on git-commit.sh by Junio C Hamano and Linus Torvalds
*
* Clone a repository into a different directory that does not yet exist.
*/
#define USE_THE_INDEX_VARIABLE
#includ... | vuln | Safe | C/C++ |
void SynchronousCompositorImpl::DidOverscroll(
const DidOverscrollParams& params) {
DCHECK(compositor_client_);
compositor_client_->DidOverscroll(params.accumulated_overscroll,
params.latest_overscroll_delta,
params.current_fling_velocity... | vuln | Vulnerable | C/C++ |
struct net *get_net_ns_by_id(struct net *net, int id)
{
struct net *peer;
if (id < 0)
return NULL;
rcu_read_lock();
spin_lock_bh(&net->nsid_lock);
peer = idr_find(&net->netns_ids, id);
if (peer)
peer = maybe_get_net(peer);
spin_unlock_bh(&net->nsid_lock);
rcu_read_unlock();
return peer;
} | vuln | Safe | C/C++ |
static av_cold int che_configure(AACContext *ac,
enum ChannelPosition che_pos,
int type, int id, int *channels)
{
if (che_pos) {
if (!ac->che[type][id]) {
if (!(ac->che[type][id] = av_mallocz(sizeof(ChannelElement))))
... | vuln | Safe | C/C++ |
int fscrypt_process_policy(struct inode *inode,
const struct fscrypt_policy *policy)
{
if (policy->version != 0)
return -EINVAL;
if (!inode_has_encryption_context(inode)) {
if (!inode->i_sb->s_cop->empty_dir)
return -EOPNOTSUPP;
if (!inode->i_sb->s_cop->empty_dir(inode))
return -ENOTEMPTY;
ret... | vuln | Vulnerable | C/C++ |
pixops_process (guchar *dest_buf,
int render_x0,
int render_y0,
int render_x1,
int render_y1,
int dest_rowstride,
int dest_channels,
gboolean dest_has_alpha,
const guchar *src_buf,
int src_width,
int... | vuln | Vulnerable | Unknown |
def download(url, remote_headers = {})
headers = remote_headers.
reverse_merge('User-Agent' => "CarrierWave/#{CarrierWave::VERSION}")
begin
file = OpenURI.open_uri(process_uri(url.to_s), headers)
rescue StandardError => e
raise CarrierWave::DownloadError, "could not... | vuln | Vulnerable | Ruby |
def endorse_resource(self, data, _suffix=''): # pylint: disable=unused-argument
"""
Endorse an entry of resource. This shows the students the
resource has the staff seal of approval.
Args:
data: dict in JSON format
data['id']: the ID of the resouce to be... | vuln | Safe | Python |
def Visualize(self, repopath, hosts=False,
bundles=False, key=False, only_client=None, output=False):
"""Build visualization of groups file."""
if output:
format = output.split('.')[-1]
else:
format = 'png'
cmd = "dot -T%s" % (format)
if... | vuln | Vulnerable | Python |
checked_xcalloc (size_t num, size_t size)
{
alloc_limit_assert ("checked_xcalloc", (num *size));
return xcalloc (num, size);
} | vuln | Vulnerable | C/C++ |
OMX_ERRORTYPE SoftMP3::internalSetParameter(
OMX_INDEXTYPE index, const OMX_PTR params) {
switch (index) {
case OMX_IndexParamStandardComponentRole:
{
const OMX_PARAM_COMPONENTROLETYPE *roleParams =
(const OMX_PARAM_COMPONENTROLETYPE *)params;
if (!isValidOMXParam... | vuln | Safe | C/C++ |
import copy
import logging
from functools import wraps
from typing import Dict
from django.core.cache import caches
from django.http import HttpRequest, JsonResponse
from django.http.response import HttpResponseNotModified
from django.views.decorators.csrf import csrf_protect
from django.views.decorators.http import r... | vuln | Vulnerable | Python |
def list(self, keyfilter='/'):
path = os.path.join(self.namespace, keyfilter)
if path != '/':
path = path.rstrip('/')
try:
result = self.etcd.read(path, recursive=True)
except etcd.EtcdKeyNotFound:
return None
except etcd.EtcdException as err:
... | vuln | Vulnerable | Python |
bool IDNSpoofChecker::SafeToDisplayAsUnicode(base::StringPiece16 label,
bool is_tld_ascii) {
UErrorCode status = U_ZERO_ERROR;
int32_t result =
uspoof_check(checker_, label.data(),
base::checked_cast<int32_t>(label.size()), NULL, &status);
if (... | vuln | Vulnerable | C/C++ |
package io.onedev.server.model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Index;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.apache.commons.lang3.RandomStringUti... | vuln | Vulnerable | Java |
bool cache_is_cached(const PageCache *cache, uint64_t addr)
{
size_t pos;
g_assert(cache);
g_assert(cache->page_cache);
pos = cache_get_cache_pos(cache, addr);
return (cache->page_cache[pos].it_addr == addr);
} | vuln | Vulnerable | C/C++ |
void WebPluginProxy::OnResourceCreated(int resource_id, HANDLE cookie) {
WebPluginResourceClient* resource_client =
reinterpret_cast<WebPluginResourceClient*>(cookie);
if (!resource_client) {
NOTREACHED();
return;
}
DCHECK(resource_clients_.find(resource_id) == resource_clients_.end());
resourc... | vuln | Vulnerable | C/C++ |
@Override
public void callSessionProgressing(ImsStreamMediaProfile profile) {
TelephonyUtils.runWithCleanCallingIdentity(()-> {
if (mListener != null) {
mListener.callSessionProgressing(ImsCallSession.this, profile);
}
}, mListenerExecu... | vuln | Safe | Java |
public boolean callFunction(List<Value> arguments) {
Context branchContext = this.eventContext.createBranch();
ArucasThreadHandler threadHandler = this.eventContext.getThreadHandler();
if (this.minecraftEvent.isThreadDefinable() && !this.runOnMainThread && EssentialUtils.getClient().isOnThread()) {
threadHandl... | vuln | Vulnerable | Java |
void SessionModelAssociator::PopulateSessionTabFromSpecifics(
const sync_pb::SessionTab& specifics,
const int64 mtime,
SessionTab* tab) {
if (specifics.has_tab_id())
tab->tab_id.set_id(specifics.tab_id());
if (specifics.has_window_id())
tab->window_id.set_id(specifics.window_id());
if (spe... | vuln | Safe | C/C++ |
int av_parser_parse2(AVCodecParserContext *s, AVCodecContext *avctx,
uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size,
int64_t pts, int64_t dts, int64_t pos)
{
int index, i;
uint8_t dummy_buf[FF_INPUT_BUFFER_PADDING_SIZE];
... | vuln | Safe | C/C++ |
GF_Err abst_box_read(GF_Box *s, GF_BitStream *bs)
{
GF_AdobeBootstrapInfoBox *ptr = (GF_AdobeBootstrapInfoBox *)s;
int i;
u32 tmp_strsize;
char *tmp_str;
GF_Err e;
ISOM_DECREASE_SIZE(ptr, 25)
ptr->bootstrapinfo_version = gf_bs_read_u32(bs);
ptr->profile = gf_bs_read_int(bs, 2);
ptr->live = gf_bs_read_int(bs, ... | vuln | Safe | C/C++ |
NTSTATUS set_nt_acl(files_struct *fsp, uint32 security_info_sent, SEC_DESC *psd)
{
connection_struct *conn = fsp->conn;
uid_t user = (uid_t)-1;
gid_t grp = (gid_t)-1;
SMB_STRUCT_STAT sbuf;
DOM_SID file_owner_sid;
DOM_SID file_grp_sid;
canon_ace *file_ace_list = NULL;
canon_ace *dir_ace_list = NULL;
bool acl_pe... | vuln | Vulnerable | Unknown |
@Override
protected void onCreate(Bundle savedInstanceState) {
((NewsReaderApplication) getApplication()).getAppComponent().injectActivity(this);
super.onCreate(savedInstanceState);
binding = ActivityNewsDetailBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
/*
//make full transp... | vuln | Vulnerable | Java |
QPDF::compute_encryption_key_from_password(
std::string const& password, EncryptionData const& data)
{
// Algorithm 3.2 from the PDF 1.7 Reference Manual
// This code does not properly handle Unicode passwords.
// Passwords are supposed to be converted from OS codepage
// characters to PDFDocEncodi... | vuln | Safe | Unknown |
MigrationState *exec_start_outgoing_migration(const char *command,
int64_t bandwidth_limit,
int async)
{
FdMigrationState *s;
FILE *f;
s = qemu_mallocz(sizeof(*s));
if (s == NULL) {
dprintf("Unable to alloc... | 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 |
static void coroutine_fn mirror_wait_on_conflicts(MirrorOp *self,
MirrorBlockJob *s,
uint64_t offset,
uint64_t bytes)
{
uint64_t self_start_chunk = offset / s->granul... | vuln | Vulnerable | C/C++ |
archive_read_format_lha_read_header(struct archive_read *a,
struct archive_entry *entry)
{
struct archive_string linkname;
struct archive_string pathname;
struct lha *lha;
const unsigned char *p;
const char *signature;
int err;
lha_crc16_init();
a->archive.archive_format = ARCHIVE_FORMAT_LHA;
if (a->arc... | vuln | Vulnerable | Unknown |
private void readCamera(VehicleProperties properties, JsonObject object)
{
if(object.has("camera"))
{
JsonObject cameraObject = JSONUtils.getAsJsonObject(object, "camera", new JsonObject());
CameraProperties.Type type = CameraProperties.Type.fromId(JSONUti... | vuln | Safe | Java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.