code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2016-2017, Yanis Guenane <yanis+ansible@guenane.org> # Copyright: (c) 2017, Markus Teufelberger <mteufelberger+ansible@mgit.at> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import...
cwe
CWE-116
C/C++
void *umm_calloc( size_t num, size_t item_size ) { void *ret; size_t size = item_size * num; /* check poison of each blocks, if poisoning is enabled */ if (!CHECK_POISON_ALL_BLOCKS()) { return NULL; } /* check full integrity of the heap, if this check is enabled */ if (!INTEGRITY_CHECK()) { retu...
cwe
CWE-190
Unknown
import os import tempfile from galaxy import model from galaxy.util.bunch import Bunch from galaxy.util.none_like import NoneDataset from galaxy.util.template import fill_template from galaxy.tools.wrappers import ( DatasetFilenameWrapper, DatasetListWrapper, DatasetCollectionWrapper, LibraryDatasetVal...
cwe
CWE-74
Python
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++
const bootbox = require('bootbox'); const Requisition = require('../model/Requisition'); require('../services/Requisitions'); require('../services/Synchronize'); /** * @author Alejandro Galue <agalue@opennms.org> * @copyright 2014 The OpenNMS Group, Inc. */ (function() { 'use strict'; angular.module('onms-req...
cwe
CWE-352
Java
function getDefaultAdapter() { var adapter; if (typeof XMLHttpRequest !== 'undefined') { // For browsers use XHR adapter adapter = __webpack_require__(8); } else if (typeof process !== 'undefined') { // For node use HTTP adapter adapter = __webpack_require__(8); } return adapter; }
cwe
CWE-755
JavaScript
bool VaapiVideoDecodeAccelerator::VaapiVP9Accelerator::GetFrameContext( const scoped_refptr<VP9Picture>& pic, Vp9FrameContext* frame_ctx) { NOTIMPLEMENTED() << "Frame context update not supported"; return false; }
cwe
CWE-362
C/C++
'use strict'; 'require baseclass'; 'require view'; 'require fs'; 'require ui'; var isReadonlyView = !L.hasViewPermission() || null; var SSHPubkeyDecoder = baseclass.singleton({ lengthDecode: function(s, off) { var l = (s.charCodeAt(off++) << 24) | (s.charCodeAt(off++) << 16) | (s.charCodeAt(off++) << 8) ...
cwe
CWE-79
JavaScript
/* zip_dirent.c -- read directory entry (local or central), clean dirent Copyright (C) 1999-2016 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at <libzip@nih.at> Redistribution and use in source and binary forms, with or with...
cwe
CWE-415
C/C++
create_bits (pixman_format_code_t format, int width, int height, int * rowstride_bytes, pixman_bool_t clear) { int stride; size_t buf_size; int bpp; /* what follows is a long-winded way, avoiding any possibility of inte...
cwe
CWE-189
C/C++
static int check_mtab(const char *progname, const char *devname, const char *dir) { if (check_newline(progname, devname) == -1 || check_newline(progname, dir) == -1) return EX_USAGE; return 0; }
cwe
CWE-20
Unknown
def parse_line(s): s = s.rstrip() r = re.sub(REG_LINE_GPERF, '', s) if r != s: return r r = re.sub(REG_HASH_FUNC, 'hash(OnigCodePoint codes[])', s) if r != s: return r r = re.sub(REG_STR_AT, 'onig_codes_byte_at(codes, \\1)', s) if r != s: return r r = re.sub(REG_UNFOLD_KEY, 'unicode_unf...
cwe
CWE-787
C/C++
def call(env) env[HTTP_ORIGIN] ||= env[HTTP_X_ORIGIN] if env[HTTP_X_ORIGIN] add_headers = nil if env[HTTP_ORIGIN] debug(env) do [ 'Incoming Headers:', " Origin: #{env[HTTP_ORIGIN]}", " Access-Control-Request-Method: #{env[HTTP_ACCESS_CONTROL_REQUEST_METHOD]...
cwe
CWE-22
Ruby
def delete_statistics_group Log.add_info(request, params.inspect) group_id = params[:group_id] if group_id.nil? or group_id.empty? @group_ids = Research.get_statistics_groups render(:partial => 'ajax_statistics_groups', :layout => false) return end @group_ids = Research.delete_...
cwe
CWE-89
Ruby
(function() { // Adds Lean Mapping shapes Sidebar.prototype.addLeanMappingPalette = function() { var w = 100; var h = 100; var s = mxConstants.STYLE_STROKEWIDTH + '=2;html=1;shape=mxgraph.lean_mapping.'; var s2 = mxConstants.STYLE_VERTICAL_LABEL_POSITION + '=bottom;html=1;' + mxConstants.STYLE_VERTICAL_ALIGN...
cwe
CWE-79
Java
static int probe_rio(struct usb_interface *intf, const struct usb_device_id *id) { struct usb_device *dev = interface_to_usbdev(intf); struct rio_usb_data *rio = &rio_instance; int retval; dev_info(&intf->dev, "USB Rio found at address %d\n", dev->devnum); retval = usb_register_dev(intf, &usb_rio_class); ...
cwe
CWE-415
C/C++
def set_pre_prov_vars @layout = "miq_request_vm" @edit = {} @edit[:explorer] = @explorer @edit[:vm_sortdir] ||= "ASC" @edit[:vm_sortcol] ||= "name" @edit[:prov_type] = "VM Provision" @edit[:hide_deprecated_templates] = true if request.parameters[:controller] == "vm_cloud" unless %w(imag...
cwe
CWE-502
Ruby
static int rtsx_usb_ms_drv_probe(struct platform_device *pdev) { struct memstick_host *msh; struct rtsx_usb_ms *host; struct rtsx_ucr *ucr; int err; ucr = usb_get_intfdata(to_usb_interface(pdev->dev.parent)); if (!ucr) return -ENXIO; dev_dbg(&(pdev->dev), "Realtek USB Memstick controller found\n"); msh ...
cwe
CWE-416
Unknown
/* * Copyright 2020 ThoughtWorks, 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 agr...
cwe
CWE-668
Java
/** * <a href="http://www.openolat.org"> * OpenOLAT - Online Learning and Training</a><br> * <p> * Licensed under the Apache License, Version 2.0 (the "License"); <br> * you may not use this file except in compliance with the License.<br> * You may obtain a copy of the License at the * <a href="http://www.apache...
cwe
CWE-91
Java
// Dependencies const protocols = require("protocols") , isSsh = require("is-ssh") , qs = require("query-string") ; /** * parsePath * Parses the input url. * * @name parsePath * @function * @param {String} url The input url. * @return {Object} An object containing the following fields: * * - `pro...
cwe
CWE-639
JavaScript
void NetworkHandler::SetRenderer(RenderProcessHost* process_host, RenderFrameHostImpl* frame_host) { process_ = process_host; host_ = frame_host; }
cwe
CWE-20
C/C++
static int oidc_handle_session_management_iframe_rp(request_rec *r, oidc_cfg *c, oidc_session_t *session, const char *client_id, const char *check_session_iframe) { oidc_debug(r, "enter"); const char *java_script = " <script type=\"text/javascript\">\n" " var targetOrigin = '%s';\n" " var...
cwe
CWE-79
Unknown
package com.salesmanager.shop.admin.controller.content; import java.io.ByteArrayInputStream; import java.net.URLConnection; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Locale; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.htt...
cwe
CWE-79
Java
def self.normalize url url.sub!(/#(?!\!)[^#]*$/,'') url.sub!('|', '%7C') uri = URI.parse(url) @@normalizer_for[uri.host].new(uri).normalize end
cwe
CWE-116
Ruby
static void worker_process(int fd, debugger_request_t& request) { std::string tombstone_path; int tombstone_fd = -1; switch (request.action) { case DEBUGGER_ACTION_DUMP_TOMBSTONE: case DEBUGGER_ACTION_CRASH: tombstone_fd = open_tombstone(&tombstone_path); if (tombstone_fd == -1) { ALOGE("debuggerd:...
cwe
CWE-264
C/C++
foreach ($elem[2] as $field) { echo ' <tr class="tr_cf tr_fields hidden" id="cf_tr_'.$field[0].'"> <td valign="top" class="td_title">&nbsp;&nbsp;<i class="fa fa-caret-right"></i>&nbsp;<i>'.$field[1].'</i> :</td> <td>'; if ($fiel...
cwe
CWE-269
PHP
static int hugetlbfs_statfs(struct dentry *dentry, struct kstatfs *buf) { struct hugetlbfs_sb_info *sbinfo = HUGETLBFS_SB(dentry->d_sb); struct hstate *h = hstate_inode(dentry->d_inode); buf->f_type = HUGETLBFS_MAGIC; buf->f_bsize = huge_page_size(h); if (sbinfo) { spin_lock(&sbinfo->stat_lock); /* If no limi...
cwe
CWE-399
C/C++
// SPDX-License-Identifier: GPL-2.0-or-later /* * * Copyright (C) Alan Cox GW4PTS (alan@lxorguk.ukuu.org.uk) * Copyright (C) Jonathan Naylor G4KLX (g4klx@g4klx.demon.co.uk) * Copyright (C) Darryl Miles G7LED (dlm@g7led.demon.co.uk) * Copyright (C) Steven Whitehouse GW7RRM (stevew@acm.org) * Copyright (C) Joerg Re...
cwe
CWE-476
C/C++
R_API RBinJavaAttrInfo *r_bin_java_local_variable_type_table_attr_new(ut8 *buffer, ut64 sz, ut64 buf_offset) { RBinJavaLocalVariableTypeAttribute *lvattr; ut64 offset = 6; ut32 i = 0; RBinJavaAttrInfo *attr = r_bin_java_default_attr_new (buffer, sz, 0); if (!attr) { return NULL; } attr->type = R_BIN_JAVA_ATTR_...
cwe
CWE-125
Unknown
'use strict'; // @ts-check // ================================================================================== // utils.js // ---------------------------------------------------------------------------------- // Description: System Information - library // for Node.js // Copyright: (c) 2014 - 202...
cwe
CWE-78
JavaScript
void stralgoLCS(client *c) { uint32_t i, j; long long minmatchlen = 0; sds a = NULL, b = NULL; int getlen = 0, getidx = 0, withmatchlen = 0; robj *obja = NULL, *objb = NULL; for (j = 2; j < (uint32_t)c->argc; j++) { char *opt = c->argv[j]->ptr; int moreargs = (c->argc-1) - j; ...
cwe
CWE-190
C/C++
function dockerContainerProcesses(containerID, callback) { containerID = containerID || ''; let result = []; return new Promise((resolve) => { process.nextTick(() => { if (containerID) { if (!_docker_socket) { _docker_socket = new DockerSocket(); } _docker_socket.getP...
cwe
CWE-78
JavaScript
public static void addActionsToNotification(PushActionsProvider provider, String categoryId, NotificationCompat.Builder builder, Intent targetIntent, Context context) throws IOException { // NOTE: THis will likely run when the main activity isn't running so we won't have // access to any display proper...
cwe
CWE-668
Java
package repository import ( "bytes" "context" "encoding/json" "errors" "fmt" goio "io" "io/fs" "io/ioutil" "net/url" "os" "os/exec" "path" "path/filepath" "regexp" "strings" "time" "github.com/argoproj/argo-cd/v2/util/io/files" "github.com/Masterminds/semver/v3" "github.com/TomOnTime/utfutil" "gi...
cwe
CWE-61
Go
PROCESS_THREAD(snmp_process, ev, data) { PROCESS_BEGIN(); /* new connection with remote host */ snmp_udp_conn = udp_new(NULL, 0, NULL); udp_bind(snmp_udp_conn, SNMP_SERVER_PORT); LOG_DBG("Listening on port %u\n", uip_ntohs(snmp_udp_conn->lport)); while(1) { PROCESS_YIELD(); if(ev == tcpip_event) ...
cwe
CWE-125
C/C++
static int udf_readdir(struct file *file, struct dir_context *ctx) { struct inode *dir = file_inode(file); struct udf_inode_info *iinfo = UDF_I(dir); struct udf_fileident_bh fibh = { .sbh = NULL, .ebh = NULL}; struct fileIdentDesc *fi = NULL; struct fileIdentDesc cfi; int block, iblock; loff_t nf_pos; int flen;...
cwe
CWE-17
C/C++
package com.salesmanager.shop.store.controller.product.facade; import com.salesmanager.core.model.merchant.MerchantStore; import com.salesmanager.core.model.reference.language.Language; import com.salesmanager.shop.model.catalog.product.type.PersistableProductType; import com.salesmanager.shop.model.catalog.product.ty...
cwe
CWE-639
Java
static int iucv_sock_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, size_t len, int flags) { int noblock = flags & MSG_DONTWAIT; struct sock *sk = sock->sk; struct iucv_sock *iucv = iucv_sk(sk); unsigned int copied, rlen; struct sk_buff *skb, *rskb, *cskb; int err = 0; if ((sk-...
cwe
CWE-200
C/C++
function G(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=r.hasLoaded,a=o;return Object($.t)(e)&&!Object($.p)(e)&&"function"==typeof e.afterLoad&&(a=!0,X(e.afterLoad).call(this,t)),Object($.s)(e)?G.call(this,e(t),t,{hasLoaded:a}):Object($.p)(e)?M()(e).call(e,(function(e){return G.call(n,e...
cwe
CWE-451
JavaScript
write_header( FT_Error error_code ) { FT_Face face; const char* basename; const char* format; error = FTC_Manager_LookupFace( handle->cache_manager, handle->scaler.face_id, &face ); if ( error ) Fatal( "can't access font file" ); if ( !statu...
cwe
CWE-120
C/C++
function catSpanFadeOut( postid, ame_cats ) { //jQuery("span#ame_category" + postid + ", a#thickboxlink" + postid).fadeOut('fast', function() { var loading = '<img border="0" alt="" src="' + ameAjaxL10n.imgUrl + 'loader.gif" align="absbottom" /> ' + ameAjaxL10n.pleaseWait; jQuery("span#ame_category" + postid).fade...
cwe
CWE-352
JavaScript
get_policy_2_svc(gpol_arg *arg, struct svc_req *rqstp) { static gpol_ret ret; kadm5_ret_t ret2; char *prime_arg, *funcname; gss_buffer_desc client_name, service_name; OM_uint32 minor_stat; kadm5_principal_ent_rec ...
cwe
CWE-772
C/C++
ciphertext_to_compressed (gnutls_session_t session, gnutls_datum_t *ciphertext, gnutls_datum_t * compressed, uint8_t type, record_parameters_st * params, uint64* sequence) { uint8_t tag[MAX_HASH_SIZE]; unsigned...
cwe
CWE-310
C/C++
mesalink_connect_step1(struct Curl_easy *data, struct connectdata *conn, int sockindex) { char *ciphers; struct ssl_connect_data *connssl = &conn->ssl[sockindex]; struct in_addr addr4; #ifdef ENABLE_IPV6 struct in6_addr addr6; #endif const char *const hostname = SSL_IS_PROXY() ? con...
cwe
CWE-290
Unknown
public static function updatePassword(Db $zdb, $id_adh, $pass) { try { $cpass = password_hash($pass, PASSWORD_BCRYPT); $update = $zdb->update(self::TABLE); $update->set( array('mdp_adh' => $cpass) )->where(self::PK . ' = ' . $id_adh); ...
cwe
CWE-89
PHP
# -*- coding: utf-8 -*- """ eve.io.mongo.parser ~~~~~~~~~~~~~~~~~~~ This module implements a Python-to-Mongo syntax parser. Allows the MongoDB data-layer to seamlessly respond to a Python-like query. :copyright: (c) 2017 by Nicola Iarocci. :license: BSD, see LICENSE for more details. """ imp...
cwe
CWE-94
Python
public void headerMultipleContentLengthValidationShouldPropagate() { LastInboundHandler inboundHandler = new LastInboundHandler(); request.addLong(HttpHeaderNames.CONTENT_LENGTH, 0); request.addLong(HttpHeaderNames.CONTENT_LENGTH, 1); Http2StreamChannel channel = newInboundStream(3, fals...
cwe
CWE-444
Java
char *curl_easy_unescape(CURL *handle, const char *string, int length, int *olen) { int alloc = (length?length:(int)strlen(string))+1; char *ns = malloc(alloc); unsigned char in; int strindex=0; unsigned long hex; CURLcode res; if(!ns) return NULL; while(--alloc > 0) { ...
cwe
CWE-89
C/C++
/* * Copyright (c) 2008-2013 University of Dundee. & Open Microscopy Environment. * All rights reserved. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the *...
cwe
CWE-79
Python
status_t BnOMX::onTransact( uint32_t code, const Parcel &data, Parcel *reply, uint32_t flags) { switch (code) { case LIVES_LOCALLY: { CHECK_OMX_INTERFACE(IOMX, data, reply); node_id node = (node_id)data.readInt32(); pid_t pid = (pid_t)data.readInt32(); reply->writeInt32(livesLoc...
cwe
CWE-119
Unknown
func TestPermissions(t *testing.T) { EnsureCleanState(t) appName := Name() _, err := RunCli("proj", "create", "test") assert.NoError(t, err) // make sure app cannot be created without permissions in project _, err = RunCli("app", "create", appName, "--repo", RepoURL(RepoURLTypeFile), "--path", guestbookPath, "...
cwe
CWE-200
Go
function configure() { deskDomain = 'https://' + config.deskDomain + '.freshdesk.com'; deskApiKey = config.deskApiKey; deskTypes = config.deskTypes || deskTypes; deskStatus = config.deskStatus || deskStatus; deskStatusWidth = {}; // Precomputes text widths for custom ticket status var div = document....
cwe
CWE-94
JavaScript
const got = require('@/utils/got'); const { parseDate } = require('@/utils/parse-date'); module.exports = async (ctx) => { const { namespace, project, host } = ctx.params; const host_ = host ? host : 'gitlab.com'; const namespace_ = encodeURIComponent(namespace); const api_url = `https://${host_}/api...
cwe
CWE-918
JavaScript
static int virtio_net_load(QEMUFile *f, void *opaque, int version_id) { VirtIONet *n = opaque; VirtIODevice *vdev = VIRTIO_DEVICE(n); int ret, i, link_down; if (version_id < 2 || version_id > VIRTIO_NET_VM_VERSION) return -EINVAL; ret = virtio_load(vdev, f); if (ret) { return r...
cwe
CWE-119
Unknown
html: function (element, attrs, content) { return '<div align="' + (attrs.defaultattr || 'left') + '">' + content + '</div>'; },
cwe
CWE-79
JavaScript
static void ati_cursor_define(ATIVGAState *s) { uint8_t data[1024]; uint8_t *src; int i, j, idx = 0; if ((s->regs.cur_offset & BIT(31)) || s->cursor_guest_mode) { return; /* Do not update cursor if locked or rendered by guest */ } /* FIXME handle cur_hv_offs correctly */ src = s->vg...
cwe
CWE-125
C/C++
op_format( oparg_T *oap, int keep_cursor) // keep cursor on same text char { long old_line_count = curbuf->b_ml.ml_line_count; // Place the cursor where the "gq" or "gw" command was given, so that "u" // can put it back there. curwin->w_cursor = oap->cursor_start; if (u_save((linenr_T)(o...
cwe
CWE-125
C/C++
static SUB_STATE_RETURN read_state_machine(SSL *s) { OSSL_STATEM *st = &s->statem; int ret, mt; unsigned long len = 0; int (*transition) (SSL *s, int mt); PACKET pkt; MSG_PROCESS_RETURN(*process_message) (SSL *s, PACKET *pkt); WORK_STATE(*post_process_message) (SSL *s, WORK_STATE wst); u...
cwe
CWE-400
Unknown
unpack14 (const unsigned char b[14], unsigned short s[16]) { // // Unpack a 14-byte block into 4 by 4 16-bit pixels. // #if defined (DEBUG) assert (b[2] != 0xfc); #endif s[ 0] = (b[0] << 8) | b[1]; unsigned short shift = (b[ 2] >> 2); unsigned short bias = (0x20 << shift); s[ 4]...
cwe
CWE-190
Unknown
function renderFile(file) { if (prevDiv == null) { return; } prevDiv.style.background = 'transparent'; prevDiv.innerHTML = ''; function showRenderMsg(msg) { prevDiv.style.background = 'transparent'; prevDiv.innerHTML = ''; var status = document.createElement('div'); status.classNa...
cwe
CWE-94
JavaScript
static unsigned long arch_get_unmapped_area_common(struct file *filp, unsigned long addr0, unsigned long len, unsigned long pgoff, unsigned long flags, enum mmap_allocation_direction dir) { struct mm_struct *mm = current->mm; struct vm_area_struct *vma; unsigned long addr = addr0; int do_color_align; struct vm_u...
cwe
CWE-119
Unknown
/** * Copyright (c) 2006-2012, JGraph Ltd */ /** * Construcs a new sidebar for the given editor. */ function Sidebar(editorUi, container) { this.editorUi = editorUi; this.container = container; this.palettes = new Object(); this.taglist = new Object(); this.lastCreated = 0; this.showTooltips = true; this.gra...
cwe
CWE-79
JavaScript
//====== Copyright Valve Corporation, All rights reserved. ==================== #include "steamnetworkingsockets_snp.h" #include "steamnetworkingsockets_connections.h" #include "crypto.h" // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" namespace SteamNetworkingSocketsLib { st...
cwe
CWE-787
C/C++
void Compute(OpKernelContext* ctx) override { const Tensor& shape_t = ctx->input(0); const Tensor& alpha_t = ctx->input(1); OP_REQUIRES(ctx, TensorShapeUtils::IsVector(shape_t.shape()) && (shape_t.dtype() == DataType::DT_INT32 || shape_t.dtype() == D...
cwe
CWE-754
C/C++
function mergeConfig(from, to) { for (var f in from) { if (_.isObject(from[f])) { if (!_.isObject(to[f])) { to[f] = from[f]; } else { mergeConfig(from[f], to[f]); } } else { to[f] = from[f]; } } }
cwe
CWE-915
JavaScript
/** * OLAT - Online Learning and Training<br> * http://www.olat.org * <p> * Licensed under the Apache License, Version 2.0 (the "License"); <br> * you may not use this file except in compliance with the License.<br> * You may obtain a copy of the License at * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * Unl...
cwe
CWE-22
Java
text : Ext.util.Format.htmlEncode(this.app.i18n._hidden(attr.name)), qtip : Tine.Tinebase.common.doubleEncode(attr.description ? this.app.i18n._hidden(attr.description) + ' ' + addText : addText), selected : attr.id === this.selectedFilterId, id : ...
cwe
CWE-79
JavaScript
" "+d.sSortDesc).addClass("asc"==g[e]?d.sSortAsc:"desc"==g[e]?d.sSortDesc:c.sSortingClass),b.find("span."+d.sSortIcon).removeClass(d.sSortJUIAsc+" "+d.sSortJUIDesc+" "+d.sSortJUI+" "+d.sSortJUIAscAllowed+" "+d.sSortJUIDescAllowed).addClass("asc"==g[e]?d.sSortJUIAsc:"desc"==g[e]?d.sSortJUIDesc:c.sSortingClassJUI))})}}})...
cwe
CWE-79
JavaScript
package proxyutil import ( "context" "errors" "log" "net/http" "net/http/httputil" "strings" "time" glog "github.com/grafana/grafana/pkg/infra/log" ) // StatusClientClosedRequest A non-standard status code introduced by nginx // for the case when a client closes the connection while nginx is processing // th...
cwe
CWE-522
Go
// mkerrors.sh -m64 // Code generated by the command above; see README.md. DO NOT EDIT. // +build amd64,darwin // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -m64 _const.go package unix import "syscall" const ( AF_APPLETALK = 0x10 AF_CCITT = 0xa...
cwe
CWE-287
Go
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
cwe
CWE-399
C/C++
static ssize_t runtime_active_kids_show(struct device *dev, struct device_attribute *attr, char *buf) { return sprintf(buf, "%d\n", dev->power.ignore_children ? 0 : atomic_read(&dev->power.child_count)); }
cwe
CWE-787
Unknown
function editInPlace(element) { closeEditInPlaceForms(); // create edit form var tag_id = $(this).attr('id').substr(5); var tag_name = $(this).text(); var tag_width = $(this).width(); $(this).parent().data("revert", $(this).parent().html()); var form = '<form id="gRenameTagForm" method="post" class="ui-h...
cwe
CWE-79
JavaScript
struct dump_dir *create_dump_dir_from_problem_data(problem_data_t *problem_data, const char *base_dir_name) { INITIALIZE_LIBREPORT(); char *type = problem_data_get_content_or_NULL(problem_data, FILENAME_ANALYZER); if (!type) { error_msg(_("Missing required item: '%s'"), FILENAME_ANALYZER); ...
cwe
CWE-22
C/C++
Chapters::~Chapters() { while (m_editions_count > 0) { Edition& e = m_editions[--m_editions_count]; e.Clear(); } }
cwe
CWE-20
C/C++
LONG ValidateSignature(HWND hDlg, const char* path) { LONG r; WINTRUST_DATA trust_data = { 0 }; WINTRUST_FILE_INFO trust_file = { 0 }; GUID guid_generic_verify = // WINTRUST_ACTION_GENERIC_VERIFY_V2 { 0xaac56b, 0xcd44, 0x11d0,{ 0x8c, 0xc2, 0x0, 0xc0, 0x4f, 0xc2, 0x95, 0xee } }; char *signature_name; size_t i, l...
cwe
CWE-347
C/C++
'use strict'; const request = require('request'); /** * A default set of user agent patterns for bots/crawlers that do not perform * well with pages that require JavaScript. */ const botUserAgents = module.exports.botUserAgents = [ 'W3C_Validator', 'baiduspider', 'bingbot', 'embedly', 'facebookexternalhi...
cwe
CWE-200
JavaScript
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #ifdef HERMES_ENABLE_DEBUGGER #include "hermes/VM/Debugger/Debugger.h" #include "hermes/Support/UTF8.h" #include "hermes/VM/Cal...
cwe
CWE-681
C/C++
package model; import object.Region; import util.DBManager; import util.FormatManager; import java.sql.ResultSet; import java.util.ArrayList; import javax.servlet.http.HttpServletRequest; /** * * @author Nick */ public class Input { public static String query; public static String table; public static...
cwe
CWE-89
JavaScript
static int snd_compress_check_input(struct snd_compr_params *params) { /* first let's check the buffer parameter's */ if (params->buffer.fragment_size == 0 || params->buffer.fragments > SIZE_MAX / params->buffer.fragment_size) return -EINVAL; /* now codec parameters */ if (params->codec.id == 0 || param...
cwe
CWE-703
C/C++
void Context::onDelete() { if (wasm_->onDelete_) { wasm_->onDelete_(this, id_); } }
cwe
CWE-476
C/C++
/* * Copyright (c) 2004-2021, University of Oslo * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this * list of cond...
cwe
CWE-918
Java
public static function unsetTransactionPart(Db $zdb, Login $login, $trans_id, $contrib_id) { try { //first, we check if contribution is part of transaction $c = new Contribution($zdb, $login, (int)$contrib_id); if ($c->isTransactionPartOf($trans_id)) { $up...
cwe
CWE-89
PHP
void Init(void) { for(int i = 0;i < 15;i++) { X[i].Init(); M[i].Init(); } }
cwe
CWE-617
C/C++
package server import ( "context" "errors" "fmt" "sort" "sync" "time" "github.com/ipfs/go-cid" blockstore "github.com/ipfs/go-ipfs-blockstore" "github.com/ipfs/go-libipfs/bitswap/internal/defaults" "github.com/ipfs/go-libipfs/bitswap/message" pb "github.com/ipfs/go-libipfs/bitswap/message/pb" bmetrics "gi...
cwe
CWE-770
Go
int ssl_set_hostname( ssl_context *ssl, const char *hostname ) { if( hostname == NULL ) return( POLARSSL_ERR_SSL_BAD_INPUT_DATA ); ssl->hostname_len = strlen( hostname ); if( ssl->hostname_len + 1 == 0 ) return( POLARSSL_ERR_SSL_BAD_INPUT_DATA ); ssl->hostname = polarssl_malloc( ssl->...
cwe
CWE-119
C/C++
long vorbis_book_decodev_add(codebook *book,float *a,oggpack_buffer *b,int n){ if(book->used_entries>0){ int i,j,entry; float *t; if(book->dim>8){ for(i=0;i<n;){ entry = decode_packed_entry_number(book,b); if(entry==-1)return(-1); t = book->valuelist+entry*book->dim; ...
cwe
CWE-787
Unknown
/* * Media device * * Copyright (C) 2010 Nokia Corporation * * Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com> * Sakari Ailus <sakari.ailus@iki.fi> * * 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 *...
cwe
CWE-200
C/C++
int ssl_cipher_list_to_bytes(SSL *s,STACK_OF(SSL_CIPHER) *sk,unsigned char *p, int (*put_cb)(const SSL_CIPHER *, unsigned char *)) { int i,j=0; SSL_CIPHER *c; unsigned char *q; #ifndef OPENSSL_NO_KRB5 int nokrb5 = !kssl_tgt_is_available(s->kssl_ctx); #endif /* OPENSSL_NO_KRB5 */ if (sk == NULL) return(0)...
cwe
CWE-310
Unknown
int udp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, size_t len, int noblock, int flags, int *addr_len) { struct inet_sock *inet = inet_sk(sk); struct sockaddr_in *sin = (struct sockaddr_in *)msg->msg_name; struct sk_buff *skb; unsigned int ulen, copied; int peeked, off = 0; int err; int is...
cwe
CWE-20
Unknown
/* * Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * * WSO2 Inc. licenses this file to you 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/...
cwe
CWE-306
Java
// SPDX-License-Identifier: GPL-2.0 /* * linux/fs/file.c * * Copyright (C) 1998-1999, Stephen Tweedie and Bill Hawes * * Manage the dynamic fd arrays in the process files_struct. */ #include <linux/syscalls.h> #include <linux/export.h> #include <linux/fs.h> #include <linux/mm.h> #include <linux/sched/signal.h...
cwe
CWE-416
C/C++
__add_options_to_select(select, options) { for(var value of options) { var option = document.createElement('option'); if (Array.isArray(value)) { // array of type [value, text] option.value = value[1]; option.innerHTML = value[1]; } else { // only value, text=value option.value = value; optio...
cwe
CWE-79
JavaScript
int FileInStream::overrun(int itemSize, int nItems, bool wait) { if (itemSize > (int)sizeof(b)) throw Exception("FileInStream overrun: max itemSize exceeded"); if (end - ptr != 0) memmove(b, ptr, end - ptr); end -= ptr - b; ptr = b; while (end < b + itemSize) { size_t n = fread((U8 *)end, b + ...
cwe
CWE-122
C/C++
/* ecc-mod-arith.c Copyright (C) 2013, 2014 Niels Möller This file is part of GNU Nettle. GNU Nettle is free software: you can redistribute it and/or modify it under the terms of either: * the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of...
cwe
CWE-787
C/C++
/* * GET mobile config */ exports.enrollment = function(req, res){ res.set('Content-Type', 'text/html'); var url = require('url'); var url_parts = url.parse(req.url, true); var query = url_parts.query; var tudid = query.udid; if (tudid) // If it's in the query, store it and redirect (so t...
cwe
CWE-79
JavaScript
/* =========================================================================== Copyright (C) 1999-2005 Id Software, Inc. This file is part of Quake III Arena source code. Quake III Arena source code is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as publish...
cwe
CWE-254
C/C++
gss_wrap_iov_length (minor_status, context_handle, conf_req_flag, qop_req, conf_state, iov, iov_count) OM_uint32 * minor_status; gss_ctx_id_t context_handle; int conf_req_flag; gss_qop_t qo...
cwe
CWE-415
C/C++
static bool blit_is_unsafe(struct CirrusVGAState *s) { /* should be the case, see cirrus_bitblt_start */ assert(s->cirrus_blt_width > 0); assert(s->cirrus_blt_height > 0); if (blit_region_is_unsafe(s, s->cirrus_blt_dstpitch, s->cirrus_blt_dstaddr & s->cirrus_addr_mask)) { ...
cwe
CWE-119
Unknown