code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
package com.salesmanager.shop.admin.model.merchant; import com.salesmanager.core.model.reference.language.Language; import java.io.Serializable; import javax.validation.constraints.NotEmpty; public class StoreLandingDescription implements Serializable { /** * */ private static final long serialVersionUID...
cwe
CWE-79
Java
/* signature.c * * Copyright (C) 2006-2019 wolfSSL Inc. * * This file is part of wolfSSL. * * wolfSSL 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 * (at your opt...
cwe
CWE-347
C/C++
ext4_mb_mark_diskspace_used(struct ext4_allocation_context *ac, handle_t *handle, unsigned int reserv_clstrs) { struct buffer_head *bitmap_bh = NULL; struct ext4_group_desc *gdp; struct buffer_head *gdp_bh; struct ext4_sb_info *sbi; struct super_block *sb; ext4_fsblk_t block; int err, len; BUG_ON(ac->ac_st...
cwe
CWE-703
Unknown
#!/usr/bin/env python3 from apkleaks.colors import clr from contextlib import closing from distutils.spawn import find_executable from pyaxmlparser import APK from urllib.request import urlopen from zipfile import ZipFile import io import json import logging.config import mimetypes import numpy import os import re impo...
cwe
CWE-88
Python
static UINT drive_process_irp_write(DRIVE_DEVICE* drive, IRP* irp) { DRIVE_FILE* file; UINT32 Length; UINT64 Offset; if (!drive || !irp || !irp->input || !irp->output || !irp->Complete) return ERROR_INVALID_PARAMETER; if (Stream_GetRemainingLength(irp->input) < 32) return ERROR_INVALID_DATA; Stream_Read_UI...
cwe
CWE-125
Unknown
public function getOnClickAction() { return 'javascript:openNewGal(\''.$this->stack_name.'\');'; }
cwe
CWE-79
PHP
# -*- coding: utf-8 -*- # rdiffweb, A web interface to rdiff-backup repositories # Copyright (C) 2012-2021 rdiffweb 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 ...
cwe
CWE-613
Python
bool asn1_read_BOOLEAN_context(struct asn1_data *data, bool *v, int context) { uint8_t tmp = 0; asn1_start_tag(data, ASN1_CONTEXT_SIMPLE(context)); asn1_read_uint8(data, &tmp); if (tmp == 0xFF) { *v = true; } else { *v = false; } asn1_end_tag(data); return !data->has_error; }
cwe
CWE-399
Unknown
item *do_item_alloc(char *key, const size_t nkey, const unsigned int flags, const rel_time_t exptime, const int nbytes) { int i; uint8_t nsuffix; item *it = NULL; char suffix[40]; size_t ntotal = item_make_header(nkey + 1, flags, nbytes, suffix, &nsuffix); if (settings.use_ca...
cwe
CWE-190
Unknown
TPM2B_SENSITIVE_DATA_Marshal(TPM2B_SENSITIVE_DATA *source, BYTE **buffer, INT32 *size) { UINT16 written = 0; written += TPM2B_Marshal(&source->b, buffer, size); return written; }
cwe
CWE-787
Unknown
import Controller from "@ember/controller"; import { action } from "@ember/object"; import { getAbsoluteURL } from "discourse-common/lib/get-url"; import discourseComputed, { afterRender, } from "discourse-common/utils/decorators"; import { longDateNoYear } from "discourse/lib/formatter"; import Sharing from "discour...
cwe
CWE-200
JavaScript
public function handle($request, Closure $next) { view()->share('cspNonce', $this->cspService->getNonce()); if ($this->cspService->allowedIFrameHostsConfigured()) { config()->set('session.same_site', 'none'); } $response = $next($request); $this->cspService->set...
cwe
CWE-79
PHP
/* vi:set ts=8 sts=4 sw=4 noet: * * VIM - Vi IMproved by Bram Moolenaar * * Do ":help uganda" in Vim to read copying and usage conditions. * Do ":help credits" in Vim to see a list of people who contributed. * See README.txt for an overview of the Vim source code. */ #include "vim.h" /* * Vim originated fro...
cwe
CWE-122
C/C++
static void pcrypt_free(struct crypto_instance *inst) { struct pcrypt_instance_ctx *ctx = crypto_instance_ctx(inst); crypto_drop_aead(&ctx->spawn); kfree(inst); }
cwe
CWE-763
C/C++
gst_matroska_demux_add_wvpk_header (GstElement * element, GstMatroskaTrackContext * stream, GstBuffer ** buf) { GstMatroskaTrackAudioContext *audiocontext = (GstMatroskaTrackAudioContext *) stream; GstBuffer *newbuf = NULL; GstMapInfo map, outmap; guint8 *buf_data, *data; Wavpack4Header wvh; wvh....
cwe
CWE-416
C/C++
static int __feat_register_sp(struct list_head *fn, u8 feat, u8 is_local, u8 mandatory, u8 const *sp_val, u8 sp_len) { dccp_feat_val fval; if (dccp_feat_type(feat) != FEAT_SP || !dccp_feat_sp_list_ok(feat, sp_val, sp_len)) return -EINVAL; /* Avoid negotiating alien CCIDs by only advertising support...
cwe
CWE-401
C/C++
QPDF::resolveObjectsInStream(int obj_stream_number) { // Force resolution of object stream QPDFObjectHandle obj_stream = getObjectByID(obj_stream_number, 0); if (! obj_stream.isStream()) { throw QPDFExc(qpdf_e_damaged_pdf, this->m->file->getName(), this->m->last_object_description, this...
cwe
CWE-787
Unknown
static void mysql_ssl_free(MYSQL *mysql MY_ATTRIBUTE((unused))) { struct st_VioSSLFd *ssl_fd= (struct st_VioSSLFd*) mysql->connector_fd; DBUG_ENTER("mysql_ssl_free"); my_free(mysql->options.ssl_key); my_free(mysql->options.ssl_cert); my_free(mysql->options.ssl_ca); my_free(mysql->options.ssl_capath); my_...
cwe
CWE-319
Unknown
int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info, const char * name, int rep_quick) { int got_error; uint i; ulong length; ha_rows start_records; my_off_t new_header_length,del; File new_file; MI_SORT_PARAM sort_param; MYISAM_SHARE *share=info->s; HA_KEYSEG *keyseg; ulong *rec...
cwe
CWE-362
Unknown
package defaults import ( "time" ) const ( // these requests take at _least_ two minutes at the moment. ProvideTimeout = time.Minute * 3 ProvSearchDelay = time.Second // Number of concurrent workers in decision engine that process requests to the blockstore BitswapEngineBlockstoreWorkerCount = 128 // the tot...
cwe
CWE-770
Go
public function get_info($object_id, $table_name = '') { $table_name = $table_name ? Dba::escape($table_name) : Dba::escape(strtolower(get_class($this))); // Make sure we've got a real id if ($object_id < 1) { return array(); } if (self::is_cached($table_name, $...
cwe
CWE-89
PHP
/* JAI-Ext - OpenSource Java Advanced Image Extensions Library * http://www.geo-solutions.it/ * Copyright 2018 GeoSolutions * * 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 * ...
cwe
CWE-94
Java
TEST_F(EncryptedRecordTest, TestAllPaddingHandshake) { addToQueue("17030100050123456789"); EXPECT_CALL(*readAead_, _decrypt(_, _, 0)) .WillOnce(Invoke([](std::unique_ptr<IOBuf>& buf, const IOBuf*, uint64_t) { expectSame(buf, "0123456789"); return getBuf("16000000"); })); EXPECT_NO_THRO...
cwe
CWE-770
Unknown
static ssize_t get_node_path_locked(struct node* node, char* buf, size_t bufsize) { const char* name; size_t namelen; if (node->graft_path) { name = node->graft_path; namelen = node->graft_pathlen; } else if (node->actual_name) { name = node->actual_name; namelen = node->namelen; } ...
cwe
CWE-264
C/C++
def mode_init(self, request): """ This is called by render_POST when the client requests an init mode operation (at startup) Args: request (Request): Incoming request. """ csessid = request.args.get('csessid')[0] remote_addr = request.getClientIP() ...
cwe
CWE-79
Python
ProcRenderAddGlyphs (ClientPtr client) { GlyphSetPtr glyphSet; REQUEST(xRenderAddGlyphsReq); GlyphNewRec glyphsLocal[NLOCALGLYPH]; GlyphNewPtr glyphsBase, glyphs, glyph_new; int remain, nglyphs; CARD32 *gids; xGlyphInfo *gi; CARD8 *bits; unsigned int s...
cwe
CWE-20
C/C++
int main(int argc, char *argv[]) { char buff[1024]; int fd, nr, nw; if (argc < 2) { fprintf(stderr, "usage: %s output-filename\n" " %s |output-command\n" " %s :host:port\n", argv[0], argv[0], argv[0]); return 1; } fd = open_...
cwe
CWE-772
C/C++
REDIS_STATIC void _quicklistInsert(quicklist *quicklist, quicklistEntry *entry, void *value, const size_t sz, int after) { int full = 0, at_tail = 0, at_head = 0, full_next = 0, full_prev = 0; int fill = quicklist->fill; quicklistNode *node = entry->node; quicklistNode...
cwe
CWE-190
Unknown
protected function taskBackup() { if (!$this->authorizeTask('backup', ['admin.maintenance', 'admin.super'])) { $this->admin->json_response = [ 'status' => 'error', 'message' => $this->admin::translate('PLUGIN_ADMIN.INSUFFICIENT_PERMISSIONS_FOR_TASK') ...
cwe
CWE-79
PHP
/** * Copyright (c) 2006-2012, JGraph Ltd */ /** * Constructs a new graph editor */ Menus = function(editorUi) { this.editorUi = editorUi; this.menus = new Object(); this.init(); // Pre-fetches checkmark image if (!mxClient.IS_SVG) { new Image().src = this.checkmarkImage; } }; /** * Sets the default fo...
cwe
CWE-79
JavaScript
var XmlEntities = require('html-entities').XmlEntities; var entities = new XmlEntities(); var AuthorizationError = require('./errors/authorizationerror'); /** * Authorization Response parameters are encoded as HTML form values that are auto-submitted in the User Agent, * and thus are transmitted via the HTTP POST met...
cwe
CWE-79
JavaScript
/* A Bison parser, made by GNU Bison 3.2.4. */ /* Bison implementation for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2015, 2018 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as publis...
cwe
CWE-20
C/C++
static enum led_brightness k90_backlight_get(struct led_classdev *led_cdev) { int ret; struct k90_led *led = container_of(led_cdev, struct k90_led, cdev); struct device *dev = led->cdev.dev->parent; struct usb_interface *usbif = to_usb_interface(dev->parent); struct usb_device *usbdev = interface_to_usbdev(usbif);...
cwe
CWE-119
Unknown
import AdmZip from 'adm-zip' import Extensions from './extensions' import { checkAuthentication } from '../../utils/server_method_helpers' Meteor.methods({ addExtension({ zipFile }) { checkAuthentication(this) const regex = /^data:.+\/(.+);base64,(.*)$/ const matches = zipFile.match(regex) const data...
cwe
CWE-285
JavaScript
rsock_init_unixsock(VALUE sock, VALUE path, int server) { struct sockaddr_un sockaddr; socklen_t sockaddrlen; int fd, status; rb_io_t *fptr; SafeStringValue(path); INIT_SOCKADDR_UN(&sockaddr, sizeof(struct sockaddr_un)); if (sizeof(sockaddr.sun_path) < (size_t)RSTRING_LEN(path)) { ...
cwe
CWE-20
C/C++
static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception) { BMPInfo bmp_info; Image *image; MagickBooleanType status; MagickOffsetType offset, start_position; MemoryInfo *pixel_info; Quantum index; register Quantum *q; register ssize_t i,...
cwe
CWE-835
C/C++
query: _.bind(this._queryCirclesAutocomplete, this), id: function(circle) { return circle.unique_id; }, initSelection: function(element, callback) { var val = $(element).val().trim(); if (val) { var circleIds = val.split(','), circles = []; OCA.Circles.api.listCircles("a...
cwe
CWE-79
JavaScript
/* * Swagger Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator p...
cwe
CWE-200
Java
static inline void set_socket_blocking(int s, int blocking) { int opts; opts = fcntl(s, F_GETFL); if (opts<0) APPL_TRACE_ERROR("set blocking (%s)", strerror(errno)); if(blocking) opts &= ~O_NONBLOCK; else opts |= O_NONBLOCK; if (fcntl(s, F_SETFL, opts) < 0) APPL_TRACE_ERRO...
cwe
CWE-284
C/C++
TPM2B_MAX_BUFFER_Marshal(TPM2B_MAX_BUFFER *source, BYTE **buffer, INT32 *size) { UINT16 written = 0; written += TPM2B_Marshal(&source->b, buffer, size); return written; }
cwe
CWE-787
Unknown
async function respond(request, options, manifest, state) { /** URL but stripped from the potential `/__data.json` suffix and its search param */ let url = new URL(request.url); if (options.csrf_check_origin) { const forbidden = request.method === 'POST' && request.headers.get('origin') !== url.origin && ...
cwe
CWE-352
JavaScript
copySync: function (from, dist) { this._supportExecSync(); try { var cmd = ''; var stats = fs.lstatSync(from); dist = path.resolve(dist); if (stats.isDirectory()) { if (this._win32) { // windows cmd = 'echo da|xcopy /s /e "' + path.join(from, '*') + '" "' + di...
cwe
CWE-77
JavaScript
void TopSitesImpl::SetTopSites(const MostVisitedURLList& new_top_sites, const CallLocation location) { DCHECK(thread_checker_.CalledOnValidThread()); MostVisitedURLList top_sites(new_top_sites); size_t num_forced_urls = MergeCachedForcedURLs(&top_sites); AddPrepopulatedPages(&top...
cwe
CWE-200
Unknown
static int set_geometry(unsigned int cmd, struct floppy_struct *g, int drive, int type, struct block_device *bdev) { int cnt; /* sanity checking for parameters. */ if (g->sect <= 0 || g->head <= 0 || /* check for zero in F_SECT_PER_TRACK */ (unsigned char)((g->sect << 2) >> FD_SIZECODE...
cwe
CWE-125
C/C++
function addChannelPageTools($agencyid, $websiteId, $channelid, $channelType) { if ($channelType == 'publisher') { $deleteReturlUrl = MAX::constructUrl(MAX_URL_ADMIN, 'affiliate-channels.php'); } else { $deleteReturlUrl = MAX::constructUrl(MAX_URL_ADMIN, 'channel-index.php'); } //du...
cwe
CWE-352
PHP
#ifdef HAVE_CONFIG_H #include "config.h" #elif defined(_MSC_VER) #include "config-msvc.h" #endif #include "syshead.h" #include "base64.h" #include "buffer.h" #include "crypto.h" #include "openvpn.h" #include "ssl_common.h" #include "auth_token.h" #include "push.h" #include "integer.h" #include "ssl.h" #include "ssl_v...
cwe
CWE-306
C/C++
function xml(options) { options = options || {}; options.type = options.type || DEFAULT_TYPES; const textParser = bodyParser.text(options); return function xmlParser(req, res, next) { // First, run the body through the text parser. textParser(req, res, function (err) { if (err) { ...
cwe
CWE-1321
JavaScript
dir_globs(long argc, const VALUE *argv, int flags) { VALUE ary = rb_ary_new(); long i; for (i = 0; i < argc; ++i) { int status; VALUE str = argv[i]; GlobPathValue(str, TRUE); status = push_glob(ary, str, flags); if (status) GLOB_JUMP_TAG(status); } return ary; }
cwe
CWE-22
Unknown
import dayjs from 'dayjs' import utc from 'dayjs/plugin/utc' import { saveAs } from 'file-saver' import { FlowRouter } from 'meteor/ostrio:flow-router-extra' import { NullXlsx } from '@neovici/nullxlsx' import bootstrap from 'bootstrap' import { i18nReady, t } from '../../utils/i18n.js' import Timecards from '../../api...
cwe
CWE-79
JavaScript
connection_changes_done (gpointer data) { ConnectionChangedInfo *info = (ConnectionChangedInfo *) data; NMAGConfSettingsPrivate *priv = NMA_GCONF_SETTINGS_GET_PRIVATE (info->settings); NMAGConfConnection *connection; connection = nma_gconf_settings_get_by_path (info->settings, info->path); if (!connection) { /*...
cwe
CWE-200
Unknown
validate_event(struct pmu_hw_events *hw_events, struct perf_event *event) { struct arm_pmu *armpmu = to_arm_pmu(event->pmu); struct hw_perf_event fake_event = event->hw; struct pmu *leader_pmu = event->group_leader->pmu; if (is_software_event(event)) return 1; if (event->pmu != leader_pmu || ev...
cwe
CWE-264
C/C++
/* * Swagger Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator p...
cwe
CWE-732
Java
private void restore_cont(struct magic_set *ms, struct cont *c) { free(ms->c.li);
cwe
CWE-787
Unknown
lys_extension_instances_free(struct ly_ctx *ctx, struct lys_ext_instance **e, unsigned int size, void (*private_destructor)(const struct lys_node *node, void *priv)) { unsigned int i, j, k; struct lyext_substmt *substmt; void **pp, **start; struct lys_node *siter, *snext; #...
cwe
CWE-617
Unknown
static struct socket *get_raw_socket(int fd) { struct { struct sockaddr_ll sa; char buf[MAX_ADDR_LEN]; } uaddr; int r; struct socket *sock = sockfd_lookup(fd, &r); if (!sock) return ERR_PTR(-ENOTSOCK); /* Parameter checking */ if (sock->sk->sk_type != SOCK_RAW) { r = -ESOCKTNOSUPPORT; goto err; } ...
cwe
CWE-787
C/C++
/** * @overview Contains functionality specifically for Unix systems. * @license MPL-2.0 * @author Eric Cornelissen <ericornelissen@gmail.com> */ /** * Escape a shell argument. * * @param {string} arg The argument to escape. * @returns {string} The escaped argument. */ function escapeShellArg(arg) { return ...
cwe
CWE-88
JavaScript
zzip_mem_disk_load(ZZIP_MEM_DISK* dir, ZZIP_DISK* disk) { if (dir->list) zzip_mem_disk_unload(dir); ___ struct zzip_disk_entry* entry = zzip_disk_findfirst(disk); for (; entry ; entry = zzip_disk_findnext(disk, entry)) { ZZIP_MEM_DISK_ENTRY* item = zzip_mem_disk_entry_new(disk, entry); if (dir->last) { di...
cwe
CWE-119
Unknown
//+build libpam /* Maddy Mail Server - Composable all-in-one email server. Copyright © 2019-2020 Max Mazurov <fox.cpp@disroot.org>, Maddy Mail Server 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...
cwe
CWE-613
Go
/***************************************************************** | | AP4 - Atom Based Sample Tables | | Copyright 2002-2008 Axiomatic Systems, LLC | | | This atom is part of AP4 (MP4 Audio Processing Library). | | Unless you have obtained Bento4 under a difference license, | this version of Bento4 is B...
cwe
CWE-476
C/C++
private void parse(UserRequest ureq) { String[] sFiles = ureq.getHttpReq().getParameterValues(FORM_ID); if (sFiles == null || sFiles.length == 0) return; files = Arrays.asList(sFiles); }
cwe
CWE-22
Java
int __glXDispSwap_CreateContext(__GLXclientState *cl, GLbyte *pc) { xGLXCreateContextReq *req = (xGLXCreateContextReq *) pc; __GLX_DECLARE_SWAP_VARIABLES; __GLX_SWAP_SHORT(&req->length); __GLX_SWAP_INT(&req->context); __GLX_SWAP_INT(&req->visual); return __glXDisp_CreateContext(cl, pc); ...
cwe
CWE-20
Unknown
loadAnnotation(css) { let annotations = css.match(/\/\*\s*# sourceMappingURL=.*\*\//gm) if (annotations && annotations.length > 0) { // Locate the last sourceMappingURL to avoid picking up // sourceMappingURLs from comments, strings, etc. let lastAnnotation = annotations[annotations.length - ...
cwe
CWE-1333
JavaScript
/* * See the NOTICE file distributed with this work for additional * information regarding copyright ownership. * * This 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 * th...
cwe
CWE-668
Java
CotpConnection_readToTpktBuffer(CotpConnection* self) { uint8_t* buffer = self->readBuffer->buffer; int bufferSize = self->readBuffer->maxSize; int bufPos = self->readBuffer->size; assert (bufferSize > 4); int readBytes; if (bufPos < 4) { readBytes = readFromSocket(self, buffer + buf...
cwe
CWE-122
C/C++
var doBootstrap = function() { element = jqLite(element); if (element.injector()) { var tag = (element[0] === window.document) ? 'document' : startingTag(element); // Encode angle brackets to prevent input from being sanitized to empty string #8683. throw ngMinErr( 'btstrpd', ...
cwe
CWE-74
JavaScript
function r(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return m(e,Error)}}
cwe
CWE-79
JavaScript
package com.salesmanager.shop.admin.controller.customers; import com.salesmanager.core.business.services.customer.attribute.CustomerOptionService; import com.salesmanager.core.business.services.reference.language.LanguageService; import com.salesmanager.core.business.utils.ajax.AjaxResponse; import com.salesmanager.co...
cwe
CWE-639
Java
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) { const OpData* op_data = reinterpret_cast<OpData*>(node->user_data); TF_LITE_ENSURE(context, node->inputs->size > 0); // The first input is the condition. const TfLiteTensor* cond = GetInput(context, node, 0); // Currently only bool is supporte...
cwe
CWE-787
C/C++
protected function imageExtensions() { return [ 'jpg', 'jpeg', 'bmp', 'png', 'webp', 'gif', 'svg' ]; }
cwe
CWE-79
PHP
/* 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...
cwe
CWE-787
C/C++
dissect_rpcap_packet (tvbuff_t *tvb, packet_info *pinfo, proto_tree *top_tree, proto_tree *parent_tree, gint offset, proto_item *top_item) { proto_tree *tree; proto_item *ti; nstime_t ts; tvbuff_t *new_tvb; guint caplen, len, frame_no; gint reported_length_remaining; ti = proto...
cwe
CWE-20
C/C++
static int rawsock_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 sk_buff *skb; int copied; int rc; pr_debug("sock=%p sk=%p len=%zu flags=%d\n", sock, sk, len, flags); skb = skb_recv_data...
cwe
CWE-20
Unknown
def init_user(username, chat_id): conn = sqlite3.connect(os.path.abspath(os.path.dirname(__file__)) + "\\users\\" + username + '.db') conn2 = sqlite3.connect(os.path.abspath(os.path.dirname(__file__)) + '\\cf.db') cursor = conn.cursor() cursor2 = conn2.cursor() cursor.execute("CREATE TABLE result (p...
cwe
CWE-89
Python
handler: function ({log} = {}) { if (!this.server.options.pasv_url) { return this.reply(502); } this.connector = new PassiveConnector(this); return this.connector.setupServer() .then((server) => { let address = this.server.options.pasv_url; // Allow connecting from local if ...
cwe
CWE-918
JavaScript
Unpickler_set_memo(UnpicklerObject *self, PyObject *obj) { PyObject **new_memo; Py_ssize_t new_memo_size = 0; Py_ssize_t i; if (obj == NULL) { PyErr_SetString(PyExc_TypeError, "attribute deletion is not supported"); return -1; } if (Py_TYPE(obj) == &Unpi...
cwe
CWE-190
C/C++
public function downloadFiles() { App()->loadLibrary('admin.pclzip'); $folder = basename(Yii::app()->request->getPost('folder', 'global')); $files = Yii::app()->request->getPost('files'); $tempdir = Yii::app()->getConfig('tempdir'); $randomizedFileName = $folder.'_'.sub...
cwe
CWE-22
PHP
static void edge_bulk_in_callback(struct urb *urb) { struct edgeport_port *edge_port = urb->context; struct device *dev = &edge_port->port->dev; unsigned char *data = urb->transfer_buffer; int retval = 0; int port_number; int status = urb->status; switch (status) { case 0: /* success */ break; case -ECONN...
cwe
CWE-191
Unknown
onedev.server.markdown = { getCookiePrefix: function($container) { if ($container.hasClass("compact-mode")) return "markdownEditor.compactMode"; else return "markdownEditor.normalMode"; }, fireInputEvent: function($input) { if(document.createEventObject) { $input[0].fireEvent("input"); } else { ...
cwe
CWE-74
Java
eap_request(esp, inp, id, len) eap_state *esp; u_char *inp; int id; int len; { u_char typenum; u_char vallen; int secret_len; char secret[MAXWORDLEN]; char rhostname[256]; MD5_CTX mdContext; u_char hash[MD5_SIGNATURE_SIZE]; #ifdef USE_SRP struct t_client *tc; struct t_num sval, gval, Nval, *Ap, Bval; u_char v...
cwe
CWE-120
C/C++
// Copyright (c) 2018 Arista Networks, Inc. All rights reserved. /* \summary: EtherType protocol for Arista Networks printer */ #ifdef HAVE_CONFIG_H #include <config.h> #endif #include "netdissect-stdinc.h" #include "netdissect.h" #include "extract.h" #include "addrtoname.h" /* From Bill Fenner: The Arista time...
cwe
CWE-787
C/C++
void readBytes(void* data, int length) { U8* dataPtr = (U8*)data; U8* dataEnd = dataPtr + length; while (dataPtr < dataEnd) { int n = check(1, dataEnd - dataPtr); memcpy(dataPtr, ptr, n); ptr += n; dataPtr += n; } }
cwe
CWE-122
C/C++
// SPDX-License-Identifier: GPL-2.0 /* * Virtio-based remote processor messaging bus * * Copyright (C) 2011 Texas Instruments, Inc. * Copyright (C) 2011 Google, Inc. * * Ohad Ben-Cohen <ohad@wizery.com> * Brian Swetland <swetland@google.com> */ #define pr_fmt(fmt) "%s: " fmt, __func__ #include <linux/dma-mapp...
cwe
CWE-415
C/C++
static cJSON *cJSON_New_Item( void ) { cJSON* node = (cJSON*) cJSON_malloc( sizeof(cJSON) ); if ( node ) memset( node, 0, sizeof(cJSON) ); return node; }
cwe
CWE-120
C/C++
dns_cache_find_delegation(struct module_env* env, uint8_t* qname, size_t qnamelen, uint16_t qtype, uint16_t qclass, struct regional* region, struct dns_msg** msg, time_t now) { /* try to find closest NS rrset */ struct ub_packed_rrset_key* nskey; struct packed_rrset_data* nsdata; struct delegpt* dp; nskey = f...
cwe
CWE-703
Unknown
process_input(struct parsed_tag *tag) { int i = 20, v, x, y, z, iw, ih, size = 20; char *q, *p, *r, *p2, *s; Str tmp = NULL; char *qq = ""; int qlen = 0; if (cur_form_id < 0) { char *s = "<form_int method=internal action=none>"; tmp = process_form(parse_tag(&s, TRUE)); } if (tmp == NU...
cwe
CWE-476
Unknown
func setCapabilities(spec *specs.Spec, keepCaps ...string) error { currentCaps, err := capability.NewPid2(0) if err != nil { return errors.Wrapf(err, "error reading capabilities of current process") } if err := currentCaps.Load(); err != nil { return errors.Wrapf(err, "error loading capabilities") } caps, err...
cwe
CWE-276
Go
package evidence import ( "bytes" "errors" "fmt" "sort" "sync" "sync/atomic" "time" "github.com/gogo/protobuf/proto" gogotypes "github.com/gogo/protobuf/types" dbm "github.com/tendermint/tm-db" clist "github.com/tendermint/tendermint/libs/clist" "github.com/tendermint/tendermint/libs/log" tmproto "githu...
cwe
CWE-400
Go
inline TfLiteStatus EvalImpl(TfLiteContext* context, TfLiteNode* node, std::function<T(T)> func, TfLiteType expected_type) { const TfLiteTensor* input = GetInput(context, node, 0); TfLiteTensor* output = GetOutput(context, node, 0); TF_LITE_ENSURE_TYPES_EQ...
cwe
CWE-787
C/C++
void VirtualAuthenticator::AddRegistration( blink::test::mojom::RegisteredKeyPtr registration, AddRegistrationCallback callback) { if (registration->application_parameter.size() != device::kRpIdHashLength) { std::move(callback).Run(false); return; } bool success = false; std::tie(std::ignore, s...
cwe
CWE-22
C/C++
def edit_page # Saved contents of Login User begin @research = Research.where("user_id=#{@login_user.id}").first rescue end if @research.nil? @research = Research.new else # Already accepted? if !@research.status.nil? and @research.status != 0 render(:action => '...
cwe
CWE-89
Ruby
/* * 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, or (at your option) any later version. * * FFmpeg is distributed...
cwe
CWE-129
C/C++
private def getPageAsHtmlImpl(request: GetRequest): Future[Result] = { // Similar to loadPost and getPageAsJsonImpl, keep in sync. [7PKW0YZ2] dieIfAssetsMissingIfDevTest() val specifiedPagePath = PagePath.fromUrlPath(request.siteId, request.request.path) match { case PagePath.Parsed.Good(path) => pat...
cwe
CWE-613
Scala
public function validateWriteAccess($skipRequestTypeCheck = false) { if (!$skipRequestTypeCheck && 'POST' !== $_SERVER['REQUEST_METHOD']) { throw new \App\Exceptions\Csrf('Invalid request - validate Write Access'); } $this->validateReadAccess(); if (class_exists('CSRFConfig') && !\CsrfMagic\Csrf::check(fals...
cwe
CWE-352
PHP
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 Nebula, 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 # # ...
cwe
CWE-79
JavaScript
bool NuMediaExtractor::getTotalBitrate(int64_t *bitrate) const { if (mTotalBitrate >= 0) { *bitrate = mTotalBitrate; return true; } off64_t size; if (mDurationUs >= 0 && mDataSource->getSize(&size) == OK) { *bitrate = size * 8000000ll / mDurationUs; // in bits/sec return true; ...
cwe
CWE-190
C/C++
cJSON *cJSON_CreateArray( void ) { cJSON *item = cJSON_New_Item(); if ( item ) item->type = cJSON_Array; return item; }
cwe
CWE-120
C/C++
/*-------------------------------------------------------------------------*/ /** @file iniparser.c @author N. Devillard @brief Parser for ini files. */ /*--------------------------------------------------------------------------*/ /*---------------------------- Includes --------------------------------...
cwe
CWE-200
C/C++
static GF_Err isoffin_process(GF_Filter *filter) { ISOMReader *read = gf_filter_get_udta(filter); u32 i, count = gf_list_count(read->channels); Bool is_active = GF_FALSE; Bool in_is_eos = GF_FALSE; Bool check_forced_end = GF_FALSE; Bool has_new_data = GF_FALSE; u64 min_offset_plus_one = 0; u32 nb_forced_end=0; ...
cwe
CWE-703
C/C++
#!/usr/bin/env python3 # Copyright (C) 2012 Canonical Ltd. # Copyright (C) 2012 Hewlett-Packard Development Company, L.P. # Copyright (C) 2012 Yahoo! Inc. # Copyright (C) 2017 Amazon.com, Inc. or its affiliates # # Author: Scott Moser <scott.moser@canonical.com> # Author: Juerg Haefliger <juerg.haefliger@hp.com> # Aut...
cwe
CWE-532
Python
static void sunkbd_reinit(struct work_struct *work) { struct sunkbd *sunkbd = container_of(work, struct sunkbd, tq); wait_event_interruptible_timeout(sunkbd->wait, sunkbd->reset >= 0, HZ); serio_write(sunkbd->serio, SUNKBD_CMD_SETLED); serio_write(sunkbd->serio, (!!test_bit(LED_CAPSL, sunkbd->dev->led) << 3) ...
cwe
CWE-416
Unknown