code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
QUtil::parse_numrange(char const* range, int max) { std::vector<int> result; char const* p = range; try { std::vector<int> work; static int const comma = -1; static int const dash = -2; enum { st_top, st_in_number, st_after_number } state = ...
cwe
CWE-787
Unknown
static __u8 *mr_report_fixup(struct hid_device *hdev, __u8 *rdesc, unsigned int *rsize) { if (*rsize >= 30 && rdesc[29] == 0x05 && rdesc[30] == 0x09) { hid_info(hdev, "fixing up button/consumer in HID report descriptor\n"); rdesc[30] = 0x0c; } return rdesc; }
cwe
CWE-119
C/C++
inline typename V::VectorType FBUnserializer<V>::unserializeVector() { p_ += CODE_SIZE; typename V::VectorType ret = V::createVector(); size_t code = nextCode(); while (code != FB_SERIALIZE_STOP) { V::vectorAppend(ret, unserializeThing()); code = nextCode(); } p_ += CODE_SIZE; return ret; }
cwe
CWE-674
C/C++
def git_hook(strict=False, modify=False): """ Git pre-commit hook to check staged files for isort errors :param bool strict - if True, return number of errors on exit, causing the hook to fail. If False, return zero so it will just act as a warning. :param bool modify - if True, fix the...
cwe
CWE-78
Python
static void print_buttons(HttpRequest req, HttpResponse res, Service_T s) { if (is_readonly(req)) { // A read-only REMOTE_USER does not get access to these buttons return; } StringBuffer_append(res->outputbuffer, "<table id='buttons'><tr>"); /* Start prog...
cwe
CWE-352
C/C++
static void ffs_user_copy_worker(struct work_struct *work) { struct ffs_io_data *io_data = container_of(work, struct ffs_io_data, work); int ret = io_data->req->status ? io_data->req->status : io_data->req->actual; if (io_data->read && ret > 0) { use_mm(io_data->mm); ret = copy_to_iter(io_d...
cwe
CWE-416
C/C++
/* * fs/userfaultfd.c * * Copyright (C) 2007 Davide Libenzi <davidel@xmailserver.org> * Copyright (C) 2008-2009 Red Hat, Inc. * Copyright (C) 2015 Red Hat, Inc. * * This work is licensed under the terms of the GNU GPL, version 2. See * the COPYING file in the top-level directory. * * Some part derive...
cwe
CWE-416
C/C++
#include "base_object-inl.h" #include "crypto_x509.h" #include "crypto_common.h" #include "crypto_context.h" #include "crypto_keys.h" #include "crypto_bio.h" #include "env-inl.h" #include "memory_tracker-inl.h" #include "node_errors.h" #include "util-inl.h" #include "v8.h" #include <string> #include <vector> namespac...
cwe
CWE-295
JavaScript
/* * INET An implementation of the TCP/IP protocol suite for the LINUX * operating system. INET is implemented using the BSD Socket * interface as the means of communication with the user level. * * PF_INET protocol family socket handler. * * Authors: Ross Biro * Fred N. van Kempen, <waltje@uWalt.NL.Mugn...
cwe
CWE-400
C/C++
static int hls_slice_header(HEVCContext *s) { GetBitContext *gb = &s->HEVClc->gb; SliceHeader *sh = &s->sh; int i, ret; // Coded parameters sh->first_slice_in_pic_flag = get_bits1(gb); if ((IS_IDR(s) || IS_BLA(s)) && sh->first_slice_in_pic_flag) { s->seq_decode = (s->seq_decode + 1) &...
cwe
CWE-476
Unknown
ecryptfs_write_metadata_to_contents(struct ecryptfs_crypt_stat *crypt_stat, struct dentry *ecryptfs_dentry, char *virt) { int rc; rc = ecryptfs_write_lower(ecryptfs_dentry->d_inode, virt, 0, crypt_stat->num_header_bytes_at_front); if (rc) printk(KERN_ERR "%s: Error attempting to write header...
cwe
CWE-189
Unknown
htmlAttrDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlAttrPtr cur, const char *encoding ATTRIBUTE_UNUSED) { xmlChar *value; /* * The html output method should not escape a & character * occurring in an attribute value immediately followed by * a { character (see Section B.7.1 ...
cwe
CWE-79
C/C++
dissect_fb_zero_tag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *fb_zero_tree, guint offset, guint32 tag_number){ guint32 tag_offset_start = offset + tag_number*4*2; guint32 tag_offset = 0, total_tag_len = 0; gint32 tag_len; while(tag_number){ proto_tree *tag_tree, *ti_len, *ti_tag, *ti_type;...
cwe
CWE-835
Unknown
int cgroup1_parse_param(struct fs_context *fc, struct fs_parameter *param) { struct cgroup_fs_context *ctx = cgroup_fc2context(fc); struct cgroup_subsys *ss; struct fs_parse_result result; int opt, i; opt = fs_parse(fc, cgroup1_fs_parameters, param, &result); if (opt == -ENOPARAM) { int ret; ret = vfs_parse...
cwe
CWE-287
Unknown
int Server::authenticate(QString &name, const QString &pw, const QStringList &emails, const QString &certhash, bool bStrongCert, const QList<QSslCertificate> &certs) { int res = -2; emit authenticateSig(res, name, certs, certhash, bStrongCert, pw); if (res != -2) { // External authentication handled it. Ignore c...
cwe
CWE-20
Unknown
static int bus_socket_make_message(sd_bus *bus, size_t size) { sd_bus_message *t; void *b; int r; assert(bus); assert(bus->rbuffer_size >= size); assert(IN_SET(bus->state, BUS_RUNNING, BUS_HELLO)); r = bus_rqueue_make_room(bus); if (r < 0) ...
cwe
CWE-787
C/C++
/* Copyright 2015 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
Python
void png_print_chunk(unsigned type, unsigned char* data, unsigned size) { char tag[5]; unsigned i; be_uint32_write(tag, type); tag[4] = 0; cout << tag << setw(8) << size; switch (type) { case ADV_MNG_CN_MHDR : cout << " width:" << be_uint32_read(data+0) << " height:" << be_uint32_read(data+4) << " frequen...
cwe
CWE-125
C/C++
e_ews_backend_ref_connection_sync (EEwsBackend *backend, ESourceAuthenticationResult *result, GCancellable *cancellable, GError **error) { EEwsConnection *connection = NULL; ESourceAuthenticationResult local_result; CamelEwsSettings *settin...
cwe
CWE-295
Unknown
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-79
Java
foreach ($call[1] as $value) { $arguments[] = $this->dumpValue($value); }
cwe
CWE-89
JavaScript
$.fn.reviewsAutoComplete = function(options) { return this.each(function() { $(this) .autocomplete({ formatItem: function(data) { var s = data[options.nameKey]; if (options.descKey) { s += " <span>(" + data[options....
cwe
CWE-79
JavaScript
package util import ( "context" "fmt" "time" errs "github.com/pkg/errors" "github.com/rancher/rancher/pkg/serviceaccounttoken" v3 "github.com/rancher/rke/types" "gopkg.in/yaml.v2" v1 "k8s.io/api/core/v1" rbacv1 "k8s.io/api/rbac/v1" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/m...
cwe
CWE-331
Go
parse_cmdline(int argc, char **argv) { int c; bool reopen_log = false; int signum; struct utsname uname_buf; int longindex; int curind; bool bad_option = false; unsigned facility; mode_t new_umask_val; struct option long_options[] = { {"use-file", required_argument, NULL, 'f'}, #if defined _WITH_VRRP_ && ...
cwe
CWE-200
Unknown
X509::X509(const char* i, size_t iSz, const char* s, size_t sSz, const char* b, int bSz, const char* a, int aSz) : issuer_(i, iSz), subject_(s, sSz), beforeDate_(b, bSz), afterDate_(a, aSz) {}
cwe
CWE-254
Unknown
function XMLRPCaddImageToGroup($name, $imageid){ $groups = getUserResources(array("imageAdmin"), array("manageGroup"), 1); if($groupid = getResourceGroupID("image/$name")){ if(!array_key_exists($groupid, $groups['image'])){ return array('status' => 'error', 'err...
cwe
CWE-20
PHP
PepperDeviceEnumerationHostHelper::PepperDeviceEnumerationHostHelper( ppapi::host::ResourceHost* resource_host, Delegate* delegate, PP_DeviceType_Dev device_type, const GURL& document_url) : resource_host_(resource_host), delegate_(delegate), device_type_(device_type), document...
cwe
CWE-399
C/C++
GF_AV1Config *gf_isom_av1_config_get(GF_ISOFile *the_file, u32 trackNumber, u32 DescriptionIndex) { GF_TrackBox *trak; GF_MPEGVisualSampleEntryBox *entry; if (gf_isom_get_reference_count(the_file, trackNumber, GF_ISOM_REF_TBAS)) { u32 ref_track; GF_Err e = gf_isom_get_reference(the_file, trackNumber, GF_ISOM_REF...
cwe
CWE-476
C/C++
compile_def_function( ufunc_T *ufunc, int check_return_type, compiletype_T compile_type, cctx_T *outer_cctx) { char_u *line = NULL; char_u *line_to_free = NULL; char_u *p; char *errormsg = NULL; // error message cctx_T cctx; garray_T *instr; int did_emsg_before = did_emsg; int ...
cwe
CWE-416
Unknown
pdf_show_image(fz_context *ctx, pdf_run_processor *pr, fz_image *image) { pdf_gstate *gstate = pr->gstate + pr->gtop; fz_matrix image_ctm; fz_rect bbox; softmask_save softmask = { NULL }; if (pr->super.hidden) return; break; case PDF_MAT_SHADE: if (gstat...
cwe
CWE-20
Unknown
QPDFWriter::pushEncryptionFilter() { if (this->m->encrypted && (! this->m->cur_data_key.empty())) { Pipeline* p = 0; if (this->m->encrypt_use_aes) { p = new Pl_AES_PDF( "aes stream encryption", this->m->pipeline, true, QUtil::unsigned_char_pointer(this->m->cur_data_key), this->m->cur...
cwe
CWE-787
Unknown
static void hci_loglink_complete_evt(struct hci_dev *hdev, struct sk_buff *skb) { struct hci_ev_logical_link_complete *ev = (void *) skb->data; struct hci_conn *hcon; struct hci_chan *hchan; struct amp_mgr *mgr; BT_DBG("%s log_handle 0x%4.4x phy_handle 0x%2.2x status 0x%2.2x", hdev->name, le16_to_cpu(ev->...
cwe
CWE-416
Unknown
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
cwe
CWE-399
C/C++
// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2014-2020, NVIDIA CORPORATION. All rights reserved. */ #include <linux/delay.h> #include <linux/io.h> #include <linux/mailbox_client.h> #include <linux/module.h> #include <linux/of.h> #include <linux/of_device.h> #include <linux/phy/phy.h> #include <linux/...
cwe
CWE-476
C/C++
int main(int argc, char *argv[]) { #ifdef HAVE_GUSI_H GUSISetup(GUSIwithSIOUXSockets); GUSISetup(GUSIwithInternetSockets); #endif #ifdef HAVE_WINSOCK_H WSAData winSockData; /* we need at least version 1.1 */ WORD winSockVersionNeeded = MAKEWORD( 1, 1 ); WSAStartup(winSockVersionNeeded, &winSoc...
cwe
CWE-264
C/C++
static void preinit_thread (lua_State *L, global_State *g) { G(L) = g; L->stack = NULL; L->ci = NULL; L->nci = 0; L->stacksize = 0; L->twups = L; /* thread has no upvalues */ L->errorJmp = NULL; L->hook = NULL; L->hookmask = 0; L->basehookcount = 0; L->allowhook = 1; resethookcount(L); L->ope...
cwe
CWE-703
Unknown
static void png_write_data(png_structp png_ptr, png_bytep data, png_size_t length) { VncState *vs = png_get_io_ptr(png_ptr); buffer_reserve(&vs->tight.png, vs->tight.png.offset + length); memcpy(vs->tight.png.buffer + vs->tight.png.offset, data, length); vs->tight.png.offset...
cwe
CWE-401
Unknown
void CLASS foveon_dp_load_raw() { unsigned c, roff[4], row, col, diff; ushort huff[512], vpred[2][2], hpred[2]; fseek (ifp, 8, SEEK_CUR); foveon_huff (huff); roff[0] = 48; FORC3 roff[c+1] = -(-(roff[c] + get4()) & -16); FORC3 { fseek (ifp, data_offset+roff[c], SEEK_SET); getbits(-1); vpred[0]...
cwe
CWE-787
Unknown
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
cwe
CWE-787
C/C++
module.exports = function(RED) { var ui = require('../ui')(RED); function ToastNode(config) { RED.nodes.createNode(this, config); if (config.hasOwnProperty("displayTime") && (config.displayTime.length > 0)) { try { this.displayTime = parseFloat(config.displayTime) * 1000; } ...
cwe
CWE-79
JavaScript
mxText.prototype.updateValue=function(){if(mxUtils.isNode(this.value))this.node.innerHTML="",this.node.appendChild(this.value);else{var a=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(a=mxUtils.htmlEntities(a,!1));a=mxUtils.replaceTrailingNewlines(a,"<div><br></div>");a=this.replaceLinefeeds?a.replace(/\n/g...
cwe
CWE-94
JavaScript
int main(int argc, char **argv) { int error; my_bool first_argument_uses_wildcards=0; char *wild; MYSQL mysql; MY_INIT(argv[0]); my_getopt_use_args_separator= TRUE; if (load_defaults("my",load_default_groups,&argc,&argv)) exit(1); my_getopt_use_args_separator= FALSE; get_options(&argc,&argv); ...
cwe
CWE-319
Unknown
int ssl3_write_bytes(SSL *s, int type, const void *buf_, int len) { const unsigned char *buf = buf_; int tot; unsigned int n, nw; #if !defined(OPENSSL_NO_MULTIBLOCK) && EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK unsigned int max_send_fragment; #endif SSL3_BUFFER *wb = &(s->s3->wbuf); int i; s->rwstate...
cwe
CWE-17
Unknown
isdn_net_setcfg(isdn_net_ioctl_cfg * cfg) { isdn_net_dev *p = isdn_net_findif(cfg->name); ulong features; int i; int drvidx; int chidx; char drvid[25]; if (p) { isdn_net_local *lp = p->local; /* See if any registered driver supports the features we want */ features = ((1 << cfg->l2_proto) << ISDN_FEATURE...
cwe
CWE-119
Unknown
public Map<String, String> handleCorsPreflightRequest(String pOrigin, String pRequestHeaders) { Map<String,String> ret = new HashMap<String, String>(); if (pOrigin != null && backendManager.isCorsAccessAllowed(pOrigin)) { // CORS is allowed, we set exactly the origin in the header, so there ...
cwe
CWE-352
Java
sparse_dump_region (struct tar_sparse_file *file, size_t i) { union block *blk; off_t bytes_left = file->stat_info->sparse_map[i].numbytes; if (!lseek_or_error (file, file->stat_info->sparse_map[i].offset)) return false; while (bytes_left > 0) { size_t bufsize = (bytes_left > BLOCKSIZE) ? BLOCKS...
cwe
CWE-835
Unknown
int do_truncate(struct dentry *dentry, loff_t length, unsigned int time_attrs, struct file *filp) { int err; struct iattr newattrs; /* Not pretty: "inode->i_size" shouldn't really be signed. But it is. */ if (length < 0) return -EINVAL; newattrs.ia_size = length; newattrs.ia_valid = ATTR_SIZE | time_attrs; ...
cwe
CWE-264
Unknown
def save_accepted_transaction(self, user_id, project_id, money): self.cursor.execute("update users set money = money - %s where id = %s"%(money, user_id)) self.cursor.execute("update projects set money = money + %s where id = %s" % (money, project_id)) self.cursor.execute("insert into transactio...
cwe
CWE-89
Python
PHP_FUNCTION(imageaffine) { zval *IM; gdImagePtr src; gdImagePtr dst; gdRect rect; gdRectPtr pRect = NULL; zval *z_rect = NULL; zval *z_affine; zval **tmp; double affine[6]; int i, nelems; zval **zval_affine_elem = NULL; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ra|a", &IM, &z_affine, &z_rect) ...
cwe
CWE-189
C/C++
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ // Copyright 2016 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE.chrome file. #include <assert.h> #include <inttypes.h> #include <stdint.h> #include <s...
cwe
CWE-476
C/C++
bool WtsSessionProcessDelegate::Core::Initialize(uint32 session_id) { if (base::win::GetVersion() == base::win::VERSION_XP) launch_elevated_ = false; if (launch_elevated_) { process_exit_event_.Set(CreateEvent(NULL, TRUE, FALSE, NULL)); if (!process_exit_event_.IsValid()) { LOG(ERROR) << "F...
cwe
CWE-399
C/C++
// Copyright 2021 dudaodong@gmail.com. All rights reserved. // Use of this source code is governed by MIT license. // Package fileutil implements some basic functions for file operations package fileutil import ( "archive/zip" "bufio" "errors" "io" "io/fs" "io/ioutil" "net/http" "os" "path" "path/filepath" ...
cwe
CWE-22
Go
rsa_blind (const struct rsa_public_key *pub, void *random_ctx, nettle_random_func *random, mpz_t c, mpz_t ri, const mpz_t m) { mpz_t r; mpz_init(r); /* c = m*(r^e) * ri = r^(-1) */ do { nettle_mpz_random(r, random_ctx, random, pub->n); /* invert r */ } while (!mpz_invert (r...
cwe
CWE-203
Unknown
static void ok_png_decode2(ok_png_decoder *decoder) { ok_png *png = decoder->png; uint8_t png_header[8]; if (!ok_read(decoder, png_header, sizeof(png_header))) { return; } uint8_t png_signature[8] = {137, 80, 78, 71, 13, 10, 26, 10}; if (memcmp(png_header, png_signature, 8) != 0) { ...
cwe
CWE-787
Unknown
function createProject(user, metadata) { if (metadata.files && metadata.migrateFiles) { // We expect there to be no active project in this scenario if (activeProject) { throw new Error("Cannot migrate as there is an active project"); } var currentEncryptionKey = settings....
cwe
CWE-22
JavaScript
func TimestampFileMetaEqual(actual data.TimestampFileMeta, expected data.TimestampFileMeta) error { // As opposed to snapshots, the length and hashes are still required in // TUF-1.0. See: // https://github.com/theupdateframework/specification/issues/38 if err := FileMetaEqual(actual.FileMeta, expected.FileMeta); e...
cwe
CWE-354
Go
construct_command_line(struct manager_ctx *manager, struct server *server) { static char cmd[BUF_SIZE]; char *method = manager->method; int i; build_config(working_dir, server); if (server->method) method = server->method; memset(cmd, 0, BUF_SIZE); snprintf(cmd, BUF_SIZE, "%s ...
cwe
CWE-78
Unknown
ProcPutImage(ClientPtr client) { GC *pGC; DrawablePtr pDraw; long length; /* length of scanline server padded */ long lengthProto; /* length of scanline protocol padded */ char *tmpImage; REQUEST(xPutImageReq); REQUEST_AT_LEAST_SIZE(xPutImageReq); VALIDATE_DRAW...
cwe
CWE-369
C/C++
static int ssd0323_load(QEMUFile *f, void *opaque, int version_id) { SSISlave *ss = SSI_SLAVE(opaque); ssd0323_state *s = (ssd0323_state *)opaque; int i; if (version_id != 1) return -EINVAL; s->cmd_len = qemu_get_be32(f); s->cmd = qemu_get_be32(f); for (i = 0; i < 8; i++) s...
cwe
CWE-119
Unknown
void Compute(OpKernelContext* context) override { const Tensor& indices = context->input(0); const Tensor& values = context->input(1); const Tensor& shape = context->input(2); const Tensor& weights = context->input(3); bool use_weights = weights.NumElements() > 0; OP_REQUIRES(context, TensorSha...
cwe
CWE-787
C/C++
public function urlOrExistingFilepath($fields) { if ($this->isFeedLocal($this->data)) { if ($this->data['Feed']['source_format'] == 'misp') { if (!is_dir($this->data['Feed']['url'])) { return 'For MISP type local feeds, please specify the containing directory....
cwe
CWE-502
PHP
OMX_ERRORTYPE SoftAMR::internalGetParameter( OMX_INDEXTYPE index, OMX_PTR params) { switch (index) { case OMX_IndexParamAudioAmr: { OMX_AUDIO_PARAM_AMRTYPE *amrParams = (OMX_AUDIO_PARAM_AMRTYPE *)params; if (amrParams->nPortIndex != 0) { return O...
cwe
CWE-119
C/C++
function simplePurifier( text, bHtml = false, bSvg = false, bSvgFilters = false ) { return DOMPurify.sanitize( sanitizeDom(text) .replaceAll('&lt;', '<') .replaceAll('&#x3C;', '<') .replaceAll('&#60;', '<') .replaceAll('&gt;', '>') ...
cwe
CWE-116
JavaScript
int get_netnsid_from_name(const char *name) { struct { struct nlmsghdr n; struct rtgenmsg g; char buf[1024]; } req = { .n.nlmsg_len = NLMSG_LENGTH(sizeof(struct rtgenmsg)), .n.nlmsg_flags = NLM_F_REQUEST, .n.nlmsg_type = RTM_GETNSID, .g.rtgen_family = AF_UNSPEC, }; struct nlmsghdr *answer; ...
cwe
CWE-416
C/C++
const got = require('@/utils/got'); const cheerio = require('cheerio'); module.exports = async (ctx) => { const language = ctx.params.language || 'www'; const url = ctx.params.url || 'video'; const link = `https://${language}.pornhub.com/${url}`; const response = await got.get(link); const $ = che...
cwe
CWE-918
JavaScript
zzip_mem_entry_fopen(ZZIP_MEM_DISK * dir, ZZIP_MEM_ENTRY * entry) { /* keep this in sync with zzip_disk_entry_fopen */ ZZIP_DISK_FILE *file = malloc(sizeof(ZZIP_MEM_DISK_FILE)); if (! file) return file; file->buffer = dir->disk->buffer; file->endbuf = dir->disk->endbuf; file->avail = zzi...
cwe
CWE-119
Unknown
/************************************************************************ * This file is part of EspoCRM. * * EspoCRM - Open Source CRM application. * Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko * Website: https://www.espocrm.com * * EspoCRM is free software: you can redistribute i...
cwe
CWE-79
JavaScript
snmp_ber_encode_integer(unsigned char *out, uint32_t *out_len, uint32_t number) { uint32_t original_out_len; original_out_len = *out_len; do { (*out_len)++; *out-- = (uint8_t)(number & 0xFF); number >>= 8; } while(number); out = snmp_ber_encode_length(out, out_len, ((*out_len - original_out_len)...
cwe
CWE-125
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-89
Java
auth_read_binary(struct sc_card *card, unsigned int offset, unsigned char *buf, size_t count, unsigned long flags) { int rv; struct sc_pkcs15_bignum bn[2]; unsigned char *out = NULL; bn[0].data = NULL; bn[1].data = NULL; LOG_FUNC_CALLED(card->ctx); sc_log(card->ctx, "offset %i; size %"SC_FORMAT_L...
cwe
CWE-125
C/C++
dissect_kafka_message_old(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int end_offset _U_) { proto_item *message_ti; proto_tree *subtree; tvbuff_t *decompressed_tvb; int decompressed_offset; int start_offset = offset; int bytes_offset; gint8 ...
cwe
CWE-401
Unknown
/* import-globals-from ../src/jsmime.jsm */ /* globals define, module */ (function(root, fn) { if (typeof define === "function" && define.amd) { define(fn); } else if (typeof module !== "undefined" && module.exports) { module.exports = fn(); } else { root.jsmime = fn(); } })(this, function() { va...
cwe
CWE-295
JavaScript
CoordinatorImpl::CoordinatorImpl(service_manager::Connector* connector) : next_dump_id_(0), client_process_timeout_(base::TimeDelta::FromSeconds(15)) { process_map_ = std::make_unique<ProcessMap>(connector); DCHECK(!g_coordinator_impl); g_coordinator_impl = this; base::trace_event::MemoryDumpManag...
cwe
CWE-787
C/C++
/*! * Copyright (c) 2017-Present, Okta, Inc. and/or its affiliates. All rights reserved. * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") * * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. * Unless required ...
cwe
CWE-601
JavaScript
fn should_support_base32_encoded_web_urls_as_path() { // given let (server, fetch) = serve_with_fetch("token"); // when let response = request(server, "\ GET /web/EHQPPSBE5DM78X3GECX2YBVGC5S6JX3S5SMPY/styles.css?test=123 HTTP/1.1\r\n\ Host: localhost:8080\r\n\ Connection: close\r\n\ \r\n\ " ); /...
cwe
CWE-346
Rust
package main import ( "fmt" "os" "text/tabwriter" "github.com/dustin/go-humanize" "github.com/flynn/go-docopt" tuf "github.com/theupdateframework/go-tuf/client" ) func init() { register("list", cmdList, ` usage: tuf-client list [-s|--store=<path>] <url> Options: -s <path> The path to the local file stor...
cwe
CWE-354
Go
static UINT parallel_process_irp_create(PARALLEL_DEVICE* parallel, IRP* irp) { char* path = NULL; int status; UINT32 PathLength; Stream_Seek(irp->input, 28); /* DesiredAccess(4) AllocationSize(8), FileAttributes(4) */ /* SharedAccess(4) CreateDisposition(4), CreateOptions(4) */ Stream_Read_UINT32(irp->input, Pat...
cwe
CWE-415
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-476
C/C++
def remote_remove_nodes(params, request, session) if not allowed_for_local_cluster(session, Permissions::FULL) return 403, 'Permission denied' end count = 0 out = "" node_list = [] options = [] while params["nodename-" + count.to_s] node_list << params["nodename-" + count.to_s] count = count +...
cwe
CWE-384
Ruby
/* * linux/ipc/shm.c * Copyright (C) 1992, 1993 Krishna Balasubramanian * Many improvements/fixes by Bruno Haible. * Replaced `struct shm_desc' by `struct vm_area_struct', July 1994. * Fixed the shm swap deallocation (shm_unuse()), August 1998 Andrea Arcangeli. * * /proc/sysvipc/shm support (c) 1999 Dragos Acos...
cwe
CWE-264
C/C++
static const ut8 *r_bin_dwarf_parse_comp_unit(Sdb *s, const ut8 *obuf, RBinDwarfCompUnit *cu, const RBinDwarfDebugAbbrev *da, size_t offset, const ut8 *debug_str, size_t debug_str_len) { const ut8 *buf = obuf, *buf_end = obuf + (cu->hdr.length - 7); ut64 abbr_code; size_t i; if (cu->hdr.length > debug_str_len...
cwe
CWE-125
C/C++
import { Meteor } from "meteor/meteor"; import nodemailer from "nodemailer"; import smtpPool from "nodemailer-smtp-pool"; const Future = Npm.require("fibers/future"); const getSmtpConfig = function () { const config = Settings.findOne({ _id: "smtpConfig" }); return config && config.value; }; const makePool = fun...
cwe
CWE-287
JavaScript
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ /* GdkPixbuf library - animated gif support * * Copyright (C) 1999 The Free Software Foundation * * Authors: Jonathan Blandford <jrb@redhat.com> * Havoc Pennington <hp@redhat.com> * * This library is free software; you can red...
cwe
CWE-787
C/C++
void resolveOrPushdowns(MatchExpression* tree) { if (tree->numChildren() == 0) { return; } if (MatchExpression::AND == tree->matchType()) { AndMatchExpression* andNode = static_cast<AndMatchExpression*>(tree); MatchExpression* indexedOr = getIndexedOr(andNode); for (size_t i...
cwe
CWE-834
Unknown
static const char *fuse_get_link(struct dentry *dentry, struct inode *inode, struct delayed_call *callback) { struct fuse_conn *fc = get_fuse_conn(inode); struct page *page; int err; err = -EIO; if (is_bad_inode(inode)) goto out_err; if (fc->cache_symlinks) return page_get_link(dentry, inode, callback)...
cwe
CWE-459
Unknown
bool read_ujpg( void ) { using namespace IOUtil; using namespace Sirikata; // colldata.start_decoder_worker_thread(std::bind(&simple_decoder, &colldata, str_in)); unsigned char ujpg_mrk[ 64 ]; // this is where we will enable seccomp, before reading user data write_byte_bill(Billing::HEADER, true,...
cwe
CWE-399
C/C++
int FdOutStream::writeWithTimeout(const void* data, int length, int timeoutms) { int n; do { fd_set fds; struct timeval tv; struct timeval* tvp = &tv; if (timeoutms != -1) { tv.tv_sec = timeoutms / 1000; tv.tv_usec = (timeoutms % 1000) * 1000; } else { tvp = NULL; } ...
cwe
CWE-787
C/C++
void WebPImage::readMetadata() { if (io_->open() != 0) throw Error(kerDataSourceOpenFailed, io_->path(), strError()); IoCloser closer(*io_); // Ensure that this is the correct image type if (!isWebPType(*io_, true)) { if (io_->error() || io_->eof()) throw Error(kerFailedT...
cwe
CWE-190
Unknown
static int jpc_dec_process_siz(jpc_dec_t *dec, jpc_ms_t *ms) { jpc_siz_t *siz = &ms->parms.siz; int compno; int tileno; jpc_dec_tile_t *tile; jpc_dec_tcomp_t *tcomp; int htileno; int vtileno; jpc_dec_cmpt_t *cmpt; dec->xstart = siz->xoff; dec->ystart = siz->yoff; dec->xend = siz->width; dec->yend = siz->he...
cwe
CWE-189
Unknown
static int decode_zbuf(AVBPrint *bp, const uint8_t *data, const uint8_t *data_end) { z_stream zstream; unsigned char *buf; unsigned buf_size; int ret; zstream.zalloc = ff_png_zalloc; zstream.zfree = ff_png_zfree; zstream.opaque = NULL; if (inflateInit(&zstream) !...
cwe
CWE-787
C/C++
pub fn ensure_ethereum_transaction<OuterOrigin>(o: OuterOrigin) -> Result<H160, &'static str> where OuterOrigin: Into<Result<RawOrigin, OuterOrigin>>, { match o.into() { Ok(RawOrigin::EthereumTransaction(n)) => Ok(n), _ => Err("bad origin: expected to be an Ethereum transaction"), } } pub struct EnsureEthereumT...
cwe
CWE-20
Rust
/* * Copyright (C) 2007-2012 Martin Willi * Copyright (C) 2012 revosec AG * HSR Hochschule fuer Technik Rapperswil * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of th...
cwe
CWE-287
C/C++
exif_data_load_data_entry (ExifData *data, ExifEntry *entry, const unsigned char *d, unsigned int size, unsigned int offset) { unsigned int s, doff; entry->tag = exif_get_short (d + offset + 0, data->priv->order); entry->format = exif_get_short (d + offset + 2, data->priv->order); entry->com...
cwe
CWE-787
C/C++
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-79
Java
ipsecmod_handle_query(struct module_qstate* qstate, struct ipsecmod_qstate* iq, struct ipsecmod_env* ie, int id) { struct ub_packed_rrset_key* rrset_key; struct packed_rrset_data* rrset_data; size_t i; /* Pass to next module if we are not enabled and whitelisted. */ if(!(iq->enabled && iq->is_whitelisted)) { qs...
cwe
CWE-613
Unknown
/** * 2014 John McLear (Etherpad Foundation / McLear Ltd) * * 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 a...
cwe
CWE-200
JavaScript
/* * GPAC - Multimedia Framework C SDK * * Authors: Jean Le Feuvre * Copyright (c) Telecom ParisTech 2020-2022 * All rights reserved * * This file is part of GPAC / MHAS reframer filter * * GPAC is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General...
cwe
CWE-125
C/C++
/////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the f...
cwe
CWE-190
Java
init_ctx_new(OM_uint32 *minor_status, spnego_gss_cred_id_t spcred, gss_ctx_id_t *ctx, send_token_flag *tokflag) { OM_uint32 ret; spnego_gss_ctx_id_t sc = NULL; sc = create_spnego_ctx(); if (sc == NULL) return GSS_S_FAILURE; /* determine negotiation mech set */ ret = get_negotiable_mechs(mino...
cwe
CWE-763
Unknown
function write_cache() { global $cms_db, $cfg_cms; $action = 'insert'; if ( $this->cache_mode == 'DB_TEST_CACHE' ) { if ( count( $this->cache_test ) >= $this->cache_test_value ) { $this->cache = $this->cache_test; $this->cache_test = array(); ...
cwe
CWE-89
PHP