code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
static void device_initfn(Object *obj) { DeviceState *dev = DEVICE(obj); ObjectClass *class; Property *prop; if (qdev_hotplug) { dev->hotplugged = 1; qdev_hot_added = true; } dev->instance_id_alias = -1; dev->realized = false; object_property_add_bool(obj, "realized", ...
vuln
Vulnerable
C/C++
public void tick() { if (this.dragon.getOwner() != null) { double dist = this.dragon.getDistance(this.dragon.getOwner()); if (dist > maxRange){ return; } if (dist > this.dragon.getBoundingBox().getAverageEdgeLength() && (!this.dragon.isFlying() && ...
vuln
Safe
Java
static void ssl_write_signature_algorithms_ext( ssl_context *ssl, unsigned char *buf, size_t *olen ) { unsigned char *p = buf; const unsigned char *end = ssl->out_msg + SSL_MAX_CONTENT_LEN; size_t sig_alg_len = 0...
vuln
Safe
Unknown
BrowserContextDestroyer::BrowserContextDestroyer( BrowserContext* context, const std::set<content::RenderProcessHost*>& hosts) : context_(context), pending_hosts_(0) { for (std::set<content::RenderProcessHost*>::iterator it = hosts.begin(); it != hosts.end(); ++it) { (*it)->AddObserver(th...
vuln
Vulnerable
C/C++
static int fsmSetFCaps(int fd, int dirfd, const char *path, const char *captxt) { int rc = 0; #if WITH_CAP if (captxt && *captxt != '\0') { cap_t fcaps = cap_from_text(captxt); if (fd >= 0) { if (fcaps == NULL || cap_set_fd(fd, fcaps)) rc = RPMERR_SETCAP_FAILED; } else { if (fcaps == NULL || ca...
vuln
Safe
C/C++
static BROTLI_INLINE uint32_t BitMask(uint32_t n) { if (BROTLI_IS_CONSTANT(n) || BROTLI_HAS_UBFX) { /* Masking with this expression turns to a single "Unsigned Bit Field Extract" UBFX instruction on ARM. */ return ~((0xFFFFFFFFu) << n); } else { return kBitMask[n]; } }
vuln
Vulnerable
Unknown
static void qcow2_invalidate_cache(BlockDriverState *bs) { BDRVQcowState *s = bs->opaque; int flags = s->flags; AES_KEY aes_encrypt_key; AES_KEY aes_decrypt_key; uint32_t crypt_method = 0; QDict *options; if (s->crypt_method) { crypt_method = s->crypt_method; memcpy(&aes...
vuln
Safe
C/C++
static int init_output_stream_streamcopy(OutputStream *ost) { OutputFile *of = output_files[ost->file_index]; InputStream *ist = get_input_stream(ost); AVCodecParameters *par_dst = ost->st->codecpar; AVCodecParameters *par_src = ost->ref_par; AVRational sar; int i, ret; uint32_t codec_tag = ...
vuln
Safe
C/C++
static void coroutine_fn v9fs_write(void *opaque) { ssize_t err; int32_t fid; uint64_t off; uint32_t count; int32_t len = 0; int32_t total = 0; size_t offset = 7; V9fsFidState *fidp; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; QEMUIOVector qiov_full; QEMUIOVector qiov; ...
vuln
Safe
C/C++
recv_password_packet(Port *port) { StringInfoData buf; if (PG_PROTOCOL_MAJOR(port->proto) >= 3) { /* Expect 'p' message type */ int mtype; mtype = pq_getbyte(); if (mtype != 'p') { /* * If the client just disconnects without offering a password, * don't make a log entry. This is legal per p...
vuln
Vulnerable
Unknown
private SendShuffleDataResponse doSendData(SendShuffleDataRequest rpcRequest) { int retryNum = 0; while (retryNum < maxRetryAttempts) { try { SendShuffleDataResponse response = getBlockingStub().sendShuffleData(rpcRequest); return response; } catch (Exception e) { retryNum++;...
vuln
Safe
Java
int ssl_needs_ins_cast (state_slot_t * ssl, dbe_column_t * col) { if (DV_WIDE == col->col_sqt.sqt_dtp && (DV_ANY == ssl->ssl_dc_dtp && DV_WIDE == ssl->ssl_sqt.sqt_dtp)) return 0; if (DV_STRING == col->col_sqt.sqt_dtp && (DV_ANY == ssl->ssl_dc_dtp && DV_STRING == ssl->ssl_sqt.sqt_dtp)) return 0; if (ssl->s...
vuln
Vulnerable
C/C++
static void free_stream(AVStream **pst) { AVStream *st = *pst; int i; if (!st) return; for (i = 0; i < st->nb_side_data; i++) av_freep(&st->side_data[i].data); av_freep(&st->side_data); if (st->parser) av_parser_close(st->parser); if (st->attached_pic.data) av...
vuln
Safe
C/C++
@Override public boolean onOptionsItemSelected(@NonNull MenuItem item) { final FragmentActivity activity = getActivity(); if (activity == null || activity.isFinishing() || activity.isDestroyed()) { return true; } Intent intent; int id = item.getItemId(); ...
vuln
Safe
Java
static void debugCallback (int fd, short flags, void *param) { int acceptFD, option; struct sockaddr_un peeraddr; socklen_t socklen = sizeof (peeraddr); int data; unsigned int qxdm_data[6]; const char *deactData[1] = {"1"}; RIL_Dial dialData; int hangupData[1] = {1}; int number; c...
vuln
Safe
C/C++
status_t BnOMX::onTransact( uint32_t code, const Parcel &data, Parcel *reply, uint32_t flags) { switch (code) { case LIVES_LOCALLY: { CHECK_OMX_INTERFACE(IOMX, data, reply); node_id node = (node_id)data.readInt32(); pid_t pid = (pid_t)data.readInt32(); reply->writeInt32(livesLoc...
vuln
Safe
C/C++
dns_cache_store(struct module_env* env, struct query_info* msgqinf, struct reply_info* msgrep, int is_referral, time_t leeway, int pside, struct regional* region, uint32_t flags, time_t qstarttime) { struct reply_info* rep = NULL; /* alloc, malloc properly (not in region, like msg is) */ rep = reply_info_co...
vuln
Safe
Unknown
WebContents* TabsCaptureVisibleTabFunction::GetWebContentsForID( int window_id, std::string* error) { Browser* browser = NULL; if (!GetBrowserFromWindowID(chrome_details_, window_id, &browser, error)) return nullptr; WebContents* contents = browser->tab_strip_model()->GetActiveWebContents(); if (!c...
vuln
Vulnerable
C/C++
@Override protected Map<String, byte[]> loadClasses() throws IOException { // iterate jar entries ByteArrayOutputStream out = new ByteArrayOutputStream(); byte[] buffer = new byte[8192]; EntryLoader loader = getEntryLoader(); try (ZipFile zipFile = new ZipFile(getPath().toFile())) { Enumeration<? extends ...
vuln
Vulnerable
Java
TPMI_ALG_SYM_MODE_Unmarshal(TPMI_ALG_SYM_MODE *target, BYTE **buffer, INT32 *size, BOOL allowNull) { TPM_RC rc = TPM_RC_SUCCESS; if (rc == TPM_RC_SUCCESS) { rc = TPM_ALG_ID_Unmarshal(target, buffer, size); } if (rc == TPM_RC_SUCCESS) { switch (*target) { #if ALG_CTR case TPM_ALG_CTR: #endif #if...
vuln
Vulnerable
Unknown
import random import secrets import string from django.contrib.auth import get_user_model from django.core.validators import EmailValidator from django.db import transaction from django.utils.decorators import method_decorator from django.views.decorators.debug import sensitive_post_parameters from django_filters.rest...
vuln
Safe
Python
static inline uint32_t vmsvga_fifo_read_raw(struct vmsvga_state_s *s) { uint32_t cmd = s->fifo[s->fifo_stop >> 2]; s->fifo_stop += 4; if (s->fifo_stop >= s->fifo_max) { s->fifo_stop = s->fifo_min; } s->fifo[SVGA_FIFO_STOP] = cpu_to_le32(s->fifo_stop); return cmd; }
vuln
Safe
C/C++
(function($) { var code = null; $.get('/version?_=' + new Date().getTime(), function(p) { $('#connector-version').text('v' + p); $.get('https://cdn.auth0.com/connector/windows/latest.json?_=' + new Date().getTime(), function(data) { var tab = $('#update-tab'); if (tab.length > 0) { tab.show(); ta...
vuln
Vulnerable
JavaScript
private ImmutableList<String> splitWords(ImapRequestLineReader request) throws DecodingException { ImmutableList.Builder<String> words = ImmutableList.builder(); request.nextWordChar(); request.consumeChar('('); String nextWord = request.consumeWord(NOOP_CHAR_VALIDATOR); while ...
vuln
Safe
Java
userauth_hostbased_fromfile(LIBSSH2_SESSION *session, const char *username, size_t username_len, const char *publickey, const char *privatekey, const char *passphrase, const char *hostname, size_t hostname_le...
vuln
Vulnerable
Unknown
public void Play() { // Play song if (currentIndexSongList < 0) { if (isExternalStoragePermissionDenied()) { requestPermissionForReading(); } else { if (currentPath == null) chooseDirectory(); else { ...
vuln
Vulnerable
Java
pq_getbytes(char *s, size_t len) { size_t amount; while (len > 0) { while (PqRecvPointer >= PqRecvLength) { if (pq_recvbuf()) /* If nothing in buffer, then recv some */ return EOF; /* Failed to recv data */ } amount = PqRecvLength - PqRecvPointer; if (amount > len) amount = len; memcpy(s, Pq...
vuln
Vulnerable
Unknown
void postRemoveBroadcastInfo(final int requestId) { mHandler.post(new Runnable() { @Override public void run() { if (mSession.getInputSession() != null) { mSession.getInputSession().removeBroadcastInfo(requestId); ...
vuln
Safe
Java
void NetworkHandler::SetRenderer(RenderProcessHost* process_host, void NetworkHandler::SetRenderer(int render_process_host_id, RenderFrameHostImpl* frame_host) { RenderProcessHost* process_host = RenderProcessHost::FromID(render_process_host_id); if (process_host) { stora...
vuln
Safe
C/C++
public static byte[] readByteArray(DataInput in) throws IOException { byte[] ab; if (in instanceof PofInputStream) { ab = (byte[]) ((PofInputStream) in).readObject(); } else { int cb = readInt(in); a...
vuln
Vulnerable
Java
/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* kdc/kdc_util.c - Utility functions for the KDC implementation */ /* * Copyright 1990,1991,2007,2008,2009 by the Massachusetts Institute of Technology. * All Rights Reserved. * * Export of this software from the United States of America may * requ...
vuln
Safe
C/C++
function isObject (o, allowArray) { return o && 'object' === typeof o && (allowArray || !Array.isArray(o)) } function isBasic (b) { return 'string' === typeof b || 'number' === typeof b } function get (obj, path, dft) { if(!isObject(obj, true)) return dft if(isBasic(path)) return obj[path] for(var i = 0; i ...
vuln
Vulnerable
JavaScript
private AuthorType transformOperatorTypeToAuthorType(OperatorType operatorType) throws IOException { AuthorType type; switch (operatorType) { case CREATE_ROLE: type = AuthorType.CREATE_ROLE; break; case DELETE_ROLE: type = AuthorType.DROP_ROLE; break; case...
vuln
Safe
Java
brcmf_wowl_nd_results(struct brcmf_if *ifp, const struct brcmf_event_msg *e, void *data) { struct brcmf_cfg80211_info *cfg = ifp->drvr->config; struct wiphy *wiphy = cfg_to_wiphy(cfg); struct brcmf_pno_scanresults_le *pfn_result; struct brcmf_pno_net_info_le *netinfo; brcmf_dbg(SCAN, "Enter\n"); if (e->...
vuln
Vulnerable
C/C++
static void rpc_init_task(struct rpc_task *task, const struct rpc_task_setup *task_setup_data) { memset(task, 0, sizeof(*task)); atomic_set(&task->tk_count, 1); task->tk_flags = task_setup_data->flags; task->tk_ops = task_setup_data->callback_ops; task->tk_calldata = task_setup_data->callback_data; INIT_LIST_HEA...
vuln
Safe
C/C++
static int update_write_order_info(rdpContext* context, wStream* s, ORDER_INFO* orderInfo, size_t offset) { size_t position; WINPR_UNUSED(context); position = Stream_GetPosition(s); Stream_SetPosition(s, offset); Stream_Write_UINT8(s, orderInfo->controlFlags); /* controlFlags (1 ...
vuln
Safe
C/C++
private Optional<File> downloadPlugin(PluginInfo info) throws IOException { URL downloadURL = info.getDownloadURL(); logger.info("Downloading the {} plugin from: {}", info.getLabel(), downloadURL); File tempPluginFile = Files.createTempFile(info.getId(), ".jar").toFile(); tempPluginFil...
vuln
Safe
Java
Http::Stream::getNextRangeOffset() const { debugs (33, 5, "range: " << http->request->range << "; http offset " << http->out.offset << "; reply " << reply); // XXX: This method is called from many places, including pullData() which // may be called before prepareReply() [on some Squ...
vuln
Safe
Unknown
static gboolean udscs_server_accept_cb(GSocketService *service, GSocketConnection *socket_conn, GObject *source_object, gpointer user_data) { struct udscs_server *server = user...
vuln
Vulnerable
C/C++
require('../services/Requisitions'); import Util from 'lib/util'; const QuickNode = require('../model/QuickNode'); /** * @author Alejandro Galue <agalue@opennms.org> * @copyright 2014 The OpenNMS Group, Inc. */ (function() { 'use strict'; const quickAddPanelBasicView = require('../../views/quick-add-panel-basi...
vuln
Vulnerable
Java
static void Np_toString(js_State *J) { char buf[32]; js_Object *self = js_toobject(J, 0); int radix = js_isundefined(J, 1) ? 10 : js_tointeger(J, 1); if (self->type != JS_CNUMBER) js_typeerror(J, "not a number"); if (radix == 10) { js_pushstring(J, jsV_numbertostring(J, buf, self->u.number)); return; } if ...
vuln
Vulnerable
C/C++
function ze(t,e,i){We(t,e,i),(qi||Yi)&&setTimeout(function(){We(t,e,i)},0)}
vuln
Vulnerable
JavaScript
// termout.c (part of mintty) // Copyright 2008-12 Andy Koppe, 2017-20 Thomas Wolff // Adapted from code from PuTTY-0.60 by Simon Tatham and team. // Licensed under the terms of the GNU General Public License v3 or later. #include "termpriv.h" #include "winpriv.h" // colours, win_get_font, win_change_font, win_led, w...
vuln
Safe
C/C++
static int sctp_sendmsg(struct sock *sk, struct msghdr *msg, size_t msg_len) { struct net *net = sock_net(sk); struct sctp_sock *sp; struct sctp_endpoint *ep; struct sctp_association *new_asoc = NULL, *asoc = NULL; struct sctp_transport *transport, *chunk_tp; struct sctp_chunk *chunk; union sctp_addr to; struct...
vuln
Safe
Unknown
/* * Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com> * * This file is part of Open5GS. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or ...
vuln
Safe
C/C++
/* * $Id: pam_radius_auth.c,v 1.39 2007/03/26 05:35:31 fcusack Exp $ * pam_radius_auth * Authenticate a user via a RADIUS session * * 0.9.0 - Didn't compile quite right. * 0.9.1 - Hands off passwords properly. Solaris still isn't completely happy * 0.9.2 - Solaris now does challenge-response. Added config...
vuln
Vulnerable
C/C++
private void resumeMission() { if (mission.canParticipate(robot) && robot.isFit()) { mission.performMission(robot); } }
vuln
Vulnerable
Java
/* Copyright (c) 2013, David C Horton 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, modify, merge, publish, distribute,...
vuln
Vulnerable
C/C++
status WAVEFile::parseFormat(const Tag &id, uint32_t size) { Track *track = getTrack(); uint16_t formatTag; readU16(&formatTag); uint16_t channelCount; readU16(&channelCount); uint32_t sampleRate; readU32(&sampleRate); uint32_t averageBytesPerSecond; readU32(&averageBytesPerSecond); uint16_t blockAlign; rea...
vuln
Vulnerable
C/C++
load(ImlibImage * im, ImlibProgressFunction progress, char progress_granularity, char immediate_load) { static const int intoffset[] = { 0, 4, 2, 1 }; static const int intjump[] = { 8, 8, 4, 2 }; int rc; DATA32 *ptr; GifFileType *gif; GifRowType *r...
vuln
Vulnerable
Unknown
""" Copyright 2014-2015. Jorgen Maas <jorgen.maas@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 Foundation; either version 2 of the License, or (at your option) any later version. This program is d...
vuln
Vulnerable
Python
/* * Copyright (c) 2014-2015 Hisilicon Limited. * * 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. */ #include <l...
vuln
Safe
C/C++
static ssize_t status_show(struct device *dev, struct device_attribute *attr, char *buf) { char *status; switch (to_devlink(dev)->status) { case DL_STATE_NONE: status = "not tracked"; break; case DL_STATE_DORMANT: status = "dormant"; break; case DL_STATE_AVAILABLE: status = "available"; break; case DL...
vuln
Safe
Unknown
func (p *HTTPClient) ReadByte() (c byte, err error) { return readByte(p.response.Body) }
vuln
Vulnerable
Go
fn should_disallow_non_get_requests() { // given let (server, fetch) = serve_with_fetch("token"); // when let response = request(server, "\ POST / HTTP/1.1\r\n\ Host: EHQPPSBE5DM78X3GECX2YBVGC5S6JX3S5SMPY.web.web3.site\r\n\ Content-Type: application/json\r\n\ Connection: close\r\n\ \r\n\ 123\r\...
vuln
Vulnerable
Rust
lzw_read_byte (GifContext *context) { int code, incode; gint retval; gint my_retval; register int i; if (context->lzw_code_pending != -1) { retval = context->lzw_code_pending; context->lzw_code_pending = -1; return retval; } if (context->lzw_fresh) { context->lzw_fresh = FALSE; do { retval = get_c...
vuln
Safe
Unknown
bool Document::isSecureContextImpl(const SecureContextCheck privilegeContextCheck) const { if (!getSecurityOrigin()->isPotentiallyTrustworthy()) return false; if (SchemeRegistry::schemeShouldBypassSecureContextCheck(getSecurityOrigin()->protocol())) return true; if (privilegeContextChec...
vuln
Safe
C/C++
package com.databasir.core.domain; import com.databasir.common.DatabasirErrors; import com.databasir.common.DatabasirException; import lombok.Getter; import lombok.RequiredArgsConstructor; @RequiredArgsConstructor @Getter public enum DomainErrors implements DatabasirErrors { REFRESH_TOKEN_EXPIRED("X_0001", "refre...
vuln
Vulnerable
Java
const exec = require('./exec'); const listProcessesOnPort = module.exports.listProcessesOnPort = async port => { const portNumber = parseInt(port, 10); if (Number.isNaN(portNumber)) { console.error("Must provide number for port."); return; } try { const result = (await exec(`lsof -i :${portNumber}`)).output.s...
vuln
Safe
JavaScript
''' SPDX-License-Identifier: Apache-2.0 Copyright 2017 Massachusetts Institute of Technology. ''' import codecs from abc import ABCMeta, abstractmethod import os import string import typing import yaml try: from yaml import CSafeLoader as SafeLoader, CSafeDumper as SafeDumper except ImportError: from yaml impo...
vuln
Safe
Python
'use strict' const url = require('url') const {send} = require('micro') const microCors = require('micro-cors') const fetch = require('node-fetch') const allowHeaders = [ 'accept-encoding', 'accept-language', 'accept', 'access-control-allow-origin', 'authorization', 'cache-control', 'connection', 'cont...
vuln
Vulnerable
JavaScript
bgp_nlri_parse_vpnv4 (struct peer *peer, struct attr *attr, struct bgp_nlri *packet) { u_char *pnt; u_char *lim; struct prefix p; int psize; int prefixlen; u_int16_t type; struct rd_as rd_as; struct rd_ip rd_ip; struct prefix_rd prd; u_char *tagpnt; /* Check peer status. */ if (peer->s...
vuln
Safe
C/C++
public void setSyncItem(String[] syncItem) { this.syncItem = syncItem != null ? syncItem.clone() : null; }
vuln
Safe
Java
/* * . .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
Vulnerable
JavaScript
static int interp(RA144Context *ractx, int16_t *out, int a, int copyold, int energy) { int work[10]; int b = NBLOCKS - a; int i; for (i=0; i<30; i++) out[i] = (a * ractx->lpc_coef[0][i] + b * ractx->lpc_coef[1][i])>> 2; if (eval_refl(work, out, ractx)) { ...
vuln
Vulnerable
C/C++
public static void detectLinks(final Spannable output) { if(output == null) return; synchronized (output) { try { if (tc != null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { try { tc.generateLinks(new TextLinks....
vuln
Safe
Java
static int qtrle_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { QtrleContext *s = avctx->priv_data; int header, start_line; int height, row_ptr; int has_palette = 0; bytestream2_init(&s->g, avpkt->data, a...
vuln
Safe
C/C++
public DirectVertexConsumer begin(int vertexCount) { if (expectedVertices != 0) { throw new IllegalStateException("Already drawing"); } this.expectedVertices = vertexCount; VertexFormat format = parent.format(); // Add one extra vertex to uphold the vanilla assumption that BufferBuilders have at least ...
vuln
Safe
Java
static int rm_read_packet(AVFormatContext *s, AVPacket *pkt) { RMDemuxContext *rm = s->priv_data; AVStream *st; int i, len, res, seq = 1; int64_t timestamp, pos; int flags; for (;;) { if (rm->audio_pkt_cnt) { st = s->streams[rm->audio_stream_num]; res...
vuln
Vulnerable
C/C++
static int ohci_service_iso_td(OHCIState *ohci, struct ohci_ed *ed, int completion) { int dir; size_t len = 0; #ifdef DEBUG_ISOCH const char *str = NULL; #endif int pid; int ret; int i; USBDevice *dev; struct ohci_iso_td iso_td; uint32_t addr; uint1...
vuln
Vulnerable
C/C++
@Override public String getQueryString() { if (Util.isPar(requestUri)) { return getParQueryString(); } StringBuilder queryStringBuilder = new StringBuilder(); try { // OAuth 2.0 request parameters final String responseTypesAsString = getResponseT...
vuln
Safe
Java
static void k_ascii(struct vc_data *vc, unsigned char value, char up_flag) { int base; if (up_flag) return; if (value < 10) { /* decimal input of code, while Alt depressed */ base = 10; } else { /* hexadecimal input of code, while AltGr depressed */ value -= 10; base = 16; } if (npadch == -1) npa...
vuln
Vulnerable
C/C++
void BindSkiaToInProcessGL() { static bool host_StubGL_installed = false; if (!host_StubGL_installed) { GrGLBinding binding; switch (gfx::GetGLImplementation()) { case gfx::kGLImplementationNone: NOTREACHED(); return; case gfx::kGLImplementationDesktopGL: binding = kDeskt...
vuln
Vulnerable
C/C++
VALUE rb_dlhandle_sym(VALUE self, VALUE sym) { void (*func)(); struct dl_handle *dlhandle; void *handle; const char *name; const char *err; int i; #if defined(HAVE_DLERROR) # define CHECK_DLERROR if( err = dlerror() ){ func = 0; } #else # define CHECK_DLERROR #endif rb_secure(2); name...
vuln
Vulnerable
C/C++
function slidePositions() { const tokenValidation = AuthTokenValidation.findOne({ connectionId: this.connection.id }); if (!tokenValidation || tokenValidation.validationStatus !== ValidationStates.VALIDATED) { Logger.warn(`Publishing SlidePositions was requested by unauth connection ${this.connection.id}`); ...
vuln
Vulnerable
JavaScript
PHP_FUNCTION(mb_ereg_search_init) { size_t argc = ZEND_NUM_ARGS(); zval *arg_str; char *arg_pattern = NULL, *arg_options = NULL; int arg_pattern_len = 0, arg_options_len = 0; OnigSyntaxType *syntax = NULL; OnigOptionType option; if (zend_parse_parameters(argc TSRMLS_CC, "z|ss", &arg_str, &arg_pattern, &arg_patt...
vuln
Vulnerable
C/C++
public Poly1305() { super(new org.bouncycastle.crypto.macs.Poly1305(new AESEngine())); }
vuln
Safe
Java
void usb_host_info(Monitor *mon, const QDict *qdict) { libusb_device **devs; struct libusb_device_descriptor ddesc; char port[16]; int i, n; if (usb_host_init() != 0) { return; } n = libusb_get_device_list(ctx, &devs); for (i = 0; i < n; i++) { if (libusb_get_device_descr...
vuln
Vulnerable
C/C++
public static @Nullable JavaVersion resolveFromJavaExecutable(@Nullable String input) { // the default java command input can always evaluate in the current runtime version if (input == null || input.equals("java")) { return JavaVersion.runtimeVersion(); } try { var process = Runtime.getRun...
vuln
Safe
Java
ArgParser::argOiMinArea(char* parameter) { o.oi_min_area = QUtil::string_to_uint(parameter); }
vuln
Safe
Unknown
/* * 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
tbGetBuffer(unsigned size) { struct textBuffer *tb; tb = &textBuffer[textBufferIndex]; textBufferIndex = (textBufferIndex + 1) % NUM_BUFFER; if (size > tb->size) { free(tb->buffer); tb->buffer = xnfalloc(size); tb->size = size; } return tb->buffer; }
vuln
Safe
C/C++
private void continueSearch() { if (!isAdded() || getSearchOwner() == null) { return; } String query = getSearchOwner().getSearchQuery(); FoodRepository.getInstance().search(getContext(), query, currentPage, this::addItems); }
vuln
Safe
Java
package jwt import ( "crypto" "crypto/hmac" "crypto/sha256" "crypto/sha512" "encoding/base64" "encoding/json" "hash" "strings" "time" "github.com/pkg/errors" ) //Algorithm is used to sign and validate a token. type Algorithm struct { signingHash hash.Hash algorithm string } // NewHeader returns a new ...
vuln
Safe
Go
void setup_new_exec(struct linux_binprm * bprm) { /* * Once here, prepare_binrpm() will not be called any more, so * the final state of setuid/setgid/fscaps can be merged into the * secureexec flag. */ bprm->secureexec |= bprm->cap_elevated; if (bprm->secureexec) { /* Make sure parent cannot signal privil...
vuln
Vulnerable
Unknown
static void nsc_decode(NSC_CONTEXT* context) static BOOL nsc_decode(NSC_CONTEXT* context) { UINT16 x; UINT16 y; UINT16 rw; BYTE shift; BYTE* bmpdata; size_t pos = 0; if (!context) return FALSE; rw = ROUND_UP_TO(context->width, 8); shift = context->ColorLossLevel - 1; /* colorloss recovery + YCoCg shift ...
vuln
Safe
C/C++
static ssize_t _hostfs_pwrite( oe_fd_t* desc, const void* buf, size_t count, oe_off_t offset) { ssize_t ret = -1; file_t* file = _cast_file(desc); /* * According to the POSIX specification, when the count is greater * than SSIZE_MAX, the result is implementation-defined. OE raises...
vuln
Safe
Unknown
rsvg_new_filter_primitive_image (void) { RsvgFilterPrimitiveImage *filter; filter = g_new (RsvgFilterPrimitiveImage, 1); _rsvg_node_init (&filter->super.super); filter->super.in = g_string_new ("none"); filter->super.result = g_string_new ("none"); filter->super.x.factor = filter->super.y.factor...
vuln
Vulnerable
Unknown
async def _handle_deltas(self, deltas): """Called with the state deltas to process Returns: tuple[dict[str, Counter], dict[str, counter]] Two dicts: the room deltas and the user deltas, mapping from room/user ID to changes in the various fields. """ ...
vuln
Vulnerable
Python
void fx_DataView(txMachine* the) { txSlot* slot; txBoolean flag = 0; txInteger offset, size; txSlot* info; txSlot* instance; txSlot* view; txSlot* buffer; if (mxIsUndefined(mxTarget)) mxTypeError("call: DataView"); if ((mxArgc > 0) && (mxArgv(0)->kind == XS_REFERENCE_KIND)) { slot = mxArgv(0)->value.refere...
vuln
Safe
Unknown
public static AuthenticatorSupplier authenticatorSupplier() { final String supplierClassName = System.getProperty(AUTHENTICATOR_SUPPLIER_PROP_NAME); if (Strings.isEmpty(supplierClassName)) { return DefaultAuthenticatorSupplier.INSTANCE; } ...
vuln
Safe
Java
public String getThumbnailUrl(int width, int height, int q) { if (value != null && value.getThumbnail() != null && !Helper.isNullOrEmpty(value.getThumbnail().getUrl())) { ImageCDNUrl imageCDNUrl = new ImageCDNUrl(Math.max(width, 0), Math.max(height, 0), q, null, value.getThumbnail().getUrl()); ...
vuln
Safe
Java
static ssize_t auto_remove_on_show(struct device *dev, struct device_attribute *attr, char *buf) { struct device_link *link = to_devlink(dev); char *str; if (link->flags & DL_FLAG_AUTOREMOVE_SUPPLIER) str = "supplier unbind"; else if (link->flags & DL_FLAG_AUTOREMOVE_CONSUMER) str = "consumer unbind"; ...
vuln
Safe
Unknown
spnego_gss_wrap_iov_length(OM_uint32 *minor_status, gss_ctx_id_t context_handle, int conf_req_flag, gss_qop_t qop_req, int *conf_state, gss_iov_buffer_desc *iov, int iov_count) { OM_uint32 ret; ret = gss_wrap_iov_length(minor_status, context_handle, conf_req_flag, ...
vuln
Vulnerable
C/C++
static int _hid_get_report(struct hid_device_priv* dev, HANDLE hid_handle, int id, void *data,
vuln
Safe
C/C++
static int hls_write_trailer(struct AVFormatContext *s) { HLSContext *hls = s->priv_data; AVFormatContext *oc = hls->avf; av_write_trailer(oc); hls->size = avio_tell(hls->avf->pb) - hls->start_pos; avio_closep(&oc->pb); avformat_free_context(oc); av_free(hls->basename); hls_append_segmen...
vuln
Vulnerable
C/C++
BlockDriverState *bdrv_find_backing_image(BlockDriverState *bs, const char *backing_file) { char *filename_full = NULL; char *backing_file_full = NULL; char *filename_tmp = NULL; int is_protocol = 0; BlockDriverState *curr_bs = NULL; BlockDriverState *retval = NULL; Error *local_erro...
vuln
Safe
C/C++
int tls1_mac(SSL *ssl, unsigned char *md, int send) { SSL3_RECORD *rec; unsigned char *seq; EVP_MD_CTX *hash; size_t md_size; int i; EVP_MD_CTX hmac, *mac_ctx; unsigned char buf[5]; int stream_mac = (send?(ssl->mac_flags & SSL_MAC_FLAG_WRITE_MAC_STREAM):(ssl->mac_flags&SSL_MAC_FLAG_READ_MAC_STREAM)); int t; ...
vuln
Vulnerable
Unknown
static int spapr_phb_init(SysBusDevice *s) { sPAPRPHBState *sphb = SPAPR_PCI_HOST_BRIDGE(s); PCIHostState *phb = PCI_HOST_BRIDGE(s); char *namebuf; int i; PCIBus *bus; if (sphb->index != -1) { hwaddr windows_base; if ((sphb->buid != -1) || (sphb->dma_liobn != -1) || (...
vuln
Safe
C/C++
private void grabData() { boolean excludeShortSounds = sharedPrefsUtils.readSharedPrefsBoolean("excludeShortSounds", false); boolean excludeWhatsApp = sharedPrefsUtils.readSharedPrefsBoolean("excludeWhatsAppSounds", false); Uri uri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI; String[...
vuln
Safe
Java