code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
private function _titlegt( $option ) { $where = '('; if ( substr( $option, 0, 2 ) == '=_' ) { if ( $this->parameters->getParameter( 'openreferences' ) ) { $where .= 'pl_title >= ' . $this->DB->addQuotes( substr( $option, 2 ) ); } else { $where .= $this->tableNames['page'] . '.page_title >= ' . $this-...
vuln
Safe
PHP
static USBPort *xhci_lookup_uport(XHCIState *xhci, uint32_t *slot_ctx) { USBPort *uport; char path[32]; int i, pos, port; port = (slot_ctx[1]>>16) & 0xFF; port = xhci->ports[port-1].uport->index+1; pos = snprintf(path, sizeof(path), "%d", port); for (i = 0; i < 5; i++) { port = (slot...
vuln
Vulnerable
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
@Override public void onCreate() { // Should happen before super.onCreate() StrictMode.setThreadPolicy( new StrictMode.ThreadPolicy.Builder() .detectDiskReads() .detectDiskWrites() .detectAll() ...
vuln
Safe
Java
isdn_ppp_open(int min, struct file *file) { int slot; struct ippp_struct *is; if (min < 0 || min >= ISDN_MAX_CHANNELS) return -ENODEV; slot = isdn_ppp_get_slot(); if (slot < 0) { return -EBUSY; } is = file->private_data = ippp_table[slot]; printk(KERN_DEBUG "ippp, open, slot: %d, minor: %d, state: %04x\n...
vuln
Vulnerable
Unknown
static int roq_read_packet(AVFormatContext *s, AVPacket *pkt) { RoqDemuxContext *roq = s->priv_data; AVIOContext *pb = s->pb; int ret = 0; unsigned int chunk_size; unsigned int chunk_type; unsigned int codebook_size; unsigned char preamble[RoQ_CHUNK_PREAMBLE_SIZE];...
vuln
Safe
C/C++
/* Mach-O support for BFD. Copyright (C) 1999-2020 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. 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 Fou...
vuln
Safe
C/C++
OMX_ERRORTYPE SoftFlacEncoder::internalGetParameter( OMX_INDEXTYPE index, OMX_PTR params) { ALOGV("SoftFlacEncoder::internalGetParameter(index=0x%x)", index); switch (index) { case OMX_IndexParamAudioPcm: { OMX_AUDIO_PARAM_PCMMODETYPE *pcmParams = (OMX_AUDIO_PARAM_PCMMODET...
vuln
Vulnerable
C/C++
protected void onPrepareActionBar(ActionBarView actionBarView) { if (actionBarView == null) { return; } actionBarView.setWindowCallback(mDialog); actionBarView.setDisplayOptions(ActionBar.DISPLAY_HOME_AS_UP | actionBarView.getDisplayOpt...
vuln
Safe
Java
/* eslint-disable no-unused-vars */ // eslint-disable-next-line no-undef const socket = io(); var MouseSelectedText = false; var MouseSelectedBox = false; var loaded = false; var questionPopupToRespond = false; const Board1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; const Board2 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 11]; const Boa...
vuln
Safe
JavaScript
int obj2ast_arg(PyObject* obj, arg_ty* out, PyArena* arena) { PyObject* tmp = NULL; identifier arg; expr_ty annotation; string type_comment; int lineno; int col_offset; if (_PyObject_HasAttrId(obj, &PyId_arg)) { int res; tmp = _PyObject_GetAttrId(obj, &PyId_arg); if ...
vuln
Vulnerable
C/C++
SwsContext *sws_alloc_context(void) { SwsContext *c = av_mallocz(sizeof(SwsContext)); c->av_class = &sws_context_class; av_opt_set_defaults(c); return c; }
vuln
Vulnerable
C/C++
@Override public String getString(String key, String defaultValue, int userId) { checkReadPermission(key, userId); return mStorage.getString(key, defaultValue, userId); }
vuln
Vulnerable
Java
psutil_net_if_addrs(PyObject *self, PyObject *args) { unsigned int i = 0; ULONG family; PCTSTR intRet; PCTSTR netmaskIntRet; char *ptr; char buff_addr[1024]; char buff_macaddr[1024]; char buff_netmask[1024]; DWORD dwRetVal = 0; #if (_WIN32_WINNT >= 0x0600) // Windows Vista and above ...
vuln
Vulnerable
Unknown
async def __call__(self, scope, receive, send): if b"_trace=1" not in scope.get("query_string", b"").split(b"&"): await self.app(scope, receive, send) return trace_start = time.perf_counter() traces = [] accumulated_body = b"" size_limit_exceeded = False ...
vuln
Vulnerable
Python
@Override public void onWalkingModeClicked(int id) { if (menuWalkingModes.containsKey(id)) { // update active walking mode WalkingMode walkingMode = menuWalkingModes.get(id); WalkingModePersistenceHelper.setActiveMode(walkingMode, getContext()); }else if(id == men...
vuln
Safe
Java
static inline int decode_vui_parameters(H264Context *h, SPS *sps){ MpegEncContext * const s = &h->s; int aspect_ratio_info_present_flag; unsigned int aspect_ratio_idc; aspect_ratio_info_present_flag= get_bits1(&s->gb); if( aspect_ratio_info_present_flag ) { aspect_ratio_idc= get_bits(&s->gb,...
vuln
Safe
C/C++
def getCommentsByPostid(self,postid,userid): sqlText="select (select Count(*) from comment_like where comments.commentid = comment_like.commentid) as like,(select Count(*) from comment_like where comments.commentid = comment_like.commentid and comment_like.userid=%d) as flag,commentid,name,comment from users,co...
vuln
Vulnerable
Python
function loaded(err, ok, state) { if (err) { return self.error(err); } if (!ok) { return self.fail(state, 403); } var code = req.query.code; var params = self.tokenParams(options); params.grant_type = 'authorization_code'; if (callbackURL) { params.redirect_uri = call...
vuln
Safe
JavaScript
void continuous_agg_update_materialization(SchemaAndName partial_view, SchemaAndName materialization_table, const NameData *time_column_name, InternalTimeRange new_materialization_range, InternalTimeRange invalidation_range, int32 chunk_id) { InternalTimeRange combined_mater...
vuln
Vulnerable
C/C++
static void qpeg_decode_intra(uint8_t *src, uint8_t *dst, int size, int stride, int width, int height) { int i; int code; int c0, c1; int run, copy; int filled = 0; height--; dst = dst + height * stride; while(size > 0) { code = *src++; size--; run = copy = 0; if(cod...
vuln
Vulnerable
C/C++
var upload = function(args, on_success, on_failure) { // Build query var codecov_endpoint = args.options.url || process.env.codecov_url || process.env.CODECOV_URL || 'https://codecov.io' var query = {} var debug = [] var yamlFile = args.options.yml || process.env.codecov_yml || pro...
vuln
Vulnerable
JavaScript
ExtensionFunction* ExtensionFunctionDispatcher::CreateExtensionFunction( const ExtensionHostMsg_Request_Params& params, const Extension* extension, int requesting_process_id, const extensions::ProcessMap& process_map, extensions::ExtensionAPI* api, void* profile, IPC::Sender* ipc_sender, ...
vuln
Safe
C/C++
int arm_set_cpu_off(uint64_t cpuid) { CPUState *target_cpu_state; ARMCPU *target_cpu; assert(qemu_mutex_iothread_locked()); DPRINTF("cpu %" PRId64 "\n", cpuid); target_cpu_state = arm_get_cpu_by_id(cpuid); if (!target_cpu_state) { return QEMU_ARM_POWERCTL_INVALID_PARAM; } ta...
vuln
Safe
C/C++
e1000_receive(VLANClientState *nc, const uint8_t *buf, size_t size) { E1000State *s = DO_UPCAST(NICState, nc, nc)->opaque; struct e1000_rx_desc desc; target_phys_addr_t base; unsigned int n, rdt; uint32_t rdh_start; uint16_t vlan_special = 0; uint8_t vlan_status = 0, vlan_offset = 0; uin...
vuln
Vulnerable
C/C++
virtio_crypto_sym_op_helper(VirtIODevice *vdev, struct virtio_crypto_cipher_para *cipher_para, struct virtio_crypto_alg_chain_data_para *alg_chain_para, struct iovec *iov, unsigned int out_num) { VirtIOCrypto *vcrypto = VIRTIO_CRYPTO(vdev); CryptoDevBackendSymOpInfo *op_info; ...
vuln
Safe
C/C++
static const QObject *qmp_input_get_object(QmpInputVisitor *qiv, const char *name) { const QObject *qobj; if (qiv->nb_stack == 0) { qobj = qiv->obj; } else { qobj = qiv->stack[qiv->nb_stack - 1].obj; } if (name && qobject_type(qobj) == QTYPE...
vuln
Vulnerable
C/C++
/* $OpenBSD: sshconnect2.c,v 1.249 2016/09/28 16:33:07 djm Exp $ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. * Copyright (c) 2008 Damien Miller. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following...
vuln
Safe
C/C++
def markAllNotfsAsSeen(): Action[JsValue] = PostJsonAction(RateLimits.MarkNotfAsSeen, maxBytes = 200) { request =>
vuln
Safe
Scala
/* * Copyright (c) 2004-2021, University of Oslo * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this * list of cond...
vuln
Safe
Java
static void Rp_test(js_State *J) { js_Regexp *re; const char *text; int opts; Resub m; re = js_toregexp(J, 0); text = js_tostring(J, 1); opts = 0; if (re->flags & JS_REGEXP_G) { if (re->last > strlen(text)) { re->last = 0; js_pushboolean(J, 0); return; } if (re->last > 0) { text += re->last;...
vuln
Vulnerable
C/C++
'use strict'; // module to handle cookies const urllib = require('url'); const SESSION_TIMEOUT = 1800; // 30 min /** * Creates a biskviit cookie jar for managing cookie values in memory * * @constructor * @param {Object} [options] Optional options object */ class Cookies { constructor(options) { th...
vuln
Safe
Java
static ssize_t gem_receive(NetClientState *nc, const uint8_t *buf, size_t size) { CadenceGEMState *s; unsigned rxbufsize, bytes_to_copy; unsigned rxbuf_offset; uint8_t rxbuf[2048]; uint8_t *rxbuf_ptr; bool first_desc = true; int maf; s = qemu_get_nic_opaque(nc); maf = g...
vuln
Safe
C/C++
// SPDX-License-Identifier: GPL-2.0+ /* * (C) Copyright 2000-2009 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. */ /* * Boot support */ #include <common.h> #include <bootm.h> #include <command.h> #include <env.h> #include <errno.h> #include <image.h> #include <malloc.h> #include <nand.h> #include <asm/b...
vuln
Vulnerable
C/C++
static struct sctp_ulpevent *sctp_make_reassembled_event(struct sk_buff_head *queue, struct sk_buff *f_frag, struct sk_buff *l_frag) { struct sk_buff *pos; struct sk_buff *new = NULL; struct sctp_ulpevent *event; struct sk_buff *pnext, *last; struct sk_buff *list = skb_shinfo(f_frag)->frag_list; /* Store the poi...
vuln
Safe
Unknown
static int link_pipe(struct pipe_inode_info *ipipe, struct pipe_inode_info *opipe, size_t len, unsigned int flags) { struct pipe_buffer *ibuf, *obuf; int ret = 0, i = 0, nbuf; /* * Potential ABBA deadlock, work around it by ordering lock * grabbing by pipe info address. Otherwise two different pro...
vuln
Safe
Unknown
static int archive_read_format_cpio_read_header(struct archive_read *a, struct archive_entry *entry) { struct cpio *cpio; const void *h; struct archive_string_conv *sconv; size_t namelength; size_t name_pad; int r; cpio = (struct cpio *)(a->format->data); sconv = cpio->opt_sconv; if (sconv == NULL) { if...
vuln
Vulnerable
C/C++
function attachToBody (options, req, reply, next) { if (req.raw[kMultipart] !== true) { next() return } const consumerStream = options.onFile || defaultConsumer const body = {} const mp = req.multipart((field, file, filename, encoding, mimetype) => { body[field] = body[field] || [] body[field...
vuln
Safe
JavaScript
static void v9fs_renameat(void *opaque) { ssize_t err = 0; size_t offset = 7; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; int32_t olddirfid, newdirfid; V9fsString old_name, new_name; v9fs_string_init(&old_name); v9fs_string_init(&new_name); err = pdu_unmarshal(pdu, offset, "dsds", ...
vuln
Safe
C/C++
void helper_mtc0_status(CPUMIPSState *env, target_ulong arg1) { MIPSCPU *cpu = mips_env_get_cpu(env); uint32_t val, old; uint32_t mask = env->CP0_Status_rw_bitmask; if (env->insn_flags & ISA_MIPS32R6) { bool has_supervisor = extract32(mask, CP0St_KSU, 2) == 0x3; if (has_supervisor && ext...
vuln
Safe
C/C++
TfLiteStatus EvalHashtable(TfLiteContext* context, TfLiteNode* node) { TF_LITE_ENSURE(context, node->user_data != nullptr); const auto* params = reinterpret_cast<const TfLiteHashtableParams*>(node->user_data); // The resource id is generated based on the given table name. const int resource_id = std::has...
vuln
Vulnerable
C/C++
private DosFileOperationResult openFileInternal(String fileName, String hostFileName, String openMode) { if (hostFileName == null) { // Not found return fileNotFoundError(fileName); } Integer freeIndex = findNextFreeFileIndex(); if (freeIndex == null) { return noFreeHandleError(); ...
vuln
Safe
Java
find_auth_end (FlatpakProxyClient *client, Buffer *buffer) { guchar *match; int i; /* First try to match any leftover at the start */ if (client->auth_end_offset > 0) { gsize left = strlen (AUTH_END_STRING) - client->auth_end_offset; gsize to_match = MIN (left, buffer->pos); /* Matched at...
vuln
Vulnerable
C/C++
public void setOnTuneEventListener(@NonNull @CallbackExecutor Executor executor, @NonNull OnTuneEventListener eventListener) { synchronized (mOnTuneEventLock) { mOnTuneEventListener = eventListener; mOnTuneEventExecutor = executor; } }
vuln
Safe
Java
public boolean checkObjectExecutePermission(Class clazz, String methodName) { if (Class.class.isAssignableFrom(clazz) && methodName != null && this.secureClassMethods.contains(methodName)) { return true; } else { return super.checkObjectExecutePermission(clazz, methodName); ...
vuln
Vulnerable
Java
private void notifyTrackPointsTableUpdate(boolean updateSamplingState, Set<TrackDataListener> sampledInListeners, Set<TrackDataListener> sampledOutListeners) { if (sampledInListeners.isEmpty() && sampledOutListeners.isEmpty()) { return; } if (updateSamplingState && numLoadedPoints >...
vuln
Safe
Java
def upload_user_data(user_stats_dict): """ Takes the User Stats dict that is populated by the other functions and then populates the user_info and user_system_summary_stats tables in the metrics MySQL DB. """ total_users = len(user_stats_dict.keys()) rows_info_inserted = 0 rows_info_upd...
vuln
Safe
Python
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
Vulnerable
Python
size_t multipart_extract(zckDL *dl, char *b, size_t l) { ALLOCD_BOOL(NULL, dl); VALIDATE_BOOL(dl->zck); if(dl->mp == NULL) return 0; zckMP *mp = dl->mp; char *buf = b; bool alloc_buf = false; /* Add new data to stored buffer */ if(mp->buffer) { if((mp->buffer_len > mp-...
vuln
Safe
C/C++
void stream_start(const char *job_id, BlockDriverState *bs, BlockDriverState *base, const char *backing_file_str, int64_t speed, BlockdevOnError on_error, Error **errp) { StreamBlockJob *s; BlockDriverState *iter; int orig_bs_flags; orig_bs_flags = bdrv_get_flags...
vuln
Vulnerable
C/C++
static void regulator_ena_gpio_free(struct regulator_dev *rdev) { struct regulator_enable_gpio *pin, *n; if (!rdev->ena_pin) return; /* Free the GPIO only in case of no use */ list_for_each_entry_safe(pin, n, &regulator_ena_gpio_list, list) { if (pin->gpiod == rdev->ena_pin->gpiod) { if (pin->request_count...
vuln
Safe
Unknown
static int cmd_info(const struct shell *shell, size_t argc, char **argv) { ARG_UNUSED(argc); ARG_UNUSED(argv); char *device_id = k_malloc(DEVICE_ID_HEX_MAX_SIZE); char *firmware_version = k_malloc(BOOT_IMG_VER_STRLEN_MAX); updatehub_get_device_identity(device_id, DEVICE_ID_HEX_MAX_SIZE); updatehub_get_firmware_...
vuln
Safe
C/C++
/*! Copyright (c) REBUILD <https://getrebuild.com/> and/or its owners. All rights reserved. rebuild is dual-licensed under commercial and open source licenses (GPLv3). See LICENSE and COMMERCIAL in the project root for license information. */ package com.rebuild.core.support.general; import cn.devezhao.commons.Objec...
vuln
Safe
Java
tcp_sack_option(struct tcpcb *tp, struct tcphdr *th, u_char *cp, int optlen) { int tmp_olen; u_char *tmp_cp; struct sackhole *cur, *p, *temp; if (!tp->sack_enable) return; /* SACK without ACK doesn't make sense. */ if ((th->th_flags & TH_ACK) == 0) return; /* Make sure the ACK on this segment is in [s...
vuln
Safe
C/C++
/* * INET An implementation of the TCP/IP protocol suite for the LINUX * operating system. INET is implemented using the BSD Socket * interface as the means of communication with the user level. * * ROUTE - implementation of the IP router. * * Authors: Ross Biro * Fred N. van Kempen, <waltje@uWalt.NL.Mug...
vuln
Safe
C/C++
const cb = require('cb'); const url = require('url'); const urlJoin = require('url-join'); const { TokenSet } = require('openid-client'); const clone = require('clone'); const { strict: assert } = require('assert'); const debug = require('./debug')('context'); const { get: getClient } = require('./client'); const { en...
vuln
Safe
JavaScript
function run(animation){ (function(compId){ window.AdobeEdge = window.AdobeEdge || {}; window.AdobeEdge.bootstrapLoading = true; // Include yepnope if(!AdobeEdge.yepnope) { /*yepnope1.5.x|WTFPL*/ (function(a,b,c){function d(a){retur...
vuln
Vulnerable
JavaScript
@SuppressWarnings("unchecked") public static <C, F> void iterateAccessibleStaticFields(Class<C> clazz, Class<F> targetFieldType, BiConsumer<F, String> fieldConsumer) { for (var field : clazz.getDeclaredFields()) { if (!Modifier.isStatic(field.getModifiers())) continue; F value; ...
vuln
Safe
Java
public Response get(final URL target, final QueryInput input, final Pair<String, String> auth) throws IOException { final var url = (input == null) ? buildTargetUrl(target, null) : buildTargetUrl(target, input.getOptional()); return this.get(url, toArgs(input, auth)); }
vuln
Vulnerable
Java
static void tgen_andi(TCGContext *s, TCGType type, TCGReg dest, uint64_t val) { static const S390Opcode ni_insns[4] = { RI_NILL, RI_NILH, RI_NIHL, RI_NIHH }; static const S390Opcode nif_insns[2] = { RIL_NILF, RIL_NIHF }; uint64_t valid = (type == TCG_TYPE_I32 ? 0xffffffffull : -1ull)...
vuln
Safe
C/C++
public void requestDestroyed(HttpServletRequest request) { if (isRequestDestroyed(request)) { return; } if (nestedInvocationGuardEnabled) { Counter counter = nestedInvocationGuard.get(); if (counter != null) { counter.value--; i...
vuln
Safe
Java
static int oidc_request_post_preserved_restore(request_rec *r, const char *original_url) { oidc_debug(r, "enter: original_url=%s", original_url); const char *method = "postOnLoad"; const char *script = apr_psprintf(r->pool, " <script type=\"text/javascript\">\n" " function str_decode(string)...
vuln
Safe
C/C++
package com.salesmanager.shop.admin.controller.customers; import com.salesmanager.core.business.services.customer.attribute.CustomerOptionValueService; import com.salesmanager.core.business.services.reference.language.LanguageService; import com.salesmanager.core.business.utils.ajax.AjaxResponse; import com.salesmanag...
vuln
Vulnerable
Java
def define_constraint_cascades(self, constraint): text = "" if constraint.ondelete is not None: text += " ON DELETE %s" % self.preparer.validate_sql_phrase( constraint.ondelete, FK_ON_DELETE ) if constraint.onupdate is not None: text += " ON UP...
vuln
Safe
Python
smb2_ioctl_query_info(const unsigned int xid, struct cifs_tcon *tcon, struct cifs_sb_info *cifs_sb, __le16 *path, int is_dir, unsigned long p) { struct iqi_vars *vars; struct smb_rqst *rqst; struct kvec *rsp_iov; struct cifs_ses *ses = tcon->ses; struct TCP_Server_Info *server = cif...
vuln
Vulnerable
Unknown
int udp_get_port(struct sock *sk, unsigned short snum, int (*scmp)(const struct sock *, const struct sock *)) { return __udp_lib_get_port(sk, snum, udp_hash, &udp_port_rover, scmp); }
vuln
Vulnerable
Unknown
void WebGL2RenderingContextBase::deleteVertexArray( WebGLVertexArrayObject* vertex_array) { if (isContextLost() || !vertex_array) return; if (!vertex_array->IsDefaultObject() && vertex_array == bound_vertex_array_object_) SetBoundVertexArrayObject(nullptr); vertex_array->DeleteObject(Conte...
vuln
Vulnerable
C/C++
public Direction getDirection() { if (holder.getBlockState().hasProperty(BlockGenericMachine.FACING)) { return holder.getBlockState().get(BlockGenericMachine.FACING); } return Direction.UP; }
vuln
Safe
Java
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
vuln
Vulnerable
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
_bson_iter_next_internal (bson_iter_t *iter, /* INOUT */ uint32_t next_keylen, /* IN */ const char **key, /* OUT */ uint32_t *bson_type, /* OUT */ bool *unsupported) /* OUT */ { const uint8_t *data; ...
vuln
Safe
C/C++
long Segment::DoParseNext( const Cluster*& pResult, long long& pos, long& len) { long long total, avail; long status = m_pReader->Length(&total, &avail); if (status < 0) //error return status; assert((total < 0) || (avail <= total)); const long long segment_stop = (m_siz...
vuln
Vulnerable
C/C++
enum ImapAuthRes imap_auth_login(struct ImapData *idata, const char *method) { char q_user[SHORT_STRING], q_pass[SHORT_STRING]; char buf[STRING]; int rc; if (mutt_bit_isset(idata->capabilities, LOGINDISABLED)) { mutt_message(_("LOGIN disabled on this server.")); return IMAP_AUTH_UNAVAIL; } if (m...
vuln
Vulnerable
Unknown
static void bump_cpu_timer(struct k_itimer *timer, u64 now) { int i; u64 delta, incr; if (timer->it.cpu.incr == 0) return; if (now < timer->it.cpu.expires) return; incr = timer->it.cpu.incr; delta = now + incr - timer->it.cpu.expires; /* Don't use (incr*2 < delta), incr*2 might overflow. */ for (i = 0; ...
vuln
Vulnerable
Unknown
/* * 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 may n...
vuln
Safe
Java
static int bdrv_open_common(BlockDriverState *bs, BlockDriverState *file, QDict *options, int flags, BlockDriver *drv, Error **errp) { int ret, open_flags; const char *filename; Error *local_err = NULL; assert(drv != NULL); assert(bs->file == NULL); assert(options != NULL && bs->options != o...
vuln
Vulnerable
C/C++
static void pred4x4_vertical_vp8_c(uint8_t *src, const uint8_t *topright, int stride){ const int lt= src[-1-1*stride]; LOAD_TOP_EDGE LOAD_TOP_RIGHT_EDGE uint32_t v = PACK_4U8((lt + 2*t0 + t1 + 2) >> 2, (t0 + 2*t1 + t2 + 2) >> 2, (t1 + 2*t2 + t3 + 2) >>...
vuln
Vulnerable
C/C++
static int dvbsub_display_end_segment(AVCodecContext *avctx, const uint8_t *buf, int buf_size, AVSubtitle *sub) { DVBSubContext *ctx = avctx->priv_data; DVBSubDisplayDefinition *display_def = ctx->display_definition; DVBSubRegion *region; DVBSubRegionDisplay *disp...
vuln
Vulnerable
C/C++
void ChromotingHost::AddAuthenticatedClient(
vuln
Safe
C/C++
void readSampleCountForLineBlock(InputStreamMutex* streamData, DeepScanLineInputFile::Data* data, int lineBlockId) { streamData->is->seekg(data->lineOffsets[lineBlockId]); if (isMultiPart(data->version)) { int partNumber; OPENEXR_IMF_I...
vuln
Safe
C/C++
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <libssh/libssh.h> #include <sys/stat.h> #include <sys/param.h> #include <errno.h> #include <grp.h> #include <pwd.h> #include <unistd.h> #ifdef HAVE_CURSES_H #include <curses.h> #else #include <ncurses.h> #endif #include <term.h> #include <time.h> #incl...
vuln
Vulnerable
C/C++
/** * WinPR: Windows Portable Runtime * NTLM Security Package (Message) * * Copyright 2011-2014 Marc-Andre Moreau <marcandre.moreau@gmail.com> * * 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 Lic...
vuln
Safe
C/C++
@Override public void begin(){ if(physics == null) return; boolean local = !Vars.net.client(); //remove stale entities refs.removeAll(ref -> { if(!ref.entity.isAdded()){ physics.remove(ref.body); ref.entity.physref(null); r...
vuln
Safe
Java
public void updateOverlayAxisIndicators() { for (final var virtualAxis : EnumSet.allOf(Input.VirtualAxis.class)) if (virtualAxisToProgressBarMap.containsKey(virtualAxis) && output != null && (isLocalRunning() || isServerRunning())) { final var progressBar = virtualAxisToProgressBarMap.get(virtualAxis); ...
vuln
Vulnerable
Java
static int do_i2c_crc(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { uint chip; ulong addr; int alen; int count; uchar byte; ulong crc; ulong err; int ret = 0; #if CONFIG_IS_ENABLED(DM_I2C) struct udevice *dev; #endif if (argc < 4) return CMD_RET_USAGE; /* * Chip is always spe...
vuln
Vulnerable
Unknown
return FAILURE; } static void php_tidy_quick_repair(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_file) { char *data=NULL, *arg1, *enc = NULL; int arg1_len, enc_len = 0, data_len = 0; zend_bool use_include_path = 0; TidyDoc doc; TidyBuffer *errbuf; zval **config = NULL; if (zend_parse_parameters(ZEND_NUM_ARGS() T...
vuln
Safe
Unknown
int VaapiVideoDecodeAccelerator::VaapiH264Accelerator::FillVARefFramesFromDPB( const H264DPB& dpb, VAPictureH264* va_pics, int num_pics) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); H264Picture::Vector::const_reverse_iterator rit; int i; for (rit = dpb.rbegin(), i = 0; rit != dpb.ren...
vuln
Safe
C/C++
/* Mac-Telnet - Connect to RouterOS or mactelnetd devices via MAC address Copyright (C) 2010, Håkon Nessjøen <haakon.nessjoen@gmail.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 Founda...
vuln
Vulnerable
C/C++
apr_status_t ap_http_filter(ap_filter_t *f, apr_bucket_brigade *b, ap_input_mode_t mode, apr_read_type_e block, apr_off_t readbytes) { core_server_config *conf; apr_bucket *e; http_ctx_t *ctx = f->ctx; apr_status_t rv; apr_off_t totalread; ...
vuln
Safe
C/C++
do_uncompress( compress_filter_context_t *zfx, z_stream *zs, IOBUF a, size_t *ret_len ) { int zrc; int rc = 0; int leave = 0; size_t n; int nread, count; int refill = !zs->avail_in; if( DBG_FILTER ) log_debug("begin inflate: avail_in=%u, avail_out=%u, inbuf=%u\n", (unsigned)zs->a...
vuln
Safe
Unknown
@SubscribeEvent public void tick(RenderWorldLastEvent event) { if (mc.player != null && mc.inGameHasFocus && !mc.gameSettings.hideGUI) { World world = mc.world; EntityPlayer player = mc.player; ItemStack stack = mc.player.getHeldItemMainhand(); if...
vuln
Vulnerable
Java
async function applyMermaid(element, key = "composer") { const mermaids = element.querySelectorAll("pre[data-code-wrap=mermaid]"); if (!mermaids.length) { return; } await loadScript(settings.theme_uploads_local.mermaid_js); window.mermaid.initialize({ startOnLoad: false, theme: getCompute...
vuln
Safe
JavaScript
@Override public Paginated<RichApplication> getApplicationsPage(PerunSession userSession, Vo vo, ApplicationsPageQuery query) throws PerunException { vosManager.checkVoExists(userSession, vo); MapSqlParameterSource namedParams = new MapSqlParameterSource(); //Authorization if (query.getGroupId() != null && !A...
vuln
Vulnerable
Java
public FormValidation doCheck(@AncestorInPath Item project, @QueryParameter String value, @QueryParameter boolean upstream) { // Require CONFIGURE permission on this project if(!project.hasPermission(Item.CONFIGURE)) return FormValidation.ok(); StringTokenizer tokens = new Stri...
vuln
Safe
Java
bool WebGLRenderingContextBase::ValidateHTMLImageElement( const SecurityOrigin* security_origin, const char* function_name, HTMLImageElement* image, ExceptionState& exception_state) { if (!image || !image->CachedImage()) { SynthesizeGLError(GL_INVALID_VALUE, function_name, "no image"); return ...
vuln
Safe
C/C++
// // [![](https://godoc.org/github.com/crewjam/saml?status.svg)](http://godoc.org/github.com/crewjam/saml) // // [![Build Status](https://travis-ci.org/crewjam/saml.svg?branch=master)](https://travis-ci.org/crewjam/saml) // // Package saml contains a partial implementation of the SAML standard in golang. // SAML is...
vuln
Vulnerable
Go
private void updateLogs() { logs = Kauri.INSTANCE.loggerManager.getLogs(player) .stream() .sorted(Comparator.comparing(log -> log.timeStamp, Comparator.reverseOrder())) .collect(Collectors.toList()); }
vuln
Safe
Java
@Inject(at = @At("HEAD"), method = "keyPressed", cancellable = true) public void keyPressed(int keyCode, int scanCode, int modifiers, CallbackInfoReturnable<Boolean> cir) { if (focusedSlot != null){ if (keyCode != 256 && !MinecraftClient.getInstance().options.inventoryKey.matchesKey(keyCode, sca...
vuln
Safe
Java
# Generated by Django 2.2.9 on 2020-02-01 12:47 from django.db import migrations import markdownx.models class Migration(migrations.Migration): dependencies = [ ('build', '0007_auto_20191118_2321'), ] operations = [ migrations.AlterField( model_name='build', name...
vuln
Vulnerable
Python
/* 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
Vulnerable
Python