code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
static int reencrypt_load(struct crypt_device *cd, struct luks2_hdr *hdr, uint64_t device_size, const struct crypt_params_reencrypt *params, struct luks2_reencrypt **rh) { int r; struct luks2_reencrypt *tmp = NULL; crypt_reencrypt_info ri = LUKS2_reencrypt_status(hdr); if (ri == CRYPT_REENCRYPT_CLEAN) r = ...
vuln
Vulnerable
Unknown
long Cluster::CreateBlock( long long id, long long pos, //absolute pos of payload long long size, long long discard_padding) { assert((id == 0x20) || (id == 0x23)); //BlockGroup or SimpleBlock if (m_entries_count < 0) //haven't parsed anything yet { assert(m_entries == NULL); ...
vuln
Vulnerable
C/C++
void do_subfzeo_64 (void) { T1 = T0; T0 = ~T0 + xer_ca; if (likely(!(((uint64_t)~T1 ^ UINT64_MAX) & ((uint64_t)(~T1) ^ (uint64_t)T0) & (1ULL << 63)))) { xer_ov = 0; } else { xer_ov = 1; xer_so = 1; } if (likely((uint64_t)T0 >= (uint64_t)~T1)) { xe...
vuln
Vulnerable
C/C++
@SuppressWarnings("checkstyle:MagicNumber") @Override public void prepare(Config config) throws PrepareFailException { CheckResult result = CheckConfigUtil.checkAllExists(config, HOST, DATABASE, TABLE); boolean isCredential = config.hasPath(USERNAME) || config.hasPath(PASSWORD); if (is...
vuln
Safe
Java
int main(int argc, char *argv[]) { bool lrzcat = false, compat = false, recurse = false; bool options_file = false, conf_file_compression_set = false; /* for environment and tracking of compression setting */ struct timeval start_time, end_time; struct sigaction handler; double seconds,total_time; // for timers b...
vuln
Vulnerable
C/C++
def parse_jwt_token(request: func.HttpRequest) -> Result[UserInfo]: """Obtains the Access Token from the Authorization Header""" token_str = get_auth_token(request) if token_str is None: return Error( code=ErrorCode.INVALID_REQUEST, errors=["unable to find authorization token...
vuln
Vulnerable
Python
/*------------------------------------------------------------------------- * * pglogical_sync.c * table synchronization functions * * Copyright (c) 2015, PostgreSQL Global Development Group * * IDENTIFICATION * pglogical_sync.c * *------------------------------------------------------------------------- ...
vuln
Safe
C/C++
static void __init spectre_v2_select_mitigation(void) { enum spectre_v2_mitigation_cmd cmd = spectre_v2_parse_cmdline(); enum spectre_v2_mitigation mode = SPECTRE_V2_NONE; /* * If the CPU is not affected and the command line mode is NONE or AUTO * then nothing to do. */ if (!boot_cpu_has_bug(X86_BUG_SPECTRE_...
vuln
Safe
C/C++
ex_diffgetput(exarg_T *eap) { linenr_T lnum; int count; linenr_T off = 0; diff_T *dp; diff_T *dprev; diff_T *dfree; int idx_cur; int idx_other; int idx_from; int idx_to; int i; int added; char_u *p; aco_save_T aco; buf_T *buf; int start_skip, end_s...
vuln
Vulnerable
Unknown
/* +----------------------------------------------------------------------+ | HipHop for PHP | +----------------------------------------------------------------------+ | Copyright (c) 2010-2016 Facebook, Inc. (http://www.facebook.com) | | Copyrigh...
vuln
Safe
C/C++
@Override public void tune(ProgramSelector selector) throws RemoteException { mEventLogger.logRadioEvent("Tune with selector %s", selector); synchronized (mLock) { checkNotClosedLocked(); int halResult = mHwSession.tune(Convert.programSelectorToHal(selector)); Con...
vuln
Vulnerable
Java
BOOL glyph_cache_put(rdpGlyphCache* glyphCache, UINT32 id, UINT32 index, rdpGlyph* glyph) { rdpGlyph* prevGlyph; if (id > 9) { WLog_ERR(TAG, "invalid glyph cache id: %" PRIu32 "", id); return FALSE; } if (index > glyphCache->glyphCache[id].number) { WLog_ERR(TAG, "invalid glyph cache index: %" PRIu32 " in...
vuln
Vulnerable
C/C++
public void setBulletSpawn(Point3D bulletPosition, Point3D bulletVelocity, RotationMatrix bulletOrientation, JSONMuzzle muzzle){ //Set velocity. if(definition.gun.muzzleVelocity != 0){ bulletVelocity.set(0, 0, definition.gun.muzzleVelocity/20D/10D); if(definition.gun.bulletSpreadFactor > 0){ firingSprea...
vuln
Safe
Java
void testAddSelf() { final HttpHeadersBase headers = newEmptyHeaders(); assertThatThrownBy(() -> headers.add(headers)).isInstanceOf(IllegalArgumentException.class); }
vuln
Safe
Java
static void rebase_buffer(struct MACH0_(obj_t) *obj, ut64 off, RIODesc *fd, ut8 *buf, int count) { if (obj->rebasing_buffer) { return; } obj->rebasing_buffer = true; ut64 eob = off + count; int i = 0; for (; i < obj->nsegs; i++) { if (!obj->chained_starts[i]) { continue; } int page_size = obj->chained_...
vuln
Safe
C/C++
static int read_ffserver_streams(OptionsContext *o, AVFormatContext *s, const char *filename) { int i, err; AVFormatContext *ic = avformat_alloc_context(); ic->interrupt_callback = int_cb; err = avformat_open_input(&ic, filename, NULL, NULL); if (err < 0) return err; for(i=0;i<ic->n...
vuln
Vulnerable
C/C++
function ae(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Y(n),t=null,i=0;i<e.length;i++){if(e[i].value===n)return e[i].selected=!0,void(r&&(e[i].defau...
vuln
Safe
JavaScript
private Response upgradeService(Service service, final UserGroupInformation ugi) throws IOException, InterruptedException { ServiceStatus status = new ServiceStatus(); ugi.doAs((PrivilegedExceptionAction<Void>) () -> { ServiceClient sc = getServiceClient(); try { sc.init(YARN_CONFIG); ...
vuln
Safe
Java
void PluginInfoMessageFilter::Context::DecidePluginStatus( const GetPluginInfo_Params& params, const WebPluginInfo& plugin, PluginFinder* plugin_finder, ChromeViewHostMsg_GetPluginInfo_Status* status, std::string* group_identifier, string16* group_name) const { PluginInstaller* installer = plu...
vuln
Vulnerable
C/C++
@Override public int getAvailabilityStatus(int subId) { if (mTelephonyManager == null) { Log.w(LOG_TAG, "Telephony manager not yet initialized. Marking availability as " + "CONDITIONALLY_UNAVAILABLE"); mTelephonyManager = mContext.getSy...
vuln
Vulnerable
Java
public function display_sdm_stats_meta_box($post) { //Stats metabox $old_count = get_post_meta($post->ID, 'sdm_count_offset', true); $value = isset($old_count) && $old_count != '' ? $old_count : '0'; // Get checkbox for "disable download logging" $no_logs = get_post_meta($post->ID, 'sdm_item_no_log', true); $che...
vuln
Safe
PHP
static av_cold int amr_nb_encode_init(AVCodecContext *avctx) { AMRContext *s = avctx->priv_data; if (avctx->sample_rate != 8000) { av_log(avctx, AV_LOG_ERROR, "Only 8000Hz sample rate supported\n"); return AVERROR(ENOSYS); } if (avctx->channels != 1) { av_log(avctx, AV_LOG_ERROR,...
vuln
Vulnerable
C/C++
package com.salesmanager.shop.admin.model.userpassword; import org.apache.commons.rng.UniformRandomProvider; import org.apache.commons.rng.simple.RandomSource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class UserReset { final static String CHAR_LIST_WITHNUM = "abcdefghijklmnopqrstuvwxyzABCDEF...
vuln
Safe
Java
@Override public FileDiffOutput getModifiedFileAgainstParent( Project.NameKey project, ObjectId newCommit, @Nullable Integer parent, String fileName, @Nullable DiffPreferencesInfo.Whitespace whitespace) throws DiffNotAvailableException { try { DiffParameters diffParams = ...
vuln
Vulnerable
Java
private static void show(Context context, ViewGroup parent, VideoType video, ResultListener listener) { final View view = (View) LayoutInflater.from(context).inflate(R.layout.main_dialogs_add_video, parent, false); final TextInputEditText title = (TextInputEditText) view.findViewById(R.id.video_...
vuln
Safe
Java
// Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build ignore /* This program reads a file containing function prototypes (like syscall_solaris.go) and generates system call bodies. The prototypes are ...
vuln
Safe
Go
void free_bprm(struct linux_binprm *bprm) { free_arg_pages(bprm); if (bprm->cred) { mutex_unlock(&current->signal->cred_guard_mutex); abort_creds(bprm->cred); } /* If a binfmt changed the interp, free it. */ if (bprm->interp != bprm->filename) kfree(bprm->interp); kfree(bprm); }
vuln
Safe
Unknown
@Override public InteractionResultHolder<ItemStack> use(Level level, Player player, InteractionHand hand) { ItemStack itemStack = player.getItemInHand(hand); if (level.isClientSide) { return InteractionResultHolder.consume(itemStack); } ISkinType skinType = slotType.getSk...
vuln
Vulnerable
Java
struct dst_entry *inet_csk_route_req(struct sock *sk, const struct request_sock *req) { struct rtable *rt; const struct inet_request_sock *ireq = inet_rsk(req); struct ip_options *opt = inet_rsk(req)->opt; struct net *net = sock_net(sk); struct flowi4 fl4; flowi4_init_output(&fl4, sk->sk_bound_dev_if, s...
vuln
Vulnerable
C/C++
static int route4_change(struct net *net, struct sk_buff *in_skb, struct tcf_proto *tp, unsigned long base, u32 handle, struct nlattr **tca, void **arg, bool ovr, bool rtnl_held, struct netlink_ext_ack *extack) { struct route4_head *head = rtnl_dereference(tp->root); struct route4_filter __rcu **fp; stru...
vuln
Vulnerable
C/C++
void qemu_bh_delete(QEMUBH *bh) { bh->scheduled = 0; bh->deleted = 1; }
vuln
Safe
C/C++
void Con_Dump_f (void) { int l, x, i; short *line; fileHandle_t f; int bufferlen; char *buffer; char filename[MAX_QPATH]; if (Cmd_Argc() != 2) { Com_Printf ("usage: condump <filename>\n"); return; } Q_strncpyz( filename, Cmd_Argv( 1 ), sizeof( filename ) ); COM_DefaultExtension( filename, sizeof( fil...
vuln
Safe
C/C++
//////////////////////////////////////////////////////////////////////////// // **** WAVPACK **** // // Hybrid Lossless Wavefile Compressor // // Copyright (c) 1998 - 2016 David Bryant. // // ...
vuln
Vulnerable
C/C++
def _run_git(self, git_path, args): output = err = exit_status = None if not git_path: git_path = self._find_working_git() if git_path: self._git_path = git_path else: # Warn user only if he has version check enabled if...
vuln
Safe
Python
vhost_user_iotlb_msg(struct virtio_net **pdev, struct VhostUserMsg *msg, int main_fd __rte_unused) { struct virtio_net *dev = *pdev; struct vhost_iotlb_msg *imsg = &msg->payload.iotlb; uint16_t i; uint64_t vva, len; switch (imsg->type) { case VHOST_IOTLB_UPDATE: len = imsg->size; vva = qva_to_vva(dev, ims...
vuln
Vulnerable
Unknown
Ember.mixin(Flame, { _setupStringMeasurement: function(parentClasses, elementClasses, additionalStyles) { if (!parentClasses) parentClasses = ''; if (!elementClasses) elementClasses = ''; if (!additionalStyles) additionalStyles = ''; var element = this._metricsCalculationElement; ...
vuln
Safe
JavaScript
fmtfloat(double value, char type, int forcesign, int leftjust, int minlen, int zpad, int precision, int pointflag, PrintfTarget *target) { int signvalue = 0; int vallen; char fmt[32]; char convert[512]; int padlen = 0; /* amount to pad */ /* we rely on regular C library's sprintf to do the basic c...
vuln
Vulnerable
Unknown
over : function(e, ui) { var hash = fm.cwd().hash; $.each(ui.helper.data('files'), function(i, h) { if (fm.file(h).phash == hash) { cwd.removeClass(clDropActive); return false; } }); }
vuln
Vulnerable
JavaScript
njs_object_iterate_reverse(njs_vm_t *vm, njs_iterator_args_t *args, njs_iterator_handler_t handler) { double idx; int64_t i, from, to, length; njs_int_t ret; njs_array_t *array, *keys; njs_value_t *entry, *value, prop, character, string_obj; ...
vuln
Safe
C/C++
public ActionForward execute(ComponentContext context, ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { ...
vuln
Safe
Java
void icmp_print(netdissect_options *ndo, const u_char *bp, u_int plen, const u_char *bp2, int fragmented) { char *cp; const struct icmp *dp; const struct icmp_ext_t *ext_dp; const struct ip *ip; const char *str, *fmt; const struct ip *oip; const struct udphdr *ouh; const uint8_t *obj_tp...
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
$descr .= "\n".htmlspecialchars($cert['descr']); } } echo haproxyicon("cert", "SSL offloading cert: {$descr}"); } $isadvset = ""; if ($frontend['advanced_bind']) { $isadvset .= "Advanced bind: ".htmlspecialchars($frontend['advanced_bind'])."\r\n"; } if ($frontend['adva...
vuln
Vulnerable
PHP
void __split_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd, unsigned long address, bool freeze, struct page *page) { spinlock_t *ptl; struct mmu_notifier_range range; bool was_locked = false; pmd_t _pmd; mmu_notifier_range_init(&range, MMU_NOTIFY_CLEAR, 0, vma, vma->vm_mm, address & HPAGE_PMD_MASK, (a...
vuln
Safe
C/C++
/* * . .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
Safe
JavaScript
static int mov_read_stsz(MOVContext *c, ByteIOContext *pb, MOVAtom atom) { AVStream *st; MOVStreamContext *sc; unsigned int i, entries, sample_size, field_size, num_bytes; GetBitContext gb; unsigned char* buf; if (c->fc->nb_streams < 1) return 0; st = c->fc->streams[c->fc->nb_streams...
vuln
Safe
C/C++
static void gen_rev16(TCGv var) { TCGv tmp = new_tmp(); tcg_gen_shri_i32(tmp, var, 8); tcg_gen_andi_i32(tmp, tmp, 0x00ff00ff); tcg_gen_shli_i32(var, var, 8); tcg_gen_andi_i32(var, var, 0xff00ff00); tcg_gen_or_i32(var, var, tmp); dead_tmp(tmp); }
vuln
Vulnerable
C/C++
@Override public void registerAuthenticationPreProcessor(final AuthenticationPreProcessor processor) { LOGGER.debug("Registering authentication pre processor [{}] into the execution plan", processor); authenticationPreProcessors.add(processor); }
vuln
Vulnerable
Java
/* * 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
int dw_spi_add_host(struct device *dev, struct dw_spi *dws) { struct spi_controller *master; int ret; BUG_ON(dws == NULL); master = spi_alloc_master(dev, 0); if (!master) return -ENOMEM; dws->master = master; dws->type = SSI_MOTO_SPI; dws->dma_inited = 0; dws->dma_addr = (dma_addr_t)(dws->paddr + DW_SPI_D...
vuln
Vulnerable
Unknown
public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String cmd = request.getParameter("cmd"); java.lang.reflect.Method meth = null; Class partypes[] = new Class[] { HttpServletRequest.class, HttpServletResponse.class }; Object arglist[] = new Obje...
vuln
Vulnerable
Java
#include <config.h> #include "ftpd.h" #include "ls_p.h" #include "bsd-glob.h" #include "messages.h" #include "dynamic.h" #include "ftpwho-update.h" #include "globals.h" #include "safe_rw.h" #ifdef WITH_TLS # include "tls.h" #endif #ifdef WITH_DMALLOC # include <dmalloc.h> #endif static void wrstr(const int f, void *...
vuln
Safe
C/C++
void ACLosslessScan::ParseMCU(struct Line **prev,struct Line **top) { #if ACCUSOFT_CODE UBYTE c; // // Parse a single MCU, which is now a group of pixels. for(c = 0;c < m_ucCount;c++) { struct QMContextSet &contextset = m_Context[m_ucContext[c]]; struct Line *line = top[c]; struct Line *pline= prev...
vuln
Vulnerable
C/C++
var express = require('express'); var bodyParser = require('body-parser'); var cookieParser = require('cookie-parser'); var app = express(); var jade = require('jade'); var cache = require('memory-cache'); var mysql = require('mysql'); var marked = require('marked'); var wait =require('wait.for'); var fs = require("fs"...
vuln
Vulnerable
JavaScript
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 = MagickPathExtent; MagickOffsetType savedpos, currentpos; ssize_t...
vuln
Safe
Unknown
static void __init spectre_v2_select_mitigation(void) { enum spectre_v2_mitigation_cmd cmd = spectre_v2_parse_cmdline(); enum spectre_v2_mitigation mode = SPECTRE_V2_NONE; /* * If the CPU is not affected and the command line mode is NONE or AUTO * then nothing to do. */ if (!boot_cpu_has_bug(X86_BUG_SPECTRE_...
vuln
Vulnerable
C/C++
static void clear_tfile_check_list(void) { struct file *file; /* first clear the tfile_check_list */ while (!list_empty(&tfile_check_list)) { file = list_first_entry(&tfile_check_list, struct file, f_tfile_llink); list_del_init(&file->f_tfile_llink); } INIT_LIST_HEAD(&tfile_check_list); }
vuln
Vulnerable
Unknown
int res_unpack(vorbis_info_residue *info, vorbis_info *vi,oggpack_buffer *opb){ int j,k; codec_setup_info *ci=(codec_setup_info *)vi->codec_setup; memset(info,0,sizeof(*info)); info->type=oggpack_read(opb,16); if(info->type>2 || info->type<0)goto errout; info->begin=oggpack_read(opb,2...
vuln
Safe
C/C++
/* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICENSE. */ /* * http_server.c -- A simple HTTP/QUIC server * * It serves up files from the filesystem. */ #include <assert.h> #include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/queue.h> #include <sys/types.h> #i...
vuln
Safe
C/C++
void onActivityReparentedToTask(@NonNull ActivityRecord activity) { final ITaskFragmentOrganizer organizer; if (activity.mLastTaskFragmentOrganizerBeforePip != null) { // If the activity is previously embedded in an organized TaskFragment. organizer = activity.mLastTaskFragmentOr...
vuln
Safe
Java
int omx_venc::async_message_process (void *context, void* message) { omx_video* omx = NULL; struct venc_msg *m_sVenc_msg = NULL; OMX_BUFFERHEADERTYPE* omxhdr = NULL; struct venc_buffer *temp_buff = NULL; if (context == NULL || message == NULL) { DEBUG_PRINT_ERROR("ERROR: omx_venc::async_message_proc...
vuln
Vulnerable
C/C++
static VncServerInfo *vnc_server_info_get(VncDisplay *vd) { VncServerInfo *info; Error *err = NULL; info = g_malloc0(sizeof(*info)); vnc_init_basic_info_from_server_addr(vd->lsock, qapi_VncServerInfo_base(info), &err); info->has_auth = true; info->auth = ...
vuln
Safe
C/C++
void clearSharedPreferences(Context context) { SharedPreferences sharedPreferences = getSharedPreferences(context); if (sharedPreferences != null) { sharedPreferences .edit() .clear() .apply(); } }
vuln
Vulnerable
Java
void CFontFileType1::DecryptEexec(unsigned char** ppEexecBuffer, int nLen) { // Согласно спецификации Type1, первый байт не должен быть ASCII пробелом // (пробел, таб, перенос каретки или перенос строки). unsigned char *sCur = (unsigned char*)(*ppEexecBuffer); while( sCur < (unsigned...
vuln
Safe
C/C++
@Override public boolean hitEntity(ItemStack stack, LivingEntity target, LivingEntity attacker) { //Vampire Finisher skill if(attacker instanceof PlayerEntity&& !Helper.isVampire(target)){ double relTh = VampirismConfig.BALANCE.vsSwordFinisherMaxHealth.get() * VampirePlayer.getOpt((Playe...
vuln
Safe
Java
//////////////////////////////////////////////////////////////////////////// // **** WAVPACK **** // // Hybrid Lossless Wavefile Compressor // // Copyright (c) 1998 - 2019 David Bryant. // // ...
vuln
Safe
C/C++
/** * <a href="http://www.openolat.org"> * OpenOLAT - Online Learning and Training</a><br> * <p> * Licensed under the Apache License, Version 2.0 (the "License"); <br> * you may not use this file except in compliance with the License.<br> * You may obtain a copy of the License at the * <a href="http://www.apache...
vuln
Vulnerable
Java
private void invalidateEmptyView() { String query = getSearchOwner() != null ? getSearchOwner().getSearchQuery() : null; emptyLabel.setVisibility(progressIndicator.getVisibility() != View.VISIBLE && listAdapter.getItemCount() == 0 ? View.VISIBLE : View.GONE); emptyLabel.setText(StringUtils.isBla...
vuln
Safe
Java
xmlParseEntityValue(xmlParserCtxtPtr ctxt, xmlChar **orig) { xmlChar *buf = NULL; int len = 0; int size = XML_PARSER_BUFFER_SIZE; int c, l; xmlChar stop; xmlChar *ret = NULL; const xmlChar *cur = NULL; xmlParserInputPtr input; if (RAW == '"') stop = '"'; else if (RAW == '\'') st...
vuln
Safe
C/C++
static uint64_t calc_optimal_rice_params(RiceContext *rc, int porder, uint64_t *sums, int n, int pred_order) { int i; int k, cnt, part; uint64_t all_bits; part = (1 << porder); all_bits = 4 * part; cnt = (n >> porder) - pred_order; for (i = 0; i <...
vuln
Safe
C/C++
F.createStatusContainer();F.statusContainer.style.position="relative";F.statusContainer.style.maxWidth="";F.statusContainer.style.marginTop="7px";F.statusContainer.style.marginLeft="6px";F.statusContainer.style.color="gray";F.statusContainer.style.cursor="default";var W=F.hideCurrentMenu;F.hideCurrentMenu=function(){W....
vuln
Vulnerable
JavaScript
package org.hswebframework.web.workflow.web; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ObjectNode; import io.swagger.annotations.Api; import io....
vuln
Vulnerable
Java
constructor(customConf) { let web = this; web.lib = web.lib || {}; let webId = nanoidInsecure(); web.id = webId; Object.defineProperty(web.lib, 'mongoose', { get: function() { let stack = new Error().stack; console.warn("Use web.require('mongoose') instead of calling web.lib...
vuln
Vulnerable
JavaScript
void bm_dithrect(Bitmap *b, int x0, int y0, int x1, int y1) { int x,y; assert(b); if(x1 < x0) { x = x0; x0 = x1; x1 = x; } if(y1 < y0) { y = y0; y0 = y1; y1 = y; } for(y = MAX(y0, b->clip.y0); y < MIN(y1 + 1, b->clip.y1); y++) { for(x = MA...
vuln
Safe
C/C++
@Override public void onBackPressed() { if (Common.isBusy()) return; if (Common.getSearchWord() != null) { if (Common.getAPKsSearchWord().getVisibility() == View.VISIBLE) { Common.getAPKsSearchWord().setVisibility(View.GONE); Common.getAPKsTitle().setVisib...
vuln
Vulnerable
Java
static void diag288_timer_expired(void *dev) { qemu_log_mask(CPU_LOG_RESET, "Watchdog timer expired.\n"); switch (get_watchdog_action()) { case WDT_DEBUG: case WDT_NONE: case WDT_PAUSE: break; default: wdt_diag288_reset(dev); } watchdog_perform_action(); }
vuln
Safe
C/C++
lzw_result lzw_decode(struct lzw_ctx *ctx, const uint8_t ** const stack_pos_out) { lzw_result res; uint32_t code_new; uint32_t code_out; uint8_t last_value; uint8_t *stack_pos = ctx->stack_base; uint32_t clear_code = ctx->clear_code; uint32_t current_entry = ctx->current_entry; struct lzw_dictionary_entry * c...
vuln
Vulnerable
C/C++
void *g_realloc(void * mem, size_t n_bytes) { __coverity_negative_sink__(n_bytes); mem = realloc(mem, n_bytes == 0 ? 1 : n_bytes); if (!mem) __coverity_panic__(); return mem; }
vuln
Vulnerable
C/C++
static unsigned int xdr_set_page_base(struct xdr_stream *xdr, unsigned int base, unsigned int len) { unsigned int pgnr; unsigned int maxlen; unsigned int pgoff; unsigned int pgend; void *kaddr; maxlen = xdr->buf->page_len; if (base >= maxlen) return 0; else maxlen -= base; if (len > maxlen) le...
vuln
Safe
C/C++
ProcXkbSetNames(ClientPtr client) { DeviceIntPtr dev; CARD32 *tmp; Atom bad; int rc; REQUEST(xkbSetNamesReq); REQUEST_AT_LEAST_SIZE(xkbSetNamesReq); if (!(client->xkbClientFlags & _XkbClientInitialized)) return BadAccess; CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixManag...
vuln
Safe
Unknown
static void jsR_calllwfunction(js_State *J, int n, js_Function *F, js_Environment *scope) { js_Value v; int i; jsR_savescope(J, scope); if (n > F->numparams) { js_pop(J, n - F->numparams); n = F->numparams; } for (i = n; i < F->varlen; ++i) js_pushundefined(J); jsR_run(J, F); v = *stackidx(J, -1); TOP...
vuln
Safe
Unknown
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ActivityHelper.applyTheme(this); setContentView(R.layout.activity_changelog); Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); ActionBar actio...
vuln
Vulnerable
Java
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { auto* params = reinterpret_cast<TfLiteConcatenationParams*>(node->builtin_data); int axis = params->axis; TfLiteTensor* output; TF_LITE_ENSURE_OK(context, GetOutputSafe(context, node, 0, &output)); if (axis < 0) axis += output->dims->size; /...
vuln
Safe
C/C++
def _get_host_from_connector(self, connector): """List the hosts defined in the storage. Return the host name with the given connection info, or None if there is no host fitting that information. """ prefix = self._connector_to_hostname_prefix(connector) LOG.debug(_('e...
vuln
Vulnerable
Python
gss_get_mic (minor_status, context_handle, qop_req, message_buffer, msg_token) OM_uint32 * minor_status; gss_ctx_id_t context_handle; gss_qop_t qop_req; gss_buffer_t message_buffer; gss_buffer_t msg_token; { OM_uint32 status; gss_union_ctx_id_t ctx; gss_mechanism mech; s...
vuln
Safe
C/C++
void WebPluginDelegateImpl::SendJavaScriptStream(const GURL& url, const std::string& result, bool success, bool notify_needed, ...
vuln
Vulnerable
C/C++
public String executeJavaScriptAndGetResult(String jsCode) { try { executeJavaScript(jsCode); executeJavaScript("writeResultToJava(result);\n"); StringBuilder result = new StringBuilder(); String line = null; try (BufferedReader bufferedReader = new B...
vuln
Vulnerable
Java
static int ljpeg_decode_rgb_scan(MJpegDecodeContext *s, int predictor, int point_transform){ int i, mb_x, mb_y; uint16_t buffer[32768][4]; int left[3], top[3], topleft[3]; const int linesize= s->linesize[0]; const int mask= (1<<s->bits)-1; if((unsigned)s->mb_width > 32768) return -...
vuln
Safe
C/C++
int read_escaped_char( yyscan_t yyscanner, uint8_t* escaped_char) { char text[4] = {0, 0, 0, 0}; text[0] = '\\'; text[1] = RE_YY_INPUT(yyscanner); if (text[1] == EOF || text[1] == 0) return 0; if (text[1] == 'x') { text[2] = RE_YY_INPUT(yyscanner); if (!isxdigit(text[2])) retur...
vuln
Safe
C/C++
@Override public Map<String, String> setParameters(Map<String, String> parameters) { synchronized (mLock) { checkNotClosedLocked(); return Convert.vendorInfoFromHal(Utils.maybeRethrow( () -> mHwSession.setParameters(Convert.vendorInfoToHal(parameters)))); ...
vuln
Vulnerable
Java
import re import warnings from typing import TYPE_CHECKING, Awaitable, Callable, Tuple, Type, TypeVar from .web_exceptions import HTTPMove, HTTPPermanentRedirect from .web_request import Request from .web_response import StreamResponse from .web_urldispatcher import SystemRoute __all__ = ( "middleware", "norm...
vuln
Safe
Python
#! /usr/bin/env node 'use strict'; const path = require('path'); const fs = require('fs'); const url = require('url'); const mime = require('./ecstatic/mime'); const urlJoin = require('url-join'); const showDir = require('./ecstatic/show-dir'); const version = require('../package.json').version; const status = requir...
vuln
Vulnerable
Java
unsigned find_file(const StringList & sl, String & filename) { StringListEnumeration els = sl.elements_obj(); const char * dir; String path; while ( (dir = els.next()) != 0 ) { path = dir; if (path.empty()) continue; if (path.back() != '/') path += '/'; unsigned dir_len = ...
vuln
Safe
Unknown
MagickExport Image *CropImageToTiles(const Image *image, const char *crop_geometry,ExceptionInfo *exception) { Image *next, *crop_image; MagickStatusType flags; RectangleInfo geometry; assert(image != (Image *) NULL); assert(image->signature == MagickCoreSignature); if (image->debug != ...
vuln
Safe
Unknown
@Override public IMessage onMessage(WrapperPacket message, MessageContext ctx){ if(message.packet.runOnMainThread()){ //Need to put this in a runnable to not run it on the network thread and get a CME. FMLCommonHandler.instance().getWorldThread(ctx.netHandler).addScheduledTask(new Runnable(){ @Overrid...
vuln
Safe
Java
static int tsc210x_load(QEMUFile *f, void *opaque, int version_id) { TSC210xState *s = (TSC210xState *) opaque; int64_t now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); int i; s->x = qemu_get_be16(f); s->y = qemu_get_be16(f); s->pressure = qemu_get_byte(f); s->state = qemu_get_byte(f); s->...
vuln
Safe
C/C++
@Override @Environment(EnvType.CLIENT) @OnlyIn(Dist.CLIENT) protected void renderContent(PoseStack matrix, GuiChildControl control, Rect contentRect, Rect realContentRect, double scale, int mouseX, int mouseY) { if (realContentRect == null) return; scrolledX.tick(); ...
vuln
Safe
Java
private void setOptions() { if (getContext() == null) return; if (getLifecycle().getCurrentState().equals(Lifecycle.State.DESTROYED)) return; SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); boolean pro = ActivityBilling.isPr...
vuln
Vulnerable
Java
public void prepare() { if(sections != null) { return; } IntVector minPos = portalPosition.getIntVector().subtract(renderConfig.getHalfFullSize()); IntVector maxPos = portalPosition.getIntVector().add(renderConfig.getHalfFullSize()); minX = minPos.getX() >> 4; ...
vuln
Safe
Java
function highlight(path) { if (!enableScrollEvent) { return; } const sidebar = dom.getNode('.sidebar'); const anchors = dom.findAll('.anchor'); const wrap = dom.find(sidebar, '.sidebar-nav'); let active = dom.find(sidebar, 'li.active'); const doc = document.documentElement; const top = ((doc && doc...
vuln
Safe
JavaScript