code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
void DelayedExecutor::delayedExecute(const QString &udi) { Solid::Device device(udi); QString exec = m_service.exec(); MacroExpander mx(device); mx.expandMacros(exec); KRun::runCommand(exec, QString(), m_service.icon(), 0); deleteLater(); }
cwe
CWE-78
Unknown
arch_get_unmapped_area(struct file *filp, unsigned long addr, unsigned long len, unsigned long pgoff, unsigned long flags) { struct mm_struct *mm = current->mm; struct vm_area_struct *vma; struct vm_unmapped_area_info info; unsigned long begin, end; if (flags & MAP_FIXED) return addr; find_start_end(flags, ...
cwe
CWE-119
Unknown
void IndexedDBCursor::RemoveCursorFromTransaction() { if (transaction_) transaction_->UnregisterOpenCursor(this); }
cwe
CWE-416
C/C++
/* xfrm_user.c: User interface to configure xfrm engine. * * Copyright (C) 2002 David S. Miller (davem@redhat.com) * * Changes: * Mitsuru KANDA @USAGI * Kazunori MIYAZAWA @USAGI * Kunihiro Ishiguro <kunihiro@ipinfusion.com> * IPv6 support * */ #include <linux/crypto.h> #include <linux/module.h> #include ...
cwe
CWE-200
C/C++
package authz import ( "time" proto "github.com/gogo/protobuf/proto" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) // NewGrant returns new Grant func NewGrant(a Authorization, expiration time.Time) (Grant, error) { g := Grant{ Expiration: expirati...
cwe
CWE-754
Go
def add_input(self, data): connection = self.connect() try: # The following introduces a deliberate security flaw. # See section on SQL injection below query = "INSERT INTO crimes (description) VALUES('{}');".format(data) with connection.cursor() as curso...
cwe
CWE-89
Python
# -*- coding: utf-8 -*- from django.contrib.auth.decorators import login_required from django.shortcuts import render, redirect, get_object_or_404 from django.urls import reverse from spirit.core.utils.views import is_post, post_data, is_ajax from spirit.core.utils import json_response from spirit.comment.models impo...
cwe
CWE-601
Python
EditorUi.prototype.updateCssForMarker=function(b,e,k,n,D){b.style.verticalAlign="top";b.style.height="21px";b.style.width="21px";b.innerHTML="";"flexArrow"==k?b.className=null!=n&&n!=mxConstants.NONE?"geSprite geSprite-"+e+"blocktrans":"geSprite geSprite-noarrow":(k=this.getImageForMarker(n,D),null!=k?(n=document.creat...
cwe
CWE-94
JavaScript
int modbus_reply(modbus_t *ctx, const uint8_t *req, int req_length, modbus_mapping_t *mb_mapping) { int offset; int slave; int function; uint16_t address; uint8_t rsp[MAX_MESSAGE_LENGTH]; int rsp_length = 0; sft_t sft; if (ctx == NULL) { errno = EINVAL; ...
cwe
CWE-125
C/C++
_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...
cwe
CWE-399
C/C++
static int snd_timer_start_slave(struct snd_timer_instance *timeri) { unsigned long flags; spin_lock_irqsave(&slave_active_lock, flags); timeri->flags |= SNDRV_TIMER_IFLG_RUNNING; if (timeri->master) list_add_tail(&timeri->active_list, &timeri->master->slave_active_head); spin_unlock_irqrestore(&slave_...
cwe
CWE-362
C/C++
static int rfcomm_sock_getname(struct socket *sock, struct sockaddr *addr, int *len, int peer) { struct sockaddr_rc *sa = (struct sockaddr_rc *) addr; struct sock *sk = sock->sk; BT_DBG("sock %p, sk %p", sock, sk); sa->rc_family = AF_BLUETOOTH; sa->rc_channel = rfcomm_pi(sk)->channel; if (peer) bacpy(&...
cwe
CWE-200
C/C++
int snd_ctl_add(struct snd_card *card, struct snd_kcontrol *kcontrol) { struct snd_ctl_elem_id id; unsigned int idx; unsigned int count; int err = -EINVAL; if (! kcontrol) return err; if (snd_BUG_ON(!card || !kcontrol->info)) goto error; id = kcontrol->id; down_write(&card->controls_rwsem); if (snd_c...
cwe
CWE-189
Unknown
void pin_remove(struct fs_pin *pin) { spin_lock(&pin_lock); hlist_del(&pin->m_list); hlist_del(&pin->s_list); spin_unlock(&pin_lock); spin_lock_irq(&pin->wait.lock); pin->done = 1; wake_up_locked(&pin->wait); spin_unlock_irq(&pin->wait.lock); }
cwe
CWE-703
C/C++
# -*- test-case-name: twisted.web.test.test_web -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Implementation of the lowest-level Resource class. """ __all__ = [ "IResource", "getChildForRequest", "Resource", "ErrorPage", "NoResource", "ForbiddenResource", ...
cwe
CWE-79
Python
TfLiteTensor* GetTempRhs(TfLiteContext* context, TfLiteNode* node, const TfLiteTensor* rhs) { TfLiteTensor* transposed_rhs = GetTemporary(context, node, 1); if (rhs->type == kTfLiteInt8) { // Get the quantization params from the RHS tensor. transposed_rhs->params.scale = rhs->params...
cwe
CWE-787
Unknown
/* radare - LGPL - Copyright 2009-2022 - ret2libc, pancake */ #include <r_types.h> #include <r_util.h> #include <r_io.h> typedef enum { R_BUFFER_FILE, R_BUFFER_IO, R_BUFFER_BYTES, R_BUFFER_MMAP, R_BUFFER_SPARSE, R_BUFFER_REF, } RBufferType; #include "buf_file.c" #include "buf_sparse.c" #include "buf_bytes.c" #...
cwe
CWE-400
C/C++
static ssize_t auto_online_blocks_show(struct device *dev, struct device_attribute *attr, char *buf) { return sprintf(buf, "%s\n", online_type_to_str[memhp_default_online_type]); }
cwe
CWE-787
Unknown
__zzip_parse_root_directory(int fd, struct _disk_trailer *trailer, struct zzip_dir_hdr **hdr_return, zzip_plugin_io_t io) { auto struct zzip_disk_entry dirent; struct zzip_dir_hdr *hdr; struct zzip_dir_hdr *hdr0; uint16_...
cwe
CWE-119
C/C++
function Extract (opts) { if (!(this instanceof Extract)) return new Extract(opts); var self = this; Parse.call(self,opts); self.on('entry', function(entry) { if (entry.type == 'Directory') return; entry.pipe(Writer({ path: path.join(opts.path,entry.path) })) .on('error',function(e)...
cwe
CWE-22
JavaScript
async function getLatestVersions(name) { const { stdout } = await execAsync(`npm view ${name} versions --json`); try { return JSON.parse(stdout); } catch (err) { throw new Error(`Failed to parse output from NPM view - ${err.toString()}`); } }
cwe
CWE-78
JavaScript
QPDF::makeIndirectObject(QPDFObjectHandle oh) { int max_objid = getObjectCount(); QPDFObjGen next(max_objid + 1, 0); this->m->obj_cache[next] = ObjCache(QPDFObjectHandle::ObjAccessor::getObject(oh), -1, -1); return QPDFObjectHandle::Factory::newIndirect( this, next.getObj(), next.getGen()); }
cwe
CWE-787
Unknown
/* 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-476
Python
rpmVerifyAttrs rpmfilesVerify(rpmfiles fi, int ix, rpmVerifyAttrs omitMask) { rpm_mode_t fmode = rpmfilesFMode(fi, ix); rpmfileAttrs fileAttrs = rpmfilesFFlags(fi, ix); rpmVerifyAttrs flags = rpmfilesVFlags(fi, ix); const char * fn = rpmfilesFN(fi, ix); struct stat sb; rpmVerifyAttrs vfy = RPMVE...
cwe
CWE-59
C/C++
/* * Authentication certificate routines for the CUPS scheduler. * * Copyright © 2021-2022 by OpenPrinting. * Copyright © 2007-2016 by Apple Inc. * Copyright © 1997-2006 by Easy Software Products. * * Licensed under Apache License v2.0. See the file "LICENSE" for more * information. */ /* * Include necessar...
cwe
CWE-269
C/C++
raptor_turtle_writer_get_option(raptor_turtle_writer *turtle_writer, raptor_option option) { int result = -1; switch(option) { case RAPTOR_OPTION_WRITER_AUTO_INDENT: result = TURTLE_WRITER_AUTO_INDENT(turtle_writer); break; case RAPTOR_OPTION_WRITER_INDENT_WID...
cwe
CWE-611
C/C++
void HTMLFormElement::scheduleFormSubmission(FormSubmission* submission) { DCHECK(submission->method() == FormSubmission::PostMethod || submission->method() == FormSubmission::GetMethod); DCHECK(submission->data()); DCHECK(submission->form()); if (submission->action().isEmpty()) return; if (docum...
cwe
CWE-19
C/C++
QStringList JlCompress::extractDir(QuaZip &zip, const QString &dir) { if(!zip.open(QuaZip::mdUnzip)) { return QStringList(); } QDir directory(dir); QStringList extracted; if (!zip.goToFirstFile()) { return QStringList(); } do { QString name = zip.getCurrentFileName()...
cwe
CWE-22
C/C++
int ParseWave64HeaderConfig (FILE *infile, char *infilename, char *fourcc, WavpackContext *wpc, WavpackConfig *config) { int64_t total_samples = 0, infilesize; Wave64ChunkHeader chunk_header; Wave64FileHeader filehdr; WaveHeader WaveHeader; int format_chunk = 0; uint32_t bcount; infilesize ...
cwe
CWE-665
Unknown
// This module allows other modules to create command line tasks. // // A command line task is invoked like this: // // node app @apostrophecms/migration:migrate // // Apostrophe is fully initialized before your task is run, except that it does // not listen for connections. So you may access all of its features in you...
cwe
CWE-613
JavaScript
write_header( FT_Error error_code ) { FT_Face face; const char* basename; error = FTC_Manager_LookupFace( handle->cache_manager, handle->scaler.face_id, &face ); if ( error ) PanicZ( "can't access font file" ); if ( !status.header ) { b...
cwe
CWE-120
C/C++
PHP_METHOD(Phar, offsetGet) { char *fname, *error; size_t fname_len; zval zfname; phar_entry_info *entry; zend_string *sfname; PHAR_ARCHIVE_OBJECT(); if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &fname, &fname_len) == FAILURE) { return; } /* security is 0 here so that we can get a better error message t...
cwe
CWE-20
Unknown
function n(n){var s=fn[n]||gn;u[n]=s(t[n],e[n],i,n)}
cwe
CWE-79
JavaScript
.5),!1));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,l-v,x));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(l-v),x-p));c.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,x-p));return c};z.prototype.getConstraints=function(c,l,x){c=[];var p=x*Math.max(0,Math.min(1,parseFloat(mxUt...
cwe
CWE-20
JavaScript
void WebPImage::decodeChunks(uint64_t filesize) { DataBuf chunkId(5); byte size_buff[WEBP_TAG_SIZE]; bool has_canvas_data = false; #ifdef DEBUG std::cout << "Reading metadata" << std::endl; #endif chunkId.pData_[4] = '\0' ; while ( !io_->eof() && (uint64...
cwe
CWE-190
C/C++
void mutt_init (int skip_sys_rc, LIST *commands) { struct passwd *pw; struct utsname utsname; char *p, buffer[STRING], error[STRING]; int i, default_rc = 0, need_pause = 0; BUFFER err; memset (&err, 0, sizeof (err)); err.data = error; err.dsize = sizeof (error); Groups = hash_create (1031, 0); Rev...
cwe
CWE-668
Unknown
int CLASS ljpeg_diff_new (LibRaw_bit_buffer& bits, LibRaw_byte_buffer* buf,ushort *huff) { int len, diff; len = bits._gethuff_lj(buf,*huff,huff+1); if (len == 16 && (!dng_version || dng_version >= 0x1010000)) return -32768; diff = bits._getbits_lj(buf,len); if ((diff & (1 << (len-1))) == 0) diff -= (...
cwe
CWE-703
Unknown
void DownloadItemImpl::OnDownloadRenamedToFinalName( DownloadFileManager* file_manager, const FilePath& full_path) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); VLOG(20) << __FUNCTION__ << "()" << " full_path = \"" << full_path.value() << "\"" << " needed rename = " << Need...
cwe
CWE-119
C/C++
def process_form(): # see https://docs.python.org/3.4/library/cgi.html for the basic usage # here. form = cgi.FieldStorage() # connect to the database conn = MySQLdb.connect(host = pnsdp.SQL_HOST, user = pnsdp.SQL_USER, passwd = pnsdp.SQL_P...
cwe
CWE-89
Python
import { Base64 } from 'js-base64'; export const mermaidUrl = (graphStr, options, api) => { const obj = { code: graphStr, mermaid: options, }; const objStr = JSON.stringify(obj); let url = 'http://localhost:9000/e2e.html?graph=' + Base64.encodeURI(objStr); if (api) { url = 'http://localhost:9000/...
cwe
CWE-74
JavaScript
WORD32 ih264d_cavlc_4x4res_block_totalcoeff_11to16(UWORD32 u4_isdc, UWORD32 u4_total_coeff_trail_one, /*!<TotalCoefficients<<16+trailingones*/ dec_bit_stream_t *ps_bitstrm ) { UWORD32 u4_total_zeroes; WORD32 i; UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffe...
cwe
CWE-119
C/C++
static bool getCoverageFormat12(vector<uint32_t>& coverage, const uint8_t* data, size_t size) { const size_t kNGroupsOffset = 12; const size_t kFirstGroupOffset = 16; const size_t kGroupSize = 12; const size_t kStartCharCodeOffset = 0; const size_t kEndCharCodeOffset = 4; const size_t kMaxNGroups = 0xfffffff0 / k...
cwe
CWE-20
C/C++
public static String getPropertyDef(InputSpec inputSpec, Map<String, Integer> indexes, String pattern, DefaultValueProvider defaultValueProvider) { int index = indexes.get(inputSpec.getName()); StringBuffer buffer = new StringBuffer(); inputSpec.appendField(buffer, index, "String"); inputSpec.appendCommonAn...
cwe
CWE-94
Java
const got = require('@/utils/got'); const cheerio = require('cheerio'); module.exports = async (ctx) => { const country = ctx.params.country || 'ww'; const rootUrl = `https://${country}.fashionnetwork.com`; const response = await got({ method: 'get', url: rootUrl, }); const $ = ch...
cwe
CWE-918
JavaScript
static InputMethodStatusConnection* GetInstance() { return Singleton<InputMethodStatusConnection, LeakySingletonTraits<InputMethodStatusConnection> >::get(); }
cwe
CWE-20
C/C++
package com.bezman.servlet; import org.apache.commons.lang.StringEscapeUtils; import org.json.simple.JSONArray; import org.json.simple.JSONObject; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframe...
cwe
CWE-89
Java
static void sasl_disconnected(IRC_SERVER_REC *server) { g_return_if_fail(server != NULL); if (!IS_IRC_SERVER(server)) { return; } if (server->sasl_timeout != 0) { g_source_remove(server->sasl_timeout); server->sasl_timeout = 0; } }
cwe
CWE-416
Unknown
TPMI_ALG_MAC_SCHEME_Unmarshal(TPMI_ALG_MAC_SCHEME *target, BYTE **buffer, INT32 *size, BOOL allowNull) { TPM_RC rc = TPM_RC_SUCCESS; if (rc == TPM_RC_SUCCESS) { rc = TPM_ALG_ID_Unmarshal(target, buffer, size); } if (rc == TPM_RC_SUCCESS) { switch (*target) { #if ALG_SHA1 case TPM_ALG_SHA1: #endi...
cwe
CWE-787
Unknown
static bool context_has_no_new_privileges(const ExecContext *c) { assert(c); if (c->no_new_privileges) return true; if (have_effective_cap(CAP_SYS_ADMIN)) /* if we are privileged, we don't need NNP */ return false; /* We need NNP if we have any form of ...
cwe
CWE-269
Unknown
int __vma_adjust(struct vm_area_struct *vma, unsigned long start, unsigned long end, pgoff_t pgoff, struct vm_area_struct *insert, struct vm_area_struct *expand) { struct mm_struct *mm = vma->vm_mm; struct vm_area_struct *next = vma->vm_next, *orig_vma = vma; struct address_space *mapping = NULL; struct rb_root *...
cwe
CWE-119
Unknown
constructor(options) { super(options); this.name = "continuous"; this.settings = extend(this.settings || {}, { infinite: true, overflow: undefined, axis: undefined, writingMode: undefined, flow: "scrolled", offset: 500, offsetDelta: 250, width: undefined, height: undefined, snap: f...
cwe
CWE-79
JavaScript
// SPDX-License-Identifier: LGPL-2.1-or-later /* * * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2014 Google Inc. * * */ #ifdef HAVE_CONFIG_H #include <config.h> #endif #include <sys/uio.h> #include <errno.h> #include "src/shared/att.h" #include "lib/bluetooth.h" #include "lib/uuid.h" #inc...
cwe
CWE-119
C/C++
ExtensionsGuestViewMessageFilter::~ExtensionsGuestViewMessageFilter() { DCHECK_CURRENTLY_ON(BrowserThread::IO); (*GetProcessIdToFilterMap())[render_process_id_] = nullptr; base::PostTaskWithTraits( FROM_HERE, BrowserThread::UI, base::BindOnce(RemoveProcessIdFromGlobalMap, render_process_id_)); }
cwe
CWE-787
C/C++
void operator = (const IniSection &s) { if (&s == this) { return; } IniBase::operator = (s); ip = s.ip; end_comment = s.end_comment; rewrite_by = s.rewrite_by; container = s.container; reindex (); }
cwe
CWE-200
C/C++
) => { if (!info || !info.sessionToken) { throw new Parse.Error( Parse.Error.INVALID_SESSION_TOKEN, 'Invalid session token' ); } const sessionToken = info.sessionToken; const selectedFields = getFieldNames(queryInfo) .filter(field => field.startsWith(keysPrefix)) .map(field => field....
cwe
CWE-863
JavaScript
processDataRcvd(tcps_sess_t *pThis, const char c, struct syslogTime *stTime, const time_t ttGenTime, multi_submit_t *pMultiSub, unsigned *const __restrict__ pnMsgs) { DEFiRet; const tcpLstnParams_t *const cnf_params = pThis->pLstnInfo->cnf_params; ISOBJ_TYPE_assert(pThis, tcps_sess); int iMaxLine = glbl.GetMax...
cwe
CWE-787
Unknown
package com.salesmanager.shop.admin.model.userpassword; import org.apache.commons.rng.UniformRandomProvider; import org.apache.commons.rng.simple.RandomSource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class UserReset { final static String CHAR_LIST_WITHNUM = "abcdefghijklmnopqrstuvwxyzABCDEF...
cwe
CWE-639
Java
TPMI_ST_ATTEST_Unmarshal(TPMI_ST_ATTEST *target, BYTE **buffer, INT32 *size) { TPM_RC rc = TPM_RC_SUCCESS; if (rc == TPM_RC_SUCCESS) { rc = TPM_ST_Unmarshal(target, buffer, size); } if (rc == TPM_RC_SUCCESS) { switch (*target) { case TPM_ST_ATTEST_CERTIFY: case TPM_ST_ATTEST_CREATION: case T...
cwe
CWE-787
Unknown
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ /* * duck_client.c -- The siduck client. See * https://tools.ietf.org/html/draft-pardue-quic-siduck-00 */ #include <assert.h> #include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/queue.h> #include ...
cwe
CWE-476
C/C++
def verify_signature(string, signature) if signature.nil? fail InvalidSignature, "missing \"signature\" param" elsif signature != generate_signature(string) fail InvalidSignature, "provided signature does not match the calculated signature" end end
cwe
CWE-203
Ruby
// ***************************************************************** -*- C++ -*- /* * Copyright (C) 2004-2021 Exiv2 authors * This program is part of the Exiv2 distribution. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as publish...
cwe
CWE-787
C/C++
nfsreq_print_noaddr(netdissect_options *ndo, register const u_char *bp, u_int length, register const u_char *bp2) { register const struct sunrpc_msg *rp; register const uint32_t *dp; nfs_type type; int v3; uint32_t proc; uint32_t access_flags; struct nfsv3_sattr sa3; ND_...
cwe
CWE-125
C/C++
RawTile TileManager::getRegion( unsigned int res, int seq, int ang, int layers, unsigned int x, unsigned int y, unsigned int width, unsigned int height ){ // If our image type can directly handle region compositing, simply return that if( image->regionDecoding() ){ if( loglevel >= 3 ){ *logfile << "TileM...
cwe
CWE-190
C/C++
static void ssh_throttle_all(Ssh ssh, int enable, int bufsize) { int i; struct ssh_channel *c; if (enable == ssh->throttled_all) return; ssh->throttled_all = enable; ssh->overall_bufsize = bufsize; if (!ssh->channels) return; for (i = 0; NULL != (c = index234(ssh->channels, i)); i++) { s...
cwe
CWE-119
Unknown
/* Copyright (c) 2009-2017 Dave Gamble and cJSON contributors 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, copy, m...
cwe
CWE-754
C/C++
crm_send_remote_msg(void *session, xmlNode * msg, gboolean encrypted) { if (encrypted) { #ifdef HAVE_GNUTLS_GNUTLS_H cib_send_tls(session, msg); #else CRM_ASSERT(encrypted == FALSE); #endif } else { cib_send_plaintext(GPOINTER_TO_INT(session), msg); } }
cwe
CWE-399
C/C++
# -*- coding: utf-8 -*- import logging import requests from flask import ( Blueprint, Response, abort, copy_current_request_context, render_template, request, session, ) from flask_login import current_user from scout.server.extensions import store from scout.server.utils import institute_...
cwe
CWE-918
Python
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...
cwe
CWE-415
C/C++
/******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ /***/ 7351: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Objec...
cwe
CWE-345
JavaScript
# -*- coding: utf-8 -*- # (c) 2009-2022 Martin Wendt and contributors; see WsgiDAV https://github.com/mar10/wsgidav # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license.php """ WSGI middleware that handles GET requests on collections to display directories. """ import os import sys from fn...
cwe
CWE-79
Python
void line6_disconnect(struct usb_interface *interface) { struct usb_line6 *line6 = usb_get_intfdata(interface); struct usb_device *usbdev = interface_to_usbdev(interface); if (!line6) return; if (WARN_ON(usbdev != line6->usbdev)) return; if (line6->urb_listen != NULL) line6_stop_listen(line6); snd_card_...
cwe
CWE-476
Unknown
/* * This file is part of Espruino, a JavaScript interpreter for Microcontrollers * * Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk> * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http...
cwe
CWE-125
C/C++
TfLiteStatus TanhPrepare(TfLiteContext* context, TfLiteNode* node) { OpData* data = reinterpret_cast<OpData*>(node->user_data); TF_LITE_ENSURE_EQ(context, NumInputs(node), 1); TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1); const TfLiteTensor* input = GetInput(context, node, 0); TfLiteTensor* output = GetOu...
cwe
CWE-787
C/C++
function test_empty_comment() { $result = $this->myxmlrpcserver->wp_newComment( array( 1, 'administrator', 'administrator', self::$post->ID, array( 'content' => '', ), ) ); $this->assertIXRError( $result ); $this->assertSame( 403, $result->code ); }
cwe
CWE-862
PHP
public function startup(Event $event) { $controller = $event->subject(); $request = $controller->request; $response = $controller->response; $cookieName = $this->_config['cookieName']; $cookieData = $request->cookie($cookieName); if ($cookieData) { $reque...
cwe
CWE-352
PHP
void TestBlinkPlatformSupport::cryptographicallyRandomValues( unsigned char* buffer, size_t length) { }
cwe
CWE-310
Unknown
struct l2tp_packet_t *l2tp_packet_alloc(int ver, int msg_type, const struct sockaddr_in *addr, int H, const char *secret, size_t secret_len) { struct l2tp_packet_t *pack = mempool_alloc(pack_pool); if (!pack) return NULL; memset(pack, 0, sizeof(*pack)); INIT_LIST_HEAD(&pack->attrs); pack->hdr.ver = ve...
cwe
CWE-120
Unknown
wrap_lines_smart(ASS_Renderer *render_priv, double max_text_width) { int i; GlyphInfo *cur, *s1, *e1, *s2, *s3; int last_space; int break_type; int exit; double pen_shift_x; double pen_shift_y; int cur_line; int run_offset; TextInfo *text_info = &render_priv->text_info; last...
cwe
CWE-125
C/C++
jas_image_t *jas_image_create(int numcmpts, jas_image_cmptparm_t *cmptparms, int clrspc) { jas_image_t *image; uint_fast32_t rawsize; uint_fast32_t inmem; int cmptno; jas_image_cmptparm_t *cmptparm; if (!(image = jas_image_create0())) { return 0; } image->clrspc_ = clrspc; image->maxcmpts_ = numcmpts; i...
cwe
CWE-20
C/C++
GURL DevToolsWindow::GetDevToolsURL(Profile* profile, const GURL& base_url, bool shared_worker_frontend, bool v8_only_frontend, const std::string& remote_frontend, ...
cwe
CWE-200
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...
cwe
CWE-668
Java
std::string decodeBase64( const std::string& encoded) { if (encoded.size() == 0) { // special case, to prevent an integer overflow down below. return ""; } using namespace boost::archive::iterators; using b64it = transform_width<binary_from_base64<std::string::const_iterator>, 8, 6>; std::s...
cwe
CWE-787
Unknown
/* -*- C++ -*- * File: libraw_cxx.cpp * Copyright 2008-2017 LibRaw LLC (info@libraw.org) * Created: Sat Mar 8 , 2008 * * LibRaw C++ interface (implementation) LibRaw is free software; you can redistribute it and/or modify it under the terms of the one of two licenses as you choose: 1. GNU LESSER GENERAL PUBLIC ...
cwe
CWE-125
C/C++
static int decode_slice_header(H264Context *h, H264Context *h0) { unsigned int first_mb_in_slice; unsigned int pps_id; int ret; unsigned int slice_type, tmp, i, j; int last_pic_structure, last_pic_droppable; int must_reinit; int needs_reinit = 0; int field_pic_flag, bottom_field_flag; ...
cwe
CWE-703
Unknown
func (b *backend) pathRoleWrite(ctx context.Context, req *logical.Request, d *framework.FieldData) (*logical.Response, error) { roleName := d.Get("role").(string) if roleName == "" { return logical.ErrorResponse("missing role name"), nil } // Allowed users is an optional field, applicable for both OTP and Dynami...
cwe
CWE-326
Go
/** * @file * IMAP login authentication method * * @authors * Copyright (C) 1999-2001,2005,2009 Brendan Cully <brendan@kublai.com> * * @copyright * 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 * Fo...
cwe
CWE-77
C/C++
function ame_author_edit( post_id, posttype ) { var ame_sack = new sack( ajaxurl ); ame_sack.execute = 1; ame_sack.method = 'POST'; ame_sack.setVar( "action", "ame_author_edit" ); ame_sack.setVar( "post_id", post_id ); ame_sack.setVar( "col_no", jQuery('.widefat thead tr th').length ); ame_sack.setVar( "posttype...
cwe
CWE-352
JavaScript
ShellWindow::ShellWindow(Profile* profile, const extensions::Extension* extension, const GURL& url) : profile_(profile), extension_(extension), ALLOW_THIS_IN_INITIALIZER_LIST( extension_function_dispatcher_(profile, this)) { web_contents_ = W...
cwe
CWE-399
C/C++
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
cwe
CWE-284
C/C++
/** * @file resolve.c * @author Michal Vasko <mvasko@cesnet.cz> * @brief libyang resolve functions * * Copyright (c) 2015 - 2018 CESNET, z.s.p.o. * * This source code is licensed under BSD 3-Clause License (the "License"). * You may not use this file except in compliance with the License. * You may obtain a co...
cwe
CWE-119
C/C++
inline typename V::VariantType FBUnserializer<V>::unserializeThing() { size_t code = nextCode(); switch (code) { case FB_SERIALIZE_BYTE: case FB_SERIALIZE_I16: case FB_SERIALIZE_I32: case FB_SERIALIZE_I64: return V::fromInt64(unserializeInt64()); case FB_SERIALIZE_VARCHAR: case FB_SER...
cwe
CWE-674
C/C++
lspci_process(STREAM s) { unsigned int pkglen; static char *rest = NULL; char *buf; pkglen = s->end - s->p; /* str_handle_lines requires null terminated strings */ buf = xmalloc(pkglen + 1); STRNCPY(buf, (char *) s->p, pkglen + 1); str_handle_lines(buf, &rest, lspci_process_line, NULL); xfree(buf); }
cwe
CWE-119
C/C++
// ximage.cpp : main implementation file /* 07/08/2001 v1.00 - Davide Pizzolato - www.xdp.it * CxImage version 7.0.2 07/Feb/2011 */ #include "ximage.h" #ifndef min #define min(a,b) (((a)<(b))?(a):(b)) #endif #ifndef max #define max(a,b) (((a)>(b))?(a):(b)) #endif //////////////////////////////////////////////////...
cwe
CWE-770
C/C++
/* * . .o8 oooo * .o8 "888 `888 * .o888oo oooo d8b oooo oooo .oooo888 .ooooo. .oooo.o 888 oooo * 888 `888""8P `888 `888 d88' `888 d88' `88b d88( "8 888 .8P' * 888 888 888 888 8...
cwe
CWE-79
JavaScript
static void check_pdf(char const* filename) { QPDF pdf; pdf.processFile(filename); std::vector<QPDFObjectHandle> const& pages = pdf.getAllPages(); assert(pages.size() == static_cast<size_t>(npages)); for (int i = 0; i < npages; ++i) { int pageno = i + 1; std::cout << "page " << p...
cwe
CWE-787
Unknown
def api_endpoint(uri) host = uri.host begin res = @dns.getresource "_rubygems._tcp.#{host}", Resolv::DNS::Resource::IN::SRV rescue Resolv::ResolvError => e verbose "Getting SRV record failed: #{e}" uri else target = res.target.to_s.strip if /\...
cwe
CWE-346
Ruby
long Tracks::Parse() { assert(m_trackEntries == NULL); assert(m_trackEntriesEnd == NULL); const long long stop = m_start + m_size; IMkvReader* const pReader = m_pSegment->m_pReader; int count = 0; long long pos = m_start; while (pos < stop) { long long id, size; const long status = ParseElementHeader(pRe...
cwe
CWE-20
C/C++
bool getBase64Row(char* ptr, int indent, char* &beg, char* &end) { beg = end = ptr = skipSpaces(ptr, 0, INT_MAX); if (!ptr || !*ptr) return false; // end of file if (ptr - fs->bufferStart() != indent) return false; // end of base64 data /* find end */ ...
cwe
CWE-476
Unknown
void BaseMultipleFieldsDateAndTimeInputType::createShadowSubtree() { ASSERT(element()->shadow()); Document* document = element()->document(); ContainerNode* container = element()->userAgentShadowRoot(); RefPtr<DateTimeEditElement> dateTimeEditElement(DateTimeEditElement::create(document, *this))...
cwe
CWE-20
C/C++
bool ContainerNode::replaceChild(PassRefPtr<Node> newChild, Node* oldChild, ExceptionCode& ec, bool shouldLazyAttach) { ASSERT(refCount() || parentOrHostNode()); RefPtr<Node> protect(this); ec = 0; if (oldChild == newChild) // nothing to do return true; checkReplaceChild(newChild.get(), ...
cwe
CWE-416
C/C++