code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
async def on_federation_query_user_devices(self, user_id: str) -> JsonDict: if not self.hs.is_mine(UserID.from_string(user_id)): raise SynapseError(400, "User is not hosted on this homeserver") stream_id, devices = await self.store.get_e2e_device_keys_for_federation_query( user_...
vuln
Safe
Python
/* packet-eap.c * Routines for EAP Extensible Authentication Protocol dissection * RFC 2284, RFC 3748 * * Wireshark - Network traffic analyzer * By Gerald Combs <gerald@wireshark.org> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #include "config.h" #include <stdio.h> /* f...
vuln
Vulnerable
C/C++
private DosFileOperationResult openFileInternal(String fileName, String hostFileName, String openMode) { Integer freeIndex = findNextFreeFileIndex(); if (freeIndex == null) { return noFreeHandleError(); } int dosIndex = freeIndex + FILE_HANDLE_OFFSET; try { RandomAccessFile randomAccessF...
vuln
Vulnerable
Java
public boolean export() { if(selectedMobData == null) { return false; } Path dir = ResourceHandler.getMorphDir().resolve("export"); try { if(!Files.exists(dir)) { Files.cr...
vuln
Vulnerable
Java
static int opt_vstats(void *optctx, const char *opt, const char *arg) { char filename[40]; time_t today2 = time(NULL); struct tm *today = localtime(&today2); if (!today) return AVERROR(errno); snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min, ...
vuln
Safe
C/C++
static void p54u_load_firmware_cb(const struct firmware *firmware, void *context) { struct p54u_priv *priv = context; struct usb_device *udev = priv->udev; struct usb_interface *intf = priv->intf; int err; if (firmware) { priv->fw = firmware; err = p54u_start_ops(priv); } else { err = -ENOENT; dev_...
vuln
Safe
Unknown
/* * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. */ /* * Licensed to Elasticsearch under one or more contributor * license agreements. See the NOTICE file distribute...
vuln
Vulnerable
Java
var profiles=[];function sendTestEmail(){var o=[];$.each($("#headersTable").DataTable().rows().data(),function(e,a){o.push({key:unescapeHtml(a[0]),value:unescapeHtml(a[1])})});var e={template:{},first_name:$("input[name=to_first_name]").val(),last_name:$("input[name=to_last_name]").val(),email:$("input[name=to_email]")...
vuln
Vulnerable
Go
php_mysqlnd_rowp_read_text_protocol_aux(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zval ** fields, unsigned int field_count, const MYSQLND_FIELD * fields_metadata, zend_bool as_int_or_float, zend_bool copy_data, MYSQLND_STATS * stats TSRMLS_DC) { unsigned int i; zend_bool last_field_was_string = FALS...
vuln
Safe
C/C++
static void dispatch_packet(AvahiServer *s, AvahiDnsPacket *p, const AvahiAddress *src_address, uint16_t port, const AvahiAddress *dst_address, AvahiIfIndex iface, int ttl) { AvahiInterface *i; int from_local_iface = 0; assert(s); assert(p); assert(src_address); assert(dst_address); assert(...
vuln
Vulnerable
C/C++
protected void configureJGit() { // Configure JGit WindowCacheConfig cfg = new WindowCacheConfig(); cfg.setPackedGitWindowSize(settings.getFilesize(Keys.git.packedGitWindowSize, cfg.getPackedGitWindowSize())); cfg.setPackedGitLimit(settings.getFilesize(Keys.git.packedGitLimit, cfg.getPackedGitLimit())); cfg....
vuln
Safe
Java
EbmlElement * EbmlElement::FindNextElement(IOCallback & DataStream, const EbmlSemanticContext & Context, int & UpperLevel, uint64 MaxDataSize, bool AllowDummyElt, unsigned int MaxLowerLevel) { int PossibleID_Length = 0; binary PossibleIdNSize[16]; int PossibleSizeLength;...
vuln
Vulnerable
C/C++
/* * GPAC - Multimedia Framework C SDK * * Authors: Jean Le Feuvre * Copyright (c) Telecom ParisTech 2000-2012 * All rights reserved * * This file is part of GPAC / Media Tools sub-project * * GPAC is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser Gene...
vuln
Vulnerable
C/C++
void PaymentRequest::Init(mojom::PaymentRequestClientPtr client, std::vector<mojom::PaymentMethodDataPtr> method_data, mojom::PaymentDetailsPtr details, mojom::PaymentOptionsPtr options) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI);...
vuln
Vulnerable
C/C++
static int get_qcx(Jpeg2000DecoderContext *s, int n, Jpeg2000QuantStyle *q) { int i, x; if (s->buf_end - s->buf < 1) return AVERROR_INVALIDDATA; x = bytestream_get_byte(&s->buf); q->nguardbits = x >> 5; q->quantsty = x & 0x1f; if (q->quantsty == JPEG2000_QSTY_NONE) { n -= 3; ...
vuln
Vulnerable
C/C++
protected List<JFrogSecurityWarning> execute(ScanConfig.Builder inputFileBuilder, List<String> args) throws IOException, InterruptedException { if (!shouldExecute) { return List.of(); } Path outputTempDir = null; Path inputFile = null; try { outputTempDir ...
vuln
Safe
Java
static void buf_to_pages(const void *buf, size_t buflen, struct page **pages, unsigned int *pgbase) { const void *p = buf; *pgbase = offset_in_page(buf); p -= *pgbase; while (p < buf + buflen) { *(pages++) = virt_to_page(p); p += PAGE_CACHE_SIZE; } }
vuln
Vulnerable
C/C++
static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) { struct sockaddr_in6 *usin = (struct sockaddr_in6 *) uaddr; struct inet_sock *inet = inet_sk(sk); struct inet_connection_sock *icsk = inet_csk(sk); struct ipv6_pinfo *np = inet6_sk(sk); struct tcp_sock *tp = tcp_sk(sk); struct ...
vuln
Vulnerable
Unknown
/* * The copyright in this software is being made available under the 2-clauses * BSD License, included below. This software may be subject to other third * party and contributor rights, including patent rights, and no such rights * are granted under this license. * * Copyright (c) 2002-2014, Universite catholi...
vuln
Safe
C/C++
//////////////////////////////////////////////////////////////////////////// // **** WAVPACK **** // // Hybrid Lossless Wavefile Compressor // // Copyright (c) 1998 - 2016 David Bryant. // // ...
vuln
Safe
C/C++
void icp_pit_init(uint32_t base, qemu_irq *pic, int irq) { int iomemtype; icp_pit_state *s; s = (icp_pit_state *)qemu_mallocz(sizeof(icp_pit_state)); s->base = base; s->timer[0] = arm_timer_init(40000000, pic[irq]); s->timer[1] = arm_timer_init(1000000, pic[irq + 1]); s->timer[2] =...
vuln
Vulnerable
C/C++
pg_SSPI_recvauth(Port *port) { int mtype; StringInfoData buf; SECURITY_STATUS r; CredHandle sspicred; CtxtHandle *sspictx = NULL, newctx; TimeStamp expiry; ULONG contextattr; SecBufferDesc inbuf; SecBufferDesc outbuf; SecBuffer OutBuffers[1]; SecBuffer InBuffers[1]; HANDLE token; TOKEN_USER *tokenu...
vuln
Vulnerable
Unknown
private static void finishDataDelivery(Context context, int op, @NonNull AttributionSourceState attributionSourceState, boolean fromDatasource) { Objects.requireNonNull(attributionSourceState); AppOpsManager appOpsManager = context.getSystemService(AppOpsManager.class); ...
vuln
Vulnerable
Java
/* * Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy,...
vuln
Vulnerable
Java
int mbedtls_ecdsa_sign_det( mbedtls_ecp_group *grp, mbedtls_mpi *r, mbedtls_mpi *s, const mbedtls_mpi *d, const unsigned char *buf, size_t blen, mbedtls_md_type_t md_alg ) { ECDSA_VALIDATE_RET( grp != NULL ); ECDSA_VALIDATE_RET( r != NULL ); ECDSA_VALIDATE_R...
vuln
Vulnerable
C/C++
static int dynticks_start_timer(struct qemu_alarm_timer *t) { struct sigevent ev; timer_t host_timer; struct sigaction act; sigfillset(&act.sa_mask); act.sa_flags = 0; act.sa_handler = host_alarm_handler; sigaction(SIGALRM, &act, NULL); ev.sigev_value.sival_int = 0; ev.sigev_notify =...
vuln
Vulnerable
C/C++
def build_proxy_request(self, url_path): url = httpx.URL(url_path) assert self.blocks # Don't proxy a URL unless it's a URL specifically loaded by the user using # gr.load() to prevent SSRF or harvesting of HF tokens by malicious Spaces. is_safe_url = any( url.host ==...
vuln
Safe
Python
@Override public void setPlaybackRate(float rate) { log.v("setPlaybackRate"); if (assertPlayerIsNotNull("setPlaybackRate()")) { player.setPlaybackRate(rate); } }
vuln
Vulnerable
Java
private boolean makeAutoShuffleList() { try { Cursor cursor = CursorFactory.makeTrackCursor(this); if (cursor != null) { if (cursor.moveToFirst()) { mAutoShuffleList.clear(); do { long id = cursor.getLong(0); mAutoShuffleList.add(id); } while (cursor.moveToNext()); return tru...
vuln
Vulnerable
Java
isdn_ioctl(struct file *file, uint cmd, ulong arg) { uint minor = iminor(file_inode(file)); isdn_ctrl c; int drvidx; int ret; int i; char __user *p; char *s; union iocpar { char name[10]; char bname[22]; isdn_ioctl_struct iocts; isdn_net_ioctl_phone phone; isdn_net_ioctl_cfg cfg; } iocpar; void __us...
vuln
Safe
Unknown
@Override public void complete(ResponseInfo responseInfo, UploadSingleRequestMetrics metrics, JSONObject response) { if (metrics != null) { requestMetricsList.add(metrics); } if (checkCancelHandler.checkCancel()) { resp...
vuln
Safe
Java
bool WtsSessionProcessDelegate::Core::Initialize(uint32 session_id) { if (base::win::GetVersion() == base::win::VERSION_XP) launch_elevated_ = false; if (launch_elevated_) { process_exit_event_.Set(CreateEvent(NULL, TRUE, FALSE, NULL)); if (!process_exit_event_.IsValid()) { LOG(ERROR) << "F...
vuln
Vulnerable
C/C++
// Copyright (c) 2015-2021 MinIO, Inc. // // This file is part of MinIO Object Storage stack // // 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
Vulnerable
Go
static void ff_jref_idct1_add(uint8_t *dest, int line_size, DCTELEM *block) { uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; dest[0] = cm[dest[0] + ((block[0] + 4)>>3)]; }
vuln
Vulnerable
C/C++
import PromiseRouter from '../PromiseRouter'; import Config from '../Config'; import express from 'express'; import path from 'path'; import fs from 'fs'; import qs from 'querystring'; import { Parse } from 'parse/node'; const public_html = path.resolve(__dirname, '../../public_html'); const views = path.resolve(__dir...
vuln
Safe
JavaScript
static int u32_change(struct net *net, struct sk_buff *in_skb, struct tcf_proto *tp, unsigned long base, u32 handle, struct nlattr **tca, void **arg, u32 flags, struct netlink_ext_ack *extack) { struct tc_u_common *tp_c = tp->data; struct tc_u_hnode *ht; struct tc_u_knode *n; struct tc_u32_s...
vuln
Vulnerable
Unknown
static void alpha_cpu_realizefn(DeviceState *dev, Error **errp) { CPUState *cs = CPU(dev); AlphaCPUClass *acc = ALPHA_CPU_GET_CLASS(dev); qemu_init_vcpu(cs); acc->parent_realize(dev, errp); }
vuln
Safe
C/C++
private boolean handleJid(Invite invite) { List<Contact> contacts = xmppConnectionService.findContacts(invite.getJid(), invite.account); if (invite.isAction(XmppUri.ACTION_JOIN)) { Conversation muc = xmppConnectionService.findFirstMuc(invite.getJid()); if (muc != null) { switchToConversation(muc, invite.g...
vuln
Vulnerable
Java
static int ldb_dn_escape_internal(char *dst, const char *src, int len) { const char *p, *s; char *d; size_t l; p = s = src; d = dst; while (p - src < len) { p += strcspn(p, ",=\n\r+<>#;\\\" "); if (p - src == len) /* found no escapable chars *...
vuln
Vulnerable
Unknown
static int read_part_of_packet(AVFormatContext *s, int64_t *pts, int *len, int *strid, int read_packet) { AVIOContext *pb = s->pb; PVAContext *pvactx = s->priv_data; int syncword, streamid, reserved, flags, length, pts_flag; int64_t pva_pts = AV_NOPTS_VALUE, startpos; ...
vuln
Vulnerable
C/C++
static int avs_read_packet(AVFormatContext * s, AVPacket * pkt) { AvsFormat *avs = s->priv_data; int sub_type = 0, size = 0; AvsBlockType type = AVS_NONE; int palette_size = 0; uint8_t palette[4 + 3 * 256]; int ret; if (avs->remaining_audio_size > 0) if (avs_read_audio_packet(s, pkt)...
vuln
Vulnerable
C/C++
PS_READ_FUNC(mm) { PS_MM_DATA; ps_sd *sd; int ret = FAILURE; mm_lock(data->mm, MM_LOCK_RD); sd = ps_sd_lookup(data, key, 0); if (sd) { *vallen = sd->datalen; *val = emalloc(sd->datalen + 1); memcpy(*val, sd->data, sd->datalen); (*val)[sd->datalen] = '\0'; ret = SUCCESS; } mm_unlock(data->mm); ret...
vuln
Vulnerable
Unknown
static void llc_cmsg_rcv(struct msghdr *msg, struct sk_buff *skb) { struct llc_sock *llc = llc_sk(skb->sk); if (llc->cmsg_flags & LLC_CMSG_PKTINFO) { struct llc_pktinfo info; memset(&info, 0, sizeof(info)); info.lpi_ifindex = llc_sk(skb->sk)->dev->ifindex; llc_pdu_decode_dsap(skb, &info.lpi_sap); ll...
vuln
Safe
C/C++
function updateMyPeerName() { let myNewPeerName = myPeerNameSet.value; let myOldPeerName = myPeerName; // myNewPeerName empty if (!myNewPeerName) return; myPeerName = myNewPeerName; myVideoParagraph.innerHTML = myPeerName + ' (me)'; sendToServer('peerName', { room_id: roomId, ...
vuln
Vulnerable
JavaScript
from math import ceil from vyper.codegen.core import bytes_data_ptr, ensure_in_memory, get_bytearray_length from vyper.codegen.ir_node import IRnode from vyper.codegen.types import BaseType, ByteArrayLike, is_base_type from vyper.exceptions import CompilerPanic from vyper.utils import MemoryPositions, bytes_to_int, ke...
vuln
Safe
Python
public void trackRequest(String requestDescriptor, long requestId) { Preconditions.checkNotNull(requestDescriptor, "Attempting to track a null request descriptor."); if (!tracingEnabled) { return; } synchronized (lock) { List<Long> requestIds = ongoingRequests.ge...
vuln
Vulnerable
Java
struct omap_mmc_s *omap2_mmc_init(struct omap_target_agent_s *ta, BlockBackend *blk, qemu_irq irq, qemu_irq dma[], omap_clk fclk, omap_clk iclk) { struct omap_mmc_s *s = (struct omap_mmc_s *) g_malloc0(sizeof(struct omap_mmc_s)); s->irq = irq; s->dma = dma; s-...
vuln
Vulnerable
C/C++
public Collection<R> getAll(K key) { if (!valid) { synchronized (this) { if (!valid) { valid = true; indirectResultMap.clear(); reloadableCollection.get().forEach(result -> { ...
vuln
Vulnerable
Java
def subset_glyphs(self, s) -> bool: if etree is None: raise ImportError("No module named 'lxml', required to subset SVG") # glyph names (before subsetting) glyph_order: List[str] = s.orig_glyph_order # map from glyph names to original glyph indices rev_orig_glyph_map: Dict[str, int] = s.rev...
vuln
Vulnerable
Python
package io.swagger.client.api; import io.swagger.client.ApiException; import io.swagger.client.ApiClient; import io.swagger.client.ApiResponse; import io.swagger.client.Configuration; import io.swagger.client.Pair; import javax.ws.rs.core.GenericType; import java.io.File; import io.swagger.client.model.ModelApiRespo...
vuln
Safe
Java
static void ehci_opreg_write(void *ptr, target_phys_addr_t addr, uint64_t val, unsigned size) { EHCIState *s = ptr; uint32_t *mmio = s->opreg + (addr >> 2); uint32_t old = *mmio; int i; trace_usb_ehci_opreg_write(addr + OPREGBASE, addr2str(addr), val); switch (addr +...
vuln
Safe
C/C++
rgb16_32ToUV_half_c_template(uint8_t *dstU, uint8_t *dstV, const uint8_t *src, int width, enum PixelFormat origin, int shr, int shg, int shb, int shp, int maskr, int maskg, int maskb, ...
vuln
Safe
C/C++
def _on_load_finished(self, ok: bool) -> None: assert self._widget is not None if sip.isdeleted(self._widget): # https://github.com/qutebrowser/qutebrowser/issues/3498 return try: sess_manager = objreg.get('session-manager') except KeyError: ...
vuln
Safe
Python
function delete_organization(id, organization_name) { const delAPI = "../delete/organization/"+id; swal.queue([{ title: 'Are you sure you want to delete '+ htmlEncode(organization_name) +'?', text: "You won't be able to revert this!", type: 'warning', showCancelButton: true, ...
vuln
Safe
JavaScript
SYSCALL_DEFINE5(add_key, const char __user *, _type, const char __user *, _description, const void __user *, _payload, size_t, plen, key_serial_t, ringid) { key_ref_t keyring_ref, key_ref; char type[32], *description; void *payload; long ret; ret = -EINVAL; if (plen > 1024 * 1024 - 1) goto error; /* ...
vuln
Vulnerable
Unknown
static filter_rule *parse_rule_tok(const char **rulestr_ptr, const filter_rule *template, int xflags, const char **pat_ptr, unsigned int *pat_len_ptr) { const uchar *s = (const uchar *)*rulestr_ptr; filter_rule *rule; unsigned int len; if (template->rflags & FILTRULE_WORD_SPLIT) { /* Skip over any ...
vuln
Safe
Unknown
DwaCompressor::uncompress (const char *inPtr, int inSize, Imath::Box2i range, const char *&outPtr) { int minX = range.min.x; int maxX = std::min (range.max.x, _max[0]); int minY = range.min.y; int maxY = std::min (range.max.y, _max[1]); int headerSize = NUM_SIZES_SINGLE*sizeof(In...
vuln
Safe
Unknown
bool move_huge_pmd(struct vm_area_struct *vma, unsigned long old_addr, unsigned long new_addr, unsigned long old_end, pmd_t *old_pmd, pmd_t *new_pmd) { spinlock_t *old_ptl, *new_ptl; pmd_t pmd; struct mm_struct *mm = vma->vm_mm; bool force_flush = false; if ((old_addr & ~HPAGE_PMD_MASK) || (new_addr ...
vuln
Safe
Unknown
match(struct magic_set *ms, struct magic *magic, uint32_t nmagic, const unsigned char *s, size_t nbytes, size_t offset, int mode, int text, int flip, int recursion_level, int *returnval) { uint32_t magindex = 0; unsigned int cont_level = 0; int need_separator = 0; int returnvalv = 0, e; /* if a match is fou...
vuln
Safe
Unknown
private boolean isHeaderPresent(RequestContext req, ThrottleCondition.HeaderConditions conditions) { boolean status = true; Map<String, String> headers = req.getHeaders(); for (Map.Entry<String, String> entry : conditions.getValues().entrySet()) { if (headers != null) { ...
vuln
Vulnerable
Java
static int mxf_parse_structural_metadata(MXFContext *mxf) { MXFPackage *material_package = NULL; MXFPackage *temp_package = NULL; int i, j, k; av_dlog(mxf->fc, "metadata sets count %d\n", mxf->metadata_sets_count); for (i = 0; i < mxf->packages_count; i++) { material_package = mxf_resol...
vuln
Vulnerable
C/C++
@SuppressWarnings("restriction") @Override public void recycle(ByteBuffer theBuf) { if(theBuf == null) { return; } // if(!(theBuf instanceof sun.nio.ch.DirectBuffer)){ theBuf.clear(); return; } final long size = theBuf.capacity(); boolean recycled = false; ...
vuln
Safe
Java
static void Ins_MIRP( INS_ARG ) { Int point, cvtEntry; TT_F26Dot6 cvt_dist, distance, cur_dist, org_dist; point = (Int)args[0]; cvtEntry = (Int)args[1]; /* XXX: UNDOCUMENTED! cvt[-1] = 0 always */ if ( BOUNDS( arg...
vuln
Safe
Unknown
void BluetoothDeviceChromeOS::RejectPairing() { if (!pairing_context_.get()) return; pairing_context_->RejectPairing(); }
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
@Override public List<ItemStack> getCurativeItems() { return (this == ModEffects.neonatal || this == ModEffects.disguise_as_vampire) ? Collections.emptyList() : super.getCurativeItems(); }
vuln
Vulnerable
Java
@Override public void readExternal(DataInput in) throws IOException { m_oResult = (T) ExternalizableHelper.readObject(in); Binary binEx = new Binary(in); // start version 2 format processing try { // when 2nd field is non-null, deserializ...
vuln
Safe
Java
void vnc_flush(VncState *vs) { if (vs->output.offset) vnc_client_write(vs); }
vuln
Vulnerable
C/C++
static int unpack_block_qpis(Vp3DecodeContext *s, GetBitContext *gb) { int qpi, i, j, bit, run_length, blocks_decoded, num_blocks_at_qpi; int num_blocks = s->total_num_coded_frags; for (qpi = 0; qpi < s->nqps-1 && num_blocks > 0; qpi++) { i = blocks_decoded = num_blocks_at_qpi = 0; bit = get...
vuln
Vulnerable
C/C++
OMX_ERRORTYPE SoftRaw::internalSetParameter( OMX_INDEXTYPE index, const OMX_PTR params) { switch (index) { case OMX_IndexParamStandardComponentRole: { const OMX_PARAM_COMPONENTROLETYPE *roleParams = (const OMX_PARAM_COMPONENTROLETYPE *)params; if (strncmp((const ...
vuln
Vulnerable
C/C++
int vp8_decode_frame(VP8D_COMP *pbi) { vp8_reader *const bc = &pbi->mbc[8]; VP8_COMMON *const pc = &pbi->common; MACROBLOCKD *const xd = &pbi->mb; const unsigned char *data = pbi->fragments.ptrs[0]; const unsigned int data_sz = pbi->fragments.sizes[0]; const unsigned char *data_end = data + data_sz; ptrdi...
vuln
Safe
C/C++
/******************************************************************************* * This file is part of OpenNMS(R). * * Copyright (C) 2009-2014 The OpenNMS Group, Inc. * OpenNMS(R) is Copyright (C) 1999-2014 The OpenNMS Group, Inc. * * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. * * OpenNMS(...
vuln
Vulnerable
Java
Opal::Call::parse_info (OpalConnection & connection) { char start_special_chars [] = "$"; char end_special_chars [] = "([;="; std::string l_party_name; std::string r_party_name; std::string app; if (!PIsDescendant(&connection, OpalPCSSConnection)) { remote_uri = (const char *) connection.GetRemoteP...
vuln
Vulnerable
Unknown
public @Nullable ConversationMessage getItem(int position) { position = isTypingViewEnabled() ? position - 1 : position; if (position == -1) { return null; } else if (position < fastRecords.size()) { return fastRecords.get(position); } else { int correctedPosition = position - fastRec...
vuln
Vulnerable
Java
@Override public void callSessionUpdateReceived(ImsCallProfile profile) { TelephonyUtils.runWithCleanCallingIdentity(()-> { if (mListener != null) { mListener.callSessionUpdateReceived(ImsCallSession.this, profile); } }, mListenerExecut...
vuln
Safe
Java
static void cpu_class_init(ObjectClass *oc, void *data) { SCLPEventClass *k = SCLP_EVENT_CLASS(oc); DeviceClass *dc = DEVICE_CLASS(oc); k->get_send_mask = send_mask; k->get_receive_mask = receive_mask; k->read_event_data = read_event_data; set_bit(DEVICE_CATEGORY_MISC, dc->categories); ...
vuln
Safe
C/C++
float CLASS find_green (int bps, int bite, int off0, int off1) { UINT64 bitbuf=0; int vbits, col, i, c; ushort img[2][2064]; double sum[]={0,0}; FORC(2) { fseek (ifp, c ? off1:off0, SEEK_SET); for (vbits=col=0; col < width; col++) { for (vbits -= bps; vbits < 0; vbits += bite) { bitbuf <<= bit...
vuln
Vulnerable
Unknown
ProcessStartupPacket(Port *port, bool SSLdone) { int32 len; void *buf; ProtocolVersion proto; MemoryContext oldcontext; pq_startmsgread(); if (pq_getbytes((char *) &len, 4) == EOF) { /* * EOF after SSLdone probably means the client didn't like our * response to NEGOTIATE_SSL_CODE. That's not an err...
vuln
Safe
Unknown
static void init_mbr(BDRVVVFATState* s) { mbr_t* real_mbr=(mbr_t*)s->first_sectors; partition_t* partition = &(real_mbr->partition[0]); int lba; memset(s->first_sectors,0,512); real_mbr->nt_id= cpu_to_le32(0xbe1afdfa); partition->attributes=0x80; lba = sector2CHS(s->bs, &part...
vuln
Safe
C/C++
func (m *Value) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowStruct } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire ...
vuln
Safe
Go
def build_path(root_dir, path): absolute_path = Path(root_dir) / path if ".." in absolute_path.parts: raise ValueError(f"Attempted directory traversal: {path}") return absolute_path
vuln
Safe
Python
/* * 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
Vulnerable
Java
static void tm_reclaim_thread(struct thread_struct *thr, struct thread_info *ti, uint8_t cause) { unsigned long msr_diff = 0; /* * If FP/VSX registers have been already saved to the * thread_struct, move them to the transact_fp array. * We clear the TIF_RESTORE_TM bit since after the reclaim * the t...
vuln
Safe
C/C++
static char *load_text_file(const char *path, unsigned flags) { FILE *fp = fopen(path, "r"); if (!fp) { if (!(flags & DD_FAIL_QUIETLY_ENOENT)) perror_msg("Can't open file '%s'", path); return (flags & DD_LOAD_TEXT_RETURN_NULL_ON_FAILURE ? NULL : xstrdup("")); } struct st...
vuln
Vulnerable
Unknown
typeset(const char *var, uint32_t set, uint32_t clr, int field, int base) { struct tbl *vp; struct tbl *vpbase, *t; char *tvar; const char *val; size_t len; bool vappend = false; enum namerefflag new_refflag = SRF_NOP; if ((set & (ARRAY | ASSOC)) == ASSOC) { new_refflag = SRF_ENABLE; set &= ~(ARRAY | ASSOC...
vuln
Safe
Unknown
key.verify = function(digest, signature, scheme) { if(typeof scheme === 'string') { scheme = scheme.toUpperCase(); } else if(scheme === undefined) { scheme = 'RSASSA-PKCS1-V1_5'; } if(scheme === 'RSASSA-PKCS1-V1_5') { scheme = { verify: function(digest, d) { // remov...
vuln
Vulnerable
JavaScript
static int vmdk_init_tables(BlockDriverState *bs, VmdkExtent *extent, Error **errp) { int ret; int l1_size, i; l1_size = extent->l1_size * sizeof(uint32_t); extent->l1_table = g_try_malloc(l1_size); if (l1_size && extent->l1_table == NULL) { return -ENOMEM; ...
vuln
Vulnerable
C/C++
private void validate(Node copy) throws SAXException, IOException { SchemaFactory schemaFactory = SchemaFactory.newInstance(schemaLanguage); Schema schema = schemaFactory.newSchema(schemaFile); Validator validator = schema.newValidator(); validator.setErrorHandler(new ErrorHandler() { ...
vuln
Vulnerable
Java
static int blkverify_open(BlockDriverState *bs, QDict *options, int flags, Error **errp) { BDRVBlkverifyState *s = bs->opaque; QemuOpts *opts; Error *local_err = NULL; int ret; opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort); qemu_opts_absorb_qdict(opts, o...
vuln
Vulnerable
C/C++
static int kvm_vm_ioctl_set_pit(struct kvm *kvm, struct kvm_pit_state *ps) { mutex_lock(&kvm->arch.vpit->pit_state.lock); memcpy(&kvm->arch.vpit->pit_state, ps, sizeof(struct kvm_pit_state)); kvm_pit_load_count(kvm, 0, ps->channels[0].count, 0); mutex_unlock(&kvm->arch.vpit->pit_state.lock); return 0; }
vuln
Vulnerable
C/C++
@Override public void complete(ScanRequest request, ScanResults results) throws MachinaException { try { ObjectMapper mapper = new ObjectMapper(); mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); if (request != null && results != null) { map...
vuln
Safe
Java
int kvm_log_start(target_phys_addr_t phys_addr, ram_addr_t size) { return kvm_dirty_pages_log_change(phys_addr, size, KVM_MEM_LOG_DIRTY_PAGES, KVM_MEM_LOG_DIRTY_PAGES); }
vuln
Safe
C/C++
@Override public void onDestroy() { super.onDestroy(); serviceInstance = null; unregisterReceiver(); }
vuln
Safe
Java
@SuppressWarnings("unchecked") @Nullable private static <T extends Throwable> T cloneException(T exception) { try { return (T) SerializationUtils.deserialize(SerializationUtils.serialize(exception)); } catch (Exception ex) { return null; // exception parameter cannot be cloned } }
vuln
Vulnerable
Java
http.withinCookieDomain = function(url, cookie) { var rval = false; // cookie may be null, a cookie object, or a domain string var domain = (cookie === null || typeof cookie === 'string') ? cookie : cookie.domain; // any domain will do if(domain === null) { rval = true; } else if(domain.charAt(0) ...
vuln
Safe
JavaScript
private void checkPermissions(@Nullable Intent intent, @Nullable ActivityInfo aInfo, @Nullable WindowProcessController callerApp, ActivityTaskSupervisor supervisor, ActivityOptions options, int callingPid, int callingUid) { // If a launch task id is specified, then ensure that the caller...
vuln
Vulnerable
Java
static int ovl_copy_up_locked(struct dentry *workdir, struct dentry *upperdir, struct dentry *dentry, struct path *lowerpath, struct kstat *stat, struct iattr *attr, const char *link) { struct inode *wdir = workdir->d_inode; struct inode *udir = upperdir->d_inode; struct dentry *newdentry ...
vuln
Vulnerable
C/C++
void show_ip(struct pt_regs *regs, const char *loglvl) { #ifdef CONFIG_X86_32 printk("%sEIP: %pS\n", loglvl, (void *)regs->ip); #else printk("%sRIP: %04x:%pS\n", loglvl, (int)regs->cs, (void *)regs->ip); #endif show_opcodes((u8 *)regs->ip, loglvl); }
vuln
Vulnerable
Unknown
@mod.route('/edit/<int:cmt_id>', methods=['GET', 'POST']) def edit(cmt_id): m = None if request.method == 'GET': cursor.execute("SELECT * FROM comment where cmt_id = %s;", (cmt_id,)) m = cursor.fetchone() return render_template('comment/edit.html', m=m, cmt_id=cmt_id) if request.met...
vuln
Safe
Python
public static ResourceLocation getOverrideTexture(UUID owner, Pair<String, String> pair) { String type = pair.getFirst(); if (type == null) return null; type = type.toLowerCase(); return switch (type) { case "skin", "cape", "elytra" -> { if (Mine...
vuln
Vulnerable
Java