code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
MemberExpression(node, asset) { // Inline environment variables accessed on process.env if (matchesPattern(node.object, 'process.env')) { let key = types.toComputedKey(node); if (types.isStringLiteral(key)) { let val = types.valueToNode(process.env[key.value]); morph(node, val); ...
cwe
CWE-200
JavaScript
MagickExport MagickBooleanType InterpolatePixelChannels( const Image *magick_restrict source,const CacheView_ *source_view, const Image *magick_restrict destination,const PixelInterpolateMethod method, const double x,const double y,Quantum *pixel,ExceptionInfo *exception) { MagickBooleanType status; doub...
cwe
CWE-190
C/C++
std::string queueloader::get_filename(const std::string& str) { std::string fn = ctrl->get_dlpath(); if (fn[fn.length()-1] != NEWSBEUTER_PATH_SEP[0]) fn.append(NEWSBEUTER_PATH_SEP); char buf[1024]; snprintf(buf, sizeof(buf), "%s", str.c_str()); char * base = basename(buf); if (!base || strlen(base) == 0) { c...
cwe
CWE-78
C/C++
translate_compat_table(struct net *net, struct xt_table_info **pinfo, void **pentry0, const struct compat_ipt_replace *compatr) { unsigned int i, j; struct xt_table_info *newinfo, *info; void *pos, *entry0, *entry1; struct compat_ipt_entry *iter0; struct ipt_replace repl; unsigned int s...
cwe
CWE-787
Unknown
NTSTATUS smb2cli_session_set_session_key(struct smbXcli_session *session, const DATA_BLOB _session_key, const struct iovec *recv_iov) { struct smbXcli_conn *conn = session->conn; uint16_t no_sign_flags; uint8_t session_key[16]; bool check_signature = true; uint32_t hdr_flags; NTSTATUS status; struct ...
cwe
CWE-94
Unknown
package io.onedev.server.web.page.project.builds.detail.artifacts; import java.io.File; import java.io.FileOutputStream; import java.io.InputStream; import java.io.OutputStream; import java.util.ArrayList; import java.util.Collection; import java.util.concurrent.Callable; import org.apache.commons.compress.utils.IOUt...
cwe
CWE-22
Java
/* schema_init.c - init builtin schema */ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software <http://www.openldap.org/>. * * Copyright 1998-2020 The OpenLDAP Foundation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted only as auth...
cwe
CWE-617
C/C++
void OneClickSigninHelper::ShowInfoBarIfPossible(net::URLRequest* request, ProfileIOData* io_data, int child_id, int route_id) { std::string google_chrome_signin_value; ...
cwe
CWE-287
C/C++
static bool tight_can_send_png_rect(VncState *vs, int w, int h) { if (vs->tight.type != VNC_ENCODING_TIGHT_PNG) { return false; } if (ds_get_bytes_per_pixel(vs->ds) == 1 || vs->clientds.pf.bytes_per_pixel == 1) { return false; } return true; }
cwe
CWE-787
C/C++
def htmlvalue(self, val): return self.block.render_basic(val)
cwe
CWE-79
Python
/* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include "JSLibInternal.h" #include "hermes/Support/Base64vlq.h" #include "hermes/VM/Callable.h" #include "hermes/VM/JSArray.h" #i...
cwe
CWE-787
C/C++
void AppControllerImpl::BindRequest(mojom::AppControllerRequest request) { bindings_.AddBinding(this, std::move(request)); }
cwe
CWE-416
C/C++
character === '&gt;' ? `${leading}\u00ad&gt;` : matched
cwe
CWE-400
JavaScript
///////////////////////////////////////////////////////////////////////////////// /* UAParser.js v0.7.32 Copyright © 2012-2021 Faisal Salman <f@faisalman.com> MIT License *//* Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data. Supports browser & node.js environment. Demo : ht...
cwe
CWE-1333
JavaScript
jas_image_t *jp2_decode(jas_stream_t *in, const char *optstr) { jp2_box_t *box; int found; jas_image_t *image; jp2_dec_t *dec; bool samedtype; int dtype; unsigned int i; jp2_cmap_t *cmapd; jp2_pclr_t *pclrd; jp2_cdef_t *cdefd; unsigned int channo; int newcmptno; int_fast32_t *lutents; #if 0 jp2_cdefchan_t...
cwe
CWE-125
C/C++
/* * RTMP input format * Copyright (c) 2009 Konstantin Shishkov * * This file is part of FFmpeg. * * FFmpeg 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 2.1 of the License, ...
cwe
CWE-119
C/C++
bucket_push (index_bucket *bucket, CK_OBJECT_HANDLE handle) { unsigned int alloc; alloc = alloc_size (bucket->num); if (bucket->num + 1 > alloc) { CK_OBJECT_HANDLE *elem; alloc = alloc ? alloc * 2 : 1; return_val_if_fail (alloc != 0, false); elem = realloc (bucket->elem, alloc * sizeof (CK_OBJ...
cwe
CWE-190
Unknown
TfLiteStatus LeakyReluEval(TfLiteContext* context, TfLiteNode* node) { const TfLiteTensor* input = GetInput(context, node, 0); TfLiteTensor* output = GetOutput(context, node, 0); const auto* params = reinterpret_cast<TfLiteLeakyReluParams*>(node->builtin_data); const LeakyReluOpData* data = reinterp...
cwe
CWE-125
C/C++
GPMF_ERR IsValidSize(GPMF_stream *ms, uint32_t size) // size is in longs not bytes. { if (ms) { int32_t nestsize = (int32_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_STRUCTURE...
cwe
CWE-369
Unknown
/* * VFIO PCI interrupt handling * * Copyright (C) 2012 Red Hat, Inc. All rights reserved. * Author: Alex Williamson <alex.williamson@redhat.com> * * 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 F...
cwe
CWE-119
C/C++
$('#fn').change(function(){ var name = $('#fn').val(); var item = $('#contacts [data-id="'+Contacts.UI.Card.id+'"]'); $(item).find('a').html(name); var added = false; $('#contacts li').each(function(){ if ($(this).text().toLowerCase() > name.toLowerCase()) { $(this).before(item).fadeIn('f...
cwe
CWE-79
JavaScript
exports.handleRequest = function (request, form, response, ignorePassword) { form = form || {}; if (form.password && !form.md5) form.md5 = md5(form.password); request.logToConsole('login.handleRequest', { action: form.action, email: form.email, md5: form.md5, }); function renderJSON(json) { ...
cwe
CWE-285
JavaScript
"/images/"+ma+".svg";return!0}function M(fa,ca,ba,ja){function ia(na,Ja){null==qa?(na=/^https?:\/\//.test(na)&&!b.editor.isCorsEnabledForUrl(na)?PROXY_URL+"?url="+encodeURIComponent(na):TEMPLATE_PATH+"/"+na,mxUtils.get(na,mxUtils.bind(this,function(Ga){200<=Ga.getStatus()&&299>=Ga.getStatus()&&(qa=Ga.getText());Ja(qa)}...
cwe
CWE-20
JavaScript
ext2_xattr_set(struct inode *inode, int name_index, const char *name, const void *value, size_t value_len, int flags) { struct super_block *sb = inode->i_sb; struct buffer_head *bh = NULL; struct ext2_xattr_header *header = NULL; struct ext2_xattr_entry *here, *last; size_t name_len, free, min_offs = sb->s...
cwe
CWE-19
C/C++
gst_aac_parse_sink_setcaps (GstBaseParse * parse, GstCaps * caps) { GstAacParse *aacparse; GstStructure *structure; gchar *caps_str; const GValue *value; aacparse = GST_AAC_PARSE (parse); structure = gst_caps_get_structure (caps, 0); caps_str = gst_caps_to_string (caps); GST_DEBUG_OBJECT (aacparse, "s...
cwe
CWE-125
Unknown
static int ssl23_get_server_hello(SSL *s) { char buf[8]; unsigned char *p; int i; int n; n=ssl23_read_bytes(s,7); if (n != 7) return(n); p=s->packet; memcpy(buf,p,n); if ((p[0] & 0x80) && (p[2] == SSL2_MT_SERVER_HELLO) && (p[5] == 0x00) && (p[6] == 0x02)) { #ifdef OPENSSL_NO_SSL2 SSLerr(SSL_F_SSL23_...
cwe
CWE-310
Unknown
static void handle_rx(struct vhost_net *net) { struct vhost_net_virtqueue *nvq = &net->vqs[VHOST_NET_VQ_RX]; struct vhost_virtqueue *vq = &nvq->vq; unsigned uninitialized_var(in), log; struct vhost_log *vq_log; struct msghdr msg = { .msg_name = NULL, .msg_namelen = 0, .msg_control = NULL, /* FIXME: get and h...
cwe
CWE-20
C/C++
static SDL_Surface* Create_Surface_Shaded(int width, int height, SDL_Color fg, SDL_Color bg, Uint32 *color) { const int alignment = Get_Alignement() - 1; SDL_Surface *textbuf; Sint64 size; Uint8 bg_alpha = bg.a; /* Create a surface with memory: * - pitch is rounded to alignment * - adress...
cwe
CWE-787
Unknown
lyd_dup_to_ctx(const struct lyd_node *node, int options, struct ly_ctx *ctx) { struct ly_ctx *log_ctx; struct lys_node_list *slist; struct lys_node *schema; const char *yang_data_name; const struct lys_module *trg_mod; const struct lyd_node *next, *elem; struct lyd_node *ret, *parent, *key, ...
cwe
CWE-119
Unknown
SYSCALL_DEFINE5(perf_event_open, struct perf_event_attr __user *, attr_uptr, pid_t, pid, int, cpu, int, group_fd, unsigned long, flags) { struct perf_event *group_leader = NULL, *output_event = NULL; struct perf_event *event, *sibling; struct perf_event_attr attr; struct perf_event_context *ctx; struct file *e...
cwe
CWE-284
Unknown
/* ** class.c - Class class ** ** See Copyright Notice in mruby.h */ #include <stdarg.h> #include <mruby.h> #include <mruby/array.h> #include <mruby/class.h> #include <mruby/numeric.h> #include <mruby/proc.h> #include <mruby/string.h> #include <mruby/variable.h> #include <mruby/error.h> #include <mruby/data.h> #includ...
cwe
CWE-476
C/C++
def test_modify_config(self) -> None: user1 = uuid4() user2 = uuid4() # no admins set self.assertTrue(can_modify_config_impl(InstanceConfig(), UserInfo())) # with oid, but no admin self.assertTrue( can_modify_config_impl(InstanceConfig(), UserInfo(object_id=...
cwe
CWE-863
Python
static int __init serial_ir_init_module(void) { int result; switch (type) { case IR_HOMEBREW: case IR_IRDEO: case IR_IRDEO_REMOTE: case IR_ANIMAX: case IR_IGOR: /* if nothing specified, use ttyS0/com1 and irq 4 */ io = io ? io : 0x3f8; irq = irq ? irq : 4; break; default: return -EINVAL; } if (!sof...
cwe
CWE-416
C/C++
function writeCommentDate(comment, dateDiv) { dateDiv.innerHTML = ''; var ts = new Date(comment.modifiedDate); var str = editorUi.timeSince(ts); if (str == null) { str = mxResources.get('lessThanAMinute'); } mxUtils.write(dateDiv, mxResources.get('timeAgo', [str], '{1} ago')); dateDiv.setAttri...
cwe
CWE-94
JavaScript
static Image *ReadMTVImage(const ImageInfo *image_info,ExceptionInfo *exception) { char buffer[MaxTextExtent]; Image *image; MagickBooleanType status; register ssize_t x; register PixelPacket *q; register unsigned char *p; ssize_t count, y; unsigned char *pixel...
cwe
CWE-401
Unknown
/* Copyright 2021 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-754
C/C++
void pjsua_init_tpselector(pjsua_transport_id tp_id, pjsip_tpselector *sel) { pjsua_transport_data *tpdata; unsigned flag; pj_bzero(sel, sizeof(*sel)); if (tp_id == PJSUA_INVALID_ID) return; pj_assert(tp_id >= 0 && tp_id < (int)PJ_ARRAY_SIZE(pjsua_var.tpdata)); tpdata = &pjsua_var.tpdat...
cwe
CWE-787
Unknown
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { const TfLiteTensor* cond_tensor = GetInput(context, node, kInputConditionTensor); TfLiteTensor* output = GetOutput(context, node, kOutputTensor); if (IsDynamicTensor(output)) { TF_LITE_ENSURE_OK(context, ResizeOutputTen...
cwe
CWE-125
C/C++
gss_unwrap_aead (minor_status, context_handle, input_message_buffer, input_assoc_buffer, output_payload_buffer, conf_state, qop_state) OM_uint32 * minor_status; gss_ctx_id_t context_handle; gss_buffer_t input_message_buffer; gss_buffer_t input_assoc_buffer...
cwe
CWE-415
C/C++
/* * Copyright (C) International Business Machines Corp., 2002-2004 * Copyright (C) Andreas Gruenbacher, 2001 * Copyright (C) Linus Torvalds, 1991, 1992 * * 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 * ...
cwe
CWE-285
C/C++
exports.database.prototype.findKeys = function (key, notKey, callback) { var query="SELECT `key` FROM `store` WHERE `key` LIKE ?" , params=[] ; //desired keys are key, e.g. pad:% key=key.replace(/\*/g,'%'); params.push(key); if(notKey!=null && notKey != undefined){ //not desired keys are notK...
cwe
CWE-697
JavaScript
nfs41_callback_svc(void *vrqstp) { struct svc_rqst *rqstp = vrqstp; struct svc_serv *serv = rqstp->rq_server; struct rpc_rqst *req; int error; DEFINE_WAIT(wq); set_freezable(); while (!kthread_should_stop()) { if (try_to_freeze()) continue; prepare_to_wait(&serv->sv_cb_waitq, &wq, TASK_INTERRUPTIB...
cwe
CWE-404
C/C++
// SPDX-License-Identifier: BSD-2-Clause /* * Copyright (c) 2015-2016, Linaro Limited * Copyright (c) 2014, STMicroelectronics International N.V. */ #include <assert.h> #include <bench.h> #include <compiler.h> #include <initcall.h> #include <io.h> #include <kernel/linker.h> #include <kernel/msg_param.h> #include <k...
cwe
CWE-119
C/C++
addPlugin(name, instance) { const lowerName = name.toLowerCase(); if (this.hasPlugin(lowerName)) { throw new Error(`A plugin called "${name}" is already registered.`); } if (typeof instance !== 'function' && instance instanceof PluginBase === false) { throw new ...
cwe
CWE-1321
JavaScript
static int ___sys_recvmsg(struct socket *sock, struct msghdr __user *msg, struct msghdr *msg_sys, unsigned int flags, int nosec) { struct compat_msghdr __user *msg_compat = (struct compat_msghdr __user *)msg; struct iovec iovstack[UIO_FASTIOV]; struct iovec *iov = iovstack; unsigned long cmsg_ptr; int err...
cwe
CWE-20
Unknown
static void move_ptes(struct vm_area_struct *vma, pmd_t *old_pmd, unsigned long old_addr, unsigned long old_end, struct vm_area_struct *new_vma, pmd_t *new_pmd, unsigned long new_addr, bool need_rmap_locks, bool *need_flush) { struct mm_struct *mm = vma->vm_mm; pte_t *old_pte, *new_pte, pte; spinlock_t *old_pt...
cwe
CWE-459
Unknown
public function update(Request $request) { $request->validate([ 'token' => 'required', 'email' => 'required|email', 'password' => 'required|min:1|confirmed', ]); $tokenMd5 = \MicroweberPackages\User\Models\PasswordReset::where('email', $request->get('emai...
cwe
CWE-190
PHP
/* * Copyright (c) 2009-2012, Salvatore Sanfilippo <antirez at gmail dot com> * 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 co...
cwe
CWE-787
C/C++
void decode(const char * in0, int size, FilterCharVector & out) const { const Chr * in = reinterpret_cast<const Chr *>(in0); if (size == -1) { for (;*in; ++in) out.append(*in); } else { const Chr * stop = reinterpret_cast<const Chr *>(in0 +size); for (;in != stop; ++i...
cwe
CWE-125
Unknown
async function set_up_api_server(app) { // Check for existing session secret value const session_secret_setting = await Settings.findOne({ where: { key: constants.session_secret_key } }); if (!session_secret_setting) { console.error(`No session secret is set, can't start API server...
cwe
CWE-287
JavaScript
return P.apply(this,arguments)};mxGraphView.prototype.createEnumerationValue=function(u){u=decodeURIComponent(mxUtils.getValue(u.style,"enumerateValue",""));""==u&&(u=++this.enumerationState);return'<div style="padding:2px;border:1px solid gray;background:yellow;border-radius:2px;">'+mxUtils.htmlEntities(u)+"</div>"};m...
cwe
CWE-20
JavaScript
public void save(String comment, boolean minorEdit) throws XWikiException { if (hasAccessLevel("edit")) { // If the current author does not have PR don't let it set current user as author of the saved document // since it can lead to right escalation if (hasProgrammingRig...
cwe
CWE-863
Java
/* * Cantata * * Copyright (c) 2011-2018 Craig Drummond <craig.p.drummond@gmail.com> * * ---- * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (a...
cwe
CWE-22
C/C++
static inline void phar_set_inode(phar_entry_info *entry TSRMLS_DC) /* {{{ */ { char tmp[MAXPATHLEN]; int tmp_len; tmp_len = entry->filename_len + entry->phar->fname_len; memcpy(tmp, entry->phar->fname, entry->phar->fname_len); memcpy(tmp + entry->phar->fname_len, entry->filename, entry->filename_len); entry->in...
cwe
CWE-119
C/C++
TfLiteStatus SelectEval(TfLiteContext* context, TfLiteNode* node) { OpData* data = reinterpret_cast<OpData*>(node->user_data); const TfLiteTensor* input_condition = GetInput(context, node, kInputTensorCondition); const TfLiteTensor* input_x = GetInput(context, node, kInputTensorX); const TfLiteTensor* inp...
cwe
CWE-787
C/C++
void remap_struct(unsigned int gtypes_nr[], unsigned int ftypes_nr[], void *ps, unsigned int f_size, unsigned int g_size) { int d; /* Sanity check */ if (MAP_SIZE(ftypes_nr) > f_size) return; /* Remap [unsigned] long fields */ d = gtypes_nr[0] - ftypes_nr[0]; if (d) { memmove(((char *) ps) + gtypes_nr[0...
cwe
CWE-125
C/C++
#!/bin/python # -*- coding: utf-8 -*- """ | This file is part of the web2py Web Framework | Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu> | License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html) Auth, Mail, PluginManager and various utilities ------------------------------------------------ """ import ...
cwe
CWE-601
JavaScript
int fuse_open_common(struct inode *inode, struct file *file, bool isdir) { struct fuse_mount *fm = get_fuse_mount(inode); struct fuse_conn *fc = fm->fc; int err; bool is_wb_truncate = (file->f_flags & O_TRUNC) && fc->atomic_o_trunc && fc->writeback_cache; bool dax_truncate = (file->f_flags & O_TRUNC) && ...
cwe
CWE-459
Unknown
/* 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 a...
cwe
CWE-787
Python
/********************************************************************** * gost_ec_keyx.c * * * * Copyright (c) 2005-2013 Cryptocom LTD * * Copyright (c) 2018,2020 Dmi...
cwe
CWE-120
C/C++
int VvcVpsUnit::deserialize() { int rez = VvcUnit::deserialize(); if (rez) return rez; try { vps_id = m_reader.getBits(4); vps_max_layers = m_reader.getBits(6) + 1; vps_max_sublayers = m_reader.getBits(3) + 1; bool vps_default_ptl_dpb_hrd_max_tid_flag = ...
cwe
CWE-22
Unknown
public function test_valid_comment_0_content() { $result = $this->myxmlrpcserver->wp_newComment( array( 1, 'administrator', 'administrator', self::$post->ID, array( 'content' => '0', ), ) ); $this->assertNotIXRError( $result ); }
cwe
CWE-862
PHP
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { auto* params = reinterpret_cast<TfLiteEmbeddingLookupSparseParams*>(node->builtin_data); TfLiteTensor* output; TF_LITE_ENSURE_OK(context, GetOutputSafe(context, node, 0, &output)); const TfLiteTensor* ids; TF_LITE_ENSURE_OK(context, GetInputS...
cwe
CWE-190
C/C++
var // A central reference to the root jQuery(document) rootjQuery, // The deferred used on DOM ready readyList, // Use the correct document accordingly with window argument (sandbox) document = window.document, location = window.location, // Map over jQuery in case of overwrite _jQuery = window.jQuery, /...
cwe
CWE-79
Java
m,!1)});l.className="geBtn";e.appendChild(l);l=mxUtils.button(mxResources.get("apply"),function(){v(b.editor.graph,f,!0)});l.className="geBtn gePrimaryBtn";e.appendChild(l);b.editor.cancelFirst||e.appendChild(u);c.appendChild(e);D.appendChild(c);t.appendChild(D);this.container=t},CustomDialog=function(b,f,l,d,u,t,D,c,e...
cwe
CWE-20
JavaScript
static bool svm_need_emulation_on_page_fault(struct kvm_vcpu *vcpu) { unsigned long cr4 = kvm_read_cr4(vcpu); bool smep = cr4 & X86_CR4_SMEP; bool smap = cr4 & X86_CR4_SMAP; bool is_user = svm_get_cpl(vcpu) == 3; /* * Detect and workaround Errata 1096 Fam_17h_00_0Fh. * * Errata: * When CPU raise #NPF on g...
cwe
CWE-835
C/C++
def get_avail_fence_agents(params, request, session) if not allowed_for_local_cluster(session, Permissions::READ) return 403, 'Permission denied' end agents = getFenceAgents(session) return JSON.generate(agents) end
cwe
CWE-384
Ruby
// Copyright 2012-2018 (c) Peter Širka <petersirka@gmail.com> // // 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, cop...
cwe
CWE-22
JavaScript
int mutt_b64_decode(char *out, const char *in) { int len = 0; unsigned char digit4; do { const unsigned char digit1 = in[0]; if ((digit1 > 127) || (base64val(digit1) == BAD)) return -1; const unsigned char digit2 = in[1]; if ((digit2 > 127) || (base64val(digit2) == BAD)) return -...
cwe
CWE-120
C/C++
lldp_decode(struct lldpd *cfg OVS_UNUSED, char *frame, int s, struct lldpd_hardware *hardware, struct lldpd_chassis **newchassis, struct lldpd_port **newport) { struct lldpd_chassis *chassis; struct lldpd_port *port; const struct eth_addr lldpaddr = LLDP_MULTICAST_ADDR; const cha...
cwe
CWE-400
C/C++
static void lsi_execute_script(LSIState *s) { PCIDevice *pci_dev = PCI_DEVICE(s); uint32_t insn; uint32_t addr, addr_high; int opcode; int insn_processed = 0; s->istat1 |= LSI_ISTAT1_SRUN; again: insn_processed++; insn = read_dword(s, s->dsp); if (!insn) { /* If we receive a...
cwe
CWE-835
Unknown
function toggleResolve(evt) { function doToggle() { var resolveActionLnk = evt.target; resolveActionLnk.innerHTML = ''; comment.isResolved = !comment.isResolved; mxUtils.write(resolveActionLnk, comment.isResolved? mxResources.get('reopen') : mxResources.get('resolve')); var actionsD...
cwe
CWE-94
JavaScript
public function addRemote($name, $url, array $params = NULL) { $this->run('remote', 'add', $params, $name, $url); return $this; }
cwe
CWE-88
PHP
# -*- coding: utf-8 -*- # Copyright (c) 2018, Frappe Technologies and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _ import json from frappe.model.document import Document from frappe.desk.doctype.notification_log.notification_l...
cwe
CWE-79
Python
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
cwe
CWE-190
C/C++
def _add_volume_to_volume_set(self, volume, volume_name, cpg, vvs_name, qos): if vvs_name is not None: # Admin has set a volume set name to add the volume to self._cli_run('createvvset -add %s %s' % (vvs_name, ...
cwe
CWE-78
Python
// SPDX-License-Identifier: GPL-2.0 /* * gadget.c - DesignWare USB3 DRD Controller Gadget Framework Link * * Copyright (C) 2010-2011 Texas Instruments Incorporated - http://www.ti.com * * Authors: Felipe Balbi <balbi@ti.com>, * Sebastian Andrzej Siewior <bigeasy@linutronix.de> */ #include <linux/kernel.h> #...
cwe
CWE-667
C/C++
function d(ja,U,J,V){function P(){U.removeChild(la);U.removeChild(ta);ia.style.display="block";R.style.display="block"}H={div:U,comment:ja,saveCallback:J,deleteOnCancel:V};var R=U.querySelector(".geCommentTxt"),ia=U.querySelector(".geCommentActionsList"),la=document.createElement("textarea"); la.className="geCommentEdi...
cwe
CWE-94
JavaScript
function add_review(data, event) { var diag_list = []; for (var idx = 0; idx < data.issues().length; idx++) { var cur_diag = data.issues()[idx]; if (cur_diag.selected()) { diag_list.push(cur_diag.jsonify()); } } var proc_list = []; for (idx = 0; idx < data.proced...
cwe
CWE-79
JavaScript
status_t BnHDCP::onTransact( uint32_t code, const Parcel &data, Parcel *reply, uint32_t flags) { switch (code) { case HDCP_SET_OBSERVER: { CHECK_INTERFACE(IHDCP, data, reply); sp<IHDCPObserver> observer = interface_cast<IHDCPObserver>(data.readStrongBinder()); r...
cwe
CWE-189
C/C++
/* // Copyright (c) 2018 Intel Corporation // // 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...
cwe
CWE-276
C/C++
function addComment(comment, parentArr, parent, level, showResolved) { //Skip resolved comments if showResolved is not set if (!showResolved && comment.isResolved) { return; } noComments.style.display = 'none'; var cdiv = document.createElement('div'); cdiv.className = 'geCommentContainer'; cdiv...
cwe
CWE-94
JavaScript
def check_in_interaction_ids access_token = Hackbot::Team .find_by(team_id: team.team_id) .bot_access_token im_id = SlackClient::Chat.open_im(slack_id, access_token)[:channel][:id] check_in_interactions = Hackbot::Interactions::CheckIn ...
cwe
CWE-89
Ruby
function formatValue( $name, $value ) { $row = $this->mCurrentRow; $wiki = $row->files_dbname; switch ( $name ) { case 'files_timestamp': $formatted = htmlspecialchars( $this->getLanguage()->userTimeAndDate( $row->files_timestamp, $this->getUser() ) ); break; case 'files_dbname': $formatted = ...
cwe
CWE-20
PHP
mobility_print(netdissect_options *ndo, const u_char *bp, const u_char *bp2 _U_) { const struct ip6_mobility *mh; const u_char *ep; unsigned mhlen, hlen; uint8_t type; mh = (const struct ip6_mobility *)bp; /* 'ep' points to the end of available data. */ ep = ndo->ndo_snapend; if (!ND_TTEST(mh-...
cwe
CWE-125
C/C++
/* bubblewrap * Copyright (C) 2016 Alexander Larsson * * This program 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 2 of the License, or (at your option) any later version. * ...
cwe
CWE-269
C/C++
public function onUpLoadPreSave(&$path, &$name, $src, $elfinder, $volume) { $opts = $this->opts; $volOpts = $volume->getOptionsPlugin('AutoResize'); if (is_array($volOpts)) { $opts = array_merge($this->opts, $volOpts); } if (! $opts['enable']) { return false; } $srcImgInfo = @getimagesize($src...
cwe
CWE-89
JavaScript
/* Copyright 2014 The Kubernetes Authors. 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 in writing, ...
cwe
CWE-863
Go
mwifiex_set_uap_rates(struct mwifiex_uap_bss_param *bss_cfg, struct cfg80211_ap_settings *params) { struct ieee_types_header *rate_ie; int var_offset = offsetof(struct ieee80211_mgmt, u.beacon.variable); const u8 *var_pos = params->beacon.head + var_offset; int len = params->beacon.head_len - var_offset; u...
cwe
CWE-787
C/C++
/* Copyright 2017 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-20
Python
xps_load_sfnt_name(xps_font_t *font, char *namep) { byte *namedata; int offset, length; /*int format;*/ int count, stringoffset; int found; int i, k; found = 0; strcpy(namep, "Unknown"); offset = xps_find_sfnt_table(font, "name", &length); if (offset < 0 || length < 6) { ...
cwe
CWE-125
C/C++
package clustersmngr import ( "context" "fmt" "sync" "time" "github.com/cheshir/ttlcache" "github.com/go-logr/logr" "github.com/weaveworks/weave-gitops/core/nsaccess" "github.com/weaveworks/weave-gitops/pkg/server/auth" v1 "k8s.io/api/core/v1" apiruntime "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachine...
cwe
CWE-532
Go
/* Audio File Library Copyright (C) 1998-2000, 2003-2004, 2010-2013, Michael Pruett <michael@68k.org> Copyright (C) 2000-2002, Silicon Graphics, Inc. Copyright (C) 2002-2003, Davy Durham This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public Lice...
cwe
CWE-119
C/C++
static void yurex_disconnect(struct usb_interface *interface) { struct usb_yurex *dev; int minor = interface->minor; dev = usb_get_intfdata(interface); usb_set_intfdata(interface, NULL); /* give back our minor */ usb_deregister_dev(interface, &yurex_class); /* prevent more I/O from starting */ mutex_lock(&de...
cwe
CWE-476
Unknown
export async function loadFromGit(input: Input): Promise<string | never> { try { return await new Promise((resolve, reject) => { exec(createCommand(input), { encoding: 'utf-8', maxBuffer: 1024 * 1024 * 1024 }, (error, stdout) => { if (error) { reject(error); } else { reso...
cwe
CWE-78
JavaScript
/* * Released under the GPLv2 only. * SPDX-License-Identifier: GPL-2.0 */ #include <linux/usb.h> #include <linux/usb/ch9.h> #include <linux/usb/hcd.h> #include <linux/usb/quirks.h> #include <linux/module.h> #include <linux/slab.h> #include <linux/device.h> #include <asm/byteorder.h> #include "usb.h" #define USB_M...
cwe
CWE-125
C/C++
/* * Copyright (C) Dmitry Volyntsev * Copyright (C) NGINX, Inc. */ #include <njs_main.h> typedef struct { int fd; njs_str_t name; njs_str_t file; char path[NJS_MAX_PATH + 1]; } njs_module_info_t; static njs_int_t njs_module_lookup(njs_vm_t *vm...
cwe
CWE-787
C/C++
/* Copyright 2017 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-908
Python
static void get_sem_elements(struct sem_data *p) { size_t i; if (!p || !p->sem_nsems || p->sem_perm.id < 0) return; p->elements = xcalloc(p->sem_nsems, sizeof(struct sem_elem)); for (i = 0; i < p->sem_nsems; i++) { struct sem_elem *e = &p->elements[i]; union semun arg = { .val = 0 }; e->semval = semctl(...
cwe
CWE-190
C/C++
mxUtils.write(U,mxResources.get("timeAgo",[J],"{1} ago"));U.setAttribute("title",ja.toLocaleDateString()+" "+ja.toLocaleTimeString())}function g(ja){var U=document.createElement("img");U.className="geCommentBusyImg";U.src=IMAGE_PATH+"/spin.gif";ja.appendChild(U);ja.busyImg=U}function m(ja){ja.style.border="1px solid re...
cwe
CWE-94
JavaScript