code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
mobility_opt_print(netdissect_options *ndo, const u_char *bp, const unsigned len) { unsigned i, optlen; for (i = 0; i < len; i += optlen) { ND_TCHECK(bp[i]); if (bp[i] == IP6MOPT_PAD1) optlen = 1; else { if (i + 1 < len) { ND_TCHECK(bp[i + 1]); optlen = bp[i + 1] + 2; } e...
vuln
Safe
C/C++
static struct sk_buff *macsec_encrypt(struct sk_buff *skb, struct net_device *dev) { int ret; struct scatterlist *sg; unsigned char *iv; struct ethhdr *eth; struct macsec_eth_header *hh; size_t unprotected_len; struct aead_request *req; struct macsec_secy *secy; struct macsec_tx_sc *tx_sc; struct ma...
vuln
Vulnerable
Unknown
query_get (struct query *z, iopause_fd *x, struct taia *stamp) { switch (dns_transmit_get (&z->dt, x, stamp)) { case 1: return doit (z, 1); case -1: return doit (z, -1); } return 0; }
vuln
Vulnerable
Unknown
parse_exp(Node** np, PToken* tok, int term, UChar** src, UChar* end, ScanEnv* env, int group_head) { int r, len, group = 0; Node* qn; Node** tp; *np = NULL; if (tok->type == (enum TokenSyms )term) goto end_of_token; switch (tok->type) { case TK_ALT: case TK_EOT: end_of_token: *np =...
vuln
Vulnerable
C/C++
// Copyright 2022 PingCAP, 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 i...
vuln
Safe
Go
function resolveAppInfo (appInfo, refresh) { if (!appInfo || typeof appInfo !== 'string') { return appInfo; } if (/^git:/i.test(appInfo)) { const splitted = appInfo.split(':'); const baseUrl = process.env.FOXX_BASE_URL || 'https://github.com/'; return {source: `${baseUrl}${splitted[1]}/archive/${s...
vuln
Safe
JavaScript
/* * MOV, 3GP, MP4 muxer * Copyright (c) 2003 Thomas Raivio * Copyright (c) 2004 Gildas Bazin <gbazin at videolan dot org> * Copyright (c) 2009 Baptiste Coudurier <baptiste dot coudurier at gmail dot com> * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it u...
vuln
Safe
C/C++
public void setSLAManager(Boolean value) { setBooleanAttribute("gluuSLAManager", value); }
vuln
Safe
Java
int qemu_set_fd_handler2(int fd, IOCanReadHandler *fd_read_poll, IOHandler *fd_read, IOHandler *fd_write, void *opaque) { IOHandlerRecord *ioh; assert(fd >= 0); if (!fd_read && !fd_write) { QLIST_FORE...
vuln
Safe
C/C++
static void spapr_cpu_reset(void *opaque) { PowerPCCPU *cpu = opaque; CPUState *cs = CPU(cpu); CPUPPCState *env = &cpu->env; cpu_reset(cs); cs->halted = 1; env->spr[SPR_HIOR] = 0; env->external_htab = (uint8_t *)spapr->htab; if (kvm_enabled() && !env->external_htab) { ...
vuln
Vulnerable
C/C++
function stringEscape(s) { function hex(ch) { return ch.charCodeAt(0).toString(16).toUpperCase(); } return s .replace(/\\/g, '\\\\') .replace(/"/g, '\\"') .replace(/\x08/g, '\\b') .replace(/\t/g, '\\t') .replace(/\n/g, '\\n') ...
vuln
Vulnerable
JavaScript
int url_is_local_not_ssh(const char *url) { const char *colon = strchr(url, ':'); const char *slash = strchr(url, '/'); return !colon || (slash && slash < colon) || (has_dos_drive_prefix(url) && is_valid_path(url)); }
vuln
Safe
C/C++
public void onClick(EntityPlayer player, boolean rightClick, BlockPos pos, ItemStack stack) { if (rightClick) { stack.getTagCompound().setIntArray("pos2", new int[] { pos.getX(), pos.getY(), pos.getZ() }); if (!player.world.isRemote) player.sendMessage(new TextComponentTr...
vuln
Vulnerable
Java
def _validate_for_predict(self, X): check_is_fitted(self) if not callable(self.kernel): X = self._validate_data( X, accept_sparse="csr", dtype=np.float64, order="C", accept_large_sparse=False, re...
vuln
Safe
Python
@Override public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception { final String channelId = ctx.channel().id().asLongText(); LOGGER.warn("{} Unexpected exception from downstream. {}", channelId, cause); ctx.channel().close(); }
vuln
Vulnerable
Java
static int qcow2_save_vmstate(BlockDriverState *bs, QEMUIOVector *qiov, int64_t pos) { BDRVQcowState *s = bs->opaque; int64_t total_sectors = bs->total_sectors; int growable = bs->growable; bool zero_beyond_eof = bs->zero_beyond_eof; int ret; BLKDBG_EVENT(bs->file, ...
vuln
Safe
C/C++
static int kvm_has_msr_star(CPUState *env) { static int has_msr_star; int ret; if (has_msr_star == 0) { struct kvm_msr_list msr_list, *kvm_msr_list; has_msr_star = -1; msr_list.nmsrs = 0; ret = kvm_ioctl(env->kvm_state, KVM_GET_MSR_INDEX_LIST, &msr_list)...
vuln
Vulnerable
C/C++
void do_subfeo (void) { T2 = T0; T0 = T1 + ~T0 + xer_ca; if (likely(!((~T2 ^ T1 ^ (-1)) & (~T2 ^ T0) & (1 << 31)))) { xer_ov = 0; } else { xer_so = 1; xer_ov = 1; } if (likely(T0 >= T1 && (xer_ca == 0 || T0 != T1))) { xer_ca = 0; } else { xer_ca = 1; ...
vuln
Vulnerable
C/C++
def get_view(db, options = {}, fetch_data = false) if !fetch_data && @report_data_additional_options.nil? process_show_list_options(options, db) end unless @edit.nil? object_ids = @edit[:object_ids] unless @edit[:object_ids].nil? object_ids = @edit[:pol_items] unless @edit[:pol_items].nil?...
vuln
Safe
Ruby
@EventHandler private void onReceivePacket(PacketEvent.Receive event) { if (!totemPops.get()) return; if (!(event.packet instanceof EntityStatusS2CPacket)) return; EntityStatusS2CPacket p = (EntityStatusS2CPacket) event.packet; if (p.getStatus() != 35) return; Entity entity...
vuln
Safe
Java
public static void reloadWorld(ServerPlayerEntity player) { player.server.execute(() -> { PolymerSyncUtils.synchronizePolymerRegistries(player.networkHandler); player.networkHandler.sendPacket(new InventoryS2CPacket(0, 0, player.playerScreenHandler.getStacks(), player.playerScreenHandler...
vuln
Vulnerable
Java
protected Element getRootElement(File f) { try { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); Document dom = db.parse(f); return dom.getDocumentElement(); } catch (Par...
vuln
Vulnerable
Java
function thenify(fn, options) { assert(typeof fn === 'function') return createWrapper(fn, options) }
vuln
Safe
JavaScript
int RAND_DRBG_generate(RAND_DRBG *drbg, unsigned char *out, size_t outlen, int prediction_resistance, const unsigned char *adin, size_t adinlen) { int fork_id; int reseed_required = 0; if (drbg->state != DRBG_READY) { /* try to recover from previous err...
vuln
Safe
Unknown
read_32 (IOBUF inp) { unsigned long a; a = iobuf_get_noeof (inp) << 24; a |= iobuf_get_noeof (inp) << 16; a |= iobuf_get_noeof (inp) << 8; a |= iobuf_get_noeof (inp); return a; }
vuln
Vulnerable
Unknown
def _create_3par_iscsi_host(self, hostname, iscsi_iqn, domain, persona_id): """Create a 3PAR host. Create a 3PAR host, if there is already a host on the 3par using the same iqn but with a different hostname, return the hostname used by 3PAR. """ cmd = ['createhost', '-is...
vuln
Safe
Python
package service import ( "context" "fmt" "net" "net/netip" "strings" "time" "github.com/go-errors/errors" grpc_auth "github.com/grpc-ecosystem/go-grpc-middleware/auth" "github.com/openfga/openfga/pkg/encoder" "github.com/openfga/openfga/pkg/encrypter" "github.com/openfga/openfga/pkg/logger" "github.com/op...
vuln
Safe
Go
private void registerAppInstallReceiver() { // Here we handle the completion of the silent app installation in the device owner mode // These intents are not delivered to LocalBroadcastManager if (appInstallReceiver == null) { appInstallReceiver = new BroadcastReceiver() { ...
vuln
Safe
Java
static int idcin_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; IdcinContext *s = avctx->priv_data; const uint8_t *pal = av_packet_get_side_data(a...
vuln
Safe
C/C++
/** * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse....
vuln
Vulnerable
Java
@Override protected void onCreate(Bundle savedInstanceState) { ((NewsReaderApplication) getApplication()).getAppComponent().injectActivity(this); super.onCreate(savedInstanceState); binding = ActivityNewsDetailBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); /* //make full transp...
vuln
Safe
Java
t1_parse_font_matrix( T1_Face face, T1_Loader loader ) { T1_Parser parser = &loader->parser; FT_Matrix* matrix = &face->type1.font_matrix; FT_Vector* offset = &face->type1.font_offset; FT_Face root = (FT_Face)&face->root; FT_Fixed temp[6]; FT_Fixed t...
vuln
Vulnerable
Unknown
@Override protected XrootdResponse<MvRequest> doOnMv(ChannelHandlerContext ctx, MvRequest req) throws XrootdException { String sourcePath = req.getSourcePath(); if (sourcePath.isEmpty()) { throw new XrootdException(kXR_ArgMissing, "no source path specified"); } ...
vuln
Safe
Java
//------------------------------------------------------------------------------ // Copyright (c) 2011-2012 by European Organization for Nuclear Research (CERN) // Author: Lukasz Janyst <ljanyst@cern.ch> //------------------------------------------------------------------------------ // XRootD is free software: you can...
vuln
Vulnerable
C/C++
GuestMemoryBlockList *qmp_guest_get_memory_blocks(Error **errp) { GuestMemoryBlockList *head, **link; Error *local_err = NULL; struct dirent *de; DIR *dp; head = NULL; link = &head; dp = opendir("/sys/devices/system/memory/"); if (!dp) { error_setg_errno(errp, errno, "Can't open ...
vuln
Vulnerable
C/C++
static av_cold int v4l2_decode_init(AVCodecContext *avctx) { V4L2Context *capture, *output; V4L2m2mContext *s; int ret; ret = ff_v4l2_m2m_create_context(avctx, &s); if (ret < 0) return ret; capture = &s->capture; output = &s->output; output->height = capture->height = avctx-...
vuln
Safe
C/C++
send(mail, done) { // Sendmail strips this header line by itself mail.message.keepBcc = true; let envelope = mail.data.envelope || mail.message.getEnvelope(); let messageId = mail.message.messageId(); let args; let sendmail; let returned; let transform; ...
vuln
Vulnerable
JavaScript
import os import platform import re import sys from django.contrib.messages import constants as messages import django.forms from nautobot import __version__ from nautobot.core.settings_funcs import is_truthy, parse_redis_connection # noqa: F401 # # Environment setup # # This is used for display in the UI. VERSION...
vuln
Safe
Python
@Override public String prepareStagingFile() { final var name = prepareGcsStagingFile(); gcsStagingFiles.add(name); final var blobId = BlobId.of(gcsConfig.getBucketName(), name); final var blobInfo = BlobInfo.newBuilder(blobId).build(); final var blob = storageClient.create(blobInfo); final va...
vuln
Vulnerable
Java
func TestSkipUnknownTypeBinaryProtocol(t *testing.T) { var m MyTestStruct d := NewDeserializer() f := NewBinaryProtocolFactoryDefault() d.Protocol = f.GetProtocol(d.Transport) // skip over a map with invalid key/value type and ~550M entries data := make([]byte, 1100000000) copy(data[:], []byte("\n\x10\rO\t6\x03\...
vuln
Safe
Go
xps_parse_color(xps_document *doc, char *base_uri, char *string, fz_colorspace **csp, float *samples) { char *p; int i, n; char buf[1024]; char *profile; *csp = fz_device_rgb(doc->ctx); samples[0] = 1; samples[1] = 0; samples[3] = 0; if (str...
vuln
Vulnerable
Unknown
ProcXSendExtensionEvent(ClientPtr client) { int ret; DeviceIntPtr dev; xEvent *first; XEventClass *list; struct tmask tmp[EMASKSIZE]; REQUEST(xSendExtensionEventReq); REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq); if (stuff->length != bytes_to_int32(sizeof(xSendExtensionEve...
vuln
Vulnerable
Unknown
def fromstring(*args, **kwargs): """ Helper func to provide easy access to the (possibly) moving target that is C{ET}. """ global ET _bootstrap() return ET.fromstring(*args, **kwargs)
vuln
Vulnerable
Python
me.urls2links = function(element) { element.html( DOMPurify.sanitize( element.html().replace( /(((https?|ftp):\/\/[\w?!=&.\/-;#@~%+*-]+(?![\w\s?!&.\/;#~%"=-]>))|((magnet):[\w?=&.\/-;#@~%+*-]+))/ig, '<a href="$1" rel=...
vuln
Safe
JavaScript
static int parse_next_header(struct message_parser_ctx *ctx, struct message_block *block_r) { struct message_part *part = ctx->part; struct message_header_line *hdr; struct message_boundary *boundary; bool full; int ret; if ((ret = message_parser_read_more(ctx, block_r, &full)) == 0) return ret; if (...
vuln
Vulnerable
Unknown
static int sas_get_port_device(struct asd_sas_port *port) { struct asd_sas_phy *phy; struct sas_rphy *rphy; struct domain_device *dev; int rc = -ENODEV; dev = sas_alloc_device(); if (!dev) return -ENOMEM; spin_lock_irq(&port->phy_list_lock); if (list_empty(&port->phy_list)) { spin_unlock_irq(&port->phy_li...
vuln
Vulnerable
C/C++
""" Copyright 2006-2009, Red Hat, Inc and Others Michael DeHaan <michael.dehaan AT gmail> 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 late...
vuln
Safe
Python
asocket* find_local_socket(unsigned local_id, unsigned peer_id) { asocket* s; asocket* result = NULL; std::lock_guard<std::recursive_mutex> lock(local_socket_list_lock); for (s = local_socket_list.next; s != &local_socket_list; s = s->next) { if (s->id != local_id) { continue...
vuln
Safe
C/C++
public function show($image_name) { $imageFile = storage_path('app/'.str_replace("-","/",$image_name)); if(!is_file($imageFile)){ abort(404); } $image = Image::make($imageFile); if(config('tipask.upload.open_watermark') && $image_name != config('tipask.upload...
vuln
Vulnerable
PHP
static int vp5_parse_header(VP56Context *s, const uint8_t *buf, int buf_size) { VP56RangeCoder *c = &s->c; int rows, cols; int ret; ret = ff_vp56_init_range_decoder(&s->c, buf, buf_size); if (ret < 0) return ret; s->frames[VP56_FRAME_CURRENT]->key_frame = !vp56_rac_get(c); vp56_rac_g...
vuln
Safe
C/C++
void doPublicKeyAuth() { try { final byte[] msg = generateAuthenticationRequest(generateSignatureData()); transport.postMessage(new AuthenticationMessage(username, "ssh-connection", "publickey") { @Override public boolean writeMessageIntoBuffer(ByteBuffer buf) { super.writeMessageIntoBuff...
vuln
Vulnerable
Java
static void nhmldump_send_frame(GF_NHMLDumpCtx *ctx, char *data, u32 data_size, GF_FilterPacket *pck) { GF_FilterPacket *dst_pck; char nhml[1024]; const GF_PropertyValue *p; u32 size; u8 *output; GF_FilterSAPType sap = gf_filter_pck_get_sap(pck); u64 dts = gf_filter_pck_get_dts(pck); u64 cts = gf_filter_pck_get...
vuln
Vulnerable
C/C++
const protocols = require("protocols") /** * parsePath * Parses the input url. * * @name parsePath * @function * @param {String} url The input url. * @return {Object} An object containing the following fields: * * - `protocols` (Array): An array with the url protocols (usually it has one element). * - `pro...
vuln
Safe
JavaScript
void mp_encode_lua_table_as_map(lua_State *L, mp_buf *buf, int level) { size_t len = 0; /* First step: count keys into table. No other way to do it with the * Lua API, we need to iterate a first time. Note that an alternative * would be to do a single run, and then hack the buffer to insert the ...
vuln
Vulnerable
C/C++
// SPDX-License-Identifier: GPL-2.0+ /* * (C) Copyright 2000, 2001 * Rich Ireland, Enterasys Networks, rireland@enterasys.com. */ /* * FPGA support */ #include <common.h> #include <command.h> #include <env.h> #include <fpga.h> #include <fs.h> #include <gzip.h> #include <image.h> #include <log.h> #include <malloc...
vuln
Safe
C/C++
/* Copyright 2019 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 ...
vuln
Vulnerable
C/C++
int stun_parse_attribute(stun_msg_t *msg, unsigned char *p, size_t left_len) { int len; uint16_t attr_type; stun_attr_t *attr, *next; attr_type = get16(p, 0); len = get16(p, 2); if ((left_len - 4) < len) // make sure we have enough space for attribute { SU_DEBUG_3(("%s: Error STUN attr len is too bi...
vuln
Safe
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 / ISO Media File Format sub-project * * GPAC is free software; you can redistribute it and/or modify * it under the terms of the GNU L...
vuln
Vulnerable
C/C++
/* * Copyright (C) 2005-2020 ManyDesigns srl. All rights reserved. * http://www.manydesigns.com/ * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 3 of * the License, or (a...
vuln
Safe
Java
ImagingFliDecode(Imaging im, ImagingCodecState state, UINT8* buf, int bytes) { UINT8* ptr; int framesize; int c, chunks; int l, lines; int i, j, x = 0, y, ymax; /* If not even the chunk size is present, we'd better leave */ if (bytes < 4) return 0; /* We don't decode anything unless ...
vuln
Vulnerable
C/C++
// Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite/handler/oauth2 (interfaces: TokenRevocationStorage) // Package internal is a generated GoMock package. package internal import ( context "context" reflect "reflect" gomock "github.com/golang/mock/gomock" fosite "github.com/ory/fosite" )...
vuln
Vulnerable
Go
int snmp_engine_get_bulk(snmp_header_t *header, snmp_varbind_t *varbinds, uint32_t *varbinds_length) { snmp_mib_resource_t *resource; uint32_t i, j, original_varbinds_length; uint32_t oid[SNMP_MAX_NR_VALUES][SNMP_MSG_OID_MAX_LEN]; uint8_t repeater; /* * A local copy of the requested oids must be kept sinc...
vuln
Vulnerable
C/C++
import { NIL, getDomainName } from './helpers'; import toObject from './toObject'; /*globals URL*/ const _parse_url_exp = new RegExp([ '^([\\w.+\\-\\*]+:)//' // protocol , '(([^:/?#]*)(?::([^/?#]*))?@|)' // username:password , '(([^:/?#]*)(?::(\\d+))?)' // host == hostname:port , '(/[^?#...
vuln
Vulnerable
JavaScript
int ff_alloc_entries(AVCodecContext *avctx, int count) { int i; if (avctx->active_thread_type & FF_THREAD_SLICE) { SliceThreadContext *p = avctx->internal->thread_ctx; p->thread_count = avctx->thread_count; p->entries = av_mallocz_array(count, sizeof(int)); if (!p->entrie...
vuln
Vulnerable
C/C++
void DevToolsWindow::InspectedContentsClosing() { web_contents_->GetRenderViewHost()->ClosePage(); }
vuln
Vulnerable
Unknown
static int raw_decode(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt); RawVideoContext *context = avctx->priv_data; const uint8_t *buf = avpkt->data; int buf_size ...
vuln
Vulnerable
C/C++
rfbClientConnectionGone(rfbClientPtr cl) { #ifdef LIBVNCSERVER_HAVE_LIBJPEG int i; #endif LOCK(rfbClientListMutex); if (cl->prev) cl->prev->next = cl->next; else cl->screen->clientHead = cl->next; if (cl->next) cl->next->prev = cl->prev; if(cl->sock>0) close(cl->sock)...
vuln
Safe
Unknown
static Jsi_RC jsi_ArrayForeachCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,Jsi_Value **ret, Jsi_Func *funcPtr) { if (_this->vt != JSI_VT_OBJECT || !Jsi_ObjIsArray(interp, _this->d.obj)) return Jsi_LogError("expected array object"); Jsi_Obj *obj; uint i; Jsi_Value *func, *vpargs; ...
vuln
Safe
C/C++
JsVar *jswrap_json_stringify(JsVar *v, JsVar *replacer, JsVar *space) { NOT_USED(replacer); JSONFlags flags = JSON_IGNORE_FUNCTIONS|JSON_NO_UNDEFINED|JSON_ARRAYBUFFER_AS_ARRAY|JSON_JSON_COMPATIBILE|JSON_ALLOW_TOJSON; JsVar *result = jsvNewFromEmptyString(); if (result) {// could be out of memory char whites...
vuln
Vulnerable
C/C++
unsigned int GetU32BE (int nPos, bool *pbSuccess) { //*pbSuccess = true; if ( nPos < 0 || nPos + 3 >= m_nLen ) { *pbSuccess = false; return 0; } unsigned int nRes = m_sFile[nPos]; nRes = (nRes << 8) + m_sFil...
vuln
Vulnerable
C/C++
int32 CommandBufferProxyImpl::RegisterTransferBuffer( base::SharedMemory* shared_memory, size_t size, int32 id_request) { if (last_state_.error != gpu::error::kNoError) return -1; int32 id; if (!Send(new GpuCommandBufferMsg_RegisterTransferBuffer( route_id_, shared_memory->handl...
vuln
Vulnerable
C/C++
public static void onPlayerLeave(ServerPlayerEntity player) { if(((PlayerAuth) player).canSkipAuth()) return; String uuid = ((PlayerAuth) player).getFakeUuid(); PlayerCache playerCache = playerCacheMap.get(uuid); if(playerCache.isAuthenticated) { playerCache.last...
vuln
Vulnerable
Java
public String decode(byte[] data, int off, int len) { StringBuilder sb = new StringBuilder(); for(int i = 0; i < len;) { short sequence; String replacement; log.debug("data[" + (off + i) + "]: " + "0x" + Util.toHexStringBE(data[off + i])); ...
vuln
Vulnerable
Java
CPError CPB_GetCommandLineArgumentsCommon(const char* url, std::string* arguments) { const CommandLine cmd = *CommandLine::ForCurrentProcess(); std::wstring arguments_w; std::wstring user_data_dir = cmd.GetSwitchValue(switches::kUserDataDir); if (!user_data_dir.empty()...
vuln
Vulnerable
C/C++
CURLFORMcode FormAdd(struct curl_httppost **httppost, struct curl_httppost **last_post, va_list params) { FormInfo *first_form, *current_form, *form = NULL; CURLFORMcode return_value = CURL_FORMADD_OK; const char *prevtype = NULL; struct curl_httppost *post = NULL; CU...
vuln
Safe
Unknown
/*! 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.web.admin; import com.rebuild.core.Application; import...
vuln
Safe
Java
status_t MediaPlayer::setDataSource(const sp<IStreamSource> &source) { ALOGV("setDataSource"); status_t err = UNKNOWN_ERROR; const sp<IMediaPlayerService> service(getMediaPlayerService()); if (service != 0) { sp<IMediaPlayer> player(service->create(this, mAudioSessionId)); if ((NO...
vuln
Safe
C/C++
public static AlertDialog createAccountSelectDialog(Activity parentActivity, final AccountSelectDelegate delegate) { if (UserConfig.getActivatedAccountsCount() < 2) { return null; } AlertDialog.Builder builder = new AlertDialog.Builder(parentActivity); final Runnable dismiss...
vuln
Vulnerable
Java
static int snd_ctl_elem_user_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct user_element *ue = kcontrol->private_data; mutex_lock(&ue->card->user_ctl_lock); memcpy(&ucontrol->value, ue->elem_data, ue->elem_data_size); mutex_unlock(&ue->card->user_ctl_lock); return 0; }
vuln
Safe
C/C++
TfLiteRegistration AddOpRegistration() { TfLiteRegistration reg = {nullptr, nullptr, nullptr, nullptr}; reg.custom_name = "my_add"; reg.builtin_code = tflite::BuiltinOperator_CUSTOM; reg.prepare = [](TfLiteContext* context, TfLiteNode* node) { // Set output size to input size const TfLiteTensor* input...
vuln
Vulnerable
C/C++
@Override public void run() { VoiceClient.LOGGER.info("Start ping"); while(!this.socketUDP.isClosed()) { try { SocketClientUDPQueue.audioChannels.values().stream().filter(ThreadSoundQueue::canKill).forEach(ThreadSoundQueue::closeAndKill); SocketClientUDPQ...
vuln
Safe
Java
PHP_FUNCTION(mb_split) { char *arg_pattern; size_t arg_pattern_len; php_mb_regex_t *re; OnigRegion *regs = NULL; char *string; OnigUChar *pos, *chunk_pos; size_t string_len; int err; size_t n; zend_long count = -1; if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|l", &arg_pattern, &arg_pattern_len, &string, ...
vuln
Vulnerable
C/C++
static void filter(FSPPContext *p, uint8_t *dst, uint8_t *src, int dst_stride, int src_stride, int width, int height, uint8_t *qp_store, int qp_stride, int is_luma) { int x, x0, y, es, qy, t; const int stride = is_luma ? p->temp_stride : (width + 16); ...
vuln
Safe
C/C++
void options_apply() { /* apply default/validated configuration */ unsigned num=0; SERVICE_OPTIONS *section; CRYPTO_THREAD_write_lock(stunnel_locks[LOCK_SECTIONS]); memcpy(&global_options, &new_global_options, sizeof(GLOBAL_OPTIONS)); memset(&new_global_options, 0, sizeof(GLOBAL_OPTIONS)); /*...
vuln
Safe
C/C++
/************************************************************************ * This file is part of EspoCRM. * * EspoCRM - Open Source CRM application. * Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko * Website: https://www.espocrm.com * * EspoCRM is free software: you can redistribute i...
vuln
Vulnerable
JavaScript
static av_cold int hevc_init_context(AVCodecContext *avctx) { HEVCContext *s = avctx->priv_data; int i; s->avctx = avctx; s->HEVClc = av_mallocz(sizeof(HEVCLocalContext)); if (!s->HEVClc) goto fail; s->HEVClcList[0] = s->HEVClc; s->sList[0] = s; s->cabac_state = av_malloc(HEVC_CO...
vuln
Safe
C/C++
void _luac_build_info(LuaProto *proto, LuacBinInfo *info) { /* process proto header info */ char *section_name; char *symbol_name; char *proto_name; char **upvalue_names = NULL; RzListIter *iter; int i = 0; // iter ut64 current_offset; ut64 current_size; // 0. check if stripped (proto name is lost) if (pro...
vuln
Vulnerable
Unknown
Server::Server(boost::asio::ip::tcp protocol, std::uint16_t port, const fs::path& doc_root) : protocol_(protocol), port_(port), doc_root_(doc_root), acceptor_(io_context_), signals_(io_context_) { AddSignals(); }
vuln
Vulnerable
Unknown
public static void main(String[] args) { UserDao userDao = new InMemoryUserDao(); UserValidationService userValidationService = new UserValidationManager(); UserCheckService userCheckService = new UserCheckManager(userDao); UserActivationDao userActivationDao = new InMemoryUserActivationDao(); MailServi...
vuln
Vulnerable
Java
int vnc_hextile_send_framebuffer_update(VncState *vs, int x, int y, int w, int h) { int i, j; int has_fg, has_bg; uint8_t *last_fg, *last_bg; last_fg = (uint8_t *) g_malloc(VNC_SERVER_FB_BYTES); last_bg = (uint8_t *) g_malloc(VNC_SERVER_FB_BYTES); has_fg ...
vuln
Safe
Unknown
int main(int argc, char *argv[]) { #ifdef HAVE_GUSI_H GUSISetup(GUSIwithSIOUXSockets); GUSISetup(GUSIwithInternetSockets); #endif #ifdef HAVE_WINSOCK_H WSAData winSockData; /* we need at least version 1.1 */ WORD winSockVersionNeeded = MAKEWORD( 1, 1 ); WSAStartup(winSockVersionNeeded, &winSoc...
vuln
Vulnerable
C/C++
@SuppressWarnings("unchecked") public static void register() { register(new ConditionFactory<>(Origins.identifier("constant"), new SerializableData() .add("value", SerializableDataType.BOOLEAN), (data, block) -> data.getBoolean("value"))); register(new ConditionFactory<>(Orig...
vuln
Safe
Java
package com.salesmanager.shop.admin.controller.merchant; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Locale; import java.util.Map; import javax.inject.Inject; import javax.servlet.http.H...
vuln
Vulnerable
Java
cfm_print(netdissect_options *ndo, register const u_char *pptr, register u_int length) { const struct cfm_common_header_t *cfm_common_header; const struct cfm_tlv_header_t *cfm_tlv_header; const uint8_t *tptr, *tlv_ptr; const uint8_t *namesp; u_int names_data_remaining; uint8_t md_name...
vuln
Vulnerable
C/C++
static inline void ide_abort_command(IDEState *s) { s->status = READY_STAT | ERR_STAT; s->error = ABRT_ERR; }
vuln
Safe
C/C++
/* Copyright 2011-2014 Autronica Fire and Security AS * * 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. * * Autho...
vuln
Safe
C/C++
import RedisPubSub from '/imports/startup/server/redis'; import { check } from 'meteor/check'; import Polls from '/imports/api/polls'; import Logger from '/imports/startup/server/logger'; import { extractCredentials } from '/imports/api/common/server/helpers'; export default function publishVote(pollId, pollAnswerId) ...
vuln
Vulnerable
JavaScript
static apr_status_t gnutls_io_input_read(mgs_handle_t * ctxt, char *buf, apr_size_t * len) { apr_size_t wanted = *len; apr_size_t bytes = 0; *len = 0; /* If we have something leftover from last time, try that first. */ if ((bytes = char_buffer_read(&ctxt->input_cbuf, buf, wanted))) { ...
vuln
Vulnerable
C/C++
def get_data(self, pathname): """get_data(pathname) -> string with file data. Return the data associated with 'pathname'. Raise OSError if the file wasn't found. """ if alt_path_sep: pathname = pathname.replace(alt_path_sep, path_sep) key = pathname ...
vuln
Safe
Python
static int opmov(RAsm *a, ut8 *data, const Opcode *op) { int l = 0; st64 offset = 0; int mod = 0; int base = 0; int rex = 0; ut64 immediate = 0; if (op->operands[1].type & OT_CONSTANT) { if (!op->operands[1].is_good_flag) { return -1; } if (op->operands[1].immediate == -1) { return -1; } immediat...
vuln
Safe
Unknown