code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
private StackTraceElement getCallingMethod() { try { throw new RuntimeException("Stacktrace Dummy Exception"); } catch (RuntimeException e) { try { final String prefix = this.getClass().getPackage().getName(); for (StackTraceElement element...
vuln
Safe
Java
static int usb_enumerate_device_otg(struct usb_device *udev) { int err = 0; #ifdef CONFIG_USB_OTG /* * OTG-aware devices on OTG-capable root hubs may be able to use SRP, * to wake us after we've powered off VBUS; and HNP, switching roles * "host" to "peripheral". The OTG descriptor helps figure this out. */...
vuln
Safe
Unknown
@SuppressWarnings("unchecked") private @Nullable Object cloneEntityData( final @NotNull Object entityDataPreClone, final @NotNull Object internalLivingEntity ) throws InvocationTargetException, InstantiationException, IllegalAccessException { if (!def.getIsOneNinteenThreeOrNewer...
vuln
Safe
Java
void GpuProcessHost::DidFailInitialize() { UMA_HISTOGRAM_BOOLEAN("GPU.GPUProcessInitialized", false); status_ = FAILURE; GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); gpu_data_manager->FallBackToNextGpuMode(); RunRequestGPUInfoCallbacks(gpu_data_manager->GetGPUInfo()); }
vuln
Vulnerable
C/C++
static void guess_mv(ERContext *s) { uint8_t *fixed = s->er_temp_buffer; #define MV_FROZEN 3 #define MV_CHANGED 2 #define MV_UNCHANGED 1 const int mb_stride = s->mb_stride; const int mb_width = s->mb_width; const int mb_height = s->mb_height; int i, depth, num_avail; int mb_x, mb_y, mot_st...
vuln
Safe
C/C++
pam_sm_authenticate (pam_handle_t * pamh, int flags, int argc, const char **argv) { int retval, rc; const char *user = NULL; const char *password = NULL; char otp[MAX_TOKEN_ID_LEN + TOKEN_OTP_LEN + 1] = { 0 }; char otp_id[MAX_TOKEN_ID_LEN + 1] = { 0 }; int password_len = 0; int skip_bytes = 0; in...
vuln
Vulnerable
C/C++
public void remove(final QualifiedName name, final Set<String> tags, final boolean updateUserMetadata) { try { jdbcTemplate.update(String.format(SQL_DELETE_TAG_ITEM_TAGS_BY_NAME_TAGS, "'" + Joiner.on("','").skipNulls().join(tags) + "'"), new SqlParameterValue(Types.VA...
vuln
Vulnerable
Java
Graph.fileSupport&&(D.addEventListener("dragover",function(v){v.stopPropagation();v.preventDefault()},!1),D.addEventListener("drop",function(v){v.stopPropagation();v.preventDefault();if(0<v.dataTransfer.files.length){v=v.dataTransfer.files[0];var x=new FileReader;x.onload=function(A){D.value=A.target.result};x.readAsTe...
vuln
Vulnerable
JavaScript
public String getCookie( HttpServletRequest request, String name ) throws ValidationException { Cookie c = getFirstCookie( request, name ); if ( c == null ) return null; String value = c.getValue(); return ESAPI.validator().getValidInput("HTTP cookie value: " + value, value, "HTTPCookieValue", 1000,...
vuln
Vulnerable
Java
/* * HTTP protocol for ffmpeg client * Copyright (c) 2000, 2001 Fabrice Bellard * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 ...
vuln
Vulnerable
C/C++
void luaReplyToRedisReply(client *c, lua_State *lua) { if (!lua_checkstack(lua, 4)) { /* Increase the Lua stack if needed to make sure there is enough room * to push 4 elements to the stack. On failure, return error.          * Notice that we need, in the worst case, 4 elements because returning a...
vuln
Safe
Unknown
int blkcg_init_queue(struct request_queue *q) { struct blkcg_gq *new_blkg, *blkg; bool preloaded; int ret; new_blkg = blkg_alloc(&blkcg_root, q, GFP_KERNEL); if (!new_blkg) return -ENOMEM; preloaded = !radix_tree_preload(GFP_KERNEL); /* * Make sure the root blkg exists and count the existing blkgs. As ...
vuln
Safe
C/C++
@Inject(method = "<init>(Lnet/minecraft/world/entity/EntityType;Lnet/minecraft/world/level/Level;)V", at = @At("RETURN")) private void activationRange$init(EntityType<? extends ItemEntity> entityType, Level world, CallbackInfo ci) { this.lifespan = ((WorldBridge) this.level).bridge$spigotConfig().itemDespaw...
vuln
Vulnerable
Java
Load_SBit_Png( FT_GlyphSlot slot, FT_Int x_offset, FT_Int y_offset, FT_Int pix_bits, TT_SBit_Metrics metrics, FT_Memory memory, FT_Byte* data, FT_UInt ...
vuln
Vulnerable
C/C++
static int r3d_read_redv(AVFormatContext *s, AVPacket *pkt, Atom *atom) { AVStream *st = s->streams[0]; int tmp, tmp2; uint64_t pos = url_ftell(s->pb); unsigned dts; int ret; dts = get_be32(s->pb); tmp = get_be32(s->pb); dprintf(s, "frame num %d\n", tmp); tmp = get_byte(s->pb); ...
vuln
Safe
C/C++
/* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICENSE. */ /* * http_client.c -- A simple HTTP/QUIC client */ #ifndef WIN32 #include <arpa/inet.h> #include <netinet/in.h> #else #include <Windows.h> #include <WinSock2.h> #include <io.h> #include <stdlib.h> #include <getopt.h> #define STDOUT_FILENO 1 #d...
vuln
Safe
C/C++
@SuppressLint("InflateParams") private void displayRecentlyOpen() { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setCancelable(true) .setTitle(getString(R.string.action_recently_open_title)) .setNegativeButton(android.R.string.no, (dialog, whichButton) -> dialog.dismiss...
vuln
Vulnerable
Java
package getter import "net/url" // RedactURL is a port of url.Redacted from the standard library, // which is like url.String but replaces any password with "xxxxx". // Only the password in u.URL is redacted. This allows the library // to maintain compatibility with go1.14. func RedactURL(u *url.URL) string { if u =...
vuln
Safe
Go
Status GetMatchingPaths(FileSystem* fs, Env* env, const string& pattern, std::vector<string>* results) { results->clear(); if (pattern.empty()) { return Status::OK(); } string fixed_prefix = pattern.substr(0, pattern.find_first_of("*?[\\")); string eval_pattern = pattern; string...
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 '"'. */ len = strlen(new_path); if(new_path[0] == '\"') { memmove((void *)new_path, (const void *)(new_path + 1), l...
vuln
Safe
C/C++
on_register_handler(TCMUService1HandlerManager1 *interface, GDBusMethodInvocation *invocation, gchar *subtype, gchar *cfg_desc, gpointer user_data) { struct tcmur_handler *handler; struct dbus_info *info; char *bus_name; bus_name = g_strdup_printf("org.kernel.TCMUService1.HandlerManager1.%s...
vuln
Vulnerable
Unknown
private AbstractAuthorityFactory createBackingStore0() throws FactoryException, SQLException { /* * We are locking on ReferencingFactoryFinder to avoid deadlocks. * @see DeferredAuthorityFactory#getBackingStore() */ assert Thread.holdsLock(ReferencingFactoryFinder.class); ...
vuln
Vulnerable
Java
def resource_status(params, request, auth_user) if not allowed_for_local_cluster(auth_user, Permissions::READ) return 403, 'Permission denied' end resource_id = params[:resource] @resources,@groups = getResourcesGroups(auth_user) location = "" res_status = "" @resources.each {|r| if r.id == resour...
vuln
Safe
Ruby
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, }; if (nb_sectors < 0 ||...
vuln
Safe
C/C++
void destroyUserData(int userId, int flags) { synchronized (mInstallLock) { final StorageManager storage = mContext.getSystemService(StorageManager.class); /* * Volume destruction order isn't really important, but to avoid any weird issues we * process internal ...
vuln
Safe
Java
static void rds_tcp_kill_sock(struct net *net) { struct rds_tcp_connection *tc, *_tc; LIST_HEAD(tmp_list); struct rds_tcp_net *rtn = net_generic(net, rds_tcp_netid); struct socket *lsock = rtn->rds_tcp_listen_sock; rtn->rds_tcp_listen_sock = NULL; rds_tcp_listen_stop(lsock, &rtn->rds_tcp_accept_w); spin_lock_ir...
vuln
Vulnerable
C/C++
netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb, struct net_device *dev) { struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); struct ieee80211_chanctx_conf *chanctx_conf; struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); struct ieee80211_hdr *hdr; struct ieee80211_sub_if_data *...
vuln
Vulnerable
C/C++
GLboolean WebGLRenderingContextBase::isFramebuffer( WebGLFramebuffer* framebuffer) { if (!framebuffer || isContextLost()) return 0; if (!framebuffer->HasEverBeenBound()) return 0; if (framebuffer->IsDeleted()) return 0; return ContextGL()->IsFramebuffer(framebuffer->Object()); }
vuln
Vulnerable
C/C++
proc_lambda(mrb_state *mrb, mrb_value self) { mrb_value blk; struct RProc *p; mrb_get_args(mrb, "&", &blk); if (mrb_nil_p(blk)) { mrb_raise(mrb, E_ARGUMENT_ERROR, "tried to create Proc object without a block"); } if (!mrb_proc_p(blk)) { mrb_raise(mrb, E_ARGUMENT_ERROR, "not a proc"); } p = mrb_...
vuln
Safe
Unknown
# pylint: disable=no-self-use, too-few-public-methods from django.conf import settings from django.contrib.sites.models import Site from django.db.utils import OperationalError, ProgrammingError from django.http import HttpResponseRedirect from django.urls import reverse from django.utils.deprecation import Middleware...
vuln
Vulnerable
Python
static s32 gf_hevc_read_pps_bs_internal(GF_BitStream *bs, HEVCState *hevc) { u32 i; s32 pps_id; HEVC_PPS *pps; //NAL header already read pps_id = gf_bs_read_ue_log(bs, "pps_id"); if ((pps_id < 0) || (pps_id >= 64)) { GF_LOG(GF_LOG_ERROR, GF_LOG_CODING, ("[HEVC] wrong PPS ID %d in PPS\n", pps_id)); return -1...
vuln
Safe
C/C++
static int _rpc_file_bcast(slurm_msg_t *msg) { int rc; int64_t offset, inx; file_bcast_info_t *file_info; file_bcast_msg_t *req = msg->data; file_bcast_info_t key; key.uid = g_slurm_auth_get_uid(msg->auth_cred, conf->auth_info); key.gid = g_slurm_auth_get_gid(msg->auth_cred, conf->auth_info); key.fname = req->...
vuln
Safe
Unknown
static CharDriverState *qemu_chr_open_win_file_out(QemuOpts *opts) { const char *file_out = qemu_opt_get(opts, "path"); HANDLE fd_out; fd_out = CreateFile(file_out, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if (fd_out == INVALID_HANDLE_VALUE...
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++
psf_fwrite (const void *ptr, sf_count_t bytes, sf_count_t items, SF_PRIVATE *psf) { sf_count_t total = 0 ; ssize_t count ; DWORD dwNumberOfBytesWritten ; if (psf->virtual_io) return psf->vio.write (ptr, bytes * items, psf->vio_user_data) / bytes ; items *= bytes ; /* Do this check after the multiplication abo...
vuln
Vulnerable
Unknown
static u32 crc32sum(u32 crc, u8 * RESTRICT buf, size_t size) { while (size--) crc = crc32Table[(crc ^ *(buf++)) & 0xff] ^ (crc >> 8); return crc; }
vuln
Vulnerable
C/C++
SPL_METHOD(SplDoublyLinkedList, offsetSet) { zval *zindex, *value; spl_dllist_object *intern; if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &zindex, &value) == FAILURE) { return; } intern = Z_SPLDLLIST_P(getThis()); if (Z_TYPE_P(zindex) == IS_NULL) { /* $obj[] = ... */ spl_ptr_lli...
vuln
Safe
C/C++
void vnc_display_init(DisplayState *ds) { VncDisplay *vs = g_malloc0(sizeof(*vs)); vs->dcl.idle = 1; vnc_display = vs; vs->lsock = -1; #ifdef CONFIG_VNC_WS vs->lwebsock = -1; #endif vs->ds = ds; QTAILQ_INIT(&vs->clients); vs->expires = TIME_MAX; if (keyboard_layout) vs->kbd_l...
vuln
Safe
C/C++
static void ip6gre_err(struct sk_buff *skb, struct inet6_skb_parm *opt, u8 type, u8 code, int offset, __be32 info) { const struct gre_base_hdr *greh; const struct ipv6hdr *ipv6h; int grehlen = sizeof(*greh); struct ip6_tnl *t; int key_off = 0; __be16 flags; __be32 key; if (!pskb_may_pull(skb, offset +...
vuln
Safe
C/C++
public function deleteItem(){ $login_user = $this->checkLogin(); $this->checkAdmin(); $item_id = I("post.item_id/d"); $return = D("Item")->soft_delete_item($item_id); if (!$return) { $this->sendError(10101); }else{ $this->sendResult($return); ...
vuln
Safe
PHP
@EventHandler(ignoreCancelled = true) public void onBlockPlaceEvent(BlockPlaceEvent event) { Player player = event.getPlayer(); User user = IridiumSkyblock.getInstance().getUserManager().getUser(player); Optional<Island> island = IridiumSkyblock.getInstance().getIslandManager().getIslandViaL...
vuln
Safe
Java
protected void internalExpireMessagesByPosition(AsyncResponse asyncResponse, String subName, boolean authoritative, MessageIdImpl messageId, boolean isExcluded, int batchIndex) { CompletableFuture<Void> future; if (topicName.isGlobal()) { futu...
vuln
Vulnerable
Java
constructor() { this._loggedIn = { value: false, tracker: new Tracker.Dependency(), }; const queryParams = new URLSearchParams(document.location.search); if (queryParams.has('sessionToken') && queryParams.get('sessionToken') !== Session.get('sessionToken')) { return; } ...
vuln
Vulnerable
JavaScript
@Override public void onServiceDisconnected(ComponentName name) { if (DEBUG) Slog.d(TAG, "TrustAgent disconnected : " + name.flattenToShortString()); mTrustAgentService = null; mManagingTrust = false; mSetTrustAgentFeaturesToken = null; mTrustManagerSe...
vuln
Vulnerable
Java
# Copyright (C) 2008-2011 Dejan Muhamedagic <dmuhamedagic@suse.de> # See COPYING for license information. import os import sys from tempfile import mkstemp import subprocess import re import glob import time import datetime import shutil import shlex import bz2 import fnmatch import gc import ipaddress import argparse...
vuln
Safe
Python
public void handleNotes() { if (mNote != null) { if (sNotzUtils.validBackup(Encryption.decrypt(mNote))) { mNewNote = Encryption.decrypt(mNote); } else if (sNotzUtils.validBackup(mNote)) { mNewNote = mNote; } if (mNewNote != null) { ...
vuln
Vulnerable
Java
static void _slurm_rpc_submit_batch_job(slurm_msg_t *msg) { static int active_rpc_cnt = 0; int error_code = SLURM_SUCCESS; DEF_TIMERS; uint32_t job_id = 0, priority = 0; struct job_record *job_ptr = NULL; slurm_msg_t response_msg; submit_response_msg_t submit_msg; job_desc_msg_t *job_desc_msg = (job_desc_msg_t ...
vuln
Vulnerable
Unknown
static int tcp_mtu_probe(struct sock *sk) { struct inet_connection_sock *icsk = inet_csk(sk); struct tcp_sock *tp = tcp_sk(sk); struct sk_buff *skb, *nskb, *next; struct net *net = sock_net(sk); int probe_size; int size_needed; int copy, len; int mss_now; int interval; /* Not currently probing/verifying, *...
vuln
Vulnerable
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. */ /* * vim9execute.c: execute Vim9 script in...
vuln
Vulnerable
C/C++
static BlockEntity getWorldTileEntityUnchecked(Level level, BlockPos pos) { if (level.isOutsideBuildHeight(pos)) { return null; } else { //Note: this should handle the pending entities that we manually did via world in 1.16 //level.hasChunkAt() will call getChunk with...
vuln
Safe
Java
# -*- coding: utf-8 -*- # Copyright © 2018, 2019 Damir Jelić <poljar@termina.org.uk> # # Permission to use, copy, modify, and/or distribute this software for # any purpose with or without fee is hereby granted, provided that the # above copyright notice and this permission notice appear in all copies. # # THE SOFTWARE...
vuln
Safe
Python
public String[] getBccIds() { return bccIds; }
vuln
Vulnerable
Java
/* +----------------------------------------------------------------------+ | HipHop for PHP | +----------------------------------------------------------------------+ | Copyright (c) 2010-present Facebook, Inc. (http://www.facebook.com) | | Copyrigh...
vuln
Vulnerable
C/C++
public static void compress(String name, List<TarFileEntry> files) throws IOException { try (TarArchiveOutputStream out = getTarArchiveOutputStream(name)){ for (TarFileEntry tarFileEntry : files){ addToArchiveCompression(out, tarFileEntry.getFile(), tarFileEntry.getArchivePath()); } } }
vuln
Vulnerable
Java
/* * 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
Vulnerable
Java
"use strict" // Dependencies const parsePath = require("parse-path") , normalizeUrl = require("normalize-url") /** * parseUrl * Parses the input url. * * **Note**: This *throws* if invalid urls are provided. * * @name parseUrl * @function * @param {String} url The input url. * @param {Boolean|Object} no...
vuln
Safe
JavaScript
static uint32_t calc_gc_buffer_size(zend_generator *generator) /* {{{ */ { uint32_t size = 4; /* value, key, retval, values */ if (generator->execute_data) { zend_execute_data *execute_data = generator->execute_data; zend_op_array *op_array = &EX(func)->op_array; /* Compiled variables */ if (!(EX_CALL_INFO()...
vuln
Safe
Unknown
PLIST_API void plist_from_bin(const char *plist_bin, uint32_t length, plist_t * plist) { char *trailer = NULL; uint8_t offset_size = 0; uint8_t dict_size = 0; uint64_t num_objects = 0; uint64_t root_object = 0; uint64_t offset_table_index = 0; char *offset_table = NULL; //first check w...
vuln
Safe
C/C++
boolean_t dnode_is_dirty(dnode_t *dn) { mutex_enter(&dn->dn_mtx); for (int i = 0; i < TXG_SIZE; i++) { if (multilist_link_active(&dn->dn_dirty_link[i])) { mutex_exit(&dn->dn_mtx); return (B_TRUE); } } mutex_exit(&dn->dn_mtx); return (B_FALSE); }
vuln
Vulnerable
C/C++
Prism.languages.scss = Prism.languages.extend('css', { 'comment': { pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/, lookbehind: true }, 'atrule': { pattern: /@[\w-]+(?:\([^()]+\)|[^(])*?(?=\s+[{;])/, inside: { 'rule': /@[\w-]+/ // See rest below } }, // url, compassified 'url': /(?:[-a-z]+-)?url(...
vuln
Safe
JavaScript
@Override public void onSendRoutingInfoForSMRequest(SriSmRequest request) { try { var msisdn = request.getMsisdn(); var serviceCentre = request.getServiceCentreAddress(); notify("Received SRI-SM request for MSISDN: " + msisdn + " from serviceCemtre: " + serviceCentre, ...
vuln
Safe
Java
static void file_add_remove(struct diff_options *options, int addremove, unsigned mode, const unsigned char *sha1, const char *fullpath) { int diff = REV_TREE_DIFFERENT; /* * Is it an add of a new file? It means that the old tree * didn't have it at all, so we will turn "REV_TREE_SAME" -> * "...
vuln
Safe
Unknown
mxCellEditor.prototype.installListeners=function(a){mxEvent.addListener(a,"dragstart",mxUtils.bind(this,function(d){this.graph.stopEditing(!1);mxEvent.consume(d)}));mxEvent.addListener(a,"blur",mxUtils.bind(this,function(d){this.blurEnabled&&this.focusLost(d)}));mxEvent.addListener(a,"keydown",mxUtils.bind(this,functio...
vuln
Vulnerable
JavaScript
static int decorrelate(TAKDecContext *s, int c1, int c2, int length) { GetBitContext *gb = &s->gb; int32_t *p1 = s->decoded[c1] + 1; int32_t *p2 = s->decoded[c2] + 1; int i; int dshift, dfactor; switch (s->dmode) { case 1: for (i = 0; i < length; i++) { int32...
vuln
Vulnerable
C/C++
static int64_t ivshmem_recv_msg(IVShmemState *s, int *pfd, Error **errp) { int64_t msg; int n, ret; n = 0; do { ret = qemu_chr_fe_read_all(&s->server_chr, (uint8_t *)&msg + n, sizeof(msg) - n); if (ret < 0) { if (ret == -EINTR) { ...
vuln
Vulnerable
C/C++
vpc_co_pwritev(BlockDriverState *bs, uint64_t offset, uint64_t bytes, QEMUIOVector *qiov, int flags) { BDRVVPCState *s = bs->opaque; int64_t image_offset; int64_t n_bytes; int64_t bytes_done = 0; int ret; VHDFooter *footer = (VHDFooter *) s->footer_buf; QEMUIOVector local_qio...
vuln
Vulnerable
C/C++
TPMI_DH_PERSISTENT_Unmarshal(TPMI_DH_PERSISTENT *target, BYTE **buffer, INT32 *size) { TPM_RC rc = TPM_RC_SUCCESS; TPMI_DH_PERSISTENT orig_target = *target; // libtpms added if (rc == TPM_RC_SUCCESS) { rc = TPM_HANDLE_Unmarshal(target, buffer, size); } if (rc == TPM_RC_SUCCESS) { BOOL isNotPers...
vuln
Safe
Unknown
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % M M AAA TTTTT L AAA BBBB ...
vuln
Safe
C/C++
public static boolean isTxFeePayable(Context c, BaseData baseData, ChainConfig chainConfig) { if (chainConfig.baseChain().equals(SIF_MAIN)) { if (new BigDecimal("100000000000000000").compareTo(baseData.getAvailable(chainConfig.mainDenom())) < 0) { return true; } ...
vuln
Vulnerable
Java
on_handler_appeared(GDBusConnection *connection, const gchar *name, const gchar *name_owner, gpointer user_data) { struct tcmur_handler *handler = user_data; struct dbus_info *info = handler->opaque; if (info->register_invocation) { info->connection = connection; tcmur_register...
vuln
Safe
Unknown
int evm_update_evmxattr(struct dentry *dentry, const char *xattr_name, const char *xattr_value, size_t xattr_value_len) { struct inode *inode = dentry->d_inode; struct evm_ima_xattr_data xattr_data; int rc = 0; rc = evm_calc_hmac(dentry, xattr_name, xattr_value, xattr_value_len, xattr_data.digest); if (r...
vuln
Safe
C/C++
static void sasl_packet(sasl_session_t *p, char *buf, int len) { int rc; size_t tlen = 0; char *cloak, *out = NULL; char temp[BUFSIZE]; char mech[61]; size_t out_len = 0; metadata_t *md; /* First piece of data in a session is the name of * the SASL mechanism that will be used. */ if(!p->mechptr) { if(l...
vuln
Vulnerable
Unknown
tabstop_set(char_u *var, int **array) { int valcount = 1; int t; char_u *cp; if (var[0] == NUL || (var[0] == '0' && var[1] == NUL)) { *array = NULL; return OK; } for (cp = var; *cp != NUL; ++cp) { if (cp == var || cp[-1] == ',') { char_u *end; if (strtol((char *...
vuln
Safe
Unknown
uint64 ReadCodedSizeValue(const binary * InBuffer, uint32 & BufferSize, uint64 & SizeUnknown) { binary SizeBitMask = 1 << 7; uint64 Result = 0x7F; unsigned int SizeIdx, PossibleSizeLength = 0; binary PossibleSize[8]; memset(PossibleSize, 0, 8); SizeUnknown = 0x7F; // the last bit is discarded when computin...
vuln
Vulnerable
Unknown
@Override public <T> T executeWithLock(MailboxPath path, LockAwareExecution<T> execution, LockType writeLock) throws MailboxException { try { lock(path, writeLock); return execution.execute(); } finally { unlock(path, writeLock); } }
vuln
Vulnerable
Java
static int vp3_decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size) { Vp3DecodeContext *s = avctx->priv_data; GetBitContext gb; static int counter = 0; int i; init_get_bits(&gb, buf, buf_size * 8); if ...
vuln
Safe
C/C++
#include <math.h> #include <string.h> #include <stdlib.h> #include "gd.h" #include "gdhelpers.h" #include "php.h" #ifdef _MSC_VER # if _MSC_VER >= 1300 /* in MSVC.NET these are available but only for __cplusplus and not _MSC_EXTENSIONS */ # if !defined(_MSC_EXTENSIONS) && defined(__cplusplus) # define HAVE_FABSF ...
vuln
Vulnerable
C/C++
static void ReplaceXmpValue(StringInfo *profile,size_t start,size_t end, const char *value) { char *datum; size_t length, new_length, value_length; length=GetStringInfoLength(profile); value_length=strlen(value); new_length=length-(end-start)+value_length; if (new_length > length) Se...
vuln
Vulnerable
C/C++
MOBI_RET mobi_reconstruct_infl(char *outstring, const MOBIIndx *infl, const MOBIIndexEntry *orth_entry) { const char *label = orth_entry->label; uint32_t *infl_groups = NULL; size_t infl_count = mobi_get_indxentry_tagarray(&infl_groups, orth_entry, INDX_TAGARR_ORTH_INFL); if (infl_count == 0 || !in...
vuln
Vulnerable
C/C++
static BOOL update_recv_secondary_order(rdpUpdate* update, wStream* s, BYTE flags) { BOOL rc = FALSE; size_t start, end, diff; BYTE orderType; UINT16 extraFlags; UINT16 orderLength; rdpContext* context = update->context; rdpSettings* settings = context->settings; rdpSecondaryUpdate* secondary = update->secondar...
vuln
Vulnerable
C/C++
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
vuln
Vulnerable
C/C++
static int arc_emac_tx(struct sk_buff *skb, struct net_device *ndev) { struct arc_emac_priv *priv = netdev_priv(ndev); unsigned int len, *txbd_curr = &priv->txbd_curr; struct net_device_stats *stats = &ndev->stats; __le32 *info = &priv->txbd[*txbd_curr].info; dma_addr_t addr; if (skb_padto(skb, ETH_ZLEN)) retu...
vuln
Vulnerable
C/C++
static struct file_struct *recv_file_entry(int f, struct file_list *flist, int xflags) { static int64 modtime, atime; #ifdef SUPPORT_CRTIMES static time_t crtime; #endif static mode_t mode; #ifdef SUPPORT_HARD_LINKS static int64 dev; #endif static dev_t rdev; static uint32 rdev_major; static uid_t uid; static g...
vuln
Vulnerable
Unknown
static int create_filtergraph(AVFilterContext *ctx, const AVFrame *in, const AVFrame *out) { ColorSpaceContext *s = ctx->priv; const AVPixFmtDescriptor *in_desc = av_pix_fmt_desc_get(in->format); const AVPixFmtDescriptor *out_desc = av_pix_fmt_desc_get(out->format); int em...
vuln
Safe
C/C++
/* -*- C++ -*- * File: libraw_cxx.cpp * Copyright 2008-2017 LibRaw LLC (info@libraw.org) * Created: Sat Mar 8 , 2008 * * LibRaw C++ interface (implementation) LibRaw is free software; you can redistribute it and/or modify it under the terms of the one of two licenses as you choose: 1. GNU LESSER GENERAL PUBLIC ...
vuln
Vulnerable
C/C++
null,null,null,10,null,null,!1,null,0<d.length?d:null)}catch(m){this.handleError(m)}};EditorUi.prototype.writeImageToClipboard=function(d,f,g,m){var q=this.base64ToBlob(d.substring(d.indexOf(",")+1),"image/png");d=new ClipboardItem({"image/png":q,"text/html":new Blob(['<img src="'+d+'" width="'+f+'" height="'+g+'">'],{...
vuln
Safe
JavaScript
/* * jabberd - Jabber Open Source Server * Copyright (c) 2002 Jeremie Miller, Thomas Muldowney, * Ryan Eatmon, Robert Norris * * 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 Found...
vuln
Safe
C/C++
static void con_disconnect(struct XenDevice *xendev) { struct XenConsole *con = container_of(xendev, struct XenConsole, xendev); if (con->chr) { qemu_chr_add_handlers(con->chr, NULL, NULL, NULL, NULL); qemu_chr_fe_release(con->chr); } xen_be_unbind_evtchn(&con->xendev); if (con->srin...
vuln
Vulnerable
C/C++
static void do_send_key(const char *string) { char keybuf[16], *q; uint8_t keycodes[16]; const char *p; int nb_keycodes, keycode, i; nb_keycodes = 0; p = string; while (*p != '\0') { q = keybuf; while (*p != '\0' && *p != '-') { if ((q - keybuf) < sizeof(keybuf) -...
vuln
Vulnerable
C/C++
public static String description2(int id) { for (int i = 0; i < cachedCustomComponents.size(); i++) { HashMap<String, Object> component = cachedCustomComponents.get(i); if (component != null) { Object componentId = component.get("id"); if (componentId ins...
vuln
Safe
Java
static int fullTest(unsigned char *srcBuf, int w, int h, int subsamp, int jpegQual, char *fileName) { char tempStr[1024], tempStr2[80]; FILE *file = NULL; tjhandle handle = NULL; unsigned char **jpegBuf = NULL, *yuvBuf = NULL, *tmpBuf = NULL, *srcPtr, *srcPtr2; double start, elapsed, e...
vuln
Vulnerable
Unknown
static int svm_cpu_init(int cpu) { struct svm_cpu_data *sd; sd = kzalloc(sizeof(struct svm_cpu_data), GFP_KERNEL); if (!sd) return -ENOMEM; sd->cpu = cpu; sd->save_area = alloc_page(GFP_KERNEL); if (!sd->save_area) goto free_cpu_data; if (svm_sev_enabled()) { sd->sev_vmcbs = kmalloc_array(max_sev_asid + ...
vuln
Safe
C/C++
static struct pxa2xx_fir_s *pxa2xx_fir_init(target_phys_addr_t base, qemu_irq irq, struct pxa2xx_dma_state_s *dma, CharDriverState *chr) { int iomemtype; struct pxa2xx_fir_s *s = (struct pxa2xx_fir_s *) qemu_mallocz(sizeof(struct pxa2xx_fir_s)); s->base = base; ...
vuln
Vulnerable
C/C++
public void load() { ArrayList<String> lines = new ArrayList<String>(); try { BufferedReader reader = new BufferedReader(new FileReader(this.dataFile)); String line = reader.readLine(); while(line != null) { lines.add(line); line = reader.readLine(); } reader.close(); } catch(Exception e...
vuln
Vulnerable
Java
BGD_DECLARE(void *) gdImagePngPtrEx (gdImagePtr im, int *size, int level) { void *rv; gdIOCtx *out = gdNewDynamicCtx (2048, NULL); if (out == NULL) return NULL; gdImagePngCtxEx (im, out, level); rv = gdDPExtractData (out, size); out->gd_free (out); return rv; }
vuln
Vulnerable
Unknown
/* Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson. * Copyright (c) 2007-2016, The Tor Project, Inc. */ /* See LICENSE for licensing information */ /** * \file rendservice.c * \brief The hidden-service side of rendezvous functionality. **/ #define RENDSERVICE_PRIVATE #include "or.h" #include "circpathb...
vuln
Vulnerable
C/C++
static int escape124_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { int buf_size = avpkt->size; Escape124Context *s = avctx->priv_data; AVFrame *frame = data; GetBitContext gb; unsigned frame_flag...
vuln
Safe
C/C++
void InstanceKlass::metaspace_pointers_do(MetaspaceClosure* it) { Klass::metaspace_pointers_do(it); if (log_is_enabled(Trace, cds)) { ResourceMark rm; log_trace(cds)("Iter(InstanceKlass): %p (%s)", this, external_name()); } it->push(&_annotations); it->push((Klass**)&_array_klasses); it->push(&_co...
vuln
Safe
Unknown
/* $Id$ */ /* * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * * 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; eit...
vuln
Safe
C/C++
void ZRLE_ENCODE_TILE(PIXEL_T* data, int w, int h, zrleOutStream* os, int zywrle_level, int *zywrleBuf) { /* First find the palette and the number of runs */ zrlePaletteHelper *ph; int runs = 0; int singlePixels = 0; rfbBool useRle; rfbBool usePalette; int estimatedBytes; int plainRleBytes; int i...
vuln
Vulnerable
Unknown