code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
void RenderFrameDevToolsAgentHost::AttachSession(DevToolsSession* session) { session->SetRenderer(frame_host_ ? frame_host_->GetProcess()->GetID() : ChildProcessHost::kInvalidUniqueID, frame_host_); protocol::EmulationHandler* emulation_handler = n...
cwe
CWE-20
C/C++
static int atusb_get_and_show_revision(struct atusb *atusb) { struct usb_device *usb_dev = atusb->usb_dev; unsigned char buffer[3]; int ret; /* Get a couple of the ATMega Firmware values */ ret = atusb_control_msg(atusb, usb_rcvctrlpipe(usb_dev, 0), ATUSB_ID, ATUSB_REQ_FROM_DEV, 0, 0, buffer, 3, 1000); i...
cwe
CWE-399
Unknown
GetNumWrongData(const byte * curPtr, const int maxnum) { int count = 0; if (1 == maxnum) { return (1); } while (*(curPtr + count) != *(curPtr + count + 1) && maxnum > count) { count++; } return (count); }
cwe
CWE-787
C/C++
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ /* * lsquic_parse_ietf_v1.c -- Parsing functions specific to IETF QUIC v1 */ #include <assert.h> #include <inttypes.h> #include <errno.h> #include <stddef.h> #include <string.h> #include <sys/queue.h> #ifndef WIN32 #include <sys/types.h> #else...
cwe
CWE-476
C/C++
def _cli_run(self, verb, cli_args): """Runs a CLI command over SSH, without doing any result parsing.""" cli_arg_strings = [] if cli_args: for k, v in cli_args.items(): if k == '': cli_arg_strings.append(" %s" % k) else: ...
vuln
Vulnerable
Python
nbd_unlocked_opt_go (struct nbd_handle *h) { int err; nbd_completion_callback c = { .callback = go_complete, .user_data = &err }; int r = nbd_unlocked_aio_opt_go (h, &c); if (r == -1) return r; r = wait_for_option (h); if (r == 0 && err) { assert (nbd_internal_is_state_negotiating (get_next_state ...
cwe
CWE-617
C/C++
static void addModuleArgument(sqlite3 *db, Table *pTable, char *zArg){ int nBytes = sizeof(char *)*(2+pTable->nModuleArg); char **azModuleArg; azModuleArg = sqlite3DbRealloc(db, pTable->azModuleArg, nBytes); if( azModuleArg==0 ){ sqlite3DbFree(db, zArg); }else{ int i = pTable->nModuleArg++; az...
cwe
CWE-190
C/C++
# -*- coding: utf-8 -*- # This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web) # Copyright (C) 2018-2019 OzzieIsaacs, cervinko, jkrehm, bodybybuddha, ok11, # andy29485, idalin, Kyosfonica, wuqi, Kennyl, lemmsh, # falgh1, grunjol, csitk...
vuln
Vulnerable
Python
static int encrypt(struct blkcipher_desc *desc, struct scatterlist *dst, struct scatterlist *src, unsigned int nbytes) { struct blkcipher_walk walk; struct crypto_blkcipher *tfm = desc->tfm; struct salsa20_ctx *ctx = crypto_blkcipher_ctx(tfm); int err; blkcipher_walk_init(&walk, dst, src, nbytes); err ...
vuln
Safe
Unknown
nfp_abm_u32_knode_replace(struct nfp_abm_link *alink, struct tc_cls_u32_knode *knode, __be16 proto, struct netlink_ext_ack *extack) { struct nfp_abm_u32_match *match = NULL, *iter; unsigned int tos_off; u8 mask, val; int err; if (!nfp_abm_u32_check_knode(alink->abm, knode, proto, extack)) { err = -EOP...
vuln
Safe
C/C++
static RzDyldRebaseInfos *get_rebase_infos(RzDyldCache *cache) { RzDyldRebaseInfos *result = RZ_NEW0(RzDyldRebaseInfos); if (!result) { return NULL; } if (!cache->hdr->slideInfoOffset || !cache->hdr->slideInfoSize) { ut32 total_slide_infos = 0; ut32 n_slide_infos[MAX_N_HDR]; ut32 i; for (i = 0; i < cach...
cwe
CWE-787
C/C++
op_replace(oparg_T *oap, int c) { int n, numc; int num_chars; char_u *newp, *oldp; size_t oldlen; struct block_def bd; char_u *after_p = NULL; int had_ctrl_v_cr = FALSE; if ((curbuf->b_ml.ml_flags & ML_EMPTY ) || oap->empty) return OK; // nothing to do if (c == REPLAC...
cwe
CWE-122
C/C++
static int asf_read_simple_index(AVFormatContext *s, const GUIDParseTable *g) { ASFContext *asf = s->priv_data; AVIOContext *pb = s->pb; AVStream *st = NULL; uint64_t interval; uint32_t pkt_num, nb_entries; int32_t prev_pkt_num = -1; int i; int64_t offset; uint64_t size = avio_rl...
vuln
Safe
C/C++
const { randomUUID } = require("crypto"); const csurf = (forbiddenMethods, excludedUrls) => { if (!forbiddenMethods) forbiddenMethods = ["POST"]; return (req, res, next) => { if (!req.cookies || !res.cookie) throw new Error("No Cookie middleware is installed"); if ( // if any excludedUrl matche...
vuln
Vulnerable
JavaScript
static int compand_delay(AVFilterContext *ctx, AVFrame *frame) { CompandContext *s = ctx->priv; AVFilterLink *inlink = ctx->inputs[0]; const int channels = inlink->channels; const int nb_samples = frame->nb_samples; int chan, i, av_uninit(dindex), oindex, av_uninit(count); AVFrame *out_frame = N...
vuln
Vulnerable
C/C++
static SQInteger thread_call(HSQUIRRELVM v) { SQObjectPtr o = stack_get(v,1); if(sq_type(o) == OT_THREAD) { SQInteger nparams = sq_gettop(v); _thread(o)->Push(_thread(o)->_roottable); for(SQInteger i = 2; i<(nparams+1); i++) sq_move(_thread(o),v,i); if(SQ_SUCCEEDED(sq...
vuln
Vulnerable
C/C++
int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *limit, int *al) { unsigned short type; unsigned short size; unsigned short len; unsigned char *data = *p; int renegotiate_seen = 0; int sigalg_seen = 0; s->servername_done = 0; s-...
vuln
Safe
Unknown
static int path_set_acls(Item *item, const char *path) { int r = 0; #if HAVE_ACL char fn[STRLEN("/proc/self/fd/") + DECIMAL_STR_MAX(int)]; _cleanup_close_ int fd = -1; struct stat st; assert(item); assert(path); fd = open(path, O_NOFOLLOW|O_CLOEXEC|O_PATH); ...
cwe
CWE-59
Unknown
def authenticate(self, username, password): child = None try: child = pexpect.spawn('/bin/sh', ['-c', '/bin/su -c "/bin/echo SUCCESS" - %s' % username], timeout=5) child.expect('.*:') child.sendline(password) result = child.expect(['su: .*', 'SUCCESS']) ...
vuln
Vulnerable
Python
CopyGetData(CopyState cstate, void *databuf, int minread, int maxread) { int bytesread = 0; switch (cstate->copy_dest) { case COPY_FILE: bytesread = fread(databuf, 1, maxread, cstate->copy_file); if (ferror(cstate->copy_file)) ereport(ERROR, (errcode_for_file_access(), errmsg("could not r...
cwe
CWE-89
Unknown
TfLiteStatus PrepareHashtableSize(TfLiteContext* context, TfLiteNode* node) { TF_LITE_ENSURE_EQ(context, NumInputs(node), 1); TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1); const TfLiteTensor* input_resource_id_tensor = GetInput(context, node, kInputResourceIdTensor); TF_LITE_ENSURE_EQ(context, input_r...
cwe
CWE-787
C/C++
static inline void t_gen_mov_TN_preg(TCGv tn, int r) { if (r < 0 || r > 15) { fprintf(stderr, "wrong register read $p%d\n", r); } if (r == PR_BZ || r == PR_WZ || r == PR_DZ) { tcg_gen_mov_tl(tn, tcg_const_tl(0)); } else if (r == PR_VR) { tcg_gen_mov_tl(tn, tcg_const_tl(32)); ...
vuln
Vulnerable
C/C++
def _get_vvset_from_3par(self, volume_name): """Get Virtual Volume Set from 3PAR. The only way to do this currently is to try and delete the volume to get the error message. NOTE(walter-boring): don't call this unless you know the volume is already in a vvset! """ ...
vuln
Vulnerable
Python
gsm_xsmp_client_connect (GsmXSMPClient *client, SmsConn conn, unsigned long *mask_ret, SmsCallbacks *callbacks_ret) { client->priv->conn = conn; if (client->priv->protocol_timeout) { g_source_remove (c...
cwe
CWE-835
C/C++
int pcie_cap_init(PCIDevice *dev, uint8_t offset, uint8_t type, uint8_t port) { int pos; uint8_t *exp_cap; assert(pci_is_express(dev)); pos = pci_add_capability(dev, PCI_CAP_ID_EXP, offset, PCI_EXP_VER2_SIZEOF); if (pos < 0) { return pos; } dev->exp.exp_cap = pos; exp_cap = ...
vuln
Vulnerable
C/C++
static wStream* rdg_receive_packet(rdpRdg* rdg) { wStream* s; const size_t header = sizeof(RdgPacketHeader); size_t packetLength; assert(header <= INT_MAX); s = Stream_New(NULL, 1024); if (!s) return NULL; if (!rdg_read_all(rdg->tlsOut, Stream_Buffer(s), header)) { Stream_Free(s, TRUE); return NULL; } ...
cwe
CWE-125
C/C++
R_API void r_anal_bb_free(RAnalBlock *bb) { if (!bb) { return; } r_anal_cond_free (bb->cond); R_FREE (bb->fingerprint); r_anal_diff_free (bb->diff); bb->diff = NULL; R_FREE (bb->op_bytes); r_anal_switch_op_free (bb->switch_op); bb->switch_op = NULL; bb->fingerprint = NULL; bb->cond = NULL; R_FREE (bb->lab...
cwe
CWE-416
C/C++
inboth (char **left, char **right) { char **both; char **temp; size_t lnum, rnum; if (left == NULL || right == NULL) return NULL; both = malloc(sizeof *both); if (both == NULL) return NULL; both[0] = NULL; for (lnum = 0; left[lnum] != NULL; ++lnum) { for (rnum = 0; right[rnum] != NULL...
vuln
Safe
Unknown
module.exports = function parse_str (str, array) { // eslint-disable-line camelcase // discuss at: https://locutus.io/php/parse_str/ // original by: Cagri Ekin // improved by: Michael White (https://getsprink.com) // improved by: Jack // improved by: Brett Zamir (https://brett-zamir....
cwe
CWE-915
JavaScript
__init int intel_pmu_init(void) { union cpuid10_edx edx; union cpuid10_eax eax; union cpuid10_ebx ebx; struct event_constraint *c; unsigned int unused; int version; if (!cpu_has(&boot_cpu_data, X86_FEATURE_ARCH_PERFMON)) { switch (boot_cpu_data.x86) { case 0x6: return p6_pmu_init(); case 0xb: return...
vuln
Vulnerable
C/C++
static boolean my_fill_input_buffer_fn(j_decompress_ptr cinfo) { struct iwjpegrcontext *rctx = (struct iwjpegrcontext*)cinfo->src; size_t bytesread = 0; int ret; ret = (*rctx->iodescr->read_fn)(rctx->ctx,rctx->iodescr, rctx->buffer,rctx->buffer_len,&bytesread); if((!ret) || (bytesread<1)) { iw_set_error(rctx-...
vuln
Safe
C/C++
def get(self, location, connection=None): location = location.store_location if not connection: connection = self.get_connection(location) try: resp_headers, resp_body = connection.get_object( container=location.container, obj=location.obj, ...
cwe
CWE-200
Python
function updateBasicSettings(PDFStructure &$structure) { // set headline if (isset($_POST['headline'])) { $structure->setTitle(str_replace('<', '', str_replace('>', '', $_POST['headline']))); } // set logo if (isset($_POST['logoFile'])) { $structure->setLogo($_POST['logoFile']); } // set folding marks if (i...
cwe
CWE-79
PHP
error::Error GLES2DecoderImpl::HandleDrawArrays( uint32 immediate_data_size, const gles2::DrawArrays& c) { GLenum mode = static_cast<GLenum>(c.mode); GLint first = static_cast<GLint>(c.first); GLsizei count = static_cast<GLsizei>(c.count); if (!validators_->draw_mode.IsValid(mode)) { SetGLError(GL_INVAL...
vuln
Vulnerable
C/C++
#include "source/extensions/filters/http/oauth2/filter.h" #include <algorithm> #include <chrono> #include <memory> #include <string> #include <vector> #include "source/common/common/assert.h" #include "source/common/common/empty_string.h" #include "source/common/common/enum_to_int.h" #include "source/common/common/fm...
cwe
CWE-306
C/C++
"""Base Tornado handlers for the Jupyter server.""" # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. import datetime import functools import ipaddress import json import mimetypes import os import re import sys import traceback import types import warnings from http...
cwe
CWE-601
Python
function decodeMap (buf, offset, length, headerLength, options) { const _temp = decodeArray(buf, offset, 2 * length, headerLength) if (!_temp) return null const [ result, consumedBytes ] = _temp var isPlainObject = !options.preferMap if (isPlainObject) { for (let i = 0; i < 2 * length; i += ...
cwe
CWE-1321
JavaScript
MediaStreamDispatcherHost::MediaStreamDispatcherHost( int render_process_id, int render_frame_id, MediaStreamManager* media_stream_manager) : render_process_id_(render_process_id), render_frame_id_(render_frame_id), media_stream_manager_(media_stream_manager), salt_and_origin_ca...
cwe
CWE-189
C/C++
GPMF_ERR IsValidSize(GPMF_stream *ms, uint32_t size) // size is in longs not bytes. { if (ms) { uint32_t nestsize = (uint32_t)ms->nest_size[ms->nest_level]; if (nestsize == 0 && ms->nest_level == 0) nestsize = ms->buffer_size_longs; if (size + 2 <= nestsize) return GPMF_OK; } return GPMF_ERROR_BAD_STRUCTU...
vuln
Safe
Unknown
def rename Log.add_info(request, params.inspect) @mail_folder = MailFolder.find(params[:id]) unless params[:thetisBoxEdit].nil? or params[:thetisBoxEdit].empty? @mail_folder.name = params[:thetisBoxEdit] @mail_folder.save end render(:partial => 'ajax_folder_name', :layout => false) e...
cwe
CWE-89
Ruby
function doc_link($paths, $text = "<sup>?</sup>") { global $jush, $connection; $server_info = $connection->server_info; $version = preg_replace('~^(\d\.?\d).*~s', '\1', $server_info); // two most significant digits $urls = array( 'sql' => "https://dev.mysql.com/doc/refman/$version/en/", 'sqlite' => "https://www...
vuln
Vulnerable
PHP
Manager.prototype.handleHandshake = function (data, req, res) { var self = this , origin = req.headers.origin , headers = { 'Content-Type': 'text/plain' }; function writeErr (status, message) { if (data.query.jsonp && jsonpolling_re.test(data.query.jsonp)) { res.writeHead(200, { 'Cont...
cwe
CWE-330
JavaScript
function showChannelHighlights() { var tbody = $('.js-highlights-tbody'); var rows = ""; var shouldSortTable = true; for (var i = 0; i < highlightsStats.streams.length; i++) { var strm = highlightsStats.streams[i]; var row = '<tr>'; row += '<td><span class="fake-link js-highlig...
cwe
CWE-79
JavaScript
static void sdhci_send_command(SDHCIState *s) { SDRequest request; uint8_t response[16]; int rlen; s->errintsts = 0; s->acmd12errsts = 0; request.cmd = s->cmdreg >> 8; request.arg = s->argument; trace_sdhci_send_command(request.cmd, request.arg); rlen = sdbus_do_command(&s->sdbus, ...
cwe
CWE-119
Unknown
bool ReceiverWasAdded(const RtpTransceiverState& transceiver_state) { uintptr_t receiver_id = RTCRtpReceiver::getId( transceiver_state.receiver_state()->webrtc_receiver().get()); for (const auto& receiver : handler_->rtp_receivers_) { if (receiver->Id() == receiver_id) return false; ...
cwe
CWE-416
C/C++
function check_admin_referer( $action = -1, $query_arg = '_wpnonce' ) { if ( -1 == $action ) { _doing_it_wrong( __FUNCTION__, __( 'You should specify a nonce action to be verified by using the first parameter.' ), '3.2.0' ); } $adminurl = strtolower( admin_url() ); $referer = strtolower( wp_get_referer() )...
cwe
CWE-843
PHP
static int ext4_writepage(struct page *page, struct writeback_control *wbc) { int ret = 0; loff_t size; unsigned int len; struct buffer_head *page_bufs; struct inode *inode = page->mapping->host; trace_ext4_writepage(inode, page); size = i_size_read(inode); if (page->index == size >> PAGE_CACHE_SHIFT) l...
cwe
CWE-703
Unknown
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { const TfLiteTensor* start = GetInput(context, node, kStartTensor); const TfLiteTensor* limit = GetInput(context, node, kLimitTensor); const TfLiteTensor* delta = GetInput(context, node, kDeltaTensor); TfLiteTensor* output = GetOutput(context, node, ...
cwe
CWE-125
C/C++
export default function shave (target, maxHeight, opts = {}) { if (!maxHeight) throw Error('maxHeight is required') let els = (typeof target === 'string') ? document.querySelectorAll(target) : target if (!els) return const character = opts.character || '…' const classname = opts.classname || 'js-shave' con...
cwe
CWE-79
JavaScript
Prism.languages.lua = { 'comment': /^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m, // \z may be used to skip the following space 'string': { pattern: /(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[\s\S]))*\1|\[(=*)\[[\s\S]*?\]\2\]/, greedy: true }, 'number': /\b0x[a-f\d]+\.?[a-f\d]*(?:p[+-]?\d+)?\b|\b\d+(?:\.\B...
vuln
Vulnerable
JavaScript
public URL createURL(String spaces, String name, String queryString, String anchor, String wikiId, XWikiContext context, FilesystemExportContext exportContext) throws Exception { // Check if the current user has the right to view the SX file. We do this since this is what would happen // in ...
cwe
CWE-22
Java
UWORD16 impeg2d_get_mb_addr_incr(stream_t *ps_stream) { UWORD16 u2_mb_addr_incr = 0; while (impeg2d_bit_stream_nxt(ps_stream,MB_ESCAPE_CODE_LEN) == MB_ESCAPE_CODE) { impeg2d_bit_stream_flush(ps_stream,MB_ESCAPE_CODE_LEN); u2_mb_addr_incr += 33; } u2_mb_addr_incr += impeg2d_dec_vld_...
cwe
CWE-200
C/C++
const got = require('@/utils/got'); const cheerio = require('cheerio'); const { parseDate } = require('@/utils/parse-date'); const { art } = require('@/utils/render'); const path = require('path'); const toSize = (raw) => { const matches = raw.match(/(\d+(\.\d+)?)(\w+)/); return matches[3] === 'GB' ? matches[1...
cwe
CWE-918
JavaScript
static void xen_netbk_fill_frags(struct xen_netbk *netbk, struct sk_buff *skb) { struct skb_shared_info *shinfo = skb_shinfo(skb); int nr_frags = shinfo->nr_frags; int i; for (i = 0; i < nr_frags; i++) { skb_frag_t *frag = shinfo->frags + i; struct xen_netif_tx_request *txp; struct page *page; u16 pending_...
vuln
Safe
C/C++
package object; import util.DBManager; import util.FormatManager; import java.sql.ResultSet; import java.util.ArrayList; import java.util.HashMap; /** * * @author Nick */ public class Variant { private int id; private String chr; private int chrInt; private int position; private String ref; ...
cwe
CWE-89
JavaScript
WebGLObject::WebGLObject(WebGLRenderingContext* context) : m_object(0) , m_attachmentCount(0) , m_deleted(false) { }
cwe
CWE-119
Unknown
end_element(PInfo pi, const char *ename) { if (TRACE <= pi->options->trace) { char indent[128]; if (DEBUG <= pi->options->trace) { char buf[1024]; printf("===== end element stack(%d) =====\n", helper_stack_depth(&pi->helpers)); snprintf(buf, sizeof(buf) - 1, "</%s>", ename); debug_stack(...
cwe
CWE-20
Unknown
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { const TfLiteTensor* input = GetInput(context, node, kInputTensor); TfLiteTensor* output = GetOutput(context, node, kOutputTensor); // There are two ways in which the 'output' can be made dynamic: it could be // a string tensor, or its shape cannot b...
cwe
CWE-125
C/C++
def get_auth_groups Log.add_info(request, params.inspect) begin @folder = Folder.find(params[:id]) rescue @folder = nil end @groups = Group.where(nil).to_a session[:folder_id] = params[:id] render(:partial => 'ajax_auth_groups', :layout => false) end
cwe
CWE-89
Ruby
StyleFormatPanel.prototype.addEffects=function(a){var b=this.editorUi,f=b.editor.graph,d=b.getSelectionState();a.style.paddingTop="4px";a.style.paddingBottom="0px";var g=document.createElement("table");g.style.width="210px";g.style.fontWeight="bold";g.style.tableLayout="fixed";var e=document.createElement("tbody"),k=do...
vuln
Vulnerable
JavaScript
/* Copyright 2020 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
Safe
C/C++
@Override public void renderItem(MinecraftClient mc, MatrixStack matrices, Item item, int x, int y, int w, int h) { if (item == null || item == Items.AIR) { super.renderItem(mc, matrices, item, x, y, w, h); } else { RenderSystem.getModelViewStack().push(); float scale = (h - 2) / 16f; float offset = 1...
vuln
Safe
Java
import datetime import hashlib import itertools import logging import os import time from collections import defaultdict from dataclasses import dataclass from operator import itemgetter from typing import ( AbstractSet, Any, Callable, Collection, Dict, Iterable, List, Mapping, Optio...
cwe
CWE-362
Python
AppProto AppLayerProtoDetectGetProto(AppLayerProtoDetectThreadCtx *tctx, Flow *f, uint8_t *buf, uint32_t buflen, uint8_t ipproto, uint8_t direction) { SCEnter(); SCLogDebug("buflen %u for %s direction"...
vuln
Vulnerable
C/C++
void Context::onDelete() { if (in_vm_context_created_ && wasm_->onDelete_) { wasm_->onDelete_(this, id_); } }
vuln
Safe
C/C++
sctp_disposition_t sctp_sf_do_asconf_ack(struct net *net, const struct sctp_endpoint *ep, const struct sctp_association *asoc, const sctp_subtype_t type, void *arg, sctp_cmd_seq_t *commands) { struct sctp_chunk *asconf_ack = arg; struct sctp_chunk *last_asconf = asoc->addip_last_asconf; struc...
vuln
Safe
C/C++
/** * Licensed to The Apereo Foundation under one or more contributor license * agreements. See the NOTICE file distributed with this work for additional * information regarding copyright ownership. * * * The Apereo Foundation licenses this file to you under the Educational * Community License, Version 2.0 (the ...
cwe
CWE-863
Java
package com.salesmanager.shop.application.config; import static org.springframework.http.MediaType.IMAGE_GIF; import static org.springframework.http.MediaType.IMAGE_JPEG; import static org.springframework.http.MediaType.IMAGE_PNG; import java.util.Arrays; import java.util.List; import java.util.Locale; import org.ap...
vuln
Vulnerable
Java
SiteInstance* parent_site_instance() const { return parent_site_instance_.get(); }
cwe
CWE-787
C/C++
/** * Copyright (c) 2006-2012, JGraph Ltd */ /** * Editor constructor executed on page load. */ Editor = function(chromeless, themes, model, graph, editable) { mxEventSource.call(this); this.chromeless = (chromeless != null) ? chromeless : this.chromeless; this.initStencilRegistry(); this.graph = graph || this....
cwe
CWE-78
JavaScript
static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOptionType options, int is_callable) { zval **arg_pattern_zval; char *arg_pattern; int arg_pattern_len; char *replace; int replace_len; zend_fcall_info arg_replace_fci; zend_fcall_info_cache arg_replace_fci_cache; char *string; i...
vuln
Safe
C/C++
static TfLiteRegistration DynamicCopyOpRegistration() { TfLiteRegistration reg = {nullptr, nullptr, nullptr, nullptr}; reg.prepare = [](TfLiteContext* context, TfLiteNode* node) { // Output 0 is dynamic TfLiteTensor* output0 = GetOutput(context, node, 0); SetTensorToDynamic(output0); //...
cwe
CWE-125
C/C++
bilinear_box_make_weights (PixopsFilterDimension *dim, double scale) { int n = ceil (1/scale + 3.0); double *pixel_weights = g_malloc_n (sizeof (double) * SUBSAMPLE, n); double w; int offset, i; dim->offset = -1.0; dim->n = n; dim->weights = pixel_weights; for (offset = 0; offset...
vuln
Vulnerable
Unknown
static int r3d_seek(AVFormatContext *s, int stream_index, int64_t sample_time, int flags) { AVStream *st = s->streams[0]; R3DContext *r3d = s->priv_data; int frame_num; if (!st->codec->time_base.num || !st->time_base.den) return -1; frame_num = sample_time*st->codec->time_base.den/ ...
vuln
Safe
C/C++
_dbus_validate_signature_with_reason (const DBusString *type_str, int type_pos, int len) { const unsigned char *p; const unsigned char *end; int last; int struct_depth; int array_depth; int dict_entry_dep...
cwe
CWE-20
Unknown
/* 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...
cwe
CWE-197
C/C++
protected function itemLocked($hash) { if (!elFinder::$commonTempPath) { return false; } $lock = elFinder::$commonTempPath . DIRECTORY_SEPARATOR . $hash . '.lock'; if (file_exists($lock)) { if (filemtime($lock) + $this->itemLockExpire < time()) { ...
cwe
CWE-78
PHP
/** * Furnace Tracker - multi-system chiptune tracker * Copyright (C) 2021-2022 tildearrow and contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the Licens...
vuln
Safe
C/C++
int zmq::curve_client_t::produce_hello (msg_t *msg_) { uint8_t hello_nonce [crypto_box_NONCEBYTES]; uint8_t hello_plaintext [crypto_box_ZEROBYTES + 64]; uint8_t hello_box [crypto_box_BOXZEROBYTES + 80]; // Prepare the full nonce memcpy (hello_nonce, "CurveZMQHELLO---", 16); memcpy (hello_nonce...
vuln
Vulnerable
Unknown
int zsetAdd(robj *zobj, double score, sds ele, int *flags, double *newscore) { /* Turn options into simple to check vars. */ int incr = (*flags & ZADD_INCR) != 0; int nx = (*flags & ZADD_NX) != 0; int xx = (*flags & ZADD_XX) != 0; *flags = 0; /* We'll return our response flags. */ double curscor...
cwe
CWE-190
Unknown
static VTermState *vterm_state_new(VTerm *vt) { VTermState *state = vterm_allocator_malloc(vt, sizeof(VTermState)); state->vt = vt; state->rows = vt->rows; state->cols = vt->cols; state->mouse_col = 0; state->mouse_row = 0; state->mouse_buttons = 0; state->mouse_protocol = MOUSE_X10; stat...
vuln
Vulnerable
Unknown
@staticmethod def get_mapped_projects(user_id: int, preferred_locale: str) -> UserMappedProjectsDTO: """ Get all projects a user has mapped on """ # This query looks scary, but we're really just creating an outer join between the query that gets the # counts of all mapped tasks and the quer...
cwe
CWE-89
Python
static int Downmix_Command(effect_handle_t self, uint32_t cmdCode, uint32_t cmdSize, void *pCmdData, uint32_t *replySize, void *pReplyData) { downmix_module_t *pDwmModule = (downmix_module_t *) self; downmix_object_t *pDownmixer; int retsize; if (pDwmModule == NULL || pDwmModule->context.state == DOWNMIX_STATE_U...
cwe
CWE-119
C/C++
def create_basename_core(basename): try: basename = basename.casefold() except Exception: basename = basename.lower() basename = basename.replace(' ', '-') basename = re.sub(r'<[^>]*>', r'', basename) basename = re.sub(r'[^a-z0-9\-]', r'', basename) basename = re.sub(r'\-\-', r'...
cwe
CWE-22
Python
def build_command_line(command, params = nil) return command.to_s if params.nil? || params.empty? "#{command} #{assemble_params(sanitize(params))}" end
cwe
CWE-78
Ruby
def _has_access(*, is_authorized: bool, func: Callable, args, kwargs): """ Define the behavior whether the user is authorized to access the resource. :param is_authorized: whether the user is authorized to access the resource :param func: the function to call if the user is authorized :param args: ...
vuln
Vulnerable
Python
$(function() { openUploadModalDialog(); }); function openUploadModalDialog(){ $('.upload').click(function(e) { e.preventDefault(); var $this = $(this); var show_title = getQueryVariable('show_title', this.href); var show_comment = getQueryVariable('show_comment', this.href);...
cwe
CWE-79
JavaScript
/*- * Copyright (c) 2003-2011 Tim Kientzle * Copyright (c) 2011-2012 Michihiro NAKAJIMA * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain th...
cwe
CWE-787
C/C++
/* * The contents of this file are subject to the OpenMRS Public License * Version 1.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://license.openmrs.org * * Software distributed under the License is distributed on an "AS IS" *...
cwe
CWE-79
Java
int add_mibdir(const char *dirname) { FILE *ip; const char *oldFile = File; char **filenames; int count = 0; int filename_count, i; #if !(defined(WIN32) || defined(cygwin)) char *token; char space; char newline; struct stat ...
vuln
Vulnerable
C/C++
void PrintFormatNumber(void * ValuePtr, int Format, int ByteCount) { int s,n; for(n=0;n<16;n++){ switch(Format){ case FMT_SBYTE: case FMT_BYTE: printf("%02x",*(uchar *)ValuePtr); s=1; break; case FMT_USHORT: printf("%d",Get16u(ValuePtr)); s=2; break; ...
cwe
CWE-703
Unknown
int processMultibulkBuffer(client *c) { char *newline = NULL; int ok; long long ll; if (c->multibulklen == 0) { /* The client should have been reset */ serverAssertWithInfo(c,NULL,c->argc == 0); /* Multi bulk length cannot be read without a \r\n */ newline = strchr(c->q...
vuln
Vulnerable
Unknown
iperf_json_printf(const char *format, ...) { cJSON* o; va_list argp; const char *cp; char name[100]; char* np; cJSON* j; o = cJSON_CreateObject(); if (o == NULL) return NULL; va_start(argp, format); np = name; for (cp = format; *cp != '\0'; ++cp) { switch (*cp) { ...
cwe
CWE-119
Unknown
static inline void check_hwrena(CPUMIPSState *env, int reg, uintptr_t pc) { if ((env->hflags & MIPS_HFLAG_CP0) || (env->CP0_HWREna & (1 << reg))) { return; } do_raise_exception(env, EXCP_RI, pc); }
vuln
Safe
C/C++
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may n...
vuln
Safe
Java
zrsdparams(i_ctx_t *i_ctx_p) { os_ptr op = osp; ref *pFilter; ref *pDecodeParms; int Intent = 0; bool AsyncRead = false; ref empty_array, filter1_array, parms1_array; uint i; int code = 0; check_op(1); if (!r_has_type(op, t_dictionary) && !r_has_type(op, t_null)) { retur...
vuln
Safe
Unknown
ExtensionsGuestViewMessageFilter::ExtensionsGuestViewMessageFilter( int render_process_id, BrowserContext* context) : GuestViewMessageFilter(kFilteredMessageClasses, base::size(kFilteredMessageClasses), render_process_id, ...
cwe
CWE-362
C/C++
static int kvm_set_guest_paused(struct kvm_vcpu *vcpu) { if (!vcpu->arch.time_page) return -EINVAL; vcpu->arch.pvclock_set_guest_stopped_request = true; kvm_make_request(KVM_REQ_CLOCK_UPDATE, vcpu); return 0; }
vuln
Vulnerable
Unknown
void md_map_sh512(uint8_t *hash, const uint8_t *msg, int len) { SHA512Context ctx; if (SHA512Reset(&ctx) != shaSuccess) { RLC_THROW(ERR_NO_VALID); return; } if (SHA512Input(&ctx, msg, len) != shaSuccess) { RLC_THROW(ERR_NO_VALID); return; } if (SHA512Result(&ctx, hash) != shaSuccess) { RLC_THROW(ERR_NO...
vuln
Vulnerable
C/C++
@Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); loadSharedPrefs(); ActionBar actionBar = getActionBar(); if (actionBar != null) { if (isStandalone && catInfo.getBoolean("isDynamic")) { actio...
vuln
Vulnerable
Java