code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
public function beforeAction($action) { // Bypass when not installed for installer if (empty(Yii::$app->params['installed']) && Yii::$app->controller->module != null && Yii::$app->controller->module->id == 'installer') { return true; } ...
cwe
CWE-200
PHP
# -*- coding: utf-8 -*- from __future__ import absolute_import from typing import Any, Dict, Union import logging import cherrypy from . import Controller, BaseController, Endpoint, ENDPOINT_MAP, \ allow_empty_body from .. import mgr from ..tools import str_to_bool logger = logging.getLogger('controllers.docs'...
cwe
CWE-79
C/C++
/* * Common NFSv4 ACL handling code. * * Copyright (c) 2002, 2003 The Regents of the University of Michigan. * All rights reserved. * * Marius Aamodt Eriksen <marius@umich.edu> * Jeff Sedlak <jsedlak@umich.edu> * J. Bruce Fields <bfields@umich.edu> * * Redistribution and use in source and binary forms,...
cwe
CWE-284
C/C++
def getOptions(poll_name): conn, c = connectDB() options_str = queryOne(c, "SELECT options FROM {} WHERE name='{}'".format(CFG("poll_table_name"), poll_name)) if options_str == None: return None options = options_str.split(",") closeDB(conn) return options
cwe
CWE-89
Python
def get(self, arg,word=None): #print "match auto" try: limit = self.get_argument("limit") word = self.get_argument("word") callback = self.get_argument("callback") #jsonp result = rtxcomplete.prefix(word,limit) result = callback+"("+json.dump...
cwe
CWE-79
Python
static inline signed int ReadPropertyMSBLong(const unsigned char **p, size_t *length) { union { unsigned int unsigned_value; signed int signed_value; } quantum; int c; register ssize_t i; unsigned char buffer[4]; size_t value; if (*length < 4) return(-1); ...
cwe
CWE-190
C/C++
static Image *ReadPANGOImage(const ImageInfo *image_info, ExceptionInfo *exception) { cairo_font_options_t *font_options; cairo_surface_t *surface; char *caption, *property; cairo_t *cairo_image; const char *option; DrawInfo *draw_info; Image *image; MagickBoolea...
cwe
CWE-476
C/C++
import Papaparse from 'papaparse' import TemplateGenerator from '~/components/import/templateParsers/TemplateGenerator' export default class CSVTemplateAdapter extends TemplateGenerator { constructor(name, data) { super() this.name = name this.csvData = data this.project = { title: this.name, ...
cwe
CWE-400
JavaScript
xmlParseAttValueComplex(xmlParserCtxtPtr ctxt, int *attlen, int normalize) { xmlChar limit = 0; xmlChar *buf = NULL; xmlChar *rep = NULL; int len = 0; int buf_size = 0; int c, l, in_space = 0; xmlChar *current = NULL; xmlEntityPtr ent; if (NXT(0) == '"') { ctxt->instate = XML_PARSE...
cwe
CWE-189
Unknown
static void perf_syscall_enter(void *ignore, struct pt_regs *regs, long id) { struct syscall_metadata *sys_data; struct syscall_trace_enter *rec; struct hlist_head *head; int syscall_nr; int rctx; int size; syscall_nr = trace_get_syscall_nr(current, regs); if (syscall_nr < 0) return; if (!test_bit(syscall_n...
cwe
CWE-476
Unknown
$("#free_space").text(FREE_SPACE.filesizeformat()); var progressbar = $( "#progressbar" ), progressLabel = $( ".progress-label" ); progressbar.progressbar({ value: 1, change: function() { progressLabel.text( progressbar.p...
cwe
CWE-79
Python
def cama_current_user return @cama_current_user if defined?(@cama_current_user) # api current user... @cama_current_user = cama_calc_api_current_user return @cama_current_user if @cama_current_user return nil unless cookies[:auth_token].present? c = cookies[:auth_token].split("&") return ni...
cwe
CWE-613
Ruby
int pos() { return ptr - start; }
cwe
CWE-122
C/C++
u=[];if(null!=b.sidebar.customEntries)for(var t=0;t<b.sidebar.customEntries.length;t++){for(var D=b.sidebar.customEntries[t],c={title:b.getResource(D.title),entries:[]},e=0;e<D.entries.length;e++){var g=D.entries[e];c.entries.push({id:g.id,title:b.getResource(g.title),desc:b.getResource(g.desc),image:g.preview})}u.push...
cwe
CWE-20
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
/** @file parse_rawml.c * @brief Functions for parsing rawml markup * * Copyright (c) 2020 Bartek Fabiszewski * http://www.fabiszewski.net * * This file is part of libmobi. * Licensed under LGPL, either version 3, or any later. * See <http://www.gnu.org/licenses/> */ #define _GNU_SOURCE 1 #ifndef __USE_BSD #...
cwe
CWE-125
C/C++
// Package docs GENERATED BY SWAG; DO NOT EDIT // This file was generated by swaggo/swag package docs import "github.com/swaggo/swag" const docTemplate = `{ "schemes": {{ marshal .Schemes }}, "swagger": "2.0", "info": { "description": "{{escape .Description}}", "title": "{{.Title}}", ...
cwe
CWE-362
Go
public function createDatabase($dbname = null) { Database::query("CREATE DATABASE `" . $dbname . "`"); }
cwe
CWE-89
PHP
/*! Copyright (c) REBUILD <https://getrebuild.com/> and/or its owners. All rights reserved. rebuild is dual-licensed under commercial and open source licenses (GPLv3). See LICENSE and COMMERCIAL in the project root for license information. */ // ~~ 高级过滤器 const BIZZ_ENTITIES = ['User', 'Department', 'Role', 'Team'] c...
cwe
CWE-89
Java
function inviteEndpoints(app) { if (!app) return; app.get("/invite/:code", async (request, response) => { try { const { code } = request.params; const invite = await Invite.get(`code = '${code}'`); if (!invite) { response.status(200).json({ invite: null, error: "Invite not found." });...
cwe
CWE-305
JavaScript
static ssize_t _hostfs_pread( oe_fd_t* desc, void* buf, size_t count, oe_off_t offset) { ssize_t ret = -1; file_t* file = _cast_file(desc); if (!file) OE_RAISE_ERRNO(OE_EINVAL); if (oe_syscall_pread_ocall(&ret, file->host_fd, buf, count, offset) != OE_OK) OE_RAI...
cwe
CWE-200
Unknown
long Chapters::Atom::ParseDisplay( IMkvReader* pReader, long long pos, long long size) { if (!ExpandDisplaysArray()) return -1; Display& d = m_displays[m_displays_count++]; d.Init(); return d.Parse(pReader, pos, size); }
cwe
CWE-119
C/C++
/* radare - LGPL - Copyright 2020 - mrmacete */ #include <r_types.h> #include <r_util.h> #include <r_hash.h> #include "coresymbolication.h" #define R_CS_EL_OFF_SEGS 0x58 #define R_CS_EL_SIZE_SEG 0x20 #define R_CS_EL_SIZE_SECT_64 0x18 #define R_CS_EL_SIZE_SECT_32 0x10 #define R_CS_EL_SIZE_SYM 0x18 #define R_CS_EL_SIZE...
cwe
CWE-787
C/C++
def get(cls, uuid): """Return a `Resource` instance of this class identified by the given code or UUID. Only `Resource` classes with specified `member_path` attributes can be directly requested with this method. """ url = urljoin(recurly.base_uri(), cls.member_path % (u...
cwe
CWE-918
Python
/***************************************************************** | | AP4 - hvcC Atoms | | Copyright 2002-2016 Axiomatic Systems, LLC | | | This file is part of Bento4/AP4 (MP4 Atom Processing Library). | | Unless you have obtained Bento4 under a difference license, | this version of Bento4 is Bento4|GP...
cwe
CWE-125
C/C++
void CClient::ProcessServerPacket(CNetChunk *pPacket) { CUnpacker Unpacker; Unpacker.Reset(pPacket->m_pData, pPacket->m_DataSize); // unpack msgid and system flag int Msg = Unpacker.GetInt(); int Sys = Msg&1; Msg >>= 1; if(Unpacker.Error()) return; if(Sys) { // system message if((pPacket->m_Flags&NET_...
cwe
CWE-787
C/C++
/* 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-122
C/C++
PS_SERIALIZER_DECODE_FUNC(php_binary) /* {{{ */ { const char *p; char *name; const char *endptr = val + vallen; zval *current; int namelen; int has_value; php_unserialize_data_t var_hash; PHP_VAR_UNSERIALIZE_INIT(var_hash); for (p = val; p < endptr; ) { zval **tmp; namelen = ((unsigned char...
cwe
CWE-416
C/C++
function main() { if (window.parent != null && window.parent.Editor != null) { if (window.parent.Editor.useLocalStorage) { document.body.innerHTML = ''; var div = document.createElement('div'); div.style.fontFamily = 'Arial'; var darkMode = typeof window.parent.Editor.isDarkMode === 'function' && ...
cwe
CWE-94
JavaScript
int fpm_request_last_activity(struct fpm_child_s *child, struct timeval *tv) /* {{{ */ { struct fpm_scoreboard_proc_s *proc; if (!tv) return -1; proc = fpm_scoreboard_proc_get(child->wp->scoreboard, child->scoreboard_i); if (!proc) { return -1; } *tv = proc->tv; return 1; }
cwe
CWE-787
Unknown
Toolbar.prototype.setFontSize = function(value) { if (this.sizeMenu != null) { this.sizeMenu.innerHTML = ''; var div = document.createElement('div'); div.style.display = 'inline-block'; div.style.overflow = 'hidden'; div.style.textOverflow = 'ellipsis'; div.style.maxWidth = '24px'; mxUtils.write(div, va...
cwe
CWE-94
JavaScript
jSuites.editor = (function(el, options) { var obj = {}; obj.options = {}; // Default configuration var defaults = { // Initial HTML content value: null, // Initial snippet snippet: null, // Add toolbar toolbar: null, // Website parser is to read w...
cwe
CWE-79
JavaScript
static int raw_getname(struct socket *sock, struct sockaddr *uaddr, int *len, int peer) { struct sockaddr_can *addr = (struct sockaddr_can *)uaddr; struct sock *sk = sock->sk; struct raw_sock *ro = raw_sk(sk); if (peer) return -EOPNOTSUPP; addr->can_family = AF_CAN; addr->can_ifindex = ro->ifindex; ...
cwe
CWE-200
Unknown
int jbd2_journal_dirty_metadata(handle_t *handle, struct buffer_head *bh) { transaction_t *transaction = handle->h_transaction; journal_t *journal; struct journal_head *jh; int ret = 0; if (is_handle_aborted(handle)) return -EROFS; if (!buffer_jbd(bh)) { ret = -EUCLEAN; goto out; } /* * We don't grab j...
cwe
CWE-787
C/C++
int fpm_status_handle_request(void) /* {{{ */ { struct fpm_scoreboard_s scoreboard, *scoreboard_p; struct fpm_scoreboard_proc_s proc; char *buffer, *time_format, time_buffer[64]; time_t now_epoch; int full, encode; char *short_syntax, *short_post; char *full_pre, *full_syntax, *full_post, *full_separator; zend_...
cwe
CWE-787
Unknown
/* * Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com> * * This file is part of Open5GS. * * 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 License, or ...
cwe
CWE-476
C/C++
flac_read_loop (SF_PRIVATE *psf, unsigned len) { FLAC_PRIVATE* pflac = (FLAC_PRIVATE*) psf->codec_data ; pflac->pos = 0 ; pflac->len = len ; pflac->remain = len ; /* First copy data that has already been decoded and buffered. */ if (pflac->frame != NULL && pflac->bufferpos < pflac->frame->header.blocksize) fla...
cwe
CWE-119
C/C++
diff_redraw( int dofold) // also recompute the folds { win_T *wp; win_T *wp_other = NULL; int used_max_fill_other = FALSE; int used_max_fill_curwin = FALSE; int n; need_diff_redraw = FALSE; FOR_ALL_WINDOWS(wp) if (wp->w_p_diff) { redraw_win_later(wp, SOME_VALID); if ...
cwe
CWE-476
C/C++
// An object that encapsulates everything we need to run a 'find' // operation, encoded in the REST API format. var SchemaController = require('./Controllers/SchemaController'); var Parse = require('parse/node').Parse; const triggers = require('./triggers'); const { continueWhile } = require('parse/lib/node/promiseUti...
cwe
CWE-755
JavaScript
/** @file * @brief 802.15.4 fragment related functions */ /* * Copyright (c) 2016 Intel Corporation * * SPDX-License-Identifier: Apache-2.0 */ #include <logging/log.h> LOG_MODULE_REGISTER(net_ieee802154_fragment, CONFIG_NET_L2_IEEE802154_LOG_LEVEL); #include <errno.h> #include <net/net_core.h> #include <...
cwe
CWE-843
C/C++
'use strict'; module.exports = require('../public/src/utils');
cwe
CWE-338
JavaScript
status_t SoundTriggerHwService::Module::startRecognition(sound_model_handle_t handle, const sp<IMemory>& dataMemory) { ALOGV("startRecognition() model handle %d", handle); if (!captureHotwordAllowed()) { return PERMISSION_DENIED; } if (dataMemory != 0 && dataMemory->pointer() == NULL) { ...
cwe
CWE-264
C/C++
// Copyright (C) 2020 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
function validateChanges(changes, source, callback) { if (!changes.length) { return; } const activeEditor = instance.getActiveEditor(); const beforeChangeResult = instance.runHooks('beforeChange', changes, source || 'edit'); let shouldBeCanceled = true; if (beforeChangeResult === false) ...
cwe
CWE-1333
JavaScript
vhost_user_get_inflight_fd(struct virtio_net **pdev, VhostUserMsg *msg, int main_fd __rte_unused) { struct rte_vhost_inflight_info_packed *inflight_packed; uint64_t pervq_inflight_size, mmap_size; uint16_t num_queues, queue_size; struct virtio_net *dev = *pdev; int fd, i, j; void *addr; if (msg->siz...
cwe
CWE-190
C/C++
static int aa_read_header(AVFormatContext *s) { int i, j, idx, largest_idx = -1; uint32_t nkey, nval, toc_size, npairs, header_seed = 0, start; char key[128], val[128], codec_name[64] = {0}; uint8_t output[24], dst[8], src[8]; int64_t largest_size = -1, current_size = -1, chapter_pos; struct toc...
cwe
CWE-665
Unknown
AP4_AtomSampleTable::GetSample(AP4_Ordinal index, AP4_Sample& sample) { AP4_Result result; // check that we have an stsc atom if (!m_StscAtom) { return AP4_ERROR_INVALID_FORMAT; } // check that we have a chunk offset table if (m_StcoAtom == NULL && m...
cwe
CWE-476
Unknown
function defaultsDeep(target, objects) { target = target || {}; function copy(target, current) { lazy.forOwn(current, function (value, key) { var val = target[key]; // add the missing property, or allow a null property to be updated if (val == null) { target[key] = value; } else...
cwe
CWE-20
JavaScript
#ifndef JSI_LITE_ONLY #ifndef JSI_AMALGAMATION #include "jsiInt.h" #endif #define bits_set(who, mask) ((who) |= (mask)) #define bits_unset(who, mask) ((who) &= (~(mask))) #define bits_get(who, mask) ((who) & (mask)) #if JSI__MEMDEBUG void jsi_VALCHK(Jsi_Value *val) { SIGASSERTV(val,VALUE); assert(v...
cwe
CWE-120
C/C++
static void copyStereo24( short *dst, const int *const *src, unsigned nSamples, unsigned /* nChannels */) { for (unsigned i = 0; i < nSamples; ++i) { *dst++ = src[0][i] >> 8; *dst++ = src[1][i] >> 8; } }
cwe
CWE-119
C/C++
static void nsc_decode(NSC_CONTEXT* context) { UINT16 x; UINT16 y; UINT16 rw = ROUND_UP_TO(context->width, 8); BYTE shift = context->ColorLossLevel - 1; /* colorloss recovery + YCoCg shift */ BYTE* bmpdata = context->BitmapData; for (y = 0; y < context->height; y++) { const BYTE* yplane; const BYTE* c...
cwe
CWE-787
C/C++
static table_row *row_from_string(cmark_syntax_extension *self, cmark_parser *parser, unsigned char *string, int len) { table_row *row = NULL; bufsize_t cell_matched = 1, pipe_matched = 1, offset; row = (table_row *)parser->mem->calloc(1, sizeof...
cwe
CWE-190
Unknown
// // PDF token parsing functions for PDFio. // // Copyright © 2021 by Michael R Sweet. // // Licensed under Apache License v2.0. See the file "LICENSE" for more // information. // // // Include necessary headers... // #include "pdfio-private.h" // // This file parses PDF language syntax: // // << dict >> ...
cwe
CWE-835
C/C++
ipcp_store_vr_results (void) { cgraph_node *node; FOR_EACH_FUNCTION_WITH_GIMPLE_BODY (node) { ipa_node_params *info = IPA_NODE_REF (node); bool found_useful_result = false; if (!opt_for_fn (node->decl, flag_ipa_vrp)) { if (dump_file) fprintf (dump_file, "Not considering %s for VR di...
cwe
CWE-20
Unknown
_rpc_batch_job(slurm_msg_t *msg, bool new_msg) { batch_job_launch_msg_t *req = (batch_job_launch_msg_t *)msg->data; bool first_job_run; int rc = SLURM_SUCCESS; bool replied = false, revoked; slurm_addr_t *cli = &msg->orig_addr; if (new_msg) { uid_t req_uid = g_slurm_auth_get_uid(msg->auth_cred, ...
cwe
CWE-20
Unknown
public function getLatestData($count = PMF_NUMBER_RECORDS_LATEST, $language = null) { global $sids; $now = date('YmdHis'); $query = ' SELECT fd.id AS id, fd.lang AS lang, fcr.category_id AS category_id, fd.thema AS q...
cwe
CWE-79
PHP
email_open( const char *email_addr, const char *subject ) { char *Mailer; char *SmtpServer = NULL; char *FromAddress = NULL; char *FinalSubject; char *FinalAddr; char *temp; int token_boundary; int num_addresses; int arg_index; FILE *mailerstream; if ( (Mailer = param("MAIL")) == NULL ) { dprintf(D_FULLDE...
cwe
CWE-20
C/C++
GF_Err cat_multiple_files(GF_ISOFile *dest, char *fileName, u32 import_flags, Double force_fps, u32 frames_per_sample, char *tmp_dir, Bool force_cat, Bool align_timelines, Bool allow_add_in_command) { CATEnum cat_enum; char *sep; cat_enum.dest = dest; cat_enum.import_flags = import_flags; cat_enum.force_fps = for...
cwe
CWE-119
C/C++
results.push({'rkey':rkey, 'tags': getTagsFromKey(rkey), 'imgIds':rIds}); // Update the UI var $toRemove = $('tr:has(.img_panel)', $this); // For each Tag combination... (E.g. 'Metaphase'+'Dead') var topLevelTag = ""; var $td, $tr; ...
cwe
CWE-79
JavaScript
ecc_ecdsa_sign (const struct ecc_curve *ecc, const mp_limb_t *zp, /* Random nonce, must be invertible mod ecc group order. */ const mp_limb_t *kp, size_t length, const uint8_t *digest, mp_limb_t *rp, mp_limb_t *sp, mp_limb_t *scratch) { #define P scratch #define kinv scratch #define hp (scr...
cwe
CWE-787
Unknown
public PBEWithSHA256AESCBC256() { super(new CBCBlockCipher(new AESFastEngine()), PKCS12, SHA256, 256, 16); }
cwe
CWE-310
Java
# encoding: utf-8 """ An application for IPython. All top-level applications should use the classes in this module for handling configuration and creating configurables. The job of an :class:`Application` is to create the master configuration object and then create the configurable objects, passing the config to them...
cwe
CWE-269
Python
unsigned int GetU32LE (int nPos, bool *pbSuccess) { //*pbSuccess = true; if ( nPos < 0 || nPos + 3 >= m_nLen ) { *pbSuccess = false; return 0; } unsigned int nRes = m_sFile[nPos + 3]; nRes = (nRes << 8) + m_...
cwe
CWE-787
C/C++
require('../services/Requisitions'); import Util from 'lib/util'; const QuickNode = require('../model/QuickNode'); /** * @author Alejandro Galue <agalue@opennms.org> * @copyright 2014 The OpenNMS Group, Inc. */ (function() { 'use strict'; const quickAddPanelBasicView = require('../../views/quick-add-panel-basi...
cwe
CWE-79
Java
/* =========================================================================== Copyright (C) 1999 - 2005, Id Software, Inc. Copyright (C) 2000 - 2013, Raven Software, Inc. Copyright (C) 2001 - 2013, Activision, Inc. Copyright (C) 2005 - 2015, ioquake3 contributors Copyright (C) 2013 - 2015, OpenJK contributors This fi...
cwe
CWE-254
C/C++
accept_ice_connection (GIOChannel *source, GIOCondition condition, GsmIceConnectionData *data) { IceListenObj listener; IceConn ice_conn; IceAcceptStatus status; GsmClient *client; GsmXsmpServer *se...
cwe
CWE-125
Unknown
void Lua::setParamsTable(lua_State* vm, const char* table_name, const char* query) const { char outbuf[FILENAME_MAX]; char *where; char *tok; char *query_string = query ? strdup(query) : NULL; lua_newtable(L); if (query_string) { // ntop->getTrace()->traceEvent(TRACE_WARNING, "[HTTP] %s", query_s...
cwe
CWE-476
C/C++
/* Copyright 2014 Alexander Okoli 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, software...
cwe
CWE-331
Go
/** * <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
static enum integrity_status evm_verify_hmac(struct dentry *dentry, const char *xattr_name, char *xattr_value, size_t xattr_value_len, struct integrity_iint_cache *iint) { struct evm_ima_xattr_data *xattr_data = NULL; struct evm_ima_xattr_data calc; enum integrity_status evm_s...
cwe
CWE-19
C/C++
package com.bezman.servlet; import org.json.simple.JSONObject; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotati...
cwe
CWE-89
Java
func (hs *HTTPServer) getPluginAssets(c *models.ReqContext) { pluginID := web.Params(c.Req)[":pluginId"] plugin, exists := hs.pluginStore.Plugin(c.Req.Context(), pluginID) if !exists { c.JsonApiErr(404, "Plugin not found", nil) return } requestedFile := filepath.Clean(web.Params(c.Req)["*"]) pluginFilePath :...
cwe
CWE-22
Go
FdInStream::FdInStream(int fd_, int timeoutms_, int bufSize_, bool closeWhenDone_) : fd(fd_), closeWhenDone(closeWhenDone_), timeoutms(timeoutms_), blockCallback(0), timing(false), timeWaitedIn100us(5), timedKbits(0), bufSize(bufSize_ ? bufSize_ : DEFAULT_BUF_SIZE), offset(0) { pt...
cwe
CWE-787
C/C++
static int writeState(const char *stateFilename) { struct logState *p; FILE *f; char *chptr; unsigned int i = 0; int error = 0; int bytes = 0; int fdcurr; int fdsave; struct stat sb; char *tmpFilename = NULL; struct tm now; time_t now_time, last_time; char *prevCtx; ...
cwe
CWE-732
Unknown
public static function extractColumnSpec($columnspec) { $first_bracket_pos = strpos($columnspec, '('); if ($first_bracket_pos) { $spec_in_brackets = chop( substr( $columnspec, $first_bracket_pos + 1, (strrpos($co...
cwe
CWE-79
PHP
static int init_ssl_connection(SSL *con) { int i; const char *str; X509 *peer; long verify_err; char buf[BUFSIZ]; #if !defined(OPENSSL_NO_NEXTPROTONEG) const unsigned char *next_proto_neg; unsigned next_proto_neg_len; #endif unsigned char *exportedkeymat; #ifndef OPENSSL_NO_DTLS if(...
cwe
CWE-399
Unknown
void cJSON_AddItemReferenceToObject( cJSON *object, const char *string, cJSON *item ) { cJSON_AddItemToObject( object, string, create_reference( item ) ); }
cwe
CWE-120
C/C++
static int aacDecoder_drcExtractAndMap ( HANDLE_AAC_DRC self, HANDLE_FDK_BITSTREAM hBs, CAacDecoderStaticChannelInfo *pAacDecoderStaticChannelInfo[], UCHAR pceInstanceTag, UCHAR channelMapping[], /* Channel mapping translating drcChannel index to canonical channel index */ int va...
cwe
CWE-119
C/C++
public void testFormat() throws Exception { assertEquals("<a> <b>c</b></a>", format("<a><b>c</b></a>", 1).replaceAll("[\r\n]", "")); assertEquals("<a> <b>c</b></a>", format("<a><b>c</b></a>", 3).replaceAll("[\r\n]", "")); assertEquals("<a><b>c</b></a>", format("<a><b>c</b></a>", -21)); ...
cwe
CWE-611
Java
static __u8 *kye_report_fixup(struct hid_device *hdev, __u8 *rdesc, unsigned int *rsize) { switch (hdev->product) { case USB_DEVICE_ID_KYE_ERGO_525V: /* the fixups that need to be done: * - change led usage page to button for extra buttons * - report size 8 count 1 must be size 1 count 8 for button *...
cwe
CWE-119
C/C++
unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsigned long len, unsigned long pgoff, unsigned long flags) { struct vm_area_struct *vma; struct vm_unmapped_area_info info; if (len > TASK_SIZE) return -ENOMEM; /* handle MAP_FIXED */ if (flags & MAP_FIXED) return addr; ...
cwe
CWE-119
Unknown
bool WtsSessionProcessDelegate::Core::LaunchProcess( IPC::Listener* delegate, ScopedHandle* process_exit_event_out) { DCHECK(main_task_runner_->BelongsToCurrentThread()); CommandLine command_line(CommandLine::NO_PROGRAM); if (launch_elevated_) { if (!job_.IsValid()) { return false; } F...
cwe
CWE-399
C/C++
Http::FilterTrailersStatus Context::onRequestTrailers() { if (!wasm_->onRequestTrailers_) { return Http::FilterTrailersStatus::Continue; } if (wasm_->onRequestTrailers_(this, id_).u64_ == 0) { return Http::FilterTrailersStatus::Continue; } return Http::FilterTrailersStatus::StopIteration; }
cwe
CWE-476
C/C++
SProcXFixesQueryVersion(ClientPtr client) { REQUEST(xXFixesQueryVersionReq); swaps(&stuff->length); swapl(&stuff->majorVersion); return (*ProcXFixesVector[stuff->xfixesReqType]) (client); }
cwe
CWE-20
C/C++
function AJchangeUserPrivs() { global $user; $node = processInputVar("activeNode", ARG_NUMERIC); if(! checkUserHasPriv("userGrant", $user["id"], $node)) { $text = "You do not have rights to modify user privileges at this node."; print "alert('$text');"; return; } $newuser = processInputVar("item", ARG_STRING...
cwe
CWE-264
PHP
static void extract_arg(RAnal *anal, RAnalFunction *fcn, RAnalOp *op, const char *reg, const char *sign, char type) { st64 ptr = 0; char *addr, *esil_buf = NULL; const st64 maxstackframe = 1024 * 8; r_return_if_fail (anal && fcn && op && reg); size_t i; for (i = 0; i < R_ARRAY_SIZE (op->src); i++) { if (op->...
cwe
CWE-416
Unknown
//////////////////////////////////////////////////////////////////////////// // **** WAVPACK **** // // Hybrid Lossless Wavefile Compressor // // Copyright (c) 1998 - 2016 David Bryant. // // ...
cwe
CWE-787
C/C++
static Image *ReadUYVYImage(const ImageInfo *image_info, ExceptionInfo *exception) { Image *image; MagickBooleanType status; register ssize_t x; register PixelPacket *q; ssize_t y; unsigned char u, v, y1, y2; /* Open image file. */ assert(image_info != (...
cwe
CWE-120
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-369
C/C++
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Copyright (c) 2011-2012 Litecoin Developers // Copyright (c) 2013-2014 Phoenixcoin Developers // Distributed under the MIT/X11 software license, see the accompanying // file LICENCE or http://www.opensource.org/licenses/mit...
cwe
CWE-404
C/C++
/* * Copyright (c) Facebook, Inc. and its affiliates. * * 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 applic...
cwe
CWE-770
C/C++
BGD_DECLARE(void *) gdImageWebpPtr (gdImagePtr im, int *size) { void *rv; gdIOCtx *out = gdNewDynamicCtx(2048, NULL); if (out == NULL) { return NULL; } gdImageWebpCtx(im, out, -1); rv = gdDPExtractData(out, size); out->gd_free(out); return rv; }
cwe
CWE-415
C/C++
from vyper import ast as vy_ast from vyper.address_space import CALLDATA, DATA, IMMUTABLES, MEMORY, STORAGE from vyper.codegen.ir_node import Encoding, IRnode from vyper.codegen.types import ( DYNAMIC_ARRAY_OVERHEAD, ArrayLike, BaseType, ByteArrayLike, DArrayType, MappingType, SArrayType, ...
cwe
CWE-119
Python
GraphViewer.prototype.updateTitle = function(title) { title = title || ''; if (this.showTitleAsTooltip && this.graph != null && this.graph.container != null) { this.graph.container.setAttribute('title', title); } if (this.filename != null) { this.filename.innerHTML = ''; mxUtils.write(this.filename, ...
cwe
CWE-94
JavaScript
static int shorten_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt) { AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; ShortenContext *s = avctx->priv_data; int i, input_buf_size = 0; ...
cwe
CWE-703
Unknown
int jpc_ppxstab_grow(jpc_ppxstab_t *tab, int maxents) { jpc_ppxstabent_t **newents; if (tab->maxents < maxents) { newents = (tab->ents) ? jas_realloc(tab->ents, maxents * sizeof(jpc_ppxstabent_t *)) : jas_malloc(maxents * sizeof(jpc_ppxstabent_t *)); if (!newents) { return -1; } tab->ents = newents; ...
cwe
CWE-189
Unknown
package api type Shortcut struct { ID int `json:"id"` // Standard fields RowStatus RowStatus `json:"rowStatus"` CreatorID int `json:"creatorId"` CreatedTs int64 `json:"createdTs"` UpdatedTs int64 `json:"updatedTs"` // Domain specific fields Title string `json:"title"` Payload string `json:"p...
cwe
CWE-284
Go
static Image *ReadIPLImage(const ImageInfo *image_info,ExceptionInfo *exception) { /* Declare variables. */ Image *image; MagickBooleanType status; register PixelPacket *q; unsigned char magick[12], *pixels; ssize_t count; ssize_t y; size_t t_count=0; size_t length; IPLInfo ipl_info; Q...
cwe
CWE-401
Unknown
void TraceEvent::AppendAsJSON( std::string* out, const ArgumentFilterPredicate& argument_filter_predicate) const { int64 time_int64 = timestamp_.ToInternalValue(); int process_id = TraceLog::GetInstance()->process_id(); const char* category_group_name = TraceLog::GetCategoryGroupName(category_group_...
cwe
CWE-399
C/C++
/* * 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-862
Java