code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
static int install_relocation_handler(int num_cpus, size_t save_state_size) { int cpus = num_cpus; #if CONFIG(X86_SMM_LOADER_VERSION2) /* Default SMRAM size is not big enough to concurrently * handle relocation for more than ~32 CPU threads * therefore, relocate 1 by 1. */ cpus = 1; #endif struct smm_loader_pa...
vuln
Safe
Unknown
public void getIdToken(Boolean forceRefresh, final GetIdTokenResultCallback resultCallback) { FirebaseUser user = getCurrentUser(); if (user == null) { resultCallback.error(FirebaseAuthenticationPlugin.ERROR_NO_USER_SIGNED_IN); return; } Task<GetTokenResult> token...
vuln
Safe
Java
function upgradeWebSocket(request, options = {}) { const upgrade = request.headers.get("upgrade"); const upgradeHasWebSocketOption = upgrade !== null && ArrayPrototypeSome( StringPrototypeSplit(upgrade, /\s*,\s*/), (option) => StringPrototypeToLowerCase(option) === "websocket", ); if (!upgrade...
vuln
Vulnerable
JavaScript
@Override public List<String> getMixins() { if (iris.getMetadata().getVersion().getFriendlyString().equals("1.1.3")) { return List.of("MixinCameraUniforms113"); } else { return List.of("MixinCameraUniforms"); } }
vuln
Vulnerable
Java
# -*- coding: utf_8 -*- from django.shortcuts import render from django.conf import settings from django.template.defaulttags import register from django.http import HttpResponseRedirect, HttpResponse from django.utils.html import escape from StaticAnalyzer.models import StaticAnalyzerAndroid from pyWebProxy.pywebprox...
vuln
Vulnerable
Python
@Deprecated public ResponseEntity<Set<Pet>> findPetsByTagsWithHttpInfo(Set<String> tags) throws RestClientException { Object postBody = null; // verify the required parameter 'tags' is set if (tags == null) { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Mi...
vuln
Vulnerable
Java
void clear() { for (var worldHandler : this.worlds.values()) { worldHandler.delete(); } this.worlds.clear(); }
vuln
Safe
Java
static void eap_response(esp, inp, id, len) eap_state *esp; u_char *inp; int id; int len; { u_char typenum; u_char vallen; int secret_len; char secret[MAXSECRETLEN]; char rhostname[256]; MD5_CTX mdContext; u_char hash[MD5_SIGNATURE_SIZE]; #ifdef USE_SRP struct t_server *ts; struct t_num A; SHA1_CTX ctxt; u_c...
vuln
Vulnerable
C/C++
gboolean cib_notify_client(gpointer key, gpointer value, gpointer user_data) { const char *type = NULL; gboolean do_send = FALSE; cib_client_t *client = value; xmlNode *update_msg = user_data; CRM_CHECK(client != NULL, return TRUE); CRM_CHECK(update_msg != NULL, return TRUE); if (client->...
vuln
Safe
C/C++
@Override public void showEntity(EntityInfo tracker, Collection<Player> players) { // Generate the packet that NMS would normally use to spawn the entity PacketContainer spawnPacket = EntityUtil.getRawEntitySpawnPacket(tracker.getEntity()); if(spawnPacket == null) {return;} if(spawn...
vuln
Safe
Java
@Override public ItemStack onFocusRightClick(ItemStack itemstack, World world, EntityPlayer player, MovingObjectPosition mop) { if (mop == null) return itemstack; Block block = world.getBlock(mop.blockX, mop.blockY, mop.blockZ); int meta = world.getBlockMetadata(mop.blockX, mop....
vuln
Safe
Java
static int milkymist_softusb_init(SysBusDevice *dev) { MilkymistSoftUsbState *s = MILKYMIST_SOFTUSB(dev); sysbus_init_irq(dev, &s->irq); memory_region_init_io(&s->regs_region, OBJECT(s), &softusb_mmio_ops, s, "milkymist-softusb", R_MAX * 4); sysbus_init_mmio(dev, &s->regs_regio...
vuln
Safe
C/C++
static int cirrus_bitblt_videotovideo_copy(CirrusVGAState * s) { if (s->ds->dpy_copy) { cirrus_do_copy(s, s->cirrus_blt_dstaddr - s->start_addr, s->cirrus_blt_srcaddr - s->start_addr, s->cirrus_blt_width, s->cirrus_blt_height); } else { if (BLTUNSAFE(s)) return 0; (*s->cirrus_r...
vuln
Vulnerable
C/C++
bool matches(const Http::RequestHeaderMap& headers) const override { if (BaseMatcherImpl::matchRoute(headers)) { if (headers.Path() == nullptr) { return false; } const Http::HeaderString& path = headers.Path()->value(); const absl::string_view query_string = Http::Utility::findQueryS...
vuln
Safe
C/C++
private void init() { // Get compiled script if cached CompiledScript cs = ScriptLoader.getScriptByPath( Grasscutter.getConfig().SCRIPTS_FOLDER + "Scene/" + getScene().getId() + "/scene" + getScene().getId() + "." + ScriptLoader.getScriptType()); if (cs == null) { Grasscutter.getLogger().warn("No script ...
vuln
Safe
Java
static long vma_compute_subtree_gap(struct vm_area_struct *vma) { unsigned long max, subtree_gap; max = vma->vm_start; if (vma->vm_prev) max -= vma->vm_prev->vm_end; if (vma->vm_rb.rb_left) { subtree_gap = rb_entry(vma->vm_rb.rb_left, struct vm_area_struct, vm_rb)->rb_subtree_gap; if (subtree_gap > max) ...
vuln
Vulnerable
Unknown
public Claims validateToken(String token) throws AuthenticationException { try { RsaKeyUtil rsaKeyUtil = new RsaKeyUtil(); PublicKey publicKey = rsaKeyUtil.fromPemEncoded(keycloakPublicKey); return (Claims) Jwts.parser().setSigningKey(publicKey).parse(token.replace("Bearer "...
vuln
Vulnerable
Java
/* * GeoTools - The Open Source Java GIS Toolkit * http://geotools.org * * (C) 2002-2015, Open Source Geospatial Foundation (OSGeo) * * This library 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 ...
vuln
Vulnerable
Java
def run_ssh_client_command(self, ssh_client: SSHClient, command: str, context=None) -> bytes: assert self.ssh_hook exit_status, agg_stdout, agg_stderr = self.ssh_hook.exec_ssh_client_command( ssh_client, command, environment=self.environment, get_pty=self.get_pty ) self.raise...
vuln
Vulnerable
Python
@Override public void handleBatch(List<ChangeEvent<Object, Object>> records, RecordCommitter<ChangeEvent<Object, Object>> committer) throws InterruptedException { LOGGER.trace("Event Hubs sink adapter processing change events"); CreateBatchOptions op = new Cr...
vuln
Vulnerable
Java
function addStyle(styleInfo) { var stylens = "urn:oasis:names:tc:opendocument:xmlns:style:1.0", newStyleElement; if (styleInfo.family !== 'paragraph') { return; } newStyleElement = editorSession.getParagraphStyleElement(styleInfo.name); ...
vuln
Safe
JavaScript
public static void load(){ //TODO might be unnecessary with no asteroids Seq<Objective> erekirSector = Seq.with(new OnPlanet(Planets.erekir)); var costMultipliers = new ObjectFloatMap<Item>(); costMultipliers.put(Items.silicon, 9); costMultipliers.put(Items.surgeAlloy, 4); ...
vuln
Safe
Java
void qcow2_free_clusters(BlockDriverState *bs, int64_t offset, int64_t size) { int ret; BLKDBG_EVENT(bs->file, BLKDBG_CLUSTER_FREE); ret = update_refcount(bs, offset, size, -1); if (ret < 0) { fprintf(stderr, "qcow2_free_clusters failed: %s\n", strerror(-ret)); ...
vuln
Safe
C/C++
f_py3eval(typval_T *argvars, typval_T *rettv) { char_u *str; char_u buf[NUMBUFLEN]; if (check_restricted() || check_secure()) return; if (p_pyx == 0) p_pyx = 3; str = tv_get_string_buf(&argvars[0], buf); do_py3eval(str, rettv); }
vuln
Safe
Unknown
/* * Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy,...
vuln
Vulnerable
Java
def GameNewPlayed(Played, ID): db.execute("UPDATE games set GamesPlayed = %i WHERE ID = %i" % (Played, ID)) database.commit()
vuln
Vulnerable
Python
ftp_retrieve_glob (struct url *u, ccon *con, int action) { struct fileinfo *f, *start; uerr_t res; con->cmd |= LEAVE_PENDING; res = ftp_get_listing (u, con, &start); if (res != RETROK) return res; /* First: weed out that do not conform the global rules given in opt.accepts and opt.rejects. */ ...
vuln
Vulnerable
Unknown
static KeyValue *copy_key_value(KeyValue *src) { KeyValue *dst = g_new(KeyValue, 1); memcpy(dst, src, sizeof(*src)); return dst;
vuln
Vulnerable
C/C++
/* * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. */ /* * Licensed to Elasticsearch under one or more contributor * license agreements. See the NOTICE file distribute...
vuln
Vulnerable
Java
@Override public void transform(Deobfuscator deobfuscator) throws Exception { ClassNode decryptClass = deobfuscator.getClasses().get("a0"); ClassNode mapClass = deobfuscator.getClasses().get("ac"); if (decryptClass == null || mapClass == null) return; SandBox sandBox = S...
vuln
Vulnerable
Java
int t2p_process_jpeg_strip( unsigned char* strip, tsize_t* striplength, unsigned char* buffer, tsize_t buffersize, tsize_t* bufferoffset, tstrip_t no, uint32 height){ tsize_t i=0; while (i < *striplength) { tsize_t datalen; uint16 ri; uint16 v_samp; uint16 h_samp; int j; int ncomp; /* ...
vuln
Safe
C/C++
static int ___sys_recvmsg(struct socket *sock, struct msghdr __user *msg, struct msghdr *msg_sys, unsigned int flags, int nosec) { struct compat_msghdr __user *msg_compat = (struct compat_msghdr __user *)msg; struct iovec iovstack[UIO_FASTIOV]; struct iovec *iov = iovstack; unsigned long cmsg_ptr; int err...
vuln
Safe
Unknown
package com.salesmanager.shop.admin.model.web; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import com.fasterxml.jackson.annotation.JsonProperty; public class Menu implements Serializable { /** * */ private static final long serialVersionUID = 1L; private String code; ...
vuln
Safe
Java
ebb_ews_connect_sync (EBookMetaBackend *meta_backend, const ENamedParameters *credentials, ESourceAuthenticationResult *out_auth_result, gchar **out_certificate_pem, GTlsCertificateFlags *out_certificate_errors, GCancellable *cancellable, GError **error) { EBookBackendEw...
vuln
Safe
Unknown
@Deprecated default boolean authenticateHttpRequest(HttpServletRequest request, HttpServletResponse response) throws Exception { AuthenticationState authenticationState = newHttpAuthState(request); String role = authenticateAsync(authenticationState.getAuthDataSource()).get(); request.setAtt...
vuln
Vulnerable
Java
bool ChromeWebUIControllerFactory::HasWebUIScheme(const GURL& url) const { return url.SchemeIs(chrome::kChromeDevToolsScheme) || url.SchemeIs(chrome::kChromeInternalScheme) || url.SchemeIs(chrome::kChromeUIScheme); }
vuln
Vulnerable
C/C++
TfLiteStatus Subgraph::AddNodeWithParameters( const std::vector<int>& inputs, const std::vector<int>& outputs, const std::vector<int>& intermediates, const char* init_data, size_t init_data_size, void* builtin_data, const TfLiteRegistration* registration, int* node_index) { std::unique_ptr<void, declt...
vuln
Safe
Unknown
static void shifter_out_im(TCGv var, int shift) { TCGv tmp = new_tmp(); if (shift == 0) { tcg_gen_andi_i32(tmp, var, 1); } else { tcg_gen_shri_i32(tmp, var, shift); if (shift != 31) tcg_gen_andi_i32(tmp, tmp, 1); } gen_set_CF(tmp); dead_tmp(tmp); }
vuln
Vulnerable
C/C++
GF_Err audio_sample_entry_Read(GF_Box *s, GF_BitStream *bs) { GF_MPEGAudioSampleEntryBox *ptr; char *data; u8 a, b, c, d; u32 i, size, v, nb_alnum; GF_Err e; u64 pos, start; ptr = (GF_MPEGAudioSampleEntryBox *)s; start = gf_bs_get_position(bs); gf_bs_seek(bs, start + 8); v = gf_bs_read_u16(bs); if (v) pt...
vuln
Safe
C/C++
public function onUpLoadPreSave(&$path, &$name, $src, $elfinder, $volume) { $opts = $this->opts; $volOpts = $volume->getOptionsPlugin('AutoResize'); if (is_array($volOpts)) { $opts = array_merge($this->opts, $volOpts); } if (! $opts['enable']) { return false; } $srcImgInfo = @getimagesize($src...
vuln
Vulnerable
JavaScript
static int decode_idat_chunk(AVCodecContext *avctx, PNGDecContext *s, uint32_t length, AVFrame *p) { int ret; size_t byte_depth = s->bit_depth > 8 ? 2 : 1; if (!(s->hdr_state & PNG_IHDR)) { av_log(avctx, AV_LOG_ERROR, "IDAT without IHDR\n"); return AVERROR_INVALI...
vuln
Safe
C/C++
void Compute(OpKernelContext* ctx) override { const Tensor& gradient = ctx->input(0); const Tensor& input = ctx->input(1); Tensor* input_backprop = nullptr; OP_REQUIRES_OK(ctx, ctx->allocate_output(0, input.shape(), &input_backprop)); OP_REQUIRES( ctx, input.IsSameSize(gr...
vuln
Vulnerable
Unknown
decryptTopicPage(data) { if (!data.currentRouteName?.startsWith("topic.")) { return; } if ( !this.container || this.container.isDestroyed || this.container.isDestroying ) { return; } const topicController = this.container.lookup("controller:topic"); const topi...
vuln
Safe
JavaScript
mxConstants.GUIDE_STROKEWIDTH);V.dialect=mxConstants.DIALECT_SVG;V.pointerEvents=!1;V.init(p.graph.getView().getOverlayPane());return V};E=function(V,M){if(V&&null!=p.guidesArrHor)for(V=0;V<p.guidesArrHor.length;V++)p.guidesArrHor[V].node.style.visibility="hidden";if(M&&null!=p.guidesArrVer)for(V=0;V<p.guidesArrVer.len...
vuln
Safe
JavaScript
LIR_Address* LIRGenerator::emit_array_address(LIR_Opr array_opr, LIR_Opr index_opr, BasicType type) { int offset_in_bytes = arrayOopDesc::base_offset_in_bytes(type); LIR_Address* addr; if (index_opr->is_constant()) { int elem_size = type2aelembytes(type); #ifdef ...
vuln
Safe
Unknown
int http_sendfile2(http_s *h, const char *prefix, size_t prefix_len, const char *encoded, size_t encoded_len) { if (HTTP_INVALID_HANDLE(h)) return -1; struct stat file_data = {.st_size = 0}; static uint64_t accept_enc_hash = 0; if (!accept_enc_hash) accept_enc_hash = fiobj_hash_string...
vuln
Vulnerable
C/C++
/** * @file * IMAP login authentication method * * @authors * Copyright (C) 1999-2001,2005,2009 Brendan Cully <brendan@kublai.com> * * @copyright * 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 * Fo...
vuln
Safe
C/C++
@Inject(method = "onEntityHit", at = @At("TAIL")) private void onAnimaConduitShotEnchantmentEntityHit(EntityHitResult entityHitResult, CallbackInfo ci){ if (!(entityHitResult.getEntity() instanceof LivingEntity)) { return; } PersistentProjectileEntity persistentProjectileEntity =...
vuln
Vulnerable
Java
@Override public boolean isEnteringPip(@NonNull TransitionInfo.Change change, @WindowManager.TransitionType int transitType) { if (change.getTaskInfo() != null && change.getTaskInfo().getWindowingMode() == WINDOWING_MODE_PINNED && !change.getContainer().equals(mCu...
vuln
Vulnerable
Java
#include "rar.hpp" size_t Archive::ReadHeader() { // Once we failed to decrypt an encrypted block, there is no reason to // attempt to do it further. We'll never be successful and only generate // endless errors. if (FailedHeaderDecryption) return 0; CurBlockPos=Tell(); size_t ReadSize; switch(Form...
vuln
Safe
C/C++
int fix_ipv6_checksums(tcpedit_t *tcpedit, struct pcap_pkthdr *pkthdr, ipv6_hdr_t *ip6_hdr, const size_t l2len) { int ret = 0; assert(tcpedit); assert(pkthdr); assert(ip6_hdr); if (pkthdr->caplen < (sizeof(*ip6_hdr) + l2len)) { tcpedit_setwarn(tcpedit, "caplen too small t...
vuln
Safe
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
vhost_user_check_and_alloc_queue_pair(struct virtio_net *dev, struct VhostUserMsg *msg) { uint16_t vring_idx; switch (msg->request.master) { case VHOST_USER_SET_VRING_KICK: case VHOST_USER_SET_VRING_CALL: case VHOST_USER_SET_VRING_ERR: vring_idx = msg->payload.u64 & VHOST_USER_VRING_IDX_MASK; break; case ...
vuln
Vulnerable
Unknown
jp2_box_t *jp2_box_create(int type) { jp2_box_t *box; jp2_boxinfo_t *boxinfo; if (!(box = jp2_box_create0())) { return 0; } box->type = type; box->len = 0; if (!(boxinfo = jp2_boxinfolookup(type))) { return 0; } box->info = boxinfo; box->ops = &boxinfo->ops; return box; }
vuln
Safe
C/C++
public static function showModal($params) { if (!isset($params['argument']) || empty($params['argument'])) { return array( 'processed' => true, 'process_status' => erTranslationClassLhTranslation::getInstance()->getTranslation('chat/chatcommand', 'Please provide moda...
vuln
Safe
PHP
horAcc16(TIFF* tif, uint8* cp0, tmsize_t cc) { tmsize_t stride = PredictorState(tif)->stride; uint16* wp = (uint16*) cp0; tmsize_t wc = cc / 2; if((cc%(2*stride))!=0) { TIFFErrorExt(tif->tif_clientdata, "horAcc16", "%s", "cc%(2*stride))!=0"); return 0; } if (wc > s...
vuln
Safe
C/C++
static int set_params(AVFilterContext *ctx, const char *params) { Frei0rContext *frei0r = ctx->priv; int i; for (i = 0; i < frei0r->plugin_info.num_params; i++) { f0r_param_info_t info; char *param; int ret; frei0r->get_param_info(&info, i); if (*params) { ...
vuln
Vulnerable
C/C++
static gboolean setup_seccomp (GPtrArray *argv_array, GArray *fd_array, const char *arch, gboolean multiarch, gboolean devel, GError **error) { __attribute__((cleanup (cleanup_seccomp))) scmp_filter_ctx seccomp = NULL; /**** B...
vuln
Safe
C/C++
package com.salesmanager.shop.admin.model.catalog; import javax.validation.constraints.NotEmpty; import java.io.Serializable; /** * Post keyword from the admin * @author Carl Samson * */ public class Keyword implements Serializable { /** * */ private static final long serialVersionUID = 1L; private lon...
vuln
Safe
Java
cJSON *cJSON_CreateObject( void )
vuln
Safe
C/C++
def show_owners name response = rubygems_api_request :get, "api/v1/gems/#{name}/owners.yaml" do |request| request.add_field "Authorization", api_key end with_response response do |resp| owners = YAML.load resp.body say "Owners for gem: #{name}" owners.each do |owner| say "-...
vuln
Vulnerable
Ruby
(function() { // Adds ArchiMate v3.0 shapes Sidebar.prototype.addArchimate3Palette = function() { this.setCurrentSearchEntryLibrary('archimate3', 'archimate3Application'); this.addArchimate3ApplicationPalette(); this.setCurrentSearchEntryLibrary('archimate3', 'archimate3Business'); this.addArchimate3Business...
vuln
Safe
Java
int get_filtered_video_frame(AVFilterContext *ctx, AVFrame *frame, AVFilterBufferRef **picref_ptr, AVRational *tb) { int ret; AVFilterBufferRef *picref; if ((ret = avfilter_request_frame(ctx->inputs[0])) < 0) return ret; if (!(picref = ctx->inputs[0]->cur_buf)) ...
vuln
Vulnerable
C/C++
/* Copyright (C) 2000-2012 by George Williams */ /* * 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 conditions and the following...
vuln
Vulnerable
C/C++
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2019, Evgeniy Krysanov <evgeniy.krysanov@gmail.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type DOCUMENTATION = r''' --- mo...
vuln
Safe
Python
public void test_like_any() { Entity from = from(Entity.class); where(from.getCode()).like().any("test"); Query<Entity> select = select(from); assertEquals("select entity_0 from Entity entity_0 where entity_0.code like '%test%'", select.getQuery()); }
vuln
Vulnerable
Java
u64 sched_clock_cpu(int cpu) { struct sched_clock_data *scd; u64 clock; if (sched_clock_stable()) return sched_clock(); if (unlikely(!sched_clock_running)) return 0ull; preempt_disable(); scd = cpu_sdc(cpu); if (cpu != smp_processor_id()) clock = sched_clock_remote(scd); else clock = sched_clock_loc...
vuln
Vulnerable
Unknown
void addToArchive( final Archiver archiver ) { for ( final Map.Entry<String, List<String>> entry : catalog.entrySet() ) { final String name = entry.getKey(); final String fname = new File( name ).getName(); File f; try { f ...
vuln
Vulnerable
Java
int decrypt(byte[] in, int inOfs, int len, byte[] out, int outOfs) { if ((len % blockSize) != 0) { throw new ProviderException("Internal error in input buffering"); } //processAAD(); synchronized (this) { checkDataLength(ibuffer.size(), len); if (len...
vuln
Safe
Java
// Copyright 2019 Joe Drago. All rights reserved. // SPDX-License-Identifier: BSD-2-Clause #include "avif/internal.h" #include <string.h> #define AUXTYPE_SIZE 64 #define CONTENTTYPE_SIZE 64 // class VisualSampleEntry(codingname) extends SampleEntry(codingname) { // unsigned int(16) pre_defined = 0; // const...
vuln
Vulnerable
C/C++
/* * Functions to sequence FLUSH and FUA writes. * * Copyright (C) 2011 Max Planck Institute for Gravitational Physics * Copyright (C) 2011 Tejun Heo <tj@kernel.org> * * This file is released under the GPLv2. * * REQ_{FLUSH|FUA} requests are decomposed to sequences consisted of three * optional steps - PREFL...
vuln
Safe
C/C++
ensure_credentials_sync (GoaProvider *provider, GoaObject *object, gint *out_expires_in, GCancellable *cancellable, GError **error) { GVariant *credentials; GoaAcco...
vuln
Vulnerable
Unknown
int sqlite3WindowRewrite(Parse *pParse, Select *p){ int rc = SQLITE_OK; if( p->pWin && p->pPrior==0 && (p->selFlags & SF_WinRewrite)==0 ){ Vdbe *v = sqlite3GetVdbe(pParse); sqlite3 *db = pParse->db; Select *pSub = 0; /* The subquery */ SrcList *pSrc = p->pSrc; Expr *pWhere = p->pWher...
vuln
Vulnerable
C/C++
public void analyze(final List<Component> components) { final Pageable<Component> paginatedComponents = new Pageable<>(PAGE_SIZE, components); while (!paginatedComponents.isPaginationComplete()) { final List<String> coordinates = new ArrayList<>(); final List<Component> paginated...
vuln
Vulnerable
Java
bool asn1_read_OctetString(struct asn1_data *data, TALLOC_CTX *mem_ctx, DATA_BLOB *blob) { int len; ZERO_STRUCTP(blob); if (!asn1_start_tag(data, ASN1_OCTET_STRING)) return false; len = asn1_tag_remaining(data); if (len < 0) { data->has_error = true; return false; } *blob = data_blob_talloc(mem_ctx, NULL, le...
vuln
Safe
Unknown
static int nbd_receive_list(QIOChannel *ioc, char **name, Error **errp) { uint64_t magic; uint32_t opt; uint32_t type; uint32_t len; uint32_t namelen; int error; *name = NULL; if (read_sync(ioc, &magic, sizeof(magic)) != sizeof(magic)) { error_setg(errp, "failed to read list opti...
vuln
Safe
C/C++
int sock_setsockopt(struct socket *sock, int level, int optname, char __user *optval, unsigned int optlen) { struct sock *sk = sock->sk; int val; int valbool; struct linger ling; int ret = 0; /* * Options without arguments */ if (optname == SO_BINDTODEVICE) return sock_setbindtodevice(sk, optval, o...
vuln
Vulnerable
C/C++
@Nullable private static <C extends AbstractContainerMenu, R> IRecipeTransferError transferRecipe( RecipeTransferManager recipeTransferManager, C container, IRecipeLayoutInternal<R> recipeLayout, Player player, boolean maxTransfer, boolean doTransfer ) { if (Internal.getRuntime().isEmpty()) { return ...
vuln
Safe
Java
private static Map<String, Object> readMapSafe(XContentParser parser, Supplier<Map<String, Object>> mapFactory) throws IOException { final Map<String, Object> map = mapFactory.get(); final String firstKey = findNonEmptyMapStart(parser); return firstKey == null ? map : readMapEntries(parser, mapF...
vuln
Safe
Java
TEE_Result syscall_asymm_verify(unsigned long state, const struct utee_attribute *usr_params, size_t num_params, const void *data, size_t data_len, const void *sig, size_t sig_len) { TEE_Result res; struct tee_cryp_state *cs; struct tee_ta_session *sess; struct tee_obj *o; size_t hash_size; int salt_len ...
vuln
Vulnerable
Unknown
do_compose_group(pdf14_buf *tos, pdf14_buf *nos, pdf14_buf *maskbuf, int x0, int x1, int y0, int y1, int n_chan, bool additive, const pdf14_nonseparable_blending_procs_t * pblend_procs, bool has_matte, bool overprint, gx_color_index drawn_comps, gs_memory_t *memor...
vuln
Safe
Unknown
/* Copyright 2016 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
Python
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { auto* params = reinterpret_cast<TfLiteLSHProjectionParams*>(node->builtin_data); int32_t* out_buf = GetOutput(context, node, 0)->data.i32; const TfLiteTensor* hash = GetInput(context, node, 0); const TfLiteTensor* input = GetInput(context, nod...
vuln
Vulnerable
C/C++
/** * @file * Read/parse/write an NNTP config file of subscribed newsgroups * * @authors * Copyright (C) 1998 Brandon Long <blong@fiction.net> * Copyright (C) 1999 Andrej Gritsenko <andrej@lucky.net> * Copyright (C) 2000-2017 Vsevolod Volkov <vvv@mutt.org.ua> * * @copyright * This program is free software: yo...
vuln
Safe
C/C++
static void amdvi_realize(DeviceState *dev, Error **err) { int ret = 0; AMDVIState *s = AMD_IOMMU_DEVICE(dev); X86IOMMUState *x86_iommu = X86_IOMMU_DEVICE(dev); MachineState *ms = MACHINE(qdev_get_machine()); MachineClass *mc = MACHINE_GET_CLASS(ms); PCMachineState *pcms = PC_MACHINE(obj...
vuln
Safe
C/C++
static void bdrv_move_feature_fields(BlockDriverState *bs_dest, BlockDriverState *bs_src) { bs_dest->open_flags = bs_src->open_flags; bs_dest->dev_ops = bs_src->dev_ops; bs_dest->dev_opaque = bs_src->dev_opaque; bs_dest->dev ...
vuln
Vulnerable
C/C++
import base64 import re from datetime import datetime import logging import ssl from xml.etree import ElementTree import iso8601 import six import recurly import recurly.errors from recurly.link_header import parse_link_value from six.moves import http_client from six.moves.urllib.parse import urlencode, urlsplit, qu...
vuln
Safe
Python
return na}function C(){function oa(pa,na){var Ka=mxResources.get(pa);null==Ka&&(Ka=pa.substring(0,1).toUpperCase()+pa.substring(1));18<Ka.length&&(Ka=Ka.substring(0,18)+"&hellip;");return Ka+" ("+na.length+")"}function sa(pa,na,Ka){mxEvent.addListener(na,"click",function(){Fa!=na&&(Fa.style.backgroundColor="",Fa=na,Fa....
vuln
Safe
JavaScript
@Override public void afterTextChanged(Editable editable) { if(c.getBuffer() != null) { if (server != null && server.isupport != null && server.isupport.has("TOPICLEN") && server.isupport.get("TOPICLEN").isInt()) dialog.setTitle("To...
vuln
Safe
Java
static int vc1_init_common(VC1Context *v) { static int done = 0; int i = 0; v->hrd_rate = v->hrd_buffer = NULL; if(!done) { init_vlc(&ff_vc1_bfraction_vlc, VC1_BFRACTION_VLC_BITS, 23, ff_vc1_bfraction_bits, 1, 1, ff_vc1_bfraction_codes, 1, 1, INIT_VLC_U...
vuln
Safe
C/C++
PHP_METHOD(Phar, addFromString) { char *localname, *cont_str; size_t localname_len, cont_len; PHAR_ARCHIVE_OBJECT(); if (zend_parse_parameters(ZEND_NUM_ARGS(), "ps", &localname, &localname_len, &cont_str, &cont_len) == FAILURE) { return; } phar_add_file(&(phar_obj->archiv...
vuln
Safe
C/C++
epass2003_sm_unwrap_apdu(struct sc_card *card, struct sc_apdu *sm, struct sc_apdu *plain) { int r; size_t len = 0; epass2003_exdata *exdata = NULL; if (!card->drv_data) return SC_ERROR_INVALID_ARGUMENTS; exdata = (epass2003_exdata *)card->drv_data; LOG_FUNC_CALLED(card->ctx); r = sc_check_sw(card, sm->sw1...
vuln
Safe
Unknown
/* * . .o8 oooo * .o8 "888 `888 * .o888oo oooo d8b oooo oooo .oooo888 .ooooo. .oooo.o 888 oooo * 888 `888""8P `888 `888 d88' `888 d88' `88b d88( "8 888 .8P' * 888 888 888 888 8...
vuln
Vulnerable
JavaScript
@EventHandler public void onDamagedEvent(EliteMobDamagedByPlayerEvent event) { FrostCone frostCone = (FrostCone) event.getEliteMobEntity().getPower(this); if (frostCone == null) return; if (frostCone.isInCooldown(event.getEliteMobEntity())) return; frostCone.doCooldownTicks(event.get...
vuln
Safe
Java
char *uwsgi_expand_path(char *dir, int dir_len, char *ptr) { char src[PATH_MAX + 1]; memcpy(src, dir, dir_len); src[dir_len] = 0; char *dst = ptr; if (!dst) dst = uwsgi_malloc(PATH_MAX + 1); if (!realpath(src, dst)) { uwsgi_error_realpath(src); if (!ptr) free(dst); return NULL; } return dst; }
vuln
Vulnerable
C/C++
/* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICENSE. */ /* * echo_client.c -- This is really a "line client:" it connects to QUIC server * and sends it stuff, line by line. It works in tandem with echo_server. */ #include <assert.h> #include <errno.h> #include <stdio.h> #include <stdlib.h> #inclu...
vuln
Safe
C/C++
void helper_idivl_EAX_T0(void) { int den, q, r; int64_t num; num = ((uint32_t)EAX) | ((uint64_t)((uint32_t)EDX) << 32); den = T0; if (den == 0) { raise_exception(EXCP00_DIVZ); } #ifdef BUGGY_GCC_DIV64 r = idiv32(&q, num, den); #else q = (num / den); r = (num % den); #end...
vuln
Vulnerable
C/C++
public File getKotlinFile(String className) { if (mCurrentProject == null) { return null; } return mCurrentProject.getKotlinFiles() .get(className); }
vuln
Safe
Java
static void co_sleep_cb(void *opaque) { CoSleepCB *sleep_cb = opaque; atomic_set(&sleep_cb->co->scheduled, NULL); aio_co_wake(sleep_cb->co); }
vuln
Safe
C/C++
def __init__(self, primary_base_path: str): self.base_path = primary_base_path
vuln
Vulnerable
Python