code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
PHP_FUNCTION(symlink) { char *topath, *frompath; int topath_len, frompath_len; int ret; char source_p[MAXPATHLEN]; char dest_p[MAXPATHLEN]; char dirname[MAXPATHLEN]; size_t len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &topath, &topath_len, &frompath, &frompath_len) == FAILURE) { return; }...
vuln
Safe
Unknown
int ssl3_get_key_exchange(SSL *s) { #ifndef OPENSSL_NO_RSA unsigned char *q, md_buf[EVP_MAX_MD_SIZE * 2]; #endif EVP_MD_CTX md_ctx; unsigned char *param, *p; int al, j, ok; long i, param_len, n, alg_k, alg_a; EVP_PKEY *pkey = NULL; const EVP_MD *md = NULL; #ifndef OPENSSL_NO_RSA RSA *rsa...
vuln
Safe
Unknown
function u(){mxShape.call(this)}function J(){mxShape.call(this)}function N(){mxRectangleShape.call(this)}function W(){mxShape.call(this)}function S(){mxShape.call(this)}function P(){mxShape.call(this)}function Z(){mxShape.call(this)}function oa(){mxShape.call(this)}function va(){mxCylinder.call(this)}function Aa(){mxCy...
vuln
Vulnerable
JavaScript
UserSchema.methods.getToken = function (userAgent) { return new Promise((resolve, reject) => { var user = this; var query = User.findOne({username: user.username}); query.exec() .then(function(row) { if (row && bcrypt.compareSync(user.password, row.password)) { ...
vuln
Safe
JavaScript
void vty_putchars(VIOsPAPRDevice *sdev, uint8_t *buf, int len) { VIOsPAPRVTYDevice *dev = VIO_SPAPR_VTY_DEVICE(sdev); qemu_chr_fe_write_all(dev->chardev, buf, len); }
vuln
Safe
C/C++
@endpoints.route("/h2h") def h2h(): if db == None: init() player1 = request.args.get('tag1', default="christmasmike") player2 = request.args.get('tag2', default="christmasmike") sql = "SELECT * FROM matches WHERE (player1 = '{player1}' OR "\ +"player2 = '{player1}') AND (player1 = '...
vuln
Safe
Python
GF_Err abst_box_read(GF_Box *s, GF_BitStream *bs) { GF_AdobeBootstrapInfoBox *ptr = (GF_AdobeBootstrapInfoBox *)s; int i; u32 tmp_strsize; char *tmp_str; GF_Err e; ISOM_DECREASE_SIZE(ptr, 25) ptr->bootstrapinfo_version = gf_bs_read_u32(bs); ptr->profile = gf_bs_read_int(bs, 2); ptr->live = gf_bs_read_int(bs, ...
vuln
Vulnerable
C/C++
function r(){var a,b,c,d,e;return Bc++,a=vc,b=N(),b!==X?(c=v(),c!==X?(d=t(),d!==X?(e=O(),e!==X?(wc=a,b=za(c,d),a=b):(vc=a,a=aa)):(vc=a,a=aa)):(vc=a,a=aa)):(vc=a,a=aa),Bc--,a===X&&(b=X,0===Bc&&g(ya)),a}
vuln
Vulnerable
JavaScript
def _create_paramiko_client(self, base_url): logging.getLogger("paramiko").setLevel(logging.WARNING) self.ssh_client = paramiko.SSHClient() base_url = urllib.parse.urlparse(base_url) self.ssh_params = { "hostname": base_url.hostname, "port": base_url.port, ...
vuln
Vulnerable
Python
_asn1_get_indefinite_length_string (const unsigned char *der, int der_len, int *len) { int len2, len3, counter, indefinite; int result; unsigned long tag; unsigned char class; counter = indefinite = 0; while (1) { if (HAVE_TWO(der_len) && (der[counter] == 0) && (der[counter + 1] == 0)) ...
vuln
Safe
Unknown
static void * attribute_align_arg worker(void *v){ AVCodecContext *avctx = v; ThreadContext *c = avctx->internal->frame_thread_encoder; AVPacket *pkt = NULL; while (!atomic_load(&c->exit)) { int got_packet, ret; AVFrame *frame; Task task; if(!pkt) pkt= av_mallocz(sizeof(*...
vuln
Safe
C/C++
/* * Licensed to Elasticsearch under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this fi...
vuln
Safe
Java
gdImagePtr gdImageCreateFromXbm(FILE * fd) { char fline[MAX_XBM_LINE_SIZE]; char iname[MAX_XBM_LINE_SIZE]; char *type; int value; unsigned int width = 0, height = 0; int fail = 0; int max_bit = 0; gdImagePtr im; int bytes = 0, i; int bit, x = 0, y = 0; int ch; char h[8]; unsigned int b; rewind(fd); whi...
vuln
Safe
C/C++
local block_state deflate_fast(s, flush) deflate_state *s; int flush; { IPos hash_head; /* head of the hash chain */ int bflush; /* set if current block must be flushed */ for (;;) { /* Make sure that we always have enough lookahead, except * at the end of the input...
vuln
Safe
Unknown
bool WideToCharMap(const wchar *Src,char *Dest,size_t DestSize,bool &Success) { // String with inconvertible characters mapped to private use Unicode area // must have the mark code somewhere. if (wcschr(Src,(wchar)MappedStringMark)==NULL) return false; Success=true; uint SrcPos=0,DestPos=0; while (Src...
vuln
Safe
C/C++
def call(env) env[HTTP_ORIGIN] ||= env[HTTP_X_ORIGIN] if env[HTTP_X_ORIGIN] add_headers = nil if env[HTTP_ORIGIN] debug(env) do [ 'Incoming Headers:', " Origin: #{env[HTTP_ORIGIN]}", " Access-Control-Request-Method: #{env[HTTP_ACCESS_CONTROL_REQUEST_METHOD]...
vuln
Vulnerable
Ruby
/* * 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
struct omap_mpu_state_s *omap310_mpu_init(MemoryRegion *system_memory, unsigned long sdram_size, const char *core) { int i; struct omap_mpu_state_s *s = (struct omap_mpu_state_s *) g_malloc0(sizeof(struct omap_mpu_state_s)); qemu_irq dma_irqs[6]; DriveInfo *di...
vuln
Vulnerable
C/C++
static void create_flash(const VirtBoardInfo *vbi) { hwaddr flashsize = vbi->memmap[VIRT_FLASH].size / 2; hwaddr flashbase = vbi->memmap[VIRT_FLASH].base; char *nodename; if (bios_name) { char *fn; int image_size; if (drive_get(IF_PFLASH, 0, 0)) { error_report("T...
vuln
Vulnerable
C/C++
int nfs3svc_decode_symlinkargs(struct svc_rqst *rqstp, __be32 *p, struct nfsd3_symlinkargs *args) { unsigned int len, avail; char *old, *new; struct kvec *vec; if (!(p = decode_fh(p, &args->ffh)) || !(p = decode_filename(p, &args->fname, &args->flen)) ) return 0; p = decode_sattr3(p, &args->attrs); ...
vuln
Vulnerable
C/C++
static int dca_exss_parse_asset_header(DCAContext *s) { int header_pos = get_bits_count(&s->gb); int header_size; int channels; int embedded_stereo = 0; int embedded_6ch = 0; int drc_code_present; int extensions_mask; int i, j; if (get_bits_left(&s->gb) < 16) return -1; ...
vuln
Vulnerable
C/C++
public Response codeToToken() { String code = formParams.getFirst(OAuth2Constants.CODE); if (code == null) { event.error(Errors.INVALID_CODE); throw new CorsErrorResponseException(cors, OAuthErrorException.INVALID_REQUEST, "Missing parameter: " + OAuth2Constants.CODE, Response.St...
vuln
Vulnerable
Java
static uint32_t get_cmd(ESPState *s, uint8_t *buf) { uint32_t dmalen; int target; dmalen = s->rregs[ESP_TCLO] | (s->rregs[ESP_TCMID] << 8); target = s->wregs[ESP_WBUSID] & 7; DPRINTF("get_cmd: len %d target %d\n", dmalen, target); if (s->dma) { s->dma_memory_read(s->dma_opaque, buf, dmal...
vuln
Vulnerable
C/C++
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { const auto* params = reinterpret_cast<TfLiteUnidirectionalSequenceLSTMParams*>( node->builtin_data); const OpData* op_data = reinterpret_cast<OpData*>(node->user_data); const bool is_layer_norm_lstm = op_data->is_layer_norm_lstm; cons...
vuln
Vulnerable
C/C++
@Override PerformanceReport parse(File reportFile) throws Exception { final SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setValidating(false); factory.setNamespaceAware(false); final SAXParser parser = factory.newSAXParser(); final PerformanceReport re...
vuln
Vulnerable
Java
PHP_METHOD(Phar, loadPhar) { char *fname, *alias = NULL, *error; size_t fname_len, alias_len = 0; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s!", &fname, &fname_len, &alias, &alias_len) == FAILURE) { return; } phar_request_initialize(); RETVAL_BOOL(phar_open_from...
vuln
Vulnerable
C/C++
public ItemStack getRandomizedExampleStack(int rand) { ItemStack[] all = getMatchingStacks(); if (all.length == 0) return ItemStack.EMPTY; else return all[(rand/20)%all.length]; }
vuln
Safe
Java
static int __init big_key_init(void) { struct crypto_skcipher *cipher; struct crypto_rng *rng; int ret; rng = crypto_alloc_rng(big_key_rng_name, 0, 0); if (IS_ERR(rng)) { pr_err("Can't alloc rng: %ld\n", PTR_ERR(rng)); return PTR_ERR(rng); } big_key_rng = rng; /* seed RNG */ ret = crypto_rng_reset(rng, ...
vuln
Safe
Unknown
static av_always_inline void vc1_apply_p_h_loop_filter(VC1Context *v, int block_num) { MpegEncContext *s = &v->s; int mb_cbp = v->cbp[s->mb_x - 1 - s->mb_stride], block_cbp = mb_cbp >> (block_num * 4), right_cbp, mb_is_intra = v->is_intra[s->mb_x - 1 - s->mb_stride], ...
vuln
Safe
C/C++
static int rsa_builtin_keygen(RSA *rsa, int bits, BIGNUM *e_value, BN_GENCB *cb) { BIGNUM *r0 = NULL, *r1 = NULL, *r2 = NULL, *r3 = NULL, *tmp; BIGNUM local_r0, local_d, local_p; BIGNUM *pr0, *d, *p; int bitsp, bitsq, ok = -1, n = 0; BN_CTX *ctx = NULL; unsigned lon...
vuln
Vulnerable
Unknown
// Copyright 2018 Google 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 ...
vuln
Safe
Go
private boolean canBecomeSick() { return !isSick() && citizen.getCitizenColonyHandler().getColony() != null && citizen.getCitizenColonyHandler().getColony().isActive() && !(citizen.getCitizenJobHandler().getColonyJob() instanceof JobHealer) ...
vuln
Safe
Java
irc_server_gnutls_callback (void *data, gnutls_session_t tls_session, const gnutls_datum_t *req_ca, int nreq, const gnutls_pk_algorithm_t *pk_algos, int pk_algos_len, gnutls_retr_st *answer, int action) { ...
vuln
Safe
Unknown
int main (int argc, char **argv) { int result; struct mt_packet data; struct sockaddr_in si_me; unsigned char buff[1500]; unsigned char print_help = 0, have_username = 0, have_password = 0; unsigned char drop_priv = 0; int c; int optval = 1; setlocale(LC_ALL, ""); bindtextdomain("mactelnet","/usr/share/local...
vuln
Safe
C/C++
// Copyright 2014 beego Author. 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 applica...
vuln
Vulnerable
Go
void exit_io_context(void) { struct io_context *ioc; task_lock(current); ioc = current->io_context; current->io_context = NULL; task_unlock(current); if (atomic_dec_and_test(&ioc->nr_tasks)) { if (ioc->aic && ioc->aic->exit) ioc->aic->exit(ioc->aic); cfq_exit(ioc); } put_io_context(ioc); }
vuln
Safe
C/C++
# -*- 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
NTSTATUS smb2cli_session_encryption_on(struct smbXcli_session *session) { if (!session->smb2->should_sign) { /* * We need required signing on the session * in order to prevent man in the middle attacks. */ return NT_STATUS_INVALID_PARAMETER_MIX; } if (session->smb2->should_encrypt) { return NT_STATUS...
vuln
Safe
Unknown
static void snippet_add_content(struct snippet_context *ctx, struct snippet_data *target, const unsigned char *data, size_t size, size_t *count_r) { i_assert(target != NULL); if (size >= 3 && ((data[0] == 0xEF && data[1] == 0xBB && data[2] == 0xBF) || (data[0] == 0xBF && data[1] == 0xBB && da...
vuln
Vulnerable
Unknown
int gnutls_global_init(void) { int ret = 0, res; int level; const char* e; GNUTLS_STATIC_MUTEX_LOCK(global_init_mutex); _gnutls_init++; if (_gnutls_init > 1) { if (_gnutls_init == 2 && _gnutls_init_ret == 0) { /* some applications may close the urandom fd * before calling gnutls_global_init(). in tha...
vuln
Safe
Unknown
def process_statistics(self, metadata, _): args = [metadata.hostname, '-p', metadata.profile, '-g', ':'.join([g for g in metadata.groups])] self.debug_log("running triggers") for notifier in os.listdir(self.data): self.debug_log("running %s" % notifier) if...
vuln
Safe
Python
static struct bio *bio_copy_kern(struct request_queue *q, void *data, unsigned int len, gfp_t gfp_mask, int reading) { unsigned long kaddr = (unsigned long)data; unsigned long end = (kaddr + len + PAGE_SIZE - 1) >> PAGE_SHIFT; unsigned long start = kaddr >> PAGE_SHIFT; struct bio *bio; void *p = data; int nr_pa...
vuln
Vulnerable
Unknown
public void verifySignature(PublicKey serverPublicKey, Random clientRandom, Random serverRandom) throws HandshakeException { if (signatureEncoded == null) { String message = "The server's ECDHE key exchange message has no signature."; AlertMessage alert = new AlertMessage(AlertLevel.FATAL, AlertDescription.D...
vuln
Vulnerable
Java
static int internal_get_user_pages_fast(unsigned long start, int nr_pages, unsigned int gup_flags, struct page **pages) { unsigned long addr, len, end; int nr_pinned = 0, ret = 0; if (WARN_ON_ONCE(gup_flags & ~(FOLL_WRITE | FOLL_LONGTERM | FOLL_FORCE | FOLL_PIN | FOLL_GET))) return -EINVAL; ...
vuln
Vulnerable
Unknown
bool IsReshapeOpSupported(const TfLiteRegistration* registration, const TfLiteNode* node, TfLiteContext* context, int coreml_version) { if (coreml_version >= 3) { return false; } if (node->inputs->size == 1) { const auto* params = reinterpret_cas...
vuln
Vulnerable
C/C++
/* * PAM authentication backend * Copyright (C) 2013 Martin Bříza <mbriza@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 Foundation; either version 2 of the License, or * (at your opti...
vuln
Vulnerable
C/C++
@Override public void index(ObjectStream<Event> eventStream) throws IOException { int cutoff = trainingParameters.getIntParameter(CUTOFF_PARAM, CUTOFF_DEFAULT); boolean sort = trainingParameters.getBooleanParameter(SORT_PARAM, SORT_DEFAULT); long start = System.currentTimeMillis(); display("Indexing...
vuln
Safe
Java
def process # We don't want any tracking back in the fs. Unlikely, but there # you go. client = self.host.gsub("..",".") dir = File.join(Puppet[:reportdir], client) if ! FileTest.exists?(dir) FileUtils.mkdir_p(dir) FileUtils.chmod_R(0750, dir) end # Now store the report. ...
vuln
Vulnerable
Ruby
@Override public OpenShiftOAuthInterceptor withConfig(Config config) { return new OpenShiftOAuthInterceptor(client, config, oauthToken); }
vuln
Vulnerable
Java
/* XML RPC Library * * (C) 2005 Trystan Scott Lee * Contact trystan@nomadirc.net * * Please read COPYING and README for further details. * * Based on the original code from Denora * * */ #include <mowgli.h> #include "atheme.h" #include "xmlrpclib.h" static int xmlrpc_error_code; typedef struct XMLRPCCmd_ X...
vuln
Safe
C/C++
static void main(string arg) { string file, *exparg; int szof; /* remove capability of path traversal */ /* discoverd by David Byrne of X-Force Red */ exparg = explode(arg, "/"); szof = sizeof(exparg); if (szof > 1) { return 1; } if (!alsos) { setup_alsos(); } if (empt...
vuln
Safe
C/C++
void pcmk_cpg_membership(cpg_handle_t handle, const struct cpg_name *groupName, const struct cpg_address *member_list, size_t member_list_entries, const struct cpg_address *left_list, size_t left_list_entries, const struct cpg_address *join...
vuln
Vulnerable
C/C++
package com.seafile.seadroid2.transfer; import android.content.Intent; import android.support.v4.content.LocalBroadcastManager; import com.google.common.collect.Lists; import com.seafile.seadroid2.SeadroidApplication; import com.seafile.seadroid2.account.Account; import com.seafile.seadroid2.notification.UploadNotifi...
vuln
Safe
Java
void isis_notif_area_mismatch(const struct isis_circuit *circuit, const char *raw_pdu, size_t raw_pdu_len) { const char *xpath = "/frr-isisd:area-mismatch"; struct list *arguments = yang_data_list_new(); char xpath_arg[XPATH_MAXLEN]; struct yang_data *data; struct isis_area *area = circuit->area; notif_...
vuln
Safe
Unknown
private void cooldown() { // Disable the password entry. if (mPasswordEntry != null) { mPasswordEntry.setEnabled(false); } if (mLockPatternView != null) { mLockPatternView.setEnabled(false); setPatternButtonsEnabled(false); } mStatusTe...
vuln
Safe
Java
static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * value_ptr, int value_len, char *offset_base, size_t IFDlength, size_t displacement) { size_t i; int de, section_index = SECTION_MAKERNOTE; int NumDirEntries, old_motorola_intel; #ifdef KALLE_0 int offset_diff; #endif const maker_note_type ...
vuln
Vulnerable
Unknown
protected void tickPrinter() { ItemStack blueprint = inventory.getStackInSlot(0); blockSkipped = false; if (blueprint.isEmpty() && !statusMsg.equals("idle") && inventory.getStackInSlot(1) .isEmpty()) { state = State.STOPPED; statusMsg = "idle"; sendUpdate = true; return; } // Skip if not Acti...
vuln
Safe
Java
bool handleBackslash(signed char& out) { char ch = *p++; switch (ch) { case 0: return false; case '"': out = ch; return true; case '\\': out = ch; return true; case '/': out = ch; return true; case 'b': out = '\b'; return true; case 'f': out = '\f'; return true; case 'n...
vuln
Safe
C/C++
void mkvparser::GetVersion(int& major, int& minor, int& build, int& revision) { IMkvReader::~IMkvReader() {} template<typename Type> Type* SafeArrayAlloc(unsigned long long num_elements, unsigned long long element_size) { if (num_elements == 0 || element_size == 0) re...
vuln
Safe
C/C++
static void qxl_init_ramsize(PCIQXLDevice *qxl, uint32_t ram_min_mb) { if (qxl->ram_size_mb != -1) { qxl->vga.vram_size = qxl->ram_size_mb * 1024 * 1024; } if (qxl->vga.vram_size < ram_min_mb * 1024 * 1024) { qxl->vga.vram_size = ram_min_mb * 1024 * 1024; } if (qxl->vram32_...
vuln
Vulnerable
C/C++
window_pane_spawn(struct window_pane *wp, int argc, char **argv, const char *path, const char *shell, const char *cwd, struct environ *env, struct termios *tio, char **cause) { struct winsize ws; char *argv0, *cmd, **argvp; const char *ptr, *first, *home; struct termios tio2; sigset_t set, oldset; if...
vuln
Vulnerable
Unknown
static inline void json_print_item_str(WriterContext *wctx, const char *key, const char *value, const char *indent) { char *key_esc = json_escape_str(key); char *value_esc = json_escape_str(value); printf("%s\"%s\": \"%s\"", inden...
vuln
Vulnerable
C/C++
dtls1_hm_fragment_free(hm_fragment *frag) { if (frag->fragment) OPENSSL_free(frag->fragment); if (frag->reassembly) OPENSSL_free(frag->reassembly); OPENSSL_free(frag); }
vuln
Vulnerable
Unknown
static int HistogramCompare(const void *x,const void *y) { const PixelInfo *color_1, *color_2; color_1=(const PixelInfo *) x; color_2=(const PixelInfo *) y; if (color_2->red != color_1->red) return((int) color_1->red-(int) color_2->red); if (color_2->green != color_1->green) return((int) colo...
vuln
Vulnerable
C/C++
static int send_sub_rect_jpeg(VncState *vs, int x, int y, int w, int h, int bg, int fg, int colors, VncPalette *palette, bool force) { int ret; if (colors == 0) { if (force || (tight_jpeg_conf[vs->tight->quality].jpeg_full && ...
vuln
Safe
Unknown
def web_upload(): from dtale.cli.loaders.csv_loader import loader_func as load_csv from dtale.cli.loaders.json_loader import loader_func as load_json from dtale.cli.loaders.excel_loader import load_file as load_excel from dtale.cli.loaders.parquet_loader import loader_func as load_parquet data_type...
vuln
Vulnerable
Python
static void pc_fw_cfg_guest_info(PcGuestInfo *guest_info) { PcRomPciInfo *info; Object *pci_info; bool ambiguous = false; if (!guest_info->has_pci_info || !guest_info->fw_cfg) { return; } pci_info = object_resolve_path_type("", TYPE_PCI_HOST_BRIDGE, &ambiguous); g_assert(!ambiguous);...
vuln
Safe
C/C++
static inline int mpeg2_fast_decode_block_non_intra(MpegEncContext *s, int16_t *block, int n) { int level, i, j, run; RLTable *rl = &ff_rl_mpeg1; uint8_t * const scantable = s->intra_scantable.permutated; const int qscale = s->qscale; OPEN...
vuln
Vulnerable
C/C++
static void new_video_stream(AVFormatContext *oc, int file_idx) { AVStream *st; AVOutputStream *ost; AVCodecContext *video_enc; enum CodecID codec_id = CODEC_ID_NONE; AVCodec *codec= NULL; st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0); if (!st) {...
vuln
Safe
C/C++
/* * Copyright (c) 1988-1997 Sam Leffler * Copyright (c) 1991-1997 Silicon Graphics, Inc. * * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear...
vuln
Vulnerable
C/C++
int get_tmp_filename(char *filename, int size) { #ifdef _WIN32 char temp_dir[MAX_PATH]; assert(size >= MAX_PATH); return (GetTempPath(MAX_PATH, temp_dir) && GetTempFileName(temp_dir, "qem", 0, filename) ? 0 : -GetLastError()); #else int fd; const char *tmpdir; tmpdir...
vuln
Safe
C/C++
void flush_tlb_mm_range(struct mm_struct *mm, unsigned long start, unsigned long end, unsigned long vmflag) { unsigned long addr; /* do a global flush by default */ unsigned long base_pages_to_flush = TLB_FLUSH_ALL; preempt_disable(); if (current->active_mm != mm) goto out; if (!current->mm) { leave_mm(...
vuln
Vulnerable
Unknown
public synchronized static void initParameters(ServletContext context) { if (isInitContext) { return; } if ("true".equalsIgnoreCase(System.getProperty(IBirtConstants.SYS_PROP_BIRT_ISDESIGNER))) { //$NON-NLS-1$ isDesigner = true; } String workingPath = "${" + IBirtConstants.SYS_PROP_WORKING_PATH + "}/"...
vuln
Vulnerable
Java
static void iothread_instance_finalize(Object *obj) { IOThread *iothread = IOTHREAD(obj); iothread_stop(obj, NULL); qemu_cond_destroy(&iothread->init_done_cond); qemu_mutex_destroy(&iothread->init_done_lock); aio_context_unref(iothread->ctx);
vuln
Vulnerable
C/C++
mcs_recv_connect_response(STREAM mcs_data) { UNUSED(mcs_data); uint8 result; uint32 length; STREAM s; struct stream packet; RD_BOOL is_fastpath; uint8 fastpath_hdr; logger(Protocol, Debug, "%s()", __func__); s = iso_recv(&is_fastpath, &fastpath_hdr); if (s == NULL) return False; packet = *s; ber_pars...
vuln
Safe
C/C++
/* global host, bridge, data, context */ 'use strict'; const { Object: localObject, Array: localArray, Error: LocalError, Reflect: localReflect, Proxy: LocalProxy, WeakMap: LocalWeakMap, Function: localFunction, Promise: localPromise, eval: localEval } = global; const { freeze: localObjectFreeze } = localO...
vuln
Vulnerable
JavaScript
@Override public ActionResult interactAt(PlayerEntity player, Vec3d pos, Hand hand) { long lastAction = ((ServerPlayerEntity) player).getLastActionTime(); ActionResult result = ActionResult.FAIL; // As weird as it sounds, this gets triggered twice, first time with the item stack player is h...
vuln
Safe
Java
private void finalizeSettlementConfig() { // Clear configuration settlements. settlementConfig.clearInitialSettlements(); // Add configuration settlements from table data. for (int x = 0; x < settlementTableModel.getRowCount(); x++) { String name = (String) settlementTableModel.getValueAt(x, SETTLEMENT_COL...
vuln
Safe
Java
def destroy_workflow Log.add_info(request, params.inspect) Item.find(params[:id]).destroy @tmpl_folder, @tmpl_workflows_folder = TemplatesHelper.get_tmpl_subfolder(TemplatesHelper::TMPL_WORKFLOWS) @group_id = params[:group_id] if @group_id.nil? or @group_id.empty? @group_id = '0' # '0' f...
vuln
Vulnerable
Ruby
static USBDevice *usb_msd_init(const char *filename) { static int nr=0; char id[8]; QemuOpts *opts; DriveInfo *dinfo; USBDevice *dev; int fatal_error; const char *p1; char fmt[32]; snprintf(id, sizeof(id), "usb%d", nr++); opts = qemu_opts_create(&qemu_drive_opts, id, 0); ...
vuln
Vulnerable
C/C++
/* $Id$ */ /* tiffcrop.c -- a port of tiffcp.c extended to include manipulations of * the image data through additional options listed below * * Original code: * Copyright (c) 1988-1997 Sam Leffler * Copyright (c) 1991-1997 Silicon Graphics, Inc. * Additions (c) Richard Nolde 2006-2010 * * Permission to use, ...
vuln
Safe
C/C++
void do_POWER_maskg (void) { uint32_t ret; if ((uint32_t)T0 == (uint32_t)(T1 + 1)) { ret = UINT32_MAX; } else { ret = (UINT32_MAX >> ((uint32_t)T0)) ^ ((UINT32_MAX >> ((uint32_t)T1)) >> 1); if ((uint32_t)T0 > (uint32_t)T1) ret = ~ret; } T0 = ret; }
vuln
Safe
C/C++
protected function doEnterNode(Node $node, Environment $env) { if ($node instanceof ModuleNode) { $this->inAModule = true; $this->tags = []; $this->filters = []; $this->functions = []; return $node; } elseif ($this->inAModule) { ...
vuln
Safe
PHP
@VisibleForTesting @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public void updateFooter() { if (mFooterView == null) { return; } // TODO: move this logic to controller, which will invoke updateFooterView directly boolean showDismissView = mClearAllEnabled && ...
vuln
Vulnerable
Java
static js_Ast *memberexp(js_State *J) { js_Ast *a; INCREC(); a = newexp(J); loop: if (jsP_accept(J, '.')) { a = EXP2(MEMBER, a, identifiername(J)); goto loop; } if (jsP_accept(J, '[')) { a = EXP2(INDEX, a, expression(J, 0)); jsP_expect(J, ']'); goto loop; } DECREC(); ...
vuln
Vulnerable
C/C++
int meth_put(struct transaction_t *txn, void *params) { struct meth_params *pparams = (struct meth_params *) params; int ret, r, precond, rights, reqd_rights; const char **hdr, *etag; struct mime_type_t *mime = NULL; struct mailbox *mailbox = NULL; struct dav_data *ddata; struct index_record...
vuln
Vulnerable
Unknown
void HTMLLinkElement::processCallback(Node* node)
vuln
Safe
C/C++
GF_Err BD_DecMFFieldVec(GF_BifsDecoder * codec, GF_BitStream *bs, GF_Node *node, GF_FieldInfo *field, Bool is_mem_com) { GF_Err e; u32 NbBits, nbFields; u32 i; GF_ChildNodeItem *last; u8 qp_local, qp_on, initial_qp; GF_FieldInfo sffield; memset(&sffield, 0, sizeof(GF_FieldInfo)); sffield.fieldIndex = field->fi...
vuln
Vulnerable
C/C++
void jswrap_i2c_writeTo(JsVar *parent, JsVar *addressVar, JsVar *args) { if (!jsvIsObject(parent)) return; IOEventFlags device = jsiGetDeviceFromClass(parent); bool sendStop = true; int address = i2c_get_address(addressVar, &sendStop); JSV_GET_AS_CHAR_ARRAY( dataPtr, dataLen, args); if (dataPtr && dataLe...
vuln
Safe
C/C++
static MagickBooleanType WriteHDRImage(const ImageInfo *image_info,Image *image, ExceptionInfo *exception) { char header[MagickPathExtent]; const char *property; MagickBooleanType status; register const Quantum *p; register ssize_t i, x; size_t length; ssize_t count...
vuln
Vulnerable
C/C++
static int aacDecoder_drcExtractAndMap ( HANDLE_AAC_DRC self, HANDLE_FDK_BITSTREAM hBs, CAacDecoderStaticChannelInfo *pAacDecoderStaticChannelInfo[], UCHAR pceInstanceTag, UCHAR channelMapping[], /* Channel mapping translating drcChannel index to canonical channel index */ int va...
vuln
Vulnerable
C/C++
public void onRenderModel(RenderEntityModelEvent event) { if(nullCheck())return; if (event.getStage() != 0 || !(event.entity instanceof EntityEnderCrystal) || !this.wireframe.getValue()) { return; } Color colour = EntityUtil.getColor(event.entity, this.wireColour.getValue().g...
vuln
Safe
Java
setup_server_realm(krb5_principal sprinc) { krb5_error_code kret; kdc_realm_t *newrealm; kret = 0; if (kdc_numrealms > 1) { if (!(newrealm = find_realm_data(sprinc->realm.data, (krb5_ui_4) sprinc->realm.length))) kret = ENOE...
vuln
Vulnerable
C/C++
njs_promise_perform_race_handler(njs_vm_t *vm, njs_iterator_args_t *args, njs_value_t *value, int64_t index) { njs_int_t ret; njs_value_t arguments[2], next; njs_promise_capability_t *capability; njs_promise_iterator_args_t *pargs; pargs = (njs_promise_i...
vuln
Vulnerable
Unknown
@Override public void onTagSelected(Tag tag, View view) { if (isAdded() && getSearchOwner() != null) { getSearchOwner().setSearchQuery(tag.getName(), true); } }
vuln
Safe
Java
compileTranslationTable (const char *tableList) { /*compile source tables into a table in memory */ int k; char mainTable[MAXSTRING]; char subTable[MAXSTRING]; int listLength; int currentListPos = 0; errorCount = 0; warningCount = 0; fileCount = 0; table = NULL; characterClasses = NULL; ruleNames ...
vuln
Vulnerable
Unknown
public Set<InheritanceVertex> getParents() { if (parents == null) { parents = new HashSet<>(); if (value.getSuperName() != null) { InheritanceVertex parentVertex = lookup.apply(value.getSuperName()); if (parentVertex != null) parents.add(parentVertex); } for (String itf : value.getInterfaces(...
vuln
Vulnerable
Java
jsi_wscallback_websock(struct lws *wsi, enum lws_callback_reasons reason, void *user, void *in, size_t len) { struct lws_context *context = lws_get_context(wsi); jsi_wsPss *pss = NULL; jsi_wsCmdObj *cmdPtr = (jsi_wsCmdObj *)lws_context_user(context); if (!cmdPtr) { fprintf(stderr, "...
vuln
Safe
C/C++
function d(I,F,H,R){function W(){F.removeChild(U);F.removeChild(X);V.style.display="block";J.style.display="block"}z={div:F,comment:I,saveCallback:H,deleteOnCancel:R};var J=F.querySelector(".geCommentTxt"),V=F.querySelector(".geCommentActionsList"),U=document.createElement("textarea");U.className= "geCommentEditTxtArea...
vuln
Vulnerable
JavaScript
void WebContents::MessageHost(const std::string& channel, blink::CloneableMessage arguments, content::RenderFrameHost* render_frame_host) { TRACE_EVENT1("electron", "WebContents::MessageHost", "channel", channel); // webContents.emit('ipc-message-host', ne...
vuln
Safe
Unknown