code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
public MethodNode buildMethod() throws MethodCompileException { if (instructions == null) { throw new MethodCompileException(unit, "The instructions have not been successfully generated!" + "Cannot build method instance."); } int access = definition.getModifiers().value(); String name = definition.getNa...
vuln
Vulnerable
Java
void cpu_dump_state (CPUPPCState *env, FILE *f, fprintf_function cpu_fprintf, int flags) { #define RGPL 4 #define RFPL 4 int i; cpu_fprintf(f, "NIP " TARGET_FMT_lx " LR " TARGET_FMT_lx " CTR " TARGET_FMT_lx " XER " TARGET_FMT_lx "\n", env->nip, env->lr, e...
vuln
Vulnerable
C/C++
static int pix_norm1_altivec(uint8_t *pix, int line_size) { int i, s = 0; const vector unsigned int zero = (const vector unsigned int) vec_splat_u32(0); vector unsigned int sv = (vector unsigned int) vec_splat_u32(0); vector signed int sum; for (i = 0; i < 16; i++) { ...
vuln
Vulnerable
C/C++
static int _is_absW(const WCHAR *path) { return path[0] == L'\\' || path[0] == L'/' || (path[0] && path[1] == L':'); }
vuln
Safe
C/C++
/* * GPAC - Multimedia Framework C SDK * * Authors: Jean Le Feuvre * Copyright (c) Telecom ParisTech 2000-2021 * All rights reserved * * This file is part of GPAC / ISO Media File Format sub-project * * GPAC is free software; you can redistribute it and/or modify * it under the terms of the GNU L...
vuln
Vulnerable
C/C++
def add_acl_role_remote(params, request, session) if not allowed_for_local_cluster(session, Permissions::GRANT) return 403, 'Permission denied' end retval = add_acl_role(session, params["name"], params["description"]) if retval == "" return [200, "Successfully added ACL role"] else return [ ...
vuln
Vulnerable
Ruby
int phar_parse_tarfile(php_stream* fp, char *fname, int fname_len, char *alias, int alias_len, phar_archive_data** pphar, int is_data, php_uint32 compression, char **error TSRMLS_DC) /* {{{ */ { char buf[512], *actual_alias = NULL, *p; phar_entry_info entry = {0}; size_t pos = 0, read, totalsize; tar_header *hdr; ...
vuln
Safe
Unknown
static int fts3AllocateSegdirIdx( Fts3Table *p, int iLangid, /* Language id */ int iIndex, /* Index for p->aIndex */ int iLevel, int *piIdx ){ int rc; /* Return Code */ sqlite3_stmt *pNextIdx; /* Query for next idx at level iLevel */...
vuln
Safe
Unknown
import logging import yaml from redash.utils.requests_session import requests_or_advocate, UnacceptableAddressException from redash.query_runner import * from redash.utils import json_dumps logger = logging.getLogger(__name__) try: import pandas as pd import xlrd import openpyxl import numpy as np ...
vuln
Safe
Python
public void setPreferredOpportunisticDataSubscription(int subId, boolean needValidation, @Nullable @CallbackExecutor Executor executor, @Nullable Consumer<Integer> callback) { String pkgForDebug = mContext != null ? mContext.getOpPackageName() : "<unknown>"; try { IOns iOpportuni...
vuln
Vulnerable
Java
void qmp_migrate_set_parameters(MigrationParameters *params, Error **errp) { MigrationState *s = migrate_get_current(); if (params->has_compress_level && (params->compress_level < 0 || params->compress_level > 9)) { error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "compress_level", ...
vuln
Safe
C/C++
v8::Local<v8::Object> V8InjectedScriptHost::create(v8::Local<v8::Context> context, V8InspectorImpl* inspector) { v8::Isolate* isolate = inspector->isolate(); v8::Local<v8::Object> injectedScriptHost = v8::Object::New(isolate); v8::Local<v8::External> debuggerExternal = v8::External::New(isolate, inspect...
vuln
Vulnerable
C/C++
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab #include <cstring> #include <sstream> #include <stack> #include <utility> #include <boost/regex.hpp> #include <iostream> #include "rapidjson/reader.h" #include "common/backport14.h" #include "rgw_auth.h" #include <arpa...
vuln
Safe
C/C++
private void showDialog(String title, int requestType) { final AlertController.AlertParams p = mAlertParams; p.mTitle = title; if(DEBUG) Log.i(TAG, "showDialog() Request type: " + mRequestType + " this: " + this); switch(requestType) { case BluetoothDevice.REQUEST_TYP...
vuln
Vulnerable
Java
private void validateHeader(String[] possibleHeader) throws InvalidCsvException, InvalidHeaderException { int headerSize = possibleHeader.length; Set<String> knownColumns = new HashSet<>(); ArrayList<String> unknownColumns = new ArrayList<>(); for (int i = 0; i < headerSize; i++) { ...
vuln
Vulnerable
Java
@Override public void actionPerformed(@NonNull AnActionEvent e) { Diagnostic<?> diagnostic = e.getData(CommonDataKeys.DIAGNOSTIC); diagnostic = DiagnosticUtil.getDiagnosticSourceUnwrapper(diagnostic); if (diagnostic == null) { return; } Editor editor = e.getData(...
vuln
Vulnerable
Java
package graphqlbackend import ( "context" "encoding/json" "fmt" "math" "path" "regexp" "sort" "strconv" "sync" "time" "github.com/cockroachdb/errors" "github.com/inconshreveable/log15" "github.com/neelance/parallel" "github.com/opentracing/opentracing-go" "github.com/opentracing/opentracing-go/ext" ot...
vuln
Safe
Go
/** \file env.c Functions for setting and getting environment variables. */ #include "config.h" #include <stdlib.h> #include <wchar.h> #include <string.h> #include <stdio.h> #include <locale.h> #include <unistd.h> #include <signal.h> #include <assert.h> #include <sys/types.h> #include <sys/stat.h> #include <pthread....
vuln
Vulnerable
C/C++
static int http_open_cnx(URLContext *h) { const char *path, *proxy_path, *lower_proto = "tcp", *local_path; char hostname[1024], hoststr[1024], proto[10]; char auth[1024], proxyauth[1024]; char path1[1024]; char buf[1024], urlbuf[1024]; int port, use_proxy, err, location_changed = 0, redirects =...
vuln
Vulnerable
C/C++
/* * See the NOTICE file distributed with this work for additional * information regarding copyright ownership. * * This 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 of * th...
vuln
Vulnerable
Java
def delete(self, req, id): """ Deletes the image and all its chunks from the Glance :param req: The WSGI/Webob Request object :param id: The opaque image identifier :raises HttpBadRequest if image registry is invalid :raises HttpNotFound if image or any chunk is not ava...
vuln
Safe
Python
package com.salesmanager.shop.admin.controller.user; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Set; import javax.inject.Inject; import javax.inject.Named; import javax.servlet.http.HttpServletR...
vuln
Vulnerable
Java
std::string PrintPreviewUI::GetPrintPreviewUIAddress() const { char preview_ui_addr[2 + (2 * sizeof(this)) + 1]; base::snprintf(preview_ui_addr, sizeof(preview_ui_addr), "%p", this); return preview_ui_addr; }
vuln
Vulnerable
C/C++
function check_app_exists($uniq_name, $bdd) { $sql = "select count(*) from bp where name = '" . $uniq_name . "';"; $req = $bdd->query($sql); $bp_exist = $req->fetch(PDO::FETCH_NUM); if($bp_exist[0] == 1){ echo "true"; } else { echo "false"; } }
vuln
Vulnerable
PHP
@Override public void handle(HttpServletRequest request, HttpServletResponse response) throws IOException { CommonAuthResponseWrapper responseWrapper = null; if (response instanceof CommonAuthResponseWrapper) { responseWrapper = (CommonAuthResponseWrapper) response; } else { ...
vuln
Vulnerable
Java
var quantityUnitsTable = $('#quantityunits-table').DataTable({ 'order': [[1, 'asc']], 'columnDefs': [ { 'orderable': false, 'targets': 0 }, { 'searchable': false, "targets": 0 } ] }); $('#quantityunits-table tbody').removeClass("d-none"); quantityUnitsTable.columns.adjust().draw(); $("#search").on("keyup", Del...
vuln
Safe
JavaScript
void ThreadableBlobRegistry::registerStreamURL(const KURL& url, const String& type) void BlobRegistry::registerStreamURL(const KURL& url, const String& type) { if (isMainThread()) { if (WebBlobRegistry* registry = blobRegistry()) registry->registerStreamURL(url, type); } else { O...
vuln
Safe
C/C++
/* Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public * License as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, ...
vuln
Vulnerable
C/C++
/** * $Id: ProxyServlet.java,v 1.4 2013/12/13 13:18:11 david Exp $ * Copyright (c) 2011-2012, JGraph Ltd */ package com.mxgraph.online; import java.io.BufferedInputStream; import java.io.ByteArrayOutputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java....
vuln
Safe
Java
static MagickBooleanType WritePICTImage(const ImageInfo *image_info, Image *image,ExceptionInfo *exception) { #define MaxCount 128 #define PictCropRegionOp 0x01 #define PictEndOfPictureOp 0xff #define PictJPEGOp 0x8200 #define PictInfoOp 0x0C00 #define PictInfoSize 512 #define PictPixmapOp 0x9A #define PictPIC...
vuln
Vulnerable
C/C++
/* * Cantata * * Copyright (c) 2011-2018 Craig Drummond <craig.p.drummond@gmail.com> * * ---- * * 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 * (a...
vuln
Safe
C/C++
/* An implementation of Red-Black Trees with invariant node pointers. * Nodes are allocated using single malloc that includes the key. * This means that string/struct keys (which are of varying length) can not be copied between nodes. * So instead of swapping node key/values, positions are swapped when balancing t...
vuln
Vulnerable
C/C++
static void ppc405ep_compute_clocks (ppc405ep_cpc_t *cpc) { uint32_t CPU_clk, PLB_clk, OPB_clk, EBC_clk, MAL_clk, PCI_clk; uint32_t UART0_clk, UART1_clk; uint64_t VCO_out, PLL_out; int M, D; VCO_out = 0; if ((cpc->pllmr[1] & 0x80000000) && !(cpc->pllmr[1] & 0x40000000)) { M = (((cpc->pll...
vuln
Safe
C/C++
file_check_mem(struct magic_set *ms, unsigned int level) { size_t len; if (level >= ms->c.len) { len = (ms->c.len = 20 + level) * sizeof(*ms->c.li); ms->c.li = CAST(struct level_info *, (ms->c.li == NULL) ? malloc(len) : realloc(ms->c.li, len)); if (ms->c.li == NULL) { file_oomem(ms, len);...
vuln
Safe
C/C++
#include "source/common/router/router.h" #include <chrono> #include <cstdint> #include <functional> #include <memory> #include <string> #include "envoy/event/dispatcher.h" #include "envoy/event/timer.h" #include "envoy/grpc/status.h" #include "envoy/http/conn_pool.h" #include "envoy/runtime/runtime.h" #include "envoy...
vuln
Vulnerable
C/C++
@Override public synchronized void done(boolean success) { if(success || (!success && !supportedAuths.contains("password"))) { ((PasswordAuthenticator)authenticator).done(success); } super.done(success); }
vuln
Vulnerable
Java
int64_t av_get_int(void *obj, const char *name, const AVOption **o_out) { int64_t intnum=1; double num=1; int den=1; av_get_number(obj, name, o_out, &num, &den, &intnum); return num*intnum/den; }
vuln
Vulnerable
C/C++
package za.org.grassroot.integration.authentication; import io.jsonwebtoken.*; import io.jsonwebtoken.impl.TextCodec; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframe...
vuln
Safe
Java
int expand_downwards(struct vm_area_struct *vma, unsigned long address) { struct mm_struct *mm = vma->vm_mm; struct vm_area_struct *prev; unsigned long gap_addr; int error; address &= PAGE_MASK; error = security_mmap_addr(address); if (error) return error; /* Enforce stack_guard_gap */ gap_addr = ad...
vuln
Safe
Unknown
public void run() { LOG.debug("Starting to get data"); try { final HardenedLoggingEventInputStream hleis = new HardenedLoggingEventInputStream(mClient.getInputStream()); while (true) { final LoggingEvent event = (LoggingEven...
vuln
Safe
Java
public void reuse () { scrollMessageId = null; scrollHighlightMode = 0; knownTotalMessageCount = -1; foundUnreadAtLeastOnce = false; canLoadTop = false; canLoadBottom = false; if (contextId == Long.MAX_VALUE) { contextId = 0; } contextId++; mergeMode = MERGE_MODE_NONE;...
vuln
Safe
Java
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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 t...
vuln
Safe
JavaScript
static void patch_reloc(tcg_insn_unit *code_ptr, int type, intptr_t value, intptr_t addend) { tcg_insn_unit *target; tcg_insn_unit old; value += addend; target = (tcg_insn_unit *)value; switch (type) { case R_PPC_REL14: reloc_pc14(code_ptr, target); break;...
vuln
Vulnerable
C/C++
/* -*- C++ -*- * Copyright 2019-2020 LibRaw LLC (info@libraw.org) * 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 LICENSE version 2.1 (See file LICENSE.LGPL provided in LibRaw distribution archive for deta...
vuln
Vulnerable
C/C++
public DockerRun currentUser() { String user = null; // Currently, default user is set on Linux, only. if (SystemUtils.IS_OS_UNIX) { UnixSystem system = new UnixSystem(); user = String.format("%d:%d", system.getUid(), system.getGid()); } return this.user...
vuln
Vulnerable
Java
void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const void *data) { struct rtattr *rta; int size = RTA_LENGTH(attrlen); rta = (struct rtattr*)skb_put(skb, RTA_ALIGN(size)); rta->rta_type = attrtype; rta->rta_len = size; memcpy(RTA_DATA(rta), data, attrlen); }
vuln
Vulnerable
Unknown
static void suffix_object( cJSON *prev, cJSON *item ) { prev->next = item; item->prev = prev; }
vuln
Vulnerable
C/C++
loadEditor(element, customConfig) { this.setElement(element); const instance = this.getEditorInstanceFromName(), self = this; let config = { language: CONFIG.langKey, allowedContent: true, disableNativeSpellChecker: false, extraAllowedContent: 'div{page-break-after*}', format_t...
vuln
Vulnerable
JavaScript
'use strict'; /*! * Module dependencies. */ const EventEmitter = require('events').EventEmitter; const Kareem = require('kareem'); const MongooseError = require('./error/mongooseError'); const SchemaType = require('./schematype'); const SchemaTypeOptions = require('./options/SchemaTypeOptions'); const VirtualOption...
vuln
Vulnerable
JavaScript
/* * Copyright (C) 2005-2020 ManyDesigns srl. All rights reserved. * http://www.manydesigns.com/ * * This 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 3 of * the License, or (a...
vuln
Vulnerable
Java
def handle_request(client, lines, requests) env = client.env io = client.io # io may be a MiniSSL::Socket return false if closed_socket?(io) normalize_env env, client env[PUMA_SOCKET] = io if env[HTTPS_KEY] && io.peercert env[PUMA_PEERCERT] = io.peercert end ...
vuln
Vulnerable
Ruby
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
vuln
Vulnerable
C/C++
void h2_beam_abort(h2_bucket_beam *beam) { h2_beam_lock bl; if (beam && enter_yellow(beam, &bl) == APR_SUCCESS) { beam->aborted = 1; r_purge_sent(beam); h2_blist_cleanup(&beam->send_list); report_consumption(beam, &bl); apr_thread_cond_broadcast(beam->change); ...
vuln
Safe
Unknown
private void handleIntent(Intent intent) { if (intent == null) { return; } NavHostFragment navHostFragment = (NavHostFragment) getSupportFragmentManager().findFragmentById(R.id.nav_host_fragment); if (navHostFragment == null) { return; } NavControl...
vuln
Safe
Java
mon_rwxa_t MonCapGrant::get_allowed(CephContext *cct, int daemon_type, EntityName name, const std::string& s, const std::string& c, const map<string,string>& c_args) const { if (profile.length()) { expand_profile(daemon_type, name); mon_rwxa_t a; for (list<MonCapGrant>::con...
vuln
Vulnerable
Unknown
function A(ha,qa,aa,ca,na){na||(da.innerHTML="",K(),T=ha,X=ca);var la=null;if(aa){la=document.createElement("table"); la.className="geTempDlgDiagramsListGrid";var oa=document.createElement("tr"),ra=document.createElement("th");ra.style.width="50%";ra.innerHTML=mxUtils.htmlEntities(mxResources.get("diagram"));oa.appendC...
vuln
Vulnerable
JavaScript
static av_cold int decode_init(WMAProDecodeCtx *s, AVCodecContext *avctx) { uint8_t *edata_ptr = avctx->extradata; unsigned int channel_mask; int i, bits; int log2_max_num_subframes; int num_possible_block_sizes; if (avctx->codec_id == AV_CODEC_ID_XMA1 || avctx->codec_id == AV_CODEC_ID_XMA2) ...
vuln
Vulnerable
C/C++
int ff_mjpeg_decode_sos(MJpegDecodeContext *s, const uint8_t *mb_bitmask, int mb_bitmask_size, const AVFrame *reference) { int len, nb_components, i, h, v, predictor, point_transform; int index, id, ret; const int block_size = s->lossless ? 1 : 8; int ilv, prev_shift; if (!s-...
vuln
Safe
C/C++
#ifndef JSI_LITE_ONLY #ifndef JSI_AMALGAMATION #include "jsiInt.h" #endif static void jsonNewDString(Jsi_Interp *interp, Jsi_DString *dStr, const char* str, int len) { char buf[100], *dp = buf; const char *cp = str; int ulen; while ((cp-str)<len) { if (*cp == '\\') { switch (c...
vuln
Vulnerable
C/C++
av_cold int ff_vaapi_encode_close(AVCodecContext *avctx) { VAAPIEncodeContext *ctx = avctx->priv_data; VAAPIEncodePicture *pic, *next; for (pic = ctx->pic_start; pic; pic = next) { next = pic->next; vaapi_encode_free(avctx, pic); } if (ctx->va_context != VA_INVALID_ID) { vaDe...
vuln
Safe
C/C++
mrb_remove_method(mrb_state *mrb, struct RClass *c, mrb_sym mid) { mt_tbl *h; MRB_CLASS_ORIGIN(c); h = c->mt; if (h && mt_del(mrb, h, mid)) return; mrb_name_error(mrb, mid, "method '%n' not defined in %C", mid, c); }
vuln
Vulnerable
C/C++
static int handle_hypercall(S390CPU *cpu, struct kvm_run *run) { CPUS390XState *env = &cpu->env; cpu_synchronize_state(CPU(cpu)); env->regs[2] = s390_virtio_hypercall(env); return 0; }
vuln
Vulnerable
C/C++
@Override protected void onResume() { super.onResume(); IRCCloudApplication.getInstance().onResume(this); String session = NetworkConnection.getInstance().session; if (session.length() > 0) { if (conn.getState() == NetworkConnection.STATE_DISCONNECTED || conn.getState() =...
vuln
Vulnerable
Java
function load() { w3_require_once(W3TC_INC_FUNCTIONS_DIR . '/admin.php'); $this->_page = w3tc_get_current_page(); /** * Run plugin action */ $action = false; foreach ($_REQUEST as $key => $value) { if (strpos($key, 'w3tc_') === 0) { ...
vuln
Vulnerable
PHP
int avio_open2(AVIOContext **s, const char *filename, int flags, const AVIOInterruptCB *int_cb, AVDictionary **options) { AVIOInternal *internal; const URLProtocol **protocols; URLContext *h; int err; protocols = ffurl_get_protocols(NULL, NULL); if (!protocols) return AVER...
vuln
Vulnerable
C/C++
TIFFReadCustomDirectory(TIFF* tif, toff_t diroff, const TIFFFieldInfo info[], size_t n) { static const char module[] = "TIFFReadCustomDirectory"; TIFFDirectory* td = &tif->tif_dir; TIFFDirEntry *dp, *dir = NULL; const TIFFFieldInfo* fip; size_t fix; uint16 i, dircount; _TIFFSetupFieldInfo(tif, info, n); d...
vuln
Safe
C/C++
int bnxt_re_create_srq(struct ib_srq *ib_srq, struct ib_srq_init_attr *srq_init_attr, struct ib_udata *udata) { struct ib_pd *ib_pd = ib_srq->pd; struct bnxt_re_pd *pd = container_of(ib_pd, struct bnxt_re_pd, ib_pd); struct bnxt_re_dev *rdev = pd->rdev; struct bnxt_qplib_dev_attr *dev_attr = &rdev...
vuln
Vulnerable
C/C++
import logging from decimal import Decimal from typing import Any, Callable, Dict import Adyen from babel.numbers import get_currency_precision from django.conf import settings from django_countries.fields import Country from ....checkout.models import Checkout from ....core.prices import quantize_price from ... impo...
vuln
Vulnerable
Python
def create exists = true if params.has_key?(:inflated_object) params[:name] ||= params[:inflated_object].name params[:admin] ||= params[:inflated_object].admin end # We can only create clients if we're the admin or the validator. # But only allow creating admin clients if we're already...
vuln
Safe
Ruby
async function validApiKey(request, response, next) { const multiUserMode = await SystemSettings.isMultiUserMode(); response.locals.multiUserMode = multiUserMode; const auth = request.header("Authorization"); const bearerKey = auth ? auth.split(" ")[1] : null; if (!bearerKey) { response.status(403).json(...
vuln
Safe
JavaScript
def __eq__(self, other): return ( other != None and isinstance(other, IndirectObject) and self.idnum == other.idnum and self.generation == other.generation and self.pdf is other.pdf )
vuln
Vulnerable
Python
it "should unstage user" do staged_user = Fabricate(:staged, email: 'staged@account.com', active: true, username: 'staged1', name: 'Stage Name') invite = Fabricate(:invite, email: 'staged@account.com') user = InviteRedeemer.create_user_from_invite(invite: invite, email: invite.email, username: 'walter...
vuln
Vulnerable
Ruby
long Segment::DoLoadCluster( if (result < 0) // error return static_cast<long>(result); if (result > 0) // weird return E_BUFFER_NOT_FULL; if ((segment_stop >= 0) && ((pos + len) > segment_stop)) return E_FILE_FORMAT_INVALID; if ((pos + len) > avail) return E_BUFFER_NOT_F...
vuln
Safe
C/C++
ossl_cipher_initialize(VALUE self, VALUE str) { EVP_CIPHER_CTX *ctx; const EVP_CIPHER *cipher; char *name; name = StringValuePtr(str); GetCipherInit(self, ctx); if (ctx) { ossl_raise(rb_eRuntimeError, "Cipher already inititalized!"); } AllocCipher(self, ctx); EVP_CIPHER_CTX_init(ct...
vuln
Safe
Unknown
public void onUnregister(String mainCommand, CMDSender sender, Arguments arguments) { Optional<String> givenUsername = arguments.get(0).filter(arg -> sender.hasPermission(Permissions.UNREGISTER_OTHER)); Database database = dbSystem.getDatabase(); UUID playerUUID = sender.getUUID().orElse(null);...
vuln
Safe
Java
static double mp_set_Ixyz_v(_cimg_math_parser& mp) { CImg<T> &img = mp.imgout; const int x = (int)_mp_arg(2), y = (int)_mp_arg(3), z = (int)_mp_arg(4); const double *ptrs = &_mp_arg(1) + 1; if (x>=0 && x<img.width() && y>=0 && y<img.height() && z>=0 && z<img...
vuln
Safe
Unknown
tiparm(const char *string, ...) { va_list ap; char *result; _nc_tparm_err = 0; va_start(ap, string); #ifdef TRACE TPS(tname) = "tiparm"; #endif /* TRACE */ result = tparam_internal(FALSE, string, ap); va_end(ap); return result; }
vuln
Vulnerable
Unknown
package datastore import ( "context" "github.com/stackrox/rox/central/notifier/datastore/internal/store" "github.com/stackrox/rox/central/role/resources" "github.com/stackrox/rox/generated/storage" "github.com/stackrox/rox/pkg/errox" "github.com/stackrox/rox/pkg/sac" "github.com/stackrox/rox/pkg/secrets" "git...
vuln
Safe
Go
static void virtio_pci_common_write(void *opaque, hwaddr addr, uint64_t val, unsigned size) { VirtIOPCIProxy *proxy = opaque; VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus); switch (addr) { case VIRTIO_PCI_COMMON_DFSELECT: proxy->dfselect = val; ...
vuln
Vulnerable
C/C++
static int qdev_add_one_global(QemuOpts *opts, void *opaque) { GlobalProperty *g; ObjectClass *oc; g = g_malloc0(sizeof(*g)); g->driver = qemu_opt_get(opts, "driver"); g->property = qemu_opt_get(opts, "property"); g->value = qemu_opt_get(opts, "value"); oc = object_class_by_name(g->driv...
vuln
Vulnerable
C/C++
static int mxf_add_metadata_set(MXFContext *mxf, void *metadata_set) { mxf->metadata_sets = av_realloc(mxf->metadata_sets, (mxf->metadata_sets_count + 1) * sizeof(*mxf->metadata_sets)); if (!mxf->metadata_sets) return -1; mxf->metadata_sets[mxf->metadata_sets_count] = metadata_set; mxf->metadata...
vuln
Vulnerable
C/C++
public static void handle(SPacketRecipesList pPacket, Supplier<NetworkEvent.Context> pContext) { pContext.get().enqueueWork(() -> { ClientPlayerEntity clientPlayerEntity = Minecraft.getInstance().player; if (clientPlayerEntity != null) { Optional<IRecipesWidget> maybeWidget = RecipesWidget.get(...
vuln
Vulnerable
Java
int qcow2_snapshot_load_tmp(BlockDriverState *bs, const char *snapshot_id, const char *name, Error **errp) { int i, snapshot_index; BDRVQcowState *s = bs->opaque; QCowSnapshot *sn; uint64_t *new_l1_table; int new_l1_...
vuln
Safe
Unknown
void Set(const CString& sLine) { const CString sVar = sLine.Token(1).AsLower(); CString sUserName = sLine.Token(2); CString sValue = sLine.Token(3, true); if (sValue.empty()) { PutModule(t_s("Usage: Set <variable> <username> <value>")); return; } ...
vuln
Safe
Unknown
static int snd_pcm_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) { struct snd_pcm_runtime *runtime; int err = 0, usecs; unsigned int bits; snd_pcm_uframes_t frames; if (PCM_RUNTIME_CHECK(substream)) return -ENXIO; runtime = substream->runtime; mutex_lock(&runtime->bu...
vuln
Safe
Unknown
@Override public AuthenticationContext authenticate(RequestContext requestContext) throws APISecurityException { String jwtToken = retrieveAuthHeaderValue(requestContext); String splitToken[] = jwtToken.split("\\s"); // Extract the token when it is sent as bearer token. i.e Authorization: Be...
vuln
Vulnerable
Java
def self.open(path_or_url, ext = nil, options = {}) options, ext = ext, nil if ext.is_a?(Hash) ext ||= if File.exist?(path_or_url) File.extname(path_or_url) else File.extname(URI(path_or_url).path) end ext.sub!(/:.*/, '') # hack for filenames or URLs that ...
vuln
Vulnerable
Ruby
static int sync(AVFormatContext *s, int64_t *timestamp, int *flags, int *stream_index, int64_t *pos){ RMDemuxContext *rm = s->priv_data; ByteIOContext *pb = s->pb; int len, num, res, i; AVStream *st; uint32_t state=0xFFFFFFFF; while(!url_feof(pb)){ *pos= url_ftell(pb) - 3; if(rm-...
vuln
Vulnerable
C/C++
private boolean addOrSendChunkData(ChunkData chunkData) { TRegionReplicaSet replicaSet = singleTsFileNode .getDataPartition() .getDataRegionReplicaSetForWriting( chunkData.getDevice(), chunkData.getTimePartitionSlot()); dataSize += (1 + repli...
vuln
Safe
Java
fpDiff(TIFF* tif, uint8* cp0, tmsize_t cc) { tmsize_t stride = PredictorState(tif)->stride; uint32 bps = tif->tif_dir.td_bitspersample / 8; tmsize_t wc = cc / bps; tmsize_t count; uint8 *cp = (uint8 *) cp0; uint8 *tmp = (uint8 *)_TIFFmalloc(cc); if((cc%(bps*stride))!=0) { TIFFErrorExt(tif->tif_cl...
vuln
Vulnerable
C/C++
def _setup(self): """Setup this image object based on current tags""" if 0xBC01 in self.tag_v2: raise OSError("Windows Media Photo files not yet supported") # extract relevant tags self._compression = COMPRESSION_INFO[self.tag_v2.get(COMPRESSION, 1)] self._planar_co...
vuln
Vulnerable
Python
function Se(e){return"string"!=typeof e||""===e?"":(0,b.sanitizeUrl)(e)}
vuln
Safe
JavaScript
static inline int l2_unscale_group(int steps, int mant, int scale_factor) { int shift, mod, val; shift = scale_factor_modshift[scale_factor]; mod = shift & 3; shift >>= 2; val = (mant - (steps >> 1)) * scale_factor_mult2[steps >> 2][mod]; if (shift > 0) val = (val + (1 << (shift - 1...
vuln
Safe
C/C++
PROCESS_THREAD(snmp_process, ev, data) { PROCESS_BEGIN(); /* new connection with remote host */ snmp_udp_conn = udp_new(NULL, 0, NULL); udp_bind(snmp_udp_conn, SNMP_SERVER_PORT); LOG_DBG("Listening on port %u\n", uip_ntohs(snmp_udp_conn->lport)); while(1) { PROCESS_YIELD(); if(ev == tcpip_event) ...
vuln
Vulnerable
C/C++
public final void finish() { if (mDebug) Slog.v(mTag, "finish(): mFinished=" + mFinished); Activity activity = mActivity; if (activity != null) { if (!activity.isFinishing()) { // In case the activity is not finished yet, do it now. activity.finishAnd...
vuln
Safe
Java
private @Nullable Term compareMetaLiteral(@NotNull MetaLitTerm litLhs, @NotNull Term preRhs, @NotNull Term type, Sub lr, Sub rl) { if (!compare(litLhs.type(), type, null)) return null; var inline = litLhs.inline(); // try getting the solved literal if (inline == litLhs) return null; // unsolvable? retur...
vuln
Safe
Java
static void calc_sums(int pmin, int pmax, uint32_t *data, int n, int pred_order, uint64_t sums[][MAX_PARTITIONS]) { int i, j; int parts; uint32_t *res, *res_end; parts = (1 << pmax); res = &data[pred_order]; res_end = &data[n >> pmax]; for (i = 0; i < parts; ...
vuln
Safe
C/C++
private CloseableGrouperIterator<MemoryPointer, ResultRow> initNewDelegate() { // Method must not be called unless there's a current bucketInterval. assert bucketInterval != null; final DateTime timestamp = fudgeTimestamp != null ? fudgeTimestamp ...
vuln
Safe
Java
@Override public boolean mayObservePackage(String packageName) { PackageManager pm = mContext.getPackageManager(); try { // A package is a module if this is non-null if (pm.getModuleInfo(packageName, 0) != null) { return true; ...
vuln
Vulnerable
Java
fribidi_log2vis ( /* input */ const FriBidiChar *str, FriBidiStrIndex len, /* input and output */ FriBidiParType *pbase_dir, /* output */ FriBidiChar *visual_str, FriBidiStrIndex *positions_L_to_V, FriBidiStrIndex *positions_V_to_L, FriBidiLevel *embedding_levels ) { register FriBidiStrIndex i; ...
vuln
Safe
Unknown