code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
static size_t hash_str(const void *ptr) extern volatile uint32_t hashtable_seed; /* Implementation of the hash function */ #include "lookup3.h"
vuln
Safe
C/C++
from __future__ import unicode_literals from itertools import chain import re import six from six.moves.urllib.parse import urlparse from xml.sax.saxutils import unescape from bleach import html5lib_shim from bleach.utils import alphabetize_attributes, force_unicode #: List of allowed tags ALLOWED_TAGS = [ 'a'...
vuln
Vulnerable
Python
/* * OpenVPN -- An application to securely tunnel IP networks * over a single TCP/UDP port, with support for SSL/TLS-based * session authentication and key exchange, * packet encryption, packet authentication, and * packet compression. * * Copyright (C) 2012-2018...
vuln
Safe
C/C++
/* * HTTP protocol analyzer * * Copyright (C) 2018 HAProxy Technologies, Christopher Faulet <cfaulet@haproxy.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 ...
vuln
Safe
C/C++
/* * Copyright(c) 2020 Cornelis Networks, Inc. * Copyright(c) 2015-2018 Intel Corporation. * * This file is provided under a dual BSD/GPLv2 license. When using or * redistributing this file, you may do so under either license. * * GPL LICENSE SUMMARY * * This program is free software; you can redistribute it ...
vuln
Safe
C/C++
rsvg_clip_path_parse (const RsvgDefs * defs, const char *str) { char *name; name = rsvg_get_url_string (str); if (name) { RsvgNode *val; val = rsvg_defs_lookup (defs, name); g_free (name); if (val && RSVG_NODE_TYPE (val) == RSVG_NODE_TYPE_CLIP_PATH) return val; ...
vuln
Safe
Unknown
func checkKeyValid(r *http.Request, accessKey string) (auth.Credentials, bool, APIErrorCode) { if !globalIAMSys.Initialized() && !globalIsGateway { // Check if server has initialized, then only proceed // to check for IAM users otherwise its okay for clients // to retry with 503 errors when server is coming up. ...
vuln
Vulnerable
Go
static void dec_mul(DisasContext *dc) { if (dc->format == OP_FMT_RI) { LOG_DIS("muli r%d, r%d, %d\n", dc->r0, dc->r1, sign_extend(dc->imm16, 16)); } else { LOG_DIS("mul r%d, r%d, r%d\n", dc->r2, dc->r0, dc->r1); } if (!(dc->env->features & LM32_FEATURE_MULTIPLY)) { ...
vuln
Safe
C/C++
authDigestNonceLink(digest_nonce_h * nonce) { assert(nonce != NULL); ++nonce->references; debugs(29, 9, "nonce '" << nonce << "' now at '" << nonce->references << "'."); }
vuln
Vulnerable
Unknown
lzw_result lzw_decode(struct lzw_ctx *ctx, const uint8_t ** const stack_pos_out) { lzw_result res; uint32_t code_new; uint32_t code_out; uint8_t last_value; uint8_t *stack_pos = ctx->stack_base; uint32_t clear_code = ctx->clear_code; uint32_t current_entry = ctx->current_entry; struct lzw_dictionary_entry * c...
vuln
Safe
C/C++
static int cgw_remove_job(struct sk_buff *skb, struct nlmsghdr *nlh) { struct cgw_job *gwj = NULL; struct hlist_node *nx; struct rtcanmsg *r; struct cf_mod mod; struct can_can_gw ccgw; u8 limhops = 0; int err = 0; if (!netlink_capable(skb, CAP_NET_ADMIN)) return -EPERM; if (nlmsg_len(nlh) < sizeof(*r)) r...
vuln
Safe
Unknown
NO_INLINE JsVar *jspeFactorDelete() { JSP_ASSERT_MATCH(LEX_R_DELETE); JsVar *parent = 0; JsVar *a = jspeFactorMember(jspeFactor(), &parent); JsVar *result = 0; if (JSP_SHOULD_EXECUTE) { bool ok = false; if (jsvIsName(a) && !jsvIsNewChild(a)) { // if no parent, check in root? if (!parent &&...
vuln
Vulnerable
C/C++
SQLWCHAR* _single_string_alloc_and_expand( LPCSTR in ) { SQLWCHAR *chr; int len = 0; if ( !in ) { return NULL; } while ( in[ len ] != 0 ) { len ++; } chr = malloc( sizeof( SQLWCHAR ) * ( len + 1 )); len = 0; while ( in[ len ] != 0 ) { chr[ len ...
vuln
Safe
C/C++
static void hidp_process_report(struct hidp_session *session, int type, const u8 *data, int len, int intr) { if (len > HID_MAX_BUFFER_SIZE) len = HID_MAX_BUFFER_SIZE; memcpy(session->input_buf, data, len); hid_input_report(session->hid, type, session->input_buf, len, intr); }
vuln
Vulnerable
C/C++
static bool do_modify_softint(CPUSPARCState *env, uint32_t value) { if (env->softint != value) { env->softint = value; #if !defined(CONFIG_USER_ONLY) if (cpu_interrupts_enabled(env)) { qemu_mutex_lock_iothread(); cpu_check_irqs(env); qemu_mutex_unlock_iothread(); ...
vuln
Safe
C/C++
static int dv_extract_audio(uint8_t* frame, uint8_t* ppcm[4], const DVprofile *sys) { int size, chan, i, j, d, of, smpls, freq, quant, half_ch; uint16_t lc, rc; const uint8_t* as_pack; uint8_t *pcm, ipcm; as_pack = dv_extract_pack(frame, dv_audio_source); if (!as_pac...
vuln
Vulnerable
Unknown
def event_err(e, pdu_to_check): errmsg = ( "event id %s: unable to verify signature for event id domain: %s" % (pdu_to_check.pdu.event_id, e.getErrorMessage()) ) # XX as above: not really sure if these are the right codes raise SynapseError...
vuln
Vulnerable
Python
@RequiresPermissions("user:list") @GetMapping("/list") public String list(@RequestParam(defaultValue = "1") Integer pageNo, String username, Model model) { username= SecurityUtil.sanitizeInput(username); IPage<User> iPage = userService.selectAll(pageNo, username); model.addAttribute("pag...
vuln
Safe
Java
static int ape_read_packet(AVFormatContext * s, AVPacket * pkt) { int ret; int nblocks; APEContext *ape = s->priv_data; uint32_t extra_size = 8; if (url_feof(s->pb)) return AVERROR_EOF; if (ape->currentframe >= ape->totalframes) return AVERROR_EOF; if (avio_seek(s->pb, ape->f...
vuln
Safe
C/C++
evdev_device_get_sysname(struct evdev_device *device) { return udev_device_get_sysname(device->udev_device); }
vuln
Vulnerable
Unknown
static int ffm_write_packet(AVFormatContext *s, int stream_index, UINT8 *buf, int size, int force_pts) { AVStream *st = s->streams[stream_index]; FFMStream *fst = st->priv_data; INT64 pts; UINT8 header[FRAME_HEADER_SIZE]; int duration; if (st->codec.codec_type == CODE...
vuln
Safe
C/C++
func collectAndCallOnce(rxPacket gw.UplinkFrame, callback func(packet models.RXPacket) error) error { phyKey := hex.EncodeToString(rxPacket.PhyPayload) txInfoB, err := proto.Marshal(rxPacket.TxInfo) if err != nil { return errors.Wrap(err, "marshal protobuf error") } txInfoHEX := hex.EncodeToString(txInfoB) key...
vuln
Safe
Go
_asn1_extract_der_octet (asn1_node node, const unsigned char *der, int der_len, unsigned flags) { int len2, len3; int counter, counter_end; int result; len2 = asn1_get_length_der (der, der_len, &len3); if (len2 < -1) return ASN1_DER_ERROR; counter = len3 + 1; DECR_LEN(der_len, len3); if (l...
vuln
Vulnerable
C/C++
public ParseToken getNextToken() { // Get next special token ParseToken specialToken = getNextSpecialToken(); // Get list of matchers for next char char nextChar = hasChar() ? getChar() : 0; Regex[] regexes = nextChar < 128 ? getRegexesForStartChar(nextChar) : getRegexes(); ...
vuln
Safe
Java
static void ppp_cp_parse_cr(struct net_device *dev, u16 pid, u8 id, unsigned int req_len, const u8 *data) { static u8 const valid_accm[6] = { LCP_OPTION_ACCM, 6, 0, 0, 0, 0 }; const u8 *opt; u8 *out; unsigned int len = req_len, nak_len = 0, rej_len = 0; if (!(out = kmalloc(len, GFP_ATOMIC))) { dev->stats...
vuln
Safe
C/C++
// +build go1.7 // Copyright 2014 The Gogs Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. // Gogs is a painless self-hosted Git Service. package main import ( "os" "github.com/urfave/cli" "github.com/gogs/gogs/cmd" "github.c...
vuln
Vulnerable
Go
static int decode_exp_vlc(WMACodecContext *s, int ch) { int last_exp, n, code; const uint16_t *ptr; float v, max_scale; uint32_t *q, *q_end, iv; const float *ptab = pow_tab + 60; const uint32_t *iptab = (const uint32_t*)ptab; ptr = s->exponent_bands[s->frame_len_bits - s->block_len_bits]; ...
vuln
Safe
C/C++
int qcow2_snapshot_load_tmp(BlockDriverState *bs, const char *snapshot_id, const char *name, Error **errp) { int i, snapshot_index; BDRVQcowState *s = bs->opaque; QCowSnapshot *sn; uint64_t *new_l1_table; int new_l1_...
vuln
Safe
C/C++
static int scsi_hot_add(Monitor *mon, DeviceState *adapter, DriveInfo *dinfo, int printinfo) { SCSIBus *scsibus; SCSIDevice *scsidev; scsibus = DO_UPCAST(SCSIBus, qbus, QLIST_FIRST(&adapter->child_bus)); if (!scsibus || strcmp(scsibus->qbus.info->name, "SCSI") != 0) { err...
vuln
Vulnerable
C/C++
static void io_wqe_enqueue(struct io_wqe *wqe, struct io_wq_work *work) { struct io_wqe_acct *acct = io_work_get_acct(wqe, work); unsigned work_flags = work->flags; bool do_create; /* * If io-wq is exiting for this task, or if the request has explicitly * been marked as one that should not get executed, cancel...
vuln
Vulnerable
Unknown
// mkerrors.sh -m64 // Code generated by the command above; see README.md. DO NOT EDIT. // +build amd64,freebsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -m64 _const.go package unix import "syscall" const ( AF_APPLETALK = 0x10 AF_ARP = 0x23 AF...
vuln
Safe
Go
static int get_whole_cluster(BlockDriverState *bs, uint64_t cluster_offset, uint64_t offset, int allocate) { uint64_t parent_cluster_offset; BDRVVmdkState *s = bs->opaque; uint8_t whole_grain[s->cluster_sectors*512]; if (s->hd->backing_hd) { BDRVVm...
vuln
Safe
C/C++
void sqlite3Fts5UnicodeAscii(u8 *aArray, u8 *aAscii){ int i = 0; int iTbl = 0; while( i<128 ){ int bToken = aArray[ aFts5UnicodeData[iTbl] & 0x1F ]; int n = (aFts5UnicodeData[iTbl] >> 5) + i; for(; i<128 && i<n; i++){ aAscii[i] = (u8)bToken; } iTbl++; } aAscii[0] = 0; ...
vuln
Safe
C/C++
int ff_mms_asf_header_parser(MMSContext *mms) { uint8_t *p = mms->asf_header; uint8_t *end; int flags, stream_id; mms->stream_num = 0; if (mms->asf_header_size < sizeof(ff_asf_guid) * 2 + 22 || memcmp(p, ff_asf_header, sizeof(ff_asf_guid))) { av_log(NULL, AV_LOG_ERROR, ...
vuln
Vulnerable
Unknown
static void wait_a_bit(void *ctx) { struct timeval when; REQUEST *request = ctx; fr_event_callback_t callback = NULL; rad_assert(request->magic == REQUEST_MAGIC); #ifdef WITH_COA /* * The CoA request is a new (internally generated) * request, created in a child thread. We therefore need * some way to tie ...
vuln
Safe
Unknown
gdm_session_worker_open_session (GdmSessionWorker *worker, GError **error) { int error_code; int flags; char *session_id = NULL; g_assert (worker->priv->state == GDM_SESSION_WORKER_STATE_ACCOUNT_DETAILS_SAVED); g_assert (geteuid () == ...
vuln
Safe
Unknown
set_num_option( int opt_idx, // index in options[] table char_u *varp, // pointer to the option variable long value, // new value char *errbuf, // buffer for error messages size_t errbuflen, // length of "errbuf" int opt_flags) // OPT_LOCAL, OPT_GLOBAL, // OPT_MODELINE, etc. { ...
vuln
Vulnerable
Unknown
@Override public void setIsSyncableAsUser(Account account, String providerName, int syncable, int userId) { if (TextUtils.isEmpty(providerName)) { throw new IllegalArgumentException("Authority must not be empty"); } enforceCrossUserPermission(userId, "...
vuln
Safe
Java
static hwaddr ppc_hash64_pteg_search(PowerPCCPU *cpu, hwaddr hash, bool secondary, target_ulong ptem, ppc_hash_pte64_t *pte) { CPUPPCState *env = &cpu->env; int i; uint64_t token; target_ulong pte0, pte1; target_ulong pte_inde...
vuln
Vulnerable
C/C++
static int acl_modify(struct ldb_module *module, struct ldb_request *req) { int ret; struct ldb_context *ldb = ldb_module_get_ctx(module); const struct dsdb_schema *schema; unsigned int i; const struct dsdb_class *objectclass; struct ldb_result *acl_res; struct security_descriptor *sd; struct dom_sid *sid = NUL...
vuln
Vulnerable
Unknown
void ModuleSQL::init() { Dispatcher = new DispatcherThread(this); ServerInstance->Threads->Start(Dispatcher); Implementation eventlist[] = { I_OnRehash, I_OnUnloadModule }; ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); OnRehash(NULL); }
vuln
Vulnerable
Unknown
static int dv_extract_audio_info(DVDemuxContext* c, uint8_t* frame) { const uint8_t* as_pack; int freq, stype, smpls, quant, i, ach; as_pack = dv_extract_pack(frame, dv_audio_source); if (!as_pack || !c->sys) { /* No audio ? */ c->ach = 0; return 0; } smpls = as_pack[1] & 0...
vuln
Safe
Unknown
int nfc_fw_download(struct nfc_dev *dev, const char *firmware_name) { int rc = 0; pr_debug("%s do firmware %s\n", dev_name(&dev->dev), firmware_name); device_lock(&dev->dev); if (dev->shutting_down) { rc = -ENODEV; goto error; } if (dev->dev_up) { rc = -EBUSY; goto error; } if (!dev->ops->fw_downlo...
vuln
Safe
Unknown
package config import ( "context" "crypto/sha256" "os" "sync" "github.com/fsnotify/fsnotify" "github.com/google/uuid" "github.com/rs/zerolog" "github.com/pomerium/pomerium/internal/fileutil" "github.com/pomerium/pomerium/internal/log" "github.com/pomerium/pomerium/internal/netutil" "github.com/pomerium/po...
vuln
Vulnerable
Go
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_share); setTitle(R.string.title_activity_share); receiver = newBroadcastReceiver(); //Get uris to send Intent intent = getIntent(); ...
vuln
Safe
Java
static void prc_destroy(jpc_enc_prc_t *prc) { jpc_enc_cblk_t *cblk; uint_fast32_t cblkno; if (prc->cblks) { for (cblkno = 0, cblk = prc->cblks; cblkno < prc->numcblks; ++cblkno, ++cblk) { cblk_destroy(cblk); } jas_free(prc->cblks); } if (prc->incltree) { jpc_tagtree_destroy(prc->incltree); } if (...
vuln
Vulnerable
Unknown
package com.salesmanager.core.business.services.catalog.product; import java.io.InputStream; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Locale; import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; import javax.inject.Inject; import o...
vuln
Safe
Java
int obj2ast_comprehension(struct ast_state *state, PyObject* obj, comprehension_ty* out, PyArena* arena) { PyObject* tmp = NULL; expr_ty target; expr_ty iter; asdl_expr_seq* ifs; int is_async; if (PyObject_GetOptionalAttr(obj, state->target, &tmp) < 0) { return 1; ...
vuln
Safe
C/C++
private void doLogging(Uri logFile) { try { OutputStream outStream = getApplication().getContentResolver().openOutputStream(logFile, "rw"); sLogcatWriter = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outStream))); } catch (IOException e) { e.printStackTrace(); sto...
vuln
Vulnerable
Java
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) { TF_LITE_ENSURE_EQ(context, NumInputs(node), 3); TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1); const TfLiteTensor* start = GetInput(context, node, kStartTensor); const TfLiteTensor* limit = GetInput(context, node, kLimitTensor); const TfLiteT...
vuln
Vulnerable
C/C++
static int sox_read_header(AVFormatContext *s) { AVIOContext *pb = s->pb; unsigned header_size, comment_size; double sample_rate, sample_rate_frac; AVStream *st; st = avformat_new_stream(s, NULL); if (!st) return AVERROR(ENOMEM); st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; if ...
vuln
Safe
C/C++
private boolean runSetupCancelAutoResets() { boolean cancel = false; // If it makes it this far and the mutex is not locked, then lock it: if ( mine.getMineStateMutex().isMinable() ) { // Set the MineStateMutex to a state of starting a mine reset: mine.getMineStateMutex().setMineStateResetStart(); ...
vuln
Vulnerable
Java
static void mpegts_write_pes(AVFormatContext *s, AVStream *st, const uint8_t *payload, int payload_size, int64_t pts, int64_t dts, int key) { MpegTSWriteStream *ts_st = st->priv_data; MpegTSWrite *ts = s->priv_data; uint8_t buf[TS_PACKET_SIZE]; u...
vuln
Vulnerable
C/C++
int qemu_bh_poll(void) { QEMUBH *bh, **pbh; int ret; ret = 0; for(;;) { pbh = &first_bh; bh = *pbh; if (!bh) break; ret = 1; *pbh = bh->next; bh->scheduled = 0; bh->cb(bh->opaque); } return ret; }
vuln
Vulnerable
C/C++
static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps) { #define HWACCEL_MAX (CONFIG_HEVC_DXVA2_HWACCEL + CONFIG_HEVC_D3D11VA_HWACCEL + CONFIG_HEVC_VAAPI_HWACCEL + CONFIG_HEVC_VDPAU_HWACCEL) enum AVPixelFormat pix_fmts[HWACCEL_MAX + 2], *fmt = pix_fmts; switch (sps->pix_fmt) { case AV_...
vuln
Safe
C/C++
static int a64_write_packet(struct AVFormatContext *s, AVPacket *pkt) { AVCodecContext *avctx = s->streams[0]->codec; A64MuxerContext *c = s->priv_data; int i, j; int ch_chunksize; int lifetime; int frame_count; int charset_size; int frame_size; int num_frames; switch (avctx...
vuln
Vulnerable
C/C++
static int aes_ccm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr) { EVP_AES_CCM_CTX *cctx = EVP_C_DATA(EVP_AES_CCM_CTX,c); switch (type) { case EVP_CTRL_INIT: cctx->key_set = 0; cctx->iv_set = 0; cctx->L = 8; cctx->M = 12; cctx->tag_set = 0; cctx->len_s...
vuln
Safe
C/C++
static inline void mcdc(uint16_t *dst, uint16_t *src, int log2w, int h, int stride, int scale, unsigned dc){ int i; dc*= 0x10001; switch(log2w){ case 0: for(i=0; i<h; i++){ dst[0] = scale*src[0] + dc; if(scale) src += stride; dst += stride; } break...
vuln
Safe
C/C++
private static Expression compileFunctionExpression(SqlBasicCall functionNode) { SqlKind functionKind = functionNode.getKind(); String functionName; switch (functionKind) { case AND: return compileAndExpression(functionNode); case OR: return compileOrExpression(functionNode); ...
vuln
Safe
Java
import logging import urllib from typing import Any, Dict, Iterable, List, Optional from urllib.parse import urlencode from django.conf import settings from django.contrib.auth import authenticate, get_backends from django.contrib.sessions.backends.base import SessionBase from django.core import validators from django...
vuln
Safe
Python
# # Copyright © 2012–2022 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <https://weblate.org/> # # 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 3 of the Licens...
vuln
Safe
Python
function displaySearchHeading(query) { var heading = document.getElementById("searchHeading"); heading.textContent = "Search results for: " + query; }
vuln
Safe
JavaScript
auto Phase3() -> Local<Value> final { if (did_finish && !*did_finish) { *did_finish = true; throw RuntimeGenericError("Script execution timed out."); } else if (async_error) { Isolate::GetCurrent()->ThrowException(async_error->CopyInto()); throw RuntimeError(); } else { return ret->Transfer...
vuln
Safe
Unknown
const got = require('@/utils/got'); const cheerio = require('cheerio'); const timezone = require('@/utils/timezone'); const { parseDate } = require('@/utils/parse-date'); const { art } = require('@/utils/render'); const path = require('path'); module.exports = async (ctx) => { const user = ctx.params.user ?? ''; ...
vuln
Vulnerable
JavaScript
wb_prep(netdissect_options *ndo, const struct pkt_prep *prep, u_int len) { int n; const struct pgstate *ps; const u_char *ep = ndo->ndo_snapend; ND_PRINT((ndo, " wb-prep:")); if (len < sizeof(*prep)) { return (-1); } n = EXTRACT_32BITS(&prep->pp_n); ps = (const struct pgstate *)(prep + 1); while (--...
vuln
Vulnerable
C/C++
vmnc_handle_wmvi_rectangle (GstVMncDec * dec, struct RfbRectangle *rect, const guint8 * data, int len, gboolean decode) { GstVideoFormat format; gint bpp, tc; guint32 redmask, greenmask, bluemask; guint32 endianness, dataendianness; GstVideoCodecState *state; /* A WMVi rectangle has a 16byte payload */...
vuln
Vulnerable
C/C++
static void tcg_out_qemu_ld_slow_path(TCGContext *s, TCGLabelQemuLdst *l) { TCGMemOp opc = l->opc; TCGReg data_reg; uint8_t **label_ptr = &l->label_ptr[0]; tcg_patch32(label_ptr[0], s->code_ptr - label_ptr[0] - 4); if (TARGET_LONG_BITS > TCG_TARGET_REG_BITS) { tcg_patch32(label_ptr[1], ...
vuln
Safe
C/C++
/** * */ package com.salesmanager.shop.admin.model.digital; import com.salesmanager.core.model.catalog.product.Product; import com.salesmanager.core.model.catalog.product.file.DigitalProduct; import javax.validation.constraints.NotEmpty; import org.springframework.web.multipart.MultipartFile; import javax.validati...
vuln
Safe
Java
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
vuln
Vulnerable
C/C++
Http::FilterDataStatus Context::onRequestBody(int body_buffer_length, bool end_of_stream) { if (!in_vm_context_created_ || !wasm_->onRequestBody_) { return Http::FilterDataStatus::Continue; } switch (wasm_ ->onRequestBody_(this, id_, static_cast<uint32_t>(body_buffer_length), ...
vuln
Safe
C/C++
void NetworkHandler::GetResponseBodyForInterception( const String& interception_id, std::unique_ptr<GetResponseBodyForInterceptionCallback> callback) { DevToolsInterceptorController* interceptor = DevToolsInterceptorController::FromBrowserContext( process_->GetBrowserContext()); if (!int...
vuln
Vulnerable
C/C++
public void applyPowers(HashSet<ElitePower> elitePowers, int availablePowerAmount) { for (Iterator<ElitePower> elitePowerIterator = elitePowers.iterator(); elitePowerIterator.hasNext(); ) { ElitePower elitePower = elitePowerIterator.next(); if (!PowersConfig.getPower(elitePower.getFileNa...
vuln
Vulnerable
Java
function updateLinkColor() { var div = document.createElement('div'); div.style.width = '100%'; div.style.height = '100%'; div.style.boxSizing = 'border-box'; if (linkColor != null && linkColor != mxConstants.NONE) { div.style.border = '1px solid black'; div.style.backgroundColor = linkColo...
vuln
Vulnerable
JavaScript
def initialize(json) @params = YAML.load(json || '') end
vuln
Vulnerable
Ruby
int kvm_init(MachineClass *mc) { static const char upgrade_note[] = "Please upgrade to at least kernel 2.6.29 or recent kvm-kmod\n" "(see http: struct { const char *name; int num; } num_cpus[] = { { "SMP", smp_cpus }, { "hotpluggable", max_cpus }, ...
vuln
Safe
C/C++
'use strict'; const services = require('./services.json'); const normalized = {}; Object.keys(services).forEach(key => { let service = services[key]; normalized[normalizeKey(key)] = normalizeService(service); [].concat(service.aliases || []).forEach(alias => { normalized[normalizeKey(alias)] = n...
vuln
Safe
Java
private void readAndReportExecutionResult() throws RunException, EngineTerminationException, InternalException { try { int status = in.readInt(); switch (status) { case RESULT_SUCCESS: return; case RESULT_NOT_IMPLEMENTED: { ...
vuln
Vulnerable
Java
#include "base_object-inl.h" #include "crypto_x509.h" #include "crypto_common.h" #include "crypto_context.h" #include "crypto_keys.h" #include "crypto_bio.h" #include "env-inl.h" #include "memory_tracker-inl.h" #include "node_errors.h" #include "util-inl.h" #include "v8.h" #include <string> #include <vector> namespac...
vuln
Vulnerable
JavaScript
bool Permissions::check_create_datawriter( const PermissionsHandle& local_handle, const uint32_t /*domain_id*/, const std::string& topic_name, const std::vector<std::string>& partitions, SecurityException& exception) { bool returned_value = false; const AccessPermissionsH...
vuln
Vulnerable
Unknown
PAM_EXTERN int pam_sm_acct_mgmt (pam_handle_t * pamh, int flags, int argc, const char **argv) { int retval, ctrl, status=PAM_AUTH_ERR; char *user; char *tty; char *r_addr; struct areply arep; struct tac_attrib *attr = NULL; int tac_fd; user = tty = r_addr = NULL; /* this also ...
vuln
Vulnerable
C/C++
HeaderMapImpl::HeaderEntryImpl& HeaderMapImpl::maybeCreateInline(HeaderEntryImpl** entry, const LowerCaseString& key) { cached_byte_size_.reset(); if (*entry) { return **entry; } std::list<HeaderEntryImpl>::iterator i = headers_.insert(key); ...
vuln
Safe
Unknown
function Glance(options) { EE.call(this) options = xtend(defaults, options || {}) this.port = options.port this.hideindex = options.hideindex this.indices = options.indices this.dir = path.resolve(options.dir) this.nodot = options.nodot return this }
vuln
Safe
JavaScript
static void header_seek (SF_PRIVATE *psf, sf_count_t position, int whence) { switch (whence) { case SEEK_SET : if (position > SIGNED_SIZEOF (psf->header)) { /* Too much header to cache so just seek instead. */ psf_fseek (psf, position, whence) ; return ; } ; if (position > psf->headend) psf->...
vuln
Vulnerable
C/C++
public void executeFunction() { Interpreter branch = this.interpreter.branch(); ClientScriptUtils.wrapSafe(() -> { this.function.invoke(branch, List.of()); }, branch); }
vuln
Safe
Java
delete_policy_2_svc(dpol_arg *arg, struct svc_req *rqstp) { static generic_ret ret; char *prime_arg; gss_buffer_desc client_name = GSS_C_EMPTY_BUFFER; gss_buffer_desc service_name = GSS_C_EMPTY_BUFFER; OM_uint32 ...
vuln
Safe
C/C++
int main(int argc, char *argv[]) { struct fuse_args args = FUSE_ARGS_INIT(argc, argv); struct fuse_session *se; struct fuse_cmdline_opts opts; struct lo_data lo = { .sandbox = SANDBOX_NAMESPACE, .debug = 0, .writeback = 0, .posix_lock = 0, .allow_direct_io = 0, ...
vuln
Safe
C/C++
rsvg_css_parse_xml_attribute_string (const char *attribute_string) { xmlSAXHandler handler; xmlParserCtxtPtr parser; xmlDocPtr doc; xmlNodePtr node; xmlAttrPtr attr; char *tag; GPtrArray *attributes; char **retval = NULL; tag = g_strdup_printf ("<rsvg-hack %s />\n", attribute_string...
vuln
Safe
Unknown
Value ExpressionArrayToObject::evaluate(const Document& root, Variables* variables) const { const Value input = _children[0]->evaluate(root, variables); if (input.nullish()) { return Value(BSONNULL); } uassert(40386, str::stream() << "$arrayToObject requires an array input, found: "...
vuln
Vulnerable
Unknown
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence) { int64_t offset1; int64_t pos; int force = whence & AVSEEK_FORCE; int buffer_size; int short_seek; whence &= ~AVSEEK_FORCE; if(!s) buffer_size = s->buf_end - s->buffer; pos = s->pos - (s->write_flag ? 0 : buffer_size...
vuln
Vulnerable
C/C++
static inline int get_ue_code(GetBitContext *gb, int order) { if (order) { int ret = get_ue_golomb(gb) << order; return ret + get_bits(gb, order); } return get_ue_golomb(gb); }
vuln
Vulnerable
C/C++
public static void initThreads(int count) { if (count <= 0) throw new IllegalArgumentException("count has to be at least equal or greater than one"); if (THREADS != null) { for (RenderingThread thread : THREADS) if (thread != null) thread.inter...
vuln
Vulnerable
Java
/* * * Copyright (C) 2011 Novell Inc. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published by * the Free Software Foundation. */ #include <linux/fs.h> #include <linux/slab.h> #include <linux/file.h> #include <linux...
vuln
Safe
C/C++
obj2ast_mod(PyObject* obj, mod_ty* out, PyArena* arena) { int isinstance; PyObject *tmp = NULL; if (obj == Py_None) { *out = NULL; return 0; } isinstance = PyObject_IsInstance(obj, (PyObject*)Module_type); if (isinstance == -1) { return 1; } if (isinstance) { ...
vuln
Safe
C/C++
static int init_image(TiffContext *s, ThreadFrame *frame) { int ret; switch (s->planar * 1000 + s->bpp * 10 + s->bppcount) { case 11: if (!s->palette_is_set) { s->avctx->pix_fmt = AV_PIX_FMT_MONOBLACK; break; } case 21: case 41: case 81: s->avctx->...
vuln
Safe
C/C++
// SPDX-License-Identifier: GPL-2.0-only /* * Driver for the TI bq24190 battery charger. * * Author: Mark A. Greer <mgreer@animalcreek.com> */ #include <linux/mod_devicetable.h> #include <linux/module.h> #include <linux/interrupt.h> #include <linux/delay.h> #include <linux/pm_runtime.h> #include <linux/power_suppl...
vuln
Safe
C/C++
/* * Symmetric key cipher operations. * * Generic encrypt/decrypt wrapper for ciphers, handles operations across * multiple page boundaries by using temporary blocks. In user context, * the kernel is given a chance to schedule us once per page. * * Copyright (c) 2015 Herbert Xu <herbert@gondor.apana.org.au> * ...
vuln
Vulnerable
C/C++
int rpmfiSetFX(rpmfi fi, int fx) { int i = -1; if (fi != NULL && fx >= 0 && fx < rpmfilesFC(fi->files)) { fi->i = fx; fi->j = rpmfilesDI(fi->files, fi->i); i = fi->i; } return i; }
vuln
Vulnerable
C/C++
static void set_pixel_format(VncState *vs, int bits_per_pixel, int depth, int big_endian_flag, int true_color_flag, int red_max, int green_max, int blue_max, int red_shift, int green_shift, int blue_shift...
vuln
Vulnerable
Unknown
# -*- coding: utf-8 -*- from __future__ import unicode_literals from future.utils import iteritems import yaml import json from mlalchemy.errors import * from mlalchemy.structures import * from mlalchemy.constants import * from mlalchemy.utils import * import logging logger = logging.getLogger(__name__) __all__ =...
vuln
Safe
Python
static int deliver(message_data_t *msg) { int n, r = 0, myrights; char *rcpt = NULL, *local_rcpt = NULL, *server, *acl; unsigned long uid; struct body *body = NULL; struct dest *dlist = NULL; duplicate_key_t dkey = {msg->id, NULL, msg->date}; /* check ACLs of all mailboxes */ for (n = 0...
vuln
Safe
Unknown