code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
int RSA_padding_check_PKCS1_OAEP(unsigned char *to, int tlen, const unsigned char *from, int flen, int num, const unsigned char *param, int plen) { int i, dblen, mlen = -1; const unsigned char *maskeddb; int lzero; unsigned char *db = NULL, seed[SHA_DIGEST_LENGTH], phash[SHA_DIGEST_LENGTH]; unsigned char *padde...
vuln
Vulnerable
Unknown
def __init__(self, sydent): self.sydent = sydent root = Resource() matrix = Resource() identity = Resource() api = Resource() v1 = self.sydent.servlets.v1 v2 = self.sydent.servlets.v2 validate = Resource() validate_v2 = Resource() email =...
vuln
Safe
Python
// Copyright (c) 2021 Target Brands, Inc. All rights reserved. // // Use of this source code is governed by the LICENSE file in this repository. package github import ( "context" "errors" "fmt" "net/http" "github.com/go-vela/server/random" "github.com/go-vela/types/library" "github.com/sirupsen/logrus" ) /...
vuln
Vulnerable
Go
static int dvbsub_parse_clut_segment(AVCodecContext *avctx, const uint8_t *buf, int buf_size) { DVBSubContext *ctx = avctx->priv_data; const uint8_t *buf_end = buf + buf_size; int i, clut_id; int version; DVBSubCLUT *clut; int entry_id, depth , full_range; ...
vuln
Vulnerable
C/C++
public boolean wantToDeclareWarOfPrevention(EmpireView v) { if (v.embassy().atPeace()) { return false; } Galaxy gal = galaxy(); if(empire.alliedWith(v.empId())) return false; float totalPotentialBombard = 0.0f; for (int id=0;id<empire.sv.co...
vuln
Safe
Java
UINT rdpgfx_read_rect16(wStream* s, RECTANGLE_16* rect16) { if (Stream_GetRemainingLength(s) < 8) { WLog_ERR(TAG, "not enough data!"); return ERROR_INVALID_DATA; } Stream_Read_UINT16(s, rect16->left); /* left (2 bytes) */ Stream_Read_UINT16(s, rect16->top); /* top (2 bytes) */ Stream_Read_UINT16(s, rect...
vuln
Vulnerable
C/C++
static int tight_init_stream(VncState *vs, int stream_id, int level, int strategy) { z_streamp zstream = &vs->tight->stream[stream_id]; if (zstream->opaque == NULL) { int err; VNC_DEBUG("VNC: TIGHT: initializing zlib stream %d\n", stream_id); VNC_DEBUG("VNC...
vuln
Safe
Unknown
/// <reference types="cypress" /> // *********************************************************** // This example plugins/index.js can be used to load plugins // // You can change the location of this file or turn off loading // the plugins file with the 'pluginsFile' configuration option. // // You can read more here: ...
vuln
Safe
JavaScript
int _XF86LoadQueryLocaleFont( Display *dpy, _Xconst char *name, XFontStruct **xfp, Font *fidp) { int l; const char *charset, *p; char buf[256]; XFontStruct *fs; XLCd lcd; if (!name) return 0; l = (int) strlen(name); if (l < 2 || name[l - 1] != '*' || name[l - 2] != '-') re...
vuln
Vulnerable
Unknown
static ssize_t store_attach(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct socket *socket; int sockfd = 0; __u32 port = 0, pdev_nr = 0, rhport = 0, devid = 0, speed = 0; struct usb_hcd *hcd; struct vhci_hcd *vhci_hcd; struct vhci_device *vdev; struct vhci *vhci;...
vuln
Vulnerable
Unknown
static void destroy_watch(struct inotify_watch *watch) { struct audit_chunk *chunk = container_of(watch, struct audit_chunk, watch); call_rcu(&chunk->head, __put_chunk); }
vuln
Safe
Unknown
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals """ Customize Form is a Single DocType used to mask the Property Setter Thus providing a better UI from user perspective """ import json import frappe import frappe.translate fr...
vuln
Vulnerable
Python
def tile_by_id(id,path): ''' ''' conn = mysql_connection() mysql = conn.cursor(cursor_class=MySQLCursorDict) tms_path = '.'.join(path.split('.')[:-1]) bucket = aws_prefix+'stuff' opaque = False image = Image.new('RGBA', (256, 256), (0, 0, 0, 0)) if request.endpoint =...
vuln
Vulnerable
Python
do_window( int nchar, long Prenum, int xchar) // extra char from ":wincmd gx" or NUL { long Prenum1; win_T *wp; #if defined(FEAT_SEARCHPATH) || defined(FEAT_FIND_ID) char_u *ptr; linenr_T lnum = -1; #endif #ifdef FEAT_FIND_ID int type = FIND_DEFINE; int len; #endif cha...
vuln
Safe
Unknown
static void gf_m2ts_process_pmt(GF_M2TS_Demuxer *ts, GF_M2TS_SECTION_ES *pmt, GF_List *sections, u8 table_id, u16 ex_table_id, u8 version_number, u8 last_section_number, u32 status) { u32 info_length, pos, desc_len, evt_type, nb_es,i; u32 nb_sections; u32 data_size; u32 nb_hevc, nb_hevc_temp, nb_shvc, nb_shvc_temp,...
vuln
Vulnerable
C/C++
def run(self, stat_name, criticity, commands, repeat, mustache_dict=None): """Run the commands (in background). - stats_name: plugin_name (+ header) - criticity: criticity of the trigger - commands: a list of command line with optional {{mustache}} - If True, then repeat the act...
vuln
Safe
Python
/* vips7 compat stub for vips_dzsave() * * 11/6/13 * - from im_vips2tiff() */ /* This file is part of VIPS. VIPS 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 ...
vuln
Vulnerable
C/C++
cap_t cap_get_proc(void) { cap_t result; /* allocate a new capability set */ result = cap_init(); if (result) { _cap_debug("getting current process' capabilities"); /* fill the capability sets via a system call */ if (capget(&result->head, &result->u[0].set)) { cap_free(result); result = ...
vuln
Safe
C/C++
(function (window) { window.TTSUtils = { statics: { breakText: '&&break&&', gap: '&&gap&&', dropdown: '&&dropdown&&', correct: '&&correct&&', wrong: '&&wrong&&', empty: '&&empty&&', nonBreakingSpace: '\u00A0', ...
vuln
Vulnerable
JavaScript
@mod.route('/register', methods=['GET', 'POST']) def register(): if request.method == 'POST': error = None email = request.form['email'].strip() nickname = request.form['nickname'].strip() password = request.form['password'].strip() password2 = request.form['password2'].strip...
vuln
Safe
Python
static int r_core_cmd_subst_i(RCore *core, char *cmd, char *colon) { const char *quotestr = "`"; const char *tick = NULL; char *ptr, *ptr2, *str; char *arroba = NULL; int i, ret = 0, pipefd; bool usemyblock = false; int scr_html = -1; int scr_color = -1; bool eos = false; bool haveQuote = false; if (!cmd) {...
vuln
Vulnerable
Unknown
@Override public void createFileOrDirectory(BasePathContent path, FileMode fileOrDirectory, FileCreationAdvancedOptions... fileOptions) throws IOException { SinglePath_rq req = (fileOrDirectory == FileMode.FILE && fileOptions.length > 0) ? new create_rq(path.dir, fileOptions[0]): ...
vuln
Vulnerable
Java
// Sandstorm - Personal Cloud Sandbox // Copyright (c) 2016 Sandstorm Development Group, Inc. and contributors // 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 // /...
vuln
Vulnerable
JavaScript
static int wavpack_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { WavpackContext *s = avctx->priv_data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; int frame_size; int samplecount = 0; s...
vuln
Safe
C/C++
void AppCacheHost::MarkAsForeignEntry(const GURL& document_url, int64 cache_document_was_loaded_from) { storage()->MarkEntryAsForeign( main_resource_was_namespace_entry_ ? namespace_entry_url_ : document_url, cache_document_was_loaded_from); SelectCache(documen...
vuln
Vulnerable
C/C++
void check_request_for_cacheability(struct stream *s, struct channel *chn) { struct http_txn *txn = s->txn; char *p1, *p2; char *cur_ptr, *cur_end, *cur_next; int pragma_found; int cc_found; int cur_idx; if ((txn->flags & (TX_CACHEABLE|TX_CACHE_IGNORE)) == TX_CACHE_IGNORE) return; /* nothing more to do here *...
vuln
Vulnerable
C/C++
parse_object(JsonLexContext *lex, JsonSemAction *sem) { /* * an object is a possibly empty sequence of object fields, separated by * commas and surrounded by curly braces. */ json_struct_action ostart = sem->object_start; json_struct_action oend = sem->object_end; JsonTokenType tok; check_stack_dep...
vuln
Safe
C/C++
BOOL drive_file_query_directory(DRIVE_FILE* file, UINT32 FsInformationClass, BYTE InitialQuery, const WCHAR* path, UINT32 PathWCharLength, wStream* output) { size_t length; WCHAR* ent_path; if (!file || !path || !output) return FALSE; if (InitialQuery != 0) { /* release search...
vuln
Safe
C/C++
/* Copyright 2015 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
Vulnerable
Python
g72x_init (SF_PRIVATE * psf) { G72x_PRIVATE *pg72x ; int bitspersample, bytesperblock, codec ; if (psf->codec_data != NULL) { psf_log_printf (psf, "*** psf->codec_data is not NULL.\n") ; return SFE_INTERNAL ; } ; psf->sf.seekable = SF_FALSE ; if (psf->sf.channels != 1) return SFE_G72X_NOT_MONO ; if ((pg...
vuln
Safe
C/C++
long AudioTrack::Parse(Segment* pSegment, const Info& info, long long element_start, long long element_size, AudioTrack*& pResult) { if (pResult) return -1; if (info.type != Track::kAudio) return -1; IMkvReader* const pReader = pSegment->m_pReader; const Settings& s = info.settings; assert(s.start >= 0); ...
vuln
Vulnerable
C/C++
// +build !windows /* Copyright The containerd Authors. 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 applica...
vuln
Safe
Go
private void execute0() { String targetArg = command().next(); CentralisedFuture<?> future = parseVictim(sender(), targetArg).thenCompose((victim) -> { if (victim == null) { return completedFuture(null); } return performEnact(victim, targetArg); }).thenCompose((punishment) -> { if (punish...
vuln
Vulnerable
Java
parse(payload) { const type = payload[0]; switch (this._step) { case 1: if (this._protocol._server) { // Server if (type !== MESSAGE.KEXDH_INIT) { return doFatalError( this._protocol, `Received packet ${type} instead of ...
vuln
Safe
JavaScript
# (from BackInTime) # Copyright (C) 2015-2017 Germar Reitze # # 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 # (at your option) any later version. # # This p...
vuln
Safe
Python
void gf_filter_pid_inst_del(GF_FilterPidInst *pidinst) { assert(pidinst); gf_filter_pid_inst_reset(pidinst); gf_fq_del(pidinst->packets, (gf_destruct_fun) pcki_del); gf_mx_del(pidinst->pck_mx); gf_list_del(pidinst->pck_reassembly); if (pidinst->props) { assert(pidinst->props->reference_count); if (safe_int_...
vuln
Vulnerable
C/C++
/* * Copyright 2010 Red Hat, Inc. and/or its affiliates. * * 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 ap...
vuln
Vulnerable
Java
static int mp_user_removexattr(FsContext *ctx, const char *path, const char *name) { if (strncmp(name, "user.virtfs.", 12) == 0) { errno = EACCES; return -1; } return local_removexattr_nofollow(ctx, path, name); }
vuln
Safe
C/C++
private void downloadIcon(final Activity context, String pkg, String name, final Runnable callback) { final File file = pkg2path(context, pkg); new Thread(() -> { try { String autogen = null; if (ignoredIcons.contains(file.getName())) { //i...
vuln
Safe
Java
static int nfs_readlink_reply(unsigned char *pkt, unsigned len) { uint32_t *data; char *path; int rlen; int ret; ret = rpc_check_reply(pkt, 1); if (ret) return ret; data = (uint32_t *)(pkt + sizeof(struct rpc_reply)); data++; rlen = ntohl(net_read_uint32(data)); /* new path length */ data++; ...
vuln
Vulnerable
C/C++
async function getSource (url, context, parentGetSource) { if (hasIitm(url)) { const realUrl = deleteIitm(url) const exportNames = await getExports(realUrl, context, parentGetSource) return { source: ` import { register } from '${iitmURL}' import * as namespace from ${JSON.stringify(url)} ...
vuln
Safe
JavaScript
magic_setparam(struct magic_set *ms, int param, const void *val) { switch (param) { case MAGIC_PARAM_INDIR_MAX: ms->indir_max = *(const size_t *)val; return 0; case MAGIC_PARAM_NAME_MAX: ms->name_max = *(const size_t *)val; return 0; case MAGIC_PARAM_ELF_PHNUM_MAX: ms->elf_phnum_max = *(const size_t *)val...
vuln
Safe
C/C++
pci_populate_msicap(struct msicap *msicap, int msgnum, int nextptr) { int mmc; /* Number of msi messages must be a power of 2 between 1 and 32 */ if (((msgnum & (msgnum - 1)) != 0) || msgnum < 1 || msgnum > 32) { pr_err("%s: invalid number of msi messages!\n", __func__); return -1; } mmc = ffs(msgnum) - 1; ...
vuln
Safe
C/C++
static void vp7_luma_dc_wht_c(int16_t block[4][4][16], int16_t dc[16]) { int i, a1, b1, c1, d1; int16_t tmp[16]; for (i = 0; i < 4; i++) { a1 = (dc[i * 4 + 0] + dc[i * 4 + 2]) * 23170; b1 = (dc[i * 4 + 0] - dc[i * 4 + 2]) * 23170; c1 = dc[i * 4 + 1] * 12540 - dc[i * 4 + 3] * 30274; ...
vuln
Vulnerable
C/C++
static int vfio_connect_container(VFIOGroup *group, AddressSpace *as, Error **errp) { VFIOContainer *container; int ret, fd; VFIOAddressSpace *space; space = vfio_get_address_space(as); QLIST_FOREACH(container, &space->containers, next) { if (!ioctl(group->f...
vuln
Safe
C/C++
int kvm_arch_put_registers(CPUState *env, int level) { int ret; assert(cpu_is_stopped(env) || qemu_cpu_is_self(env)); ret = kvm_getput_regs(env, 1); if (ret < 0) { return ret; } ret = kvm_put_xsave(env); if (ret < 0) { return ret; } ret = kvm_put_xcrs(env); if (re...
vuln
Safe
C/C++
void Compute(tensorflow::OpKernelContext* context) override { for (int ngram_width : ngram_widths_) { OP_REQUIRES( context, ngram_width > 0, errors::InvalidArgument("ngram_widths must contain positive values")); } const tensorflow::Tensor* data; OP_REQUIRES_OK(context, context...
vuln
Safe
C/C++
static void FUNCC(pred8x8_vertical)(uint8_t *_src, int _stride){ int i; pixel *src = (pixel*)_src; int stride = _stride/sizeof(pixel); const pixel4 a= AV_RN4PA(((pixel4*)(src-stride))+0); const pixel4 b= AV_RN4PA(((pixel4*)(src-stride))+1); for(i=0; i<8; i++){ AV_WN4PA(((pixel4*)(src+i*s...
vuln
Safe
C/C++
public PaginatedResult<ProjectCompact> getUserWatching(String userName, ProjectSortingStrategy sortingStrategy, RequestPagination pagination) { getUserRequired(userName, usersDAO::getUser, User.class); boolean canSeeHidden = getHangarPrincipal().getGlobalPermissions().has(Permission.SeeHidden); ...
vuln
Vulnerable
Java
@Override public void handle(final RoutingContext routingContext) { workerExecutor.<Void>executeBlocking( promise -> authorize(promise, routingContext), false, ar -> handleAuthorizeResult(ar, routingContext)); }
vuln
Safe
Java
static int shmem_remount_fs(struct super_block *sb, int *flags, char *data) { struct shmem_sb_info *sbinfo = SHMEM_SB(sb); struct shmem_sb_info config = *sbinfo; unsigned long inodes; int error = -EINVAL; if (shmem_parse_options(data, &config, true)) return error; spin_lock(&sbinfo->stat_lock); inodes ...
vuln
Vulnerable
C/C++
/* * File: ximatif.cpp * Purpose: Platform Independent TIFF Image Class Loader and Writer * 07/Aug/2001 Davide Pizzolato - www.xdp.it * CxImage version 7.0.2 07/Feb/2011 */ #include "ximatif.h" #ifndef min #define min(a,b) (((a)<(b))?(a):(b)) #endif #ifndef max #define max(a,b) (((a)>(b))?(a):(b)) #endif #if ...
vuln
Vulnerable
C/C++
private void validate(){ if(this.models == null){ throw new InvalidParameterException("Element \"models\" is required"); } if(this.textureSize == null){ throw new InvalidParameterException("Element \"textureSize\" is required"); } }
vuln
Vulnerable
Java
def protected! if not PCSAuth.loginByToken(session, cookies) and not PCSAuth.isLoggedIn(session) # If we're on /managec/<cluster_name>/main we redirect match_expr = "/managec/(.*)/(.*)" mymatch = request.path.match(match_expr) on_managec_main = false if mymatch and mymatch.length >= 3 ...
vuln
Vulnerable
Ruby
@TdlibThread void onUpdateNewMessage (TdApi.UpdateNewMessage update) { if (update.message.isOutgoing || update.message.sendingState != null) return; ViewController<?> c = UI.getCurrentStackItem(); if (c instanceof MessagesController && c.isSameTdlib(tdlib)) { long activeChatId = ((MessagesCont...
vuln
Vulnerable
Java
public synchronized void stopScript() { if (!this.isScriptRunning()) { return; } this.mainScriptThread.interrupt(); this.mainScriptThread = null; if (this.context != null) { FakeEntityWrapper.clearFakeEntities(this.context); BoxShapeWrapper.clearBoxesToRender(this.context); MinecraftScriptEvents.c...
vuln
Safe
Java
keepalived_main(int argc, char **argv) { bool report_stopped = true; struct utsname uname_buf; char *end; int exit_code = KEEPALIVED_EXIT_OK; /* Ensure time_now is set. We then don't have to check anywhere * else if it is set. */ set_time_now(); /* Save command line options in case need to log them later */ ...
vuln
Safe
Unknown
const got = require('@/utils/got'); const cheerio = require('cheerio'); module.exports = async (ctx) => { const baseUrl = 'https://gouhuo.qq.com'; const url = `${baseUrl}/guide`; const response = await got({ method: 'get', url: url, headers: { Referer: `https://gouhuo.qq...
vuln
Safe
JavaScript
/* * FreeRTOS Kernel V10.4.2 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * 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, includ...
vuln
Vulnerable
C/C++
static ssize_t firmware_loading_show(struct device *dev, struct device_attribute *attr, char *buf) { struct fw_sysfs *fw_sysfs = to_fw_sysfs(dev); int loading = 0; mutex_lock(&fw_lock); if (fw_sysfs->fw_priv) loading = fw_sysfs_loading(fw_sysfs->fw_priv); mutex_unlock(&fw_lock); return sysfs_emit(buf...
vuln
Safe
Unknown
def annotate(path, identifier=nil) p = CGI.escape(scm_iconv(@path_encoding, 'UTF-8', path)) blame = Annotate.new hg 'rhannotate', '-ncu', '-r', CGI.escape(hgrev(identifier)), hgtarget(p) do |io| io.each_line do |line| line.force_encoding('ASCII-8BIT') ...
vuln
Vulnerable
Ruby
int mpi_powm(MPI res, MPI base, MPI exp, MPI mod) { mpi_ptr_t mp_marker = NULL, bp_marker = NULL, ep_marker = NULL; mpi_ptr_t xp_marker = NULL; mpi_ptr_t tspace = NULL; mpi_ptr_t rp, ep, mp, bp; mpi_size_t esize, msize, bsize, rsize; int esign, msign, bsign, rsign; mpi_size_t size; int mod_shift_cnt; int negat...
vuln
Safe
C/C++
av_cold void ff_msmpeg4_encode_init(MpegEncContext *s) { static int init_done=0; int i; common_init(s); if(s->msmpeg4_version>=4){ s->min_qcoeff= -255; s->max_qcoeff= 255; } if (!init_done) { init_done = 1; init_mv_table(&mv_tables[0]); init_mv_t...
vuln
Safe
C/C++
package com.salesmanager.shop.admin.controller.orders; import com.salesmanager.core.business.modules.email.Email; import com.salesmanager.core.business.services.catalog.product.PricingService; import com.salesmanager.core.business.services.customer.CustomerService; import com.salesmanager.core.business.services.order....
vuln
Vulnerable
Java
// Copyright Istio Authors // // 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 to in wri...
vuln
Vulnerable
Go
@Override public String execute( final Context context, final Map< String, String > params ) throws PluginException { final String title = params.get( PARAM_TITLE ); String description = params.get( PARAM_DESCRIPTION ); String version = params.get( PARAM_VERSION ); String submitter =...
vuln
Vulnerable
Java
/* Computation of FIRST stets */ #include "pgenheaders.h" #include "grammar.h" #include "token.h" extern int Py_DebugFlag; /* Forward */ static void calcfirstset(grammar *, dfa *); void addfirstsets(grammar *g) { int i; dfa *d; if (Py_DebugFlag) printf("Adding FIRST sets ...\n"); for (i = ...
vuln
Safe
Python
private static String getTitle(PlayerInventoryHolder holder) { ItemStack stack = holder.getCurrentItem(); if (!MetaItems.CLIPBOARD.isItemEqual(stack)) throw new IllegalArgumentException("Given item stack is not a clipboard!"); NBTTagCompound tagCompound = getPageCompound(stack); ...
vuln
Vulnerable
Java
public Text2D setText(String newText) { text = Objects.requireNonNullElse(newText, DefaultText); setMetrics(FastJEngine.getCanvas().getGraphics()); return this; }
vuln
Safe
Java
/* Copyright 2018 BlackRock, Inc. 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 to in writing, software di...
vuln
Safe
Go
public KeyPair generateKeyPair() { if (!initialised) { Integer paramStrength = Integers.valueOf(strength); if (params.containsKey(paramStrength)) { param = (DSAKeyGenerationParameters)params.get(paramStrength); } else ...
vuln
Safe
Java
/* ** codegen.c - mruby code generator ** ** See Copyright Notice in mruby.h */ #include <mruby.h> #include <mruby/compile.h> #include <mruby/proc.h> #include <mruby/dump.h> #include <mruby/numeric.h> #include <mruby/string.h> #include <mruby/debug.h> #include <mruby/presym.h> #include "node.h" #include <mruby/opcode....
vuln
Vulnerable
C/C++
static uint64_t itc_tag_read(void *opaque, hwaddr addr, unsigned size) { MIPSITUState *tag = (MIPSITUState *)opaque; uint64_t index = addr >> 3; uint64_t ret = 0; switch (index) { case 0 ... ITC_ADDRESSMAP_NUM: ret = tag->ITCAddressMap[index]; break; default: qemu_log_mas...
vuln
Vulnerable
C/C++
void ed_map_dst(ed_t p, const uint8_t *msg, int len, const uint8_t *dst, int dst_len) { bn_t k; fp_t t; ed_t q; /* enough space for two field elements plus extra bytes for uniformity */ const int len_per_elm = (FP_PRIME + ed_param_level() + 7) / 8; uint8_t *pseudo_random_bytes = RLC_ALLOCA(uint8_t, 2 * len_per_el...
vuln
Vulnerable
C/C++
void AppControllerImpl::OnAppUpdate(const apps::AppUpdate& update) { void AppControllerService::OnAppUpdate(const apps::AppUpdate& update) { if (!update.StateIsNull() && !update.NameChanged() && !update.ReadinessChanged()) { return; } if (client_) { client_->OnAppChanged(CreateAppPtr(update)); ...
vuln
Safe
C/C++
/* 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
void EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl, const unsigned char *in, int inl) { int i, j; unsigned int total = 0; *outl = 0; if (inl <= 0) return; OPENSSL_assert(ctx->length <= (int)sizeof(ctx->enc_data)); if (ctx->length - ctx->num...
vuln
Safe
Unknown
static int amrnb_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt) { AMRContext *p = avctx->priv_data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; float *buf_out; int i, subfram...
vuln
Safe
C/C++
public void start() { try { this.started.compareAndSet(false, true); ClientBuilder clientBuilder = PulsarClient.builder() .serviceUrl(clientConfiguration.getServiceAddr()); if (clientConfiguration.getAuthPlugin() != null) { Preconditions.check...
vuln
Safe
Java
function allowCrossDomain (req, res, next) { res.setHeader('Access-Control-Allow-Origin', '*') res.setHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, PATCH, OPTIONS') res.setHeader( 'Access-Control-Allow-Headers', 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,...
vuln
Safe
JavaScript
def dbLookup(msg): if len(msg.split(',')) != 2: #procura na lista de paises query = 'SELECT id FROM paises WHERE nome == ?;' cursor.execute(query,(msg,)) if cursor.fetchone(): return True else: return False else: cidade = msg.split(',')[0]....
vuln
Safe
Python
int obj2ast_mod(PyObject* obj, mod_ty* out, PyArena* arena) { int isinstance; PyObject *tmp = NULL; if (obj == Py_None) { *out = NULL; return 0; } isinstance = PyObject_IsInstance(obj, (PyObject*)Module_type); if (isinstance == -1) { return 1; } if (isinstance) ...
vuln
Vulnerable
C/C++
int main(int argc, char **argv) { struct ifreq ifr; #ifndef SIOCBRADDIF unsigned long ifargs[4]; #endif int ifindex; int fd = -1, ctlfd = -1, unixfd = -1; int use_vnet = 0; int mtu; const char *bridge = NULL; char iface[IFNAMSIZ]; int index; ACLRule *acl_rule; ACLList acl_lis...
vuln
Safe
Unknown
PHP_FUNCTION(mdecrypt_generic) { zval *mcryptind; char *data; int data_len; php_mcrypt *pm; char* data_s; int block_size, data_size; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &mcryptind, &data, &data_len) == FAILURE) { return; } ZEND_FETCH_RESOURCE(pm, php_mcrypt * , &mcryptind, -1,...
vuln
Safe
C/C++
static int apply_window_and_mdct(vorbis_enc_context *venc, float *audio, int samples) { int channel; const float * win = venc->win[0]; int window_len = 1 << (venc->log2_blocksize[0] - 1); float n = (float)(1 << venc->log2_blocksize[0]) / 4.0; AVFloatDSPContext *fdsp ...
vuln
Safe
C/C++
private static void setDocumentContent(IDocument document, IStorage storage, String encoding, IProgressMonitor monitor, boolean skipUTF8BOM) throws CoreException { Reader in= null; InputStream contentStream= storage.getContents(); try { if (skipUTF8BOM) { for (int i= 0; i < 3; i++) if (contentStream....
vuln
Vulnerable
Java
int mwifiex_ret_wmm_get_status(struct mwifiex_private *priv, const struct host_cmd_ds_command *resp) { u8 *curr = (u8 *) &resp->params.get_wmm_status; uint16_t resp_len = le16_to_cpu(resp->size), tlv_len; int mask = IEEE80211_WMM_IE_AP_QOSINFO_PARAM_SET_CNT_MASK; bool valid = true; struct mwifiex_ie_typ...
vuln
Vulnerable
C/C++
protected void flushPlans(Seq<BuildPlan> plans, boolean freeze, boolean force, boolean removeFrozen){ var configLogic = Core.settings.getBool("processorconfigs"); var temp = new BuildPlan[plans.size + plans.count(plan -> plan.block == Blocks.waterExtractor) * 3]; // Cursed but works good enough for me ...
vuln
Safe
Java
BGD_DECLARE(void *) gdImageGifPtr(gdImagePtr im, int *size) { void *rv; gdIOCtx *out = gdNewDynamicCtx(2048, NULL); if (out == NULL) return NULL; gdImageGifCtx(im, out); rv = gdDPExtractData(out, size); out->gd_free(out); return rv; }
vuln
Vulnerable
Unknown
/* $Id$ */ /* * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; eit...
vuln
Safe
C/C++
private static CliConfigImpl parse(final CommandContext ctx, File f) throws CliInitializationException { if(f == null) { throw new CliInitializationException("The file argument is null."); } if(!f.exists()) { //throw new CliInitializationException(f.getAbsolutePath() + " ...
vuln
Safe
Java
#include "jsi.h" #include "jslex.h" #include "jsparse.h" #include "jscompile.h" #include "jsvalue.h" /* for jsV_numbertostring */ #define cexp jsC_cexp /* collision with math.h */ #define JF js_State *J, js_Function *F JS_NORETURN void jsC_error(js_State *J, js_Ast *node, const char *fmt, ...) JS_PRINTFLIKE(3,4); s...
vuln
Safe
C/C++
private void batchWoodcutting(Player player, GameObject object, ObjectWoodcuttingDef def, int axeId) { player.playerServerMessage(MessageType.QUEST, "You swing your " + player.getWorld().getServer().getEntityHandler().getItemDef(axeId).getName().toLowerCase() + " at the tree..."); thinkbubble(new Item(axeId)); de...
vuln
Safe
Java
/* * Copyright (c) 1999-2000 Image Power, Inc. and the University of * British Columbia. * Copyright (c) 2001-2003 Michael David Adams. * All rights reserved. */ /* __START_OF_JASPER_LICENSE__ * * JasPer License Version 2.0 * * Copyright (c) 2001-2006 Michael David Adams * Copyright (c) 1999-2000 Image P...
vuln
Vulnerable
C/C++
/* This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web) * Copyright (C) 2012-2019 mutschler, janeczku, jkrehm, OzzieIsaacs * * 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 Soft...
vuln
Safe
JavaScript
xmlXPtrNewContext(xmlDocPtr doc, xmlNodePtr here, xmlNodePtr origin) { xmlXPathContextPtr ret; ret = xmlXPathNewContext(doc); if (ret == NULL) return(ret); ret->xptr = 1; ret->here = here; ret->origin = origin; xmlXPathRegisterFunc(ret, (xmlChar *)"range", xmlXPtrRangeFu...
vuln
Safe
Unknown
private Map<String, Object> createModel(Notification newNotice) throws FileNotFoundException, IOException { Map<String, Object> model = Maps.newHashMap(); model.put("title", newNotice.getName()!=null ? "Editing notice: " + newNotice.getName() : ""); model.put("noticeUei", newNotice.g...
vuln
Vulnerable
Java
# -*- coding: utf-8 -*- # rdiffweb, A web interface to rdiff-backup repositories # Copyright (C) 2012-2021 rdiffweb contributors # # 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 ...
vuln
Vulnerable
Python
static void leon3_generic_hw_init(MachineState *machine) { ram_addr_t ram_size = machine->ram_size; const char *cpu_model = machine->cpu_model; const char *kernel_filename = machine->kernel_filename; SPARCCPU *cpu; CPUSPARCState *env; MemoryRegion *address_space_mem = get_system_memory(); ...
vuln
Vulnerable
C/C++
size_t Archive::ReadHeader50() { RawRead Raw(this); bool Decrypt=Encrypted && CurBlockPos>(int64)SFXSize+SIZEOF_MARKHEAD5; if (Decrypt) { #if defined(RAR_NOCRYPT) return 0; #else byte HeadersInitV[SIZE_INITV]; if (Read(HeadersInitV,SIZE_INITV)!=SIZE_INITV) { UnexpEndArcMsg(); retu...
vuln
Safe
C/C++