code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
@Override public void onHitTarget(World world, RayTraceResult target, UUID shooter, Entity projectile, boolean headshot) { }
vuln
Safe
Java
/* * TUN - Universal TUN/TAP device driver. * Copyright (C) 1999-2002 Maxim Krasnyansky <maxk@qualcomm.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 L...
vuln
Safe
C/C++
public static synchronized void send(@NotNull String message) throws Exception { if (!message.contains(System.lineSeparator())) { bw.write(message + System.lineSeparator()); } else { bw.write(message); } bw.flush(); }
vuln
Safe
Java
@staticmethod def get_max_task_id_for_project(project_id: int): """Gets the nights task id currently in use on a project""" sql = """select max(id) from tasks where project_id = :project_id GROUP BY project_id""" result = db.engine.execute(text(sql), project_id=project_id) if result....
vuln
Safe
Python
@Override public void onViewCreated(@NonNull View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); boolean isRecreated = listView != null; bindViews(); initLayout(); if (!isRecreated && getSearchOwner() != null) { getSearchOwner(...
vuln
Safe
Java
def patch(self, id): """Update node --- description: >- Update the node specified by the id. Only a user or node that belongs to the organization of the node are allowed to update it.\n If the node does not exists it is created as a new node.\n ### Permis...
vuln
Safe
Python
@Override public void callSessionInviteParticipantsRequestFailed(ImsReasonInfo reasonInfo) { TelephonyUtils.runWithCleanCallingIdentity(()-> { if (mListener != null) { mListener.callSessionInviteParticipantsRequestFailed(ImsCallSession.this, ...
vuln
Safe
Java
void md_map_sh512(uint8_t *hash, const uint8_t *msg, size_t len) { SHA512Context ctx; if (SHA512Reset(&ctx) != shaSuccess) { RLC_THROW(ERR_NO_VALID); return; } if (SHA512Input(&ctx, msg, len) != shaSuccess) { RLC_THROW(ERR_NO_VALID); return; } if (SHA512Result(&ctx, hash) != shaSuccess) { RLC_THROW(ERR...
vuln
Safe
C/C++
$('#modalExport .btn-primary').on('click', function (e) { e.preventDefault(); var elBtn = $(this), bid = $('#modalExport input[name=exportGroupBy]:checked').val(), url = listId + '/export' + (bid ? '/' + bid : ''); elBtn.attr('href', eHtml(url)); ...
vuln
Safe
JavaScript
static void WriteProfile(j_compress_ptr jpeg_info,Image *image) { const char *name; const StringInfo *profile; MagickBooleanType iptc; register ssize_t i; size_t length, tag_length; StringInfo *custom_profile; /* Save image profile as a APP marker. */ iptc=MagickF...
vuln
Vulnerable
C/C++
void user_describe(const struct key *key, struct seq_file *m) { seq_puts(m, key->description); if (key_is_instantiated(key)) seq_printf(m, ": %u", key->datalen); }
vuln
Vulnerable
C/C++
public void pause() { mediaPlayer.pause(); }
vuln
Vulnerable
Java
public Spell getSpell() { return spell; }
vuln
Vulnerable
Java
int ffio_rewind_with_probe_data(AVIOContext *s, unsigned char **bufp, int buf_size) { int64_t buffer_start; int buffer_size; int overlap, new_size, alloc_size; uint8_t *buf = *bufp; if (s->write_flag) { av_freep(bufp); return AVERROR(EINVAL); } buffer_size = s->buf_end - s->b...
vuln
Safe
C/C++
static int futex_lock_pi_atomic(u32 __user *uaddr, struct futex_hash_bucket *hb, union futex_key *key, struct futex_pi_state **ps, struct task_struct *task, int set_waiters) { int lock_taken, ret, force_take = 0; u32 uval, newval, curval, vpid = task_pid_vnr(task); retry: ret = lock_taken = 0; /* * ...
vuln
Safe
Unknown
double ConvolverNode::latencyTime() const { MutexTryLocker tryLocker(m_processLock); if (tryLocker.locked()) return m_reverb ? m_reverb->latencyFrames() / static_cast<double>(sampleRate()) : 0; // Since we don't want to block the Audio Device thread, we return a large value // instead of trying...
vuln
Safe
C/C++
enlist (char **cpp, char *new, size_t len) { size_t i, j; if (cpp == NULL) return NULL; if ((new = icpyalloc(new)) == NULL) { freelist(cpp); return NULL; } new[len] = '\0'; /* Is there already something in the list that's new (or longer)? */ for (i = 0; cpp[i] != NULL; ++i) if (...
vuln
Safe
Unknown
//--------------------------------------------------------------------------- #include <vcl.h> #pragma hdrstop #include "ScpFileSystem.h" #include "Terminal.h" #include "Common.h" #include "Exceptions.h" #include "Interface.h" #include "TextsCore.h" #include "HelpCore.h" #include "SecureShell.h" #include <StrUtils.hp...
vuln
Vulnerable
C/C++
static int decode_tsw1(GetByteContext *gb, uint8_t *frame, int width, int height) { const uint8_t *frame_start = frame; const uint8_t *frame_end = frame + width * height; int mask = 0x10000, bitbuf = 0; int v, count, segments; unsigned offset; segments = bytestream2_get_le32(gb); offset ...
vuln
Vulnerable
C/C++
gs_main_finit(gs_main_instance * minst, int exit_status, int code) { i_ctx_t *i_ctx_p = minst->i_ctx_p; gs_dual_memory_t dmem = {0}; int exit_code; ref error_object; char *tempnames; /* NB: need to free gs_name_table */ /* * Previous versions of this code closed the devices in th...
vuln
Vulnerable
Unknown
private void _refreshLists() { filtered_list.clear(); reference_list.clear(); String paletteFileContent = FileUtil.readFile(pallet_path); String blocksFileContent = FileUtil.readFile(blocks_path); if (paletteFileContent.equals("")) { FileUtil.writeFile(pallet_path, "[...
vuln
Safe
Java
@Override public TypedActionResult<ItemStack> use(World world, PlayerEntity user, Hand hand) { ItemStack stack = user.getStackInHand(hand); if (!world.isClient()) { ReleasedSoulEntity releasedSoul = new ReleasedSoulEntity(RequiemEntities.RELEASED_SOUL, world, Optional.ofNullable(stack.ge...
vuln
Vulnerable
Java
MONGO_EXPORT int mongo_run_command( mongo *conn, const char *db, const bson *command, bson *out ) { int ret = MONGO_OK; bson response = {NULL, 0}; bson fields; int sl = strlen( db ); char *ns = bson_malloc( sl + 5 + 1 ); /* ".$cmd" + nul */ int res, success = ...
vuln
Vulnerable
Unknown
static plist_t parse_bin_node(struct bplist_data *bplist, const char** object) { uint16_t type = 0; uint64_t size = 0; if (!object) return NULL; type = (**object) & BPLIST_MASK; size = (**object) & BPLIST_FILL; (*object)++; if (size == BPLIST_FILL) { switch (type) { ...
vuln
Safe
C/C++
package com.salesmanager.shop.admin.controller.products; import com.salesmanager.core.business.services.catalog.product.ProductService; import com.salesmanager.core.business.services.catalog.product.file.DigitalProductService; import com.salesmanager.core.business.utils.ajax.AjaxResponse; import com.salesmanager.core....
vuln
Vulnerable
Java
public EntityAnimation activate(DoorActivator activator, @Nullable EntityPlayer player, @Nullable UUID uuid, boolean sendUpdate) throws LittleActionException { if (waitingForApproval) throw new LittleActionExceptionHidden("Door has not been approved yet!"); if (activator == DoorActi...
vuln
Vulnerable
Java
def load_files(*file_paths) files = (site_configs + file_paths).map { |f| Pathname.new(f) } # TODO: Validate config state in some way. configs = files.map { |file| YAML.load(file.read) } load(*configs) end
vuln
Vulnerable
Ruby
@Override public boolean isBlockedPartnerOrParent(Partner partner) { if (partner.getHasBlockedAccount()) { return true; } if (partner.getParentPartner() != null) { return isBlockedPartnerOrParent(partner.getParentPartner()); } return false; }
vuln
Safe
Java
public static void openFile(Context context, File file) { if(file == null || !file.exists()) { EMLog.e(TAG, "Cannot open the file, because the file is not exit, file: "+file); return; } String filename = file.getName(); String mimeType = getMimeType(context, file)...
vuln
Safe
Java
@PostConstruct protected void init() { this.registry.register(this); this.setErrorHandler(new EventMulticasterErrorHandler()); }
vuln
Safe
Java
static void pc_dimm_plug(HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { HotplugHandlerClass *hhc; Error *local_err = NULL; PCMachineState *pcms = PC_MACHINE(hotplug_dev); PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms); PCDIMMDevice *dimm = PC_DIMM(dev); ...
vuln
Vulnerable
C/C++
void helper_divl_EAX_T0(void) { unsigned int den, r; uint64_t num, q; num = ((uint32_t)EAX) | ((uint64_t)((uint32_t)EDX) << 32); den = T0; if (den == 0) { raise_exception(EXCP00_DIVZ); } #ifdef BUGGY_GCC_DIV64 r = div32(&q, num, den); #else q = (num / den); r = (num % de...
vuln
Safe
C/C++
/* * Dragonfly - Runtime dependency management library * Copyright (c) 2021 Joshua Sing <joshua@hypera.dev> * * 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, in...
vuln
Safe
Java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you ...
vuln
Vulnerable
Java
@Override public String fromXML(String source) throws MessageSerializerException { try { if (deserializationProperties.isUseStrictParser()) { return deserializationPipeParser.encode(deserializationXmlParser.parse(source)); } else { /* ...
vuln
Safe
Java
pcf_read_TOC( FT_Stream stream, PCF_Face face ) { FT_Error error; PCF_Toc toc = &face->toc; PCF_Table tables; FT_Memory memory = FT_FACE( face )->memory; FT_UInt n; if ( FT_STREAM_SEEK ( 0 ) || FT_STREAM_READ_FIELDS ( pcf_toc_he...
vuln
Safe
C/C++
PHP_FUNCTION(bcpow) { char *left, *right; int left_len, right_len; long scale_param = 0; bc_num first, second, result; int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS(); if (zend_parse_parameters(argc TSRMLS_CC, "ss|l", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) { return; } if (argc...
vuln
Safe
Unknown
@Override public void initialise(GraphWriteMethods wg) { // dont initialise if there is 0 nodes present if (wg.getVertexCount() == 0) { stopAnimation(); } else { nodeRadiusAttribute = VisualConcept.VertexAttribute.NODE_RADIUS.get(wg); for (int pos = 0; pos...
vuln
Safe
Java
def __init__(self,p): try: self.tokens = np.array([symbolToIndex["START"]] + [ symbolToIndex[s] for s in serializeProgram(p) ] + [symbolToIndex["END"]]) except KeyError: print "Key error in tokenization",serializeProgram(p) assert False self.image = p...
vuln
Safe
Python
@Override public void render(float partialTicks, ItemTransforms.TransformType transformType, ItemStack stack, ItemStack parent, @Nullable LivingEntity entity, PoseStack poseStack, MultiBufferSource renderTypeBuffer, int light, int overlay) { if(OptifineHelper.isShadersEnabled()) { do...
vuln
Safe
Java
static struct dst_entry *geneve_get_v6_dst(struct sk_buff *skb, struct net_device *dev, struct geneve_sock *gs6, struct flowi6 *fl6, const struct ip_tunnel_info *info) { bool use_cache = ip_tunnel_dst_cache_usable(skb, info); struct geneve_dev *geneve = netdev_priv(dev); struct dst_en...
vuln
Vulnerable
Unknown
public function batUpdate(){ $cats = I("post.cats"); $item_id = I("post.item_id/d"); $login_user = $this->checkLogin(); if (!$this->checkItemEdit($login_user['uid'] , $item_id)) { $this->sendError(10103); return ; } $ret = ''; $data_array =...
vuln
Safe
PHP
static int pfkey_register(struct sock *sk, struct sk_buff *skb, const struct sadb_msg *hdr, void * const *ext_hdrs) { struct pfkey_sock *pfk = pfkey_sk(sk); struct sk_buff *supp_skb; if (hdr->sadb_msg_satype > SADB_SATYPE_MAX) return -EINVAL; if (hdr->sadb_msg_satype != SADB_SATYPE_UNSPEC) { if (pfk->register...
vuln
Vulnerable
C/C++
static bool bdrv_drain_recurse(BlockDriverState *bs) { BdrvChild *child; bool waited; waited = BDRV_POLL_WHILE(bs, atomic_read(&bs->in_flight) > 0); if (bs->drv && bs->drv->bdrv_drain) { bs->drv->bdrv_drain(bs); } QLIST_FOREACH(child, &bs->children, next) { waited |= bdrv_drain_r...
vuln
Vulnerable
C/C++
private static void handleCascadingTweak( File coreMod, JarFile jar, String cascadedTweaker, LaunchClassLoader classLoader, Integer sortingOrder) { try { // Have to manually stuff the tweaker into the parent classloader // PATCHED BEGIN URL coreModUrl = coreMod.to...
vuln
Safe
Java
static int live_callback(struct live_data_t *livedata, struct pcap_pkthdr *pkthdr, const u_char * nextpkt) { ipv4_hdr_t *ip_hdr = NULL; ipv6_hdr_t *ip6_hdr = NULL; pcap_t *send = NULL; static u_char *pktdata = NULL; /* full packet buffer */ int cache_mode, retcode; static unsig...
vuln
Safe
C/C++
@Override public void setStates(){ //Set buttons based on if we have prev or next items. prevPackButton.enabled = prevPack != null; nextPackButton.enabled = nextPack != null; prevPartButton.enabled = prevItem != null; nextPartButton.enabled = nextItem != null; prevColorButton.visible = currentItem inst...
vuln
Safe
Java
@Override public PluginPick<BattleCreationPlugin> pickBattleCreationPlugin(SectorEntityToken opponent) { /* if (opponent instanceof CampaignFleetAPI && NexConfig.useCustomBattleCreationPlugin) { return new PluginPick<BattleCreationPlugin>(new SSP_BattleCreationPluginImpl(), PickPriority.MOD_GENERAL); } */ ...
vuln
Safe
Java
MagickExport Image *AdaptiveThresholdImage(const Image *image, const size_t width,const size_t height,const double bias, ExceptionInfo *exception) { #define AdaptiveThresholdImageTag "AdaptiveThreshold/Image" CacheView *image_view, *threshold_view; Image *threshold_image; MagickBooleanType ...
vuln
Vulnerable
Unknown
private void newUserLogin(String aUsername) { User u = new User(); u.setUsername(aUsername); u.setPassword(EMPTY_PASSWORD); u.setEnabled(true); u.setRealm(UserDao.REALM_PREAUTH); Set<Role> s = new HashSet<>(); s.add(Role.ROLE_USER); Properties settin...
vuln
Vulnerable
Java
// SPDX-License-Identifier: GPL-2.0 /* * Copyright (c) 2012 - 2018 Microchip Technology Inc., and its subsidiaries. * All rights reserved. */ #include "netdev.h" #define WILC_HIF_SCAN_TIMEOUT_MS 5000 #define WILC_HIF_CONNECT_TIMEOUT_MS 9500 #define WILC_FALSE_FRMWR_CHANNEL 100 #define...
vuln
Vulnerable
C/C++
int ff_mpeg4_encode_picture_header(MpegEncContext *s, int picture_number) { int time_incr; int time_div, time_mod; if (s->pict_type == AV_PICTURE_TYPE_I) { if (!(s->avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER)) { if (s->strict_std_compliance < FF_COMPLIANCE_VERY_STRICT) ...
vuln
Safe
C/C++
int kvm_irqchip_add_msi_route(KVMState *s, MSIMessage msg) { struct kvm_irq_routing_entry kroute = {}; int virq; if (!kvm_gsi_routing_enabled()) { return -ENOSYS; } virq = kvm_irqchip_get_virq(s); if (virq < 0) { return virq; } kroute.gsi = virq; kroute.type = KVM_IRQ...
vuln
Safe
C/C++
#!/usr/bin/python # -*- coding: utf-8 -*- # Hive Netius System # Copyright (c) 2008-2020 Hive Solutions Lda. # # This file is part of Hive Netius System. # # Hive Netius System is free software: you can redistribute it and/or modify # it under the terms of the Apache License as published by the Apache # Foun...
vuln
Safe
Python
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.rtds.svc; import com.rtds.jpa.CaptureType; import java.util.List; import javax.enterprise.context.ApplicationScoped; impor...
vuln
Vulnerable
Java
ipv6_dup_options(struct sock *sk, struct ipv6_txoptions *opt) { struct ipv6_txoptions *opt2; opt2 = sock_kmalloc(sk, opt->tot_len, GFP_ATOMIC); if (opt2) { long dif = (char *)opt2 - (char *)opt; memcpy(opt2, opt, opt->tot_len); if (opt2->hopopt) *((char **)&opt2->hopopt) += dif; if (opt2->dst0opt) *((...
vuln
Safe
C/C++
package the.bytecode.club.bytecodeviewer.util; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.util.Enumeration; import java.util.Objects; import java.util.jar.JarEntry; import java.util.jar.JarFile; import java.u...
vuln
Vulnerable
Java
function systemEndpoints(app) { if (!app) return; app.get("/ping", (_, response) => { response.status(200).json({ online: true }); }); app.get("/migrate", async (_, response) => { const execSync = require("child_process").execSync; execSync("npx prisma migrate deploy --schema=./prisma/schema.prism...
vuln
Safe
JavaScript
static void ext4_clamp_want_extra_isize(struct super_block *sb) { struct ext4_sb_info *sbi = EXT4_SB(sb); struct ext4_super_block *es = sbi->s_es; /* determine the minimum size of new large inodes, if present */ if (sbi->s_inode_size > EXT4_GOOD_OLD_INODE_SIZE && sbi->s_want_extra_isize == 0) { sbi->s_want_...
vuln
Vulnerable
Unknown
@Override public void start(BundleContext context) throws Exception { super.start(context); setDefault(this); TmfCoreTracer.init(); /* Initialize the trace manager */ TmfTraceManager.getInstance(); /* Initialize the analysis manager */ TmfAnalysisManager.initi...
vuln
Vulnerable
Java
private void setSsid_spinner() { final ArrayList<String> ssidListFromPrefs = new ArrayList<>(); final ArrayList<String> ssids = new ArrayList<>(); if (newServer != null) { Set<String> ssidFromPrefs = newServer.getLocalServerSsid(); //noinspection SpellCheckingInspection ...
vuln
Vulnerable
Java
zstatus(i_ctx_t *i_ctx_p) { os_ptr op = osp; switch (r_type(op)) { case t_file: { stream *s; make_bool(op, (file_is_valid(s, op) ? 1 : 0)); } return 0; case t_string: { gs_parsed_file_name_t pname; ...
vuln
Vulnerable
C/C++
srtp_unprotect_aead (srtp_ctx_t *ctx, srtp_stream_ctx_t *stream, int delta, xtd_seq_num_t est, void *srtp_hdr, unsigned int *pkt_octet_len) { srtp_hdr_t *hdr = (srtp_hdr_t*)srtp_hdr; uint32_t *enc_start; /* pointer to start of encrypted portion */ unsigned int enc_octet_len = 0; /* nu...
vuln
Vulnerable
Unknown
ErrorCode HTTP2Codec::checkNewStream(uint32_t streamId, bool trailersAllowed) { if (streamId == 0) { goawayErrorMessage_ = folly::to<string>( "GOAWAY error: received streamID=", streamId, " as invalid new stream for lastStreamID_=", lastStreamID_); VLOG(4) << goawayErrorMessage_; return Er...
vuln
Vulnerable
C/C++
int config__parse_args(struct mosquitto_db *db, struct mosquitto__config *config, int argc, char *argv[]) { int i; int port_tmp; for(i=1; i<argc; i++){ if(!strcmp(argv[i], "-c") || !strcmp(argv[i], "--config-file")){ if(i<argc-1){ db->config_file = argv[i+1]; if(config__read(db, config, false)){ ...
vuln
Safe
C/C++
/* * Copyright (c) 2018-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ #include <fizz/record/EncryptedRecordLayer.h> #include <fizz/crypto/aead/IOBufUtil.h> namespace fizz {...
vuln
Vulnerable
C/C++
@Inject( method = {"m_cbzunkqe", "method_43613"}, at = @At( value = "INVOKE", target = "Lnet/minecraft/world/level/LevelProperties;<init>(Lnet/minecraft/world/level/LevelInfo;Lnet/minecraft/world/gen/GeneratorOptions;Lcom/mojang/serialization/Lifecycle;)V", remap = true ), remap = false, c...
vuln
Safe
Java
public static boolean handleCollideBlockEvent(final Block block, final Level world, final BlockPos pos, final net.minecraft.world.level.block.state.BlockState state, final net.minecraft.world.entity.Entity entity, final Direction direction, final CollisionType type) { if (pos.getY() <= 0...
vuln
Vulnerable
Java
public static void placeInitialCommander(UnitManager unitMgr) { PersonConfig personConfig = SimulationConfig.instance().getPersonConfig(); Commander commander = personConfig.getCommander(); ReportingAuthorityType sponsorCode = commander.getSponsorStr(); Settlement selected = null; Collection<Settlement...
vuln
Vulnerable
Java
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { auto* params = reinterpret_cast<TfLiteSequenceRNNParams*>(node->builtin_data); const TfLiteTensor* input; TF_LITE_ENSURE_OK(context, GetInputSafe(context, node, kInputTensor, &input)); const TfLiteTensor* input_weights; TF_LITE_ENSURE_OK( con...
vuln
Safe
C/C++
static int qcow2_do_open(BlockDriverState *bs, QDict *options, int flags, Error **errp) { BDRVQcow2State *s = bs->opaque; unsigned int len, i; int ret = 0; QCowHeader header; Error *local_err = NULL; uint64_t ext_end; uint64_t l1_vm_state_index; ret = bdrv_pread(...
vuln
Vulnerable
C/C++
static CACHE_BITMAP_V2_ORDER* update_read_cache_bitmap_v2_order(rdpUpdate* update, wStream* s, BOOL compressed, UINT16 flags) { BOOL rc; BYTE bitsPerPixelId; CACHE_BITMAP_V2_ORDER* cache_bitmap_v2; if (!update || !s) return NULL; cache_bitmap_v2 =...
vuln
Safe
C/C++
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ #define _GNU_SOURCE /* for memmem */ #include <assert.h> #include <errno.h> #include <limits.h> #include <time.h> #include <string.h> #include <sys/queue.h> #ifndef WIN32 #include <netinet/in.h> #include <netdb.h> #include <sys/socket.h>...
vuln
Vulnerable
C/C++
static int set_expr(AVExpr **pexpr, const char *expr, void *log_ctx) { int ret; AVExpr *old = NULL; if (*pexpr) old = *pexpr; ret = av_expr_parse(pexpr, expr, var_names, NULL, NULL, NULL, NULL, 0, log_ctx); if (ret < 0) { av_log(log_ctx, AV_LOG_ERROR, ...
vuln
Safe
C/C++
private void assertSafeToStartCustomActivity(Intent intent) { // Activity can be started if it belongs to the same app if (intent.getPackage() != null && intent.getPackage().equals(packageName)) { return; } ResolveInfo resolveInfo = mPackageManager.resolve...
vuln
Safe
Java
static INLINE OPJ_BOOL opj_tcd_init_tile(opj_tcd_t *p_tcd, OPJ_UINT32 p_tile_no, OPJ_BOOL isEncoder, OPJ_FLOAT32 fraction, OPJ_SIZE_T sizeof_block, opj_event_mgr_t* manager) { OPJ_UINT32 (*l_gain_ptr)(OPJ_UINT32) = 00; OPJ_UINT32 compno, resno, bandno, precno, cblkno; opj_tcp_t * l_tcp = 00; opj_cp_t * l_cp = 00; ...
vuln
Safe
C/C++
PcGuestInfo *pc_guest_info_init(ram_addr_t below_4g_mem_size, ram_addr_t above_4g_mem_size) { PcGuestInfoState *guest_info_state = g_malloc0(sizeof *guest_info_state); PcGuestInfo *guest_info = &guest_info_state->info; guest_info->pci_info.w32.end = IO_APIC_DEFAULT_ADDRESS; ...
vuln
Vulnerable
C/C++
static Image *ReadICONImage(const ImageInfo *image_info, ExceptionInfo *exception) { IconFile icon_file; IconInfo icon_info; Image *image; MagickBooleanType status; register ssize_t i, x; register Quantum *q; register unsigned char *p; size_t bit, byte, ...
vuln
Safe
Unknown
static void assemble_file(const char *fname, StrList **depend_ptr) { char *line; insn output_ins; int i; uint64_t prev_offset_changed; int64_t stall_count = 0; /* Make sure we make forward progress... */ switch (cmd_sb) { case 16: break; case 32: if (!iflag_cpu_level_ok(...
vuln
Vulnerable
Unknown
/* Userspace key control operations * * Copyright (C) 2004-5 Red Hat, Inc. All Rights Reserved. * Written by David Howells (dhowells@redhat.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 Foun...
vuln
Safe
C/C++
static int dirac_probe(AVProbeData *p) { unsigned size; if (AV_RL32(p->buf) != MKTAG('B', 'B', 'C', 'D')) return 0; size = AV_RB32(p->buf+5); if (size < 13) return 0; if (size + 13LL > p->buf_size) return AVPROBE_SCORE_MAX / 4; if (AV_RL32(p->buf + size) != MKTAG('B', 'B'...
vuln
Safe
C/C++
char *url_decode_r(char *to, char *url, size_t size) { char *s = url, // source *d = to, // destination *e = &to[size - 1]; // destination end while(*s && d < e) { if(unlikely(*s == '%')) { if(likely(s[1] && s[2])) { *d++ = from_hex(s[1...
vuln
Vulnerable
C/C++
void ff_get_guid(AVIOContext *s, ff_asf_guid *g) { assert(sizeof(*g) == 16); if (avio_read(s, *g, sizeof(*g)) < (int)sizeof(*g)) memset(*g, 0, sizeof(*g)); }
vuln
Safe
C/C++
int lg4ff_init(struct hid_device *hid) { struct hid_input *hidinput; struct input_dev *dev; struct list_head *report_list = &hid->report_enum[HID_OUTPUT_REPORT].report_list; struct hid_report *report = list_entry(report_list->next, struct hid_report, list); const struct usb_device_descriptor *udesc = &(hid_to_usb_...
vuln
Safe
C/C++
void stellaris_gamepad_init(int n, qemu_irq *irq, const int *keycode) { gamepad_state *s; int i; s = g_new0(gamepad_state, 1); s->buttons = g_new0(gamepad_button, n); for (i = 0; i < n; i++) { s->buttons[i].irq = irq[i]; s->buttons[i].keycode = keycode[i]; } s->num_buttons = ...
vuln
Safe
C/C++
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
vuln
Safe
C/C++
static ssize_t parse8BIM(Image *ifile, Image *ofile) { char brkused, quoted, *line, *token, *newstr, *name; int state, next; unsigned char dataset; unsigned int recnum; int inputlen = MaxTextExtent; MagickOffsetType savedpos, currentpos; ssize_t ...
vuln
Safe
Unknown
static XmlSchema createSchemaInstance(ThreadContext context, RubyClass klazz, Source source, IRubyObject parseOptions) { Ruby runtime = context.getRuntime(); XmlSchema xmlSchema = (XmlSchema) NokogiriService.XML_SCHEMA_ALLOCATOR.allocate(runtime, klazz); if (parseOptions == null) { ...
vuln
Safe
C/C++
RawTile KakaduImage::getRegion( int seq, int ang, unsigned int res, int layers, int x, int y, unsigned int w, unsigned int h ) { // Scale up our output bit depth to the nearest factor of 8 unsigned int obpc = bpc; if( bpc <= 16 && bpc > 8 ) obpc = 16; else if( bpc <= 8 ) obpc = 8; #ifdef DEBUG Timer timer; ...
vuln
Vulnerable
C/C++
/* * Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com> * * This file is part of Open5GS. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or ...
vuln
Safe
C/C++
static Image *ReadSCREENSHOTImage(const ImageInfo *image_info, ExceptionInfo *exception) { Image *image; assert(image_info->signature == MagickSignature); if (image_info->debug != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s", image_info->filename); assert(exception != (E...
vuln
Safe
C/C++
bool AXARIAGridCell::isAriaRowHeader() const { const AtomicString& role = getAttribute(HTMLNames::roleAttr); return equalIgnoringCase(role, "rowheader"); }
vuln
Vulnerable
C/C++
/* SPDX-FileCopyrightText: 1997 Markus Wuebben <markus.wuebben@kde.org> SPDX-FileCopyrightText: 2009 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.net SPDX-FileCopyrightText: 2009 Andras Mantia <andras@kdab.net> SPDX-FileCopyrightText: 2010 Torgny Nyblom <nyblom@kde.org> SPDX-FileCopyrightText...
vuln
Safe
C/C++
static void mxf_read_pixel_layout(AVIOContext *pb, MXFDescriptor *descriptor) { int code, value, ofs = 0; char layout[16] = {0}; do { code = avio_r8(pb); value = avio_r8(pb); av_dlog(NULL, "pixel layout: code %#x\n", code); if (ofs <= 14) { layout[ofs++] = code; ...
vuln
Vulnerable
C/C++
@Override protected ExecuteResult doWork(ExecutableContext context) throws ExecuteException { String jobId = getParam(MetadataConstants.P_JOB_ID); String cubeId = getParam(MetadataConstants.P_CUBE_ID); String mergedSegmentUuid = getParam(MetadataConstants.P_SEGMENT_IDS); final Kylin...
vuln
Vulnerable
Java
def sendEmail(sydent, templateName, mailTo, substitutions): mailFrom = sydent.cfg.get('email', 'email.from') mailTemplateFile = sydent.cfg.get('email', templateName) myHostname = sydent.cfg.get('email', 'email.hostname') if myHostname == '': myHostname = socket.getfqdn() ...
vuln
Vulnerable
Python
/* * MPEG-4 decoder * Copyright (c) 2000,2001 Fabrice Bellard * Copyright (c) 2002-2010 Michael Niedermayer <michaelni@gmx.at> * * 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 ...
vuln
Vulnerable
C/C++
# -*- coding: utf-8 -*- # # Copyright (C) 2020-2021 CERN. # Copyright (C) 2020 Northwestern University. # # Invenio-Drafts-Resources is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see LICENSE file for more # details. """Primary service for working with records and draf...
vuln
Vulnerable
Python
int av_get_cpu_flags(void) { int flags = cpu_flags; if (flags == -1) { flags = get_cpu_flags(); cpu_flags = flags; } return flags; }
vuln
Vulnerable
C/C++
import { isTestSuiteActive } from "../../support/page_objects/projectConstants"; import { mainPage } from "../../support/page_objects/mainPage"; export const genTest = (apiType, dbType) => { if (!isTestSuiteActive(apiType, dbType)) return; describe(`${ dbType === "xcdb" ? "Meta - " : "" }${apiType...
vuln
Safe
JavaScript