code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
var CC = require('config-chain').ConfigChain var inherits = require('inherits') var configDefs = require('./defaults.js') var types = configDefs.types var once = require('once') var fs = require('fs') var path = require('path') var nopt = require('nopt') var ini = require('ini') var Umask = configDefs.Umask var correct...
cwe
CWE-732
JavaScript
do_refill(struct table *tbl, int row, int col, int maxlimit) { TextList *orgdata; TextListItem *l; struct readbuffer obuf; struct html_feed_environ h_env; struct environment envs[MAX_ENV_LEVEL]; int colspan, icell; if (tbl->tabdata[row] == NULL || tbl->tabdata[row][col] == NULL) return; ...
cwe
CWE-835
C/C++
/********************************************************************** regparse.c - Oniguruma (regular expression library) **********************************************************************/ /*- * Copyright (c) 2002-2016 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> * All rights reserved. * * Redistribution an...
cwe
CWE-787
C/C++
xps_parse_gradient_stops(xps_document *doc, char *base_uri, fz_xml *node, struct stop *stops, int maxcount) { fz_colorspace *colorspace; float sample[8]; float rgb[3]; int before, after; int count; int i; /* We may have to insert 2 extra stops when postprocessing */ maxcount -= 2; count = 0; while (node &&...
cwe
CWE-119
Unknown
/*! lazysizes - v5.2.0 */ !function(a,b){if(a){var c=function(){b(a.lazySizes),a.removeEventListener("lazyunveilread",c,!0)};b=b.bind(null,a,a.document),"object"==typeof module&&module.exports?b(require("lazysizes")):a.lazySizes?c():a.addEventListener("lazyunveilread",c,!0)}}("undefined"!=typeof window?window:0,functio...
cwe
CWE-79
JavaScript
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
cwe
CWE-772
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
/* * Copyright © 2015-2018 Aeneas Rekkas <aeneas+oss@aeneas.io> * * 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...
cwe
CWE-754
Go
void luaC_barrier_ (lua_State *L, GCObject *o, GCObject *v) { global_State *g = G(L); lua_assert(isblack(o) && iswhite(v) && !isdead(g, v) && !isdead(g, o)); if (keepinvariant(g)) { /* must keep invariant? */ reallymarkobject(g, v); /* restore invariant */ if (isold(o)) { lua_assert(!isold(v)); /...
cwe
CWE-763
Unknown
static int ssl_scan_clienthello_custom_tlsext(SSL *s, const unsigned char *data, const unsigned char *limit, int *al) { unsigned short type, size, len; /* If resumed session ...
cwe
CWE-190
Unknown
void RenderSVGImage::paint(PaintInfo& paintInfo, const LayoutPoint&) { ANNOTATE_GRAPHICS_CONTEXT(paintInfo, this); if (paintInfo.context->paintingDisabled() || style()->visibility() == HIDDEN || !m_imageResource->hasImage()) return; FloatRect boundingBox = repaintRectInLocalCoordinates(); if (...
cwe
CWE-399
C/C++
void Server::handleCommand_InventoryAction(NetworkPacket* pkt) { session_t peer_id = pkt->getPeerId(); RemotePlayer *player = m_env->getPlayer(peer_id); if (player == NULL) { errorstream << "Server::ProcessData(): Canceling: No player for peer_id=" << peer_id << " disconnecting peer!" << std::endl; Discon...
cwe
CWE-276
C/C++
this.canvas.end=this.originalEnd;this.canvas.rect=this.originalRect;this.canvas.ellipse=this.originalEllipse;this.canvas.roundrect=this.originalRoundrect};mxShape.prototype.createRoughCanvas=function(Q){return new u(Q,Editor.createRoughCanvas(Q),this)};var E=mxShape.prototype.createHandJiggle;mxShape.prototype.createHa...
cwe
CWE-20
JavaScript
QPDF::initializeEncryption() { if (this->m->encp->encryption_initialized) { return; } this->m->encp->encryption_initialized = true; // After we initialize encryption parameters, we must used stored // key information and never look at /Encrypt again. Otherwise, // things could go wrong if...
cwe
CWE-787
Unknown
int vp9_alloc_context_buffers(VP9_COMMON *cm, int width, int height) { int new_mi_size; vp9_set_mb_mi(cm, width, height); new_mi_size = cm->mi_stride * calc_mi_size(cm->mi_rows); if (cm->mi_alloc_size < new_mi_size) { cm->free_mi(cm); if (cm->alloc_mi(cm, new_mi_size)) goto fail; } if (cm->seg_map_alloc...
cwe
CWE-20
C/C++
int line6_init_pcm(struct usb_line6 *line6, struct line6_pcm_properties *properties) { int i, err; unsigned ep_read = line6->properties->ep_audio_r; unsigned ep_write = line6->properties->ep_audio_w; struct snd_pcm *pcm; struct snd_line6_pcm *line6pcm; if (!(line6->properties->capabilities & LINE6_CAP_PCM))...
cwe
CWE-476
C/C++
irc_server_gnutls_callback (void *data, gnutls_session_t tls_session, const gnutls_datum_t *req_ca, int nreq, const gnutls_pk_algorithm_t *pk_algos, int pk_algos_len, gnutls_retr_st *answer) { struct t_irc_server *server; g...
cwe
CWE-20
C/C++
void clear() { req = crow::request(); header_field.clear(); header_value.clear(); header_building_state = 0; qs_point = 0; }
cwe
CWE-416
Unknown
import copy import logging from functools import wraps from typing import Dict from django.core.cache import caches from django.http import HttpRequest, JsonResponse from django.http.response import HttpResponseNotModified from django.views.decorators.csrf import csrf_protect from django.views.decorators.http import r...
cwe
CWE-79
Python
function auth_nodes_dialog(unauth_nodes, callback_success, callback_success_one) { callback_success = typeof callback_success !== 'undefined' ? callback_success : null; callback_success_one = typeof callback_success_one !== 'undefined' ? callback_success_one : null; var buttonsOpts = [ { text: "Authent...
cwe
CWE-79
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. * * The IP to API glue. * * Authors: see ip.c * * Fixes: * Many : Split from ip.c , see ip.c for history. ...
cwe
CWE-125
C/C++
long Segment::LoadCluster( long long& pos, long& len) { for (;;) { const long result = DoLoadCluster(pos, len); if (result <= 1) return result; } }
cwe
CWE-119
C/C++
static int em_ret_far(struct x86_emulate_ctxt *ctxt) { int rc; unsigned long eip, cs; u16 old_cs; int cpl = ctxt->ops->cpl(ctxt); struct desc_struct old_desc, new_desc; const struct x86_emulate_ops *ops = ctxt->ops; if (ctxt->mode == X86EMUL_MODE_PROT64) ops->get_segment(ctxt, &old_cs, &old_desc, NULL, V...
cwe
CWE-200
C/C++
function sendFileInformations(file, peer_id, broadcast = false) { fileToSend = file; // check if valid if (fileToSend && fileToSend.size > 0) { // no peers in the room if (!thereIsPeerConnections()) { return userLog('info', 'No participants detected'); } let fileI...
cwe
CWE-79
JavaScript
static int cirrus_bitblt_common_patterncopy(CirrusVGAState * s, const uint8_t * src) { uint8_t *dst; dst = s->vram_ptr + s->cirrus_blt_dstaddr; (*s->cirrus_rop) (s, dst, src, s->cirrus_blt_dstpitch, 0, s->cirrus_blt_width, s->cirrus_blt_height); cirr...
cwe
CWE-787
Unknown
void PaymentRequest::UpdateWith(mojom::PaymentDetailsPtr details) { std::string error; if (!ValidatePaymentDetails(ConvertPaymentDetails(details), &error)) { LOG(ERROR) << error; OnConnectionTerminated(); return; } if (details->shipping_address_errors && !PaymentsValidators::IsValidAd...
cwe
CWE-189
C/C++
/* * GPAC - Multimedia Framework C SDK * * Authors: Jean Le Feuvre, Romain Bouqueau, Cyril Concolato * Copyright (c) Telecom ParisTech 2000-2021 * All rights reserved * * This file is part of GPAC / Media Tools sub-project * * GPAC is free software; you can redistribute it and/or modify * it unde...
cwe
CWE-120
C/C++
public function checkRedirect(RequestInterface $request, array $options, ResponseInterface $response) { if (\strpos((string) $response->getStatusCode(), '3') !== 0 || !$response->hasHeader('Location') ) { return $response; } $this->guardMax($request, $respons...
cwe
CWE-212
PHP
export function store_isFeatFlagOn(store: Store, featureFlag: St): Bo { return _.includes(store.siteFeatureFlags, featureFlag) || _.includes(store.serverFeatureFlags, featureFlag); }
cwe
CWE-613
Scala
function m(u,F){G=!1;var C=null!=u.Text&&u.Text.t?u.Text:null!=u.Value&&u.Value.t?u.Value: null!=u.Lane_0&&u.Lane_0.t?u.Lane_0:null;null==C&&null!=u.State?u.State.t&&(C=u.State):null==C&&null!=u.Note?u.Note.t&&(C=u.Note):null==C&&null!=u.Title?u.Title.t&&(C=u.Title):u.t&&(C=u);null==C&&null!=u.TextAreas?null!=u.TextAre...
cwe
CWE-79
JavaScript
/* * Copyright (c) 2000, 2001, 2002 Fabrice Bellard * * 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 o...
cwe
CWE-119
C/C++
static void kvmclock_reset(struct kvm_vcpu *vcpu) { if (vcpu->arch.time_page) { kvm_release_page_dirty(vcpu->arch.time_page); vcpu->arch.time_page = NULL; } }
cwe
CWE-399
Unknown
void bn_mul_comba4(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b) { r[4]=bn_mul_words( &(r[0]),a,4,b[0]); r[5]=bn_mul_add_words(&(r[1]),a,4,b[1]); r[6]=bn_mul_add_words(&(r[2]),a,4,b[2]); r[7]=bn_mul_add_words(&(r[3]),a,4,b[3]); }
cwe
CWE-310
Unknown
load_header (XwdLoader *loader) // gconstpointer in, gsize in_max_len, XwdHeader *header_out) { XwdHeader *h = &loader->header; XwdHeader in; const guint32 *p = (const guint32 *) &in; if (!file_mapping_taste (loader->mapping, &in, 0, sizeof (in))) return FALSE; h->header_size = g_ntohl (*(...
cwe
CWE-125
C/C++
struct sk_buff *sock_alloc_send_pskb(struct sock *sk, unsigned long header_len, unsigned long data_len, int noblock, int *errcode) { struct sk_buff *skb; gfp_t gfp_mask; long timeo; int err; gfp_mask = sk->sk_allocation; if (gfp_mask & __GFP_WAIT) gfp_mask |= __GFP_REPEAT; timeo = sock_sndt...
cwe
CWE-20
C/C++
/* * Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * * 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,...
cwe
CWE-287
Java
/* * 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
int wc_SignatureGenerateHash( enum wc_HashType hash_type, enum wc_SignatureType sig_type, const byte* hash_data, word32 hash_len, byte* sig, word32 *sig_len, const void* key, word32 key_len, WC_RNG* rng) { int ret; /* Suppress possible unused arg if all signature types are disabled */ (void...
cwe
CWE-200
C/C++
package scanner import ( "context" "io/fs" "os" "path/filepath" "sort" "strings" "time" "github.com/navidrome/navidrome/conf" "github.com/navidrome/navidrome/core" "github.com/navidrome/navidrome/log" "github.com/navidrome/navidrome/model" "github.com/navidrome/navidrome/model/request" "github.com/navidr...
cwe
CWE-89
Go
private void readKeys( ) throws GeneralSecurityException { if ( DatastoreService.existsKey( DATASTORE_PUBLIC_KEY ) && DatastoreService.existsKey( DATASTORE_PRIVATE_KEY ) ) { X509EncodedKeySpec keySpecPublic = new X509EncodedKeySpec(Base64.getDecoder().decode(DatastoreService.getDataValue( DA...
cwe
CWE-326
Java
from django.shortcuts import render from django.views.generic import TemplateView, View from haystack.query import SearchQuerySet from haystack.utils.geo import Point from django.http import HttpResponse from django.contrib.gis.measure import D from django.contrib.gis.geos import GEOSGeometry from django.db import conn...
cwe
CWE-89
Python
// SPDX-License-Identifier: GPL-2.0-or-later /* * HID driver for multitouch panels * * Copyright (c) 2010-2012 Stephane Chatty <chatty@enac.fr> * Copyright (c) 2010-2013 Benjamin Tissoires <benjamin.tissoires@gmail.com> * Copyright (c) 2010-2012 Ecole Nationale de l'Aviation Civile, France * Copyright (c) 20...
cwe
CWE-787
C/C++
/* * The Python Imaging Library. * $Id$ * * decoder for Autodesk Animator FLI/FLC animations * * history: * 97-01-03 fl Created * 97-01-17 fl Added SS2 support (FLC) * * Copyright (c) Fredrik Lundh 1997. * Copyright (c) Secret Labs AB 1997. * * See the README file for information on usage and redistributio...
cwe
CWE-119
Python
static char* allocFromUTF16(const char16_t* in, size_t len) { if (len == 0) return getEmptyString(); const ssize_t bytes = utf16_to_utf8_length(in, len); if (bytes < 0) { return getEmptyString(); } SharedBuffer* buf = SharedBuffer::alloc(bytes+1); ALOG_ASSERT(buf, "Unable to al...
cwe
CWE-119
C/C++
static int oidc_handle_logout(request_rec *r, oidc_cfg *c, oidc_session_t *session) { oidc_provider_t *provider = NULL; /* pickup the command or URL where the user wants to go after logout */ char *url = NULL; oidc_util_get_request_parameter(r, OIDC_REDIRECT_URI_REQUEST_LOGOUT, &url); oidc_debug(r, "enter (url...
cwe
CWE-601
C/C++
// Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build darwin,amd64,!go1.12 package unix //sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS_GETDIRENTRIES64 // Copyright 201...
cwe
CWE-287
Go
# -*- 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-770
Python
static int shadow_copy2_get_shadow_copy_data( vfs_handle_struct *handle, files_struct *fsp, struct shadow_copy_data *shadow_copy2_data, bool labels) { DIR *p; const char *snapdir; struct dirent *d; TALLOC_CTX *tmp_ctx = talloc_stackframe(); snapdir = shadow_copy2_find_snapdir(tmp_ctx, handle, fsp->fsp_name); ...
cwe
CWE-200
Unknown
int Http2Stream::DoWrite(WriteWrap* req_wrap, uv_buf_t* bufs, size_t nbufs, uv_stream_t* send_handle) { CHECK_NULL(send_handle); Http2Scope h2scope(this); if (!IsWritable() || IsDestroyed()) { req_wrap->Done(UV_EOF); return 0; } ...
cwe
CWE-416
Unknown
int kvm_iommu_map_pages(struct kvm *kvm, struct kvm_memory_slot *slot) { gfn_t gfn, end_gfn; pfn_t pfn; int r = 0; struct iommu_domain *domain = kvm->arch.iommu_domain; int flags; /* check if iommu exists and in use */ if (!domain) return 0; gfn = slot->base_gfn; end_gfn = gfn + slot->npages; flags =...
cwe
CWE-119
Unknown
int f2fs_trim_fs(struct f2fs_sb_info *sbi, struct fstrim_range *range) { __u64 start = F2FS_BYTES_TO_BLK(range->start); __u64 end = start + F2FS_BYTES_TO_BLK(range->len) - 1; unsigned int start_segno, end_segno; struct cp_control cpc; int err = 0; if (start >= MAX_BLKADDR(sbi) || range->len < sbi->blocksize) r...
cwe
CWE-20
Unknown
/* * Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * * 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,...
cwe
CWE-287
Java
it 'should write the public key to disk if its the first time its been seen' do @plugin.stubs(:lookup_config_option).with('learn_public_keys').returns('1') @plugin.stubs(:lookup_config_option).with('publickey_dir').returns('ssh/pkd') File.stubs(:directory?).with('ssh/pkd').returns(true) ...
cwe
CWE-20
Ruby
package main import ( "fmt" "os" "github.com/mholt/archiver" ) func main() { if len(os.Args) < 3 { fatal(usage) } cmd, filename := os.Args[1], os.Args[2] ff := archiver.MatchingFormat(filename) if ff == nil { fatalf("%s: Unsupported file extension", filename) } var err error switch cmd { case "mak...
cwe
CWE-22
Go
function showByModel() { global $order, $template, $db; expHistory::set('viewable', $this->params); $product = new product(); $model = $product->find("first", 'model="' . $this->params['model'] . '"'); //eDebug($model); $product_type = new $model->product_type($model->id...
cwe
CWE-89
PHP
mxEvent.getSource(F);null!=G;){if(G==v||G==x){F.stopPropagation();F.preventDefault();break}G=G.parentNode}});var K=function(F){return function(G,N,J,E,H,S,U,Q,W){null!=W&&(/(\.v(dx|sdx?))($|\?)/i.test(W.name)||/(\.vs(x|sx?))($|\?)/i.test(W.name))?b.importVisio(W,mxUtils.bind(this,function(V){c(V,N,J,E,H,S,U,"fixed",mxE...
cwe
CWE-20
JavaScript
gss_wrap_aead (minor_status, context_handle, conf_req_flag, qop_req, input_assoc_buffer, input_payload_buffer, conf_state, output_message_buffer) OM_uint32 * minor_status; gss_ctx_id_t context_handle; int conf_req_flag; gss_q...
cwe
CWE-415
C/C++
int ECDSA_verify(int type, const unsigned char *dgst, int dgst_len, const unsigned char *sigbuf, int sig_len, EC_KEY *eckey) { ECDSA_SIG *s; int ret=-1; s = ECDSA_SIG_new(); if (s == NULL) return(ret); if (d2i_ECDSA_SIG(&s, &sigbuf, sig_len) == NULL) goto err; ret=ECDSA_do_verify(dgst, dgst_len, s, eckey); e...
cwe
CWE-310
C/C++
cdf_read_property_info(const cdf_stream_t *sst, const cdf_header_t *h, uint32_t offs, cdf_property_info_t **info, size_t *count, size_t *maxcount) { const cdf_section_header_t *shp; cdf_section_header_t sh; const uint8_t *p, *q, *e; int16_t s16; int32_t s32; uint32_t u32; int64_t s64; uint64_t u64; cdf_tim...
cwe
CWE-189
Unknown
static int futex_requeue(u32 __user *uaddr1, unsigned int flags, u32 __user *uaddr2, int nr_wake, int nr_requeue, u32 *cmpval, int requeue_pi) { union futex_key key1 = FUTEX_KEY_INIT, key2 = FUTEX_KEY_INIT; int drop_count = 0, task_count = 0, ret; struct futex_pi_state *pi_state = NULL; struct futex_hash_bu...
cwe
CWE-269
Unknown
/* * GPAC Multimedia Framework * * Authors: Cyril Concolato, Jean Le Feuvre * Copyright (c) Telecom ParisTech 2004-2022 * All rights reserved * * This file is part of GPAC / SVG Loader module * * GPAC is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser...
cwe
CWE-404
C/C++
XSetFontPath ( register Display *dpy, char **directories, int ndirs) { register int n = 0; register int i; register int nbytes; char *p; register xSetFontPathReq *req; int retCode; LockDisplay(dpy); GetReq (SetFontPath, req); req->nFonts = ndirs; for (i = 0; i < ndirs; i++) { n = (int) (...
cwe
CWE-120
Unknown
dump_sig_subpkt (int hashed, int type, int critical, const byte * buffer, size_t buflen, size_t length) { const char *p = NULL; int i; /* The CERT has warning out with explains how to use GNUPG to detect * the ARRs - we print our old message here when it is a faked ARR * and add an additional notice. *...
cwe
CWE-20
Unknown
pseudo_ulog( ClassAd *ad ) { ULogEvent *event = instantiateEvent(ad); int result = 0; char const *critical_error = NULL; MyString CriticalErrorBuf; bool event_already_logged = false; bool put_job_on_hold = false; char const *hold_reason = NULL; char *hold_reason_buf = NULL; int hold_reason_code = 0; int hold_...
cwe
CWE-134
C/C++
dname_pkt_compare(sldns_buffer* pkt, uint8_t* d1, uint8_t* d2) { uint8_t len1, len2; log_assert(pkt && d1 && d2); len1 = *d1++; len2 = *d2++; while( len1 != 0 || len2 != 0 ) { /* resolve ptrs */ if(LABEL_IS_PTR(len1)) { d1 = sldns_buffer_at(pkt, PTR_OFFSET(len1, *d1)); len1 = *d1++; continue; } if...
cwe
CWE-400
Unknown
jbig2_sd_cat(Jbig2Ctx *ctx, int n_dicts, Jbig2SymbolDict **dicts) { int i, j, k, symbols; Jbig2SymbolDict *new = NULL; /* count the imported symbols and allocate a new array */ symbols = 0; for (i = 0; i < n_dicts; i++) symbols += dicts[i]->n_symbols; /* fill a new array with cl...
cwe
CWE-190
C/C++
int econn_message_encode(char **strp, const struct econn_message *msg) { struct json_object *jobj = NULL; char *str = NULL; int err; if (!strp || !msg) return EINVAL; err = jzon_creatf(&jobj, "sss", "version", econn_proto_version, "type", econn_msg_name(msg->msg_type), "sessid", msg->sessid_se...
cwe
CWE-134
C/C++
static ssize_t size_show(struct device *dev, struct device_attribute *attr, char *buf) { struct cacheinfo *this_leaf = dev_get_drvdata(dev); return sprintf(buf, "%uK\n", this_leaf->size >> 10); }
cwe
CWE-787
Unknown
/* Copyright 1996-2014 Han The Thanh <thanh@pdftex.org> 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 the License, or (at your option) any later version. This program is distri...
cwe
CWE-119
C/C++
private static function evaluate($func, $a, $b) { $r = false; if (\is_null($a) && $func != '$exists') { return false; } switch ($func) { case '$eq' : $r = $a == $b; break; case '$ne' : $r = $a != $b; ...
cwe
CWE-89
PHP
it "should reject a wildcard subjectAltName" do @request.stubs(:subject_alt_names).returns ['DNS:foo', 'DNS:*.bar'] expect { @ca.sign(@name, true) }.to raise_error( Puppet::SSL::CertificateAuthority::CertificateSigningError, /subjectAltName contains a wildcard/ ) end
cwe
CWE-264
Ruby
// Copyright (c) 2018-2022, Sylabs Inc. All rights reserved. // This software is licensed under a 3-clause BSD license. Please consult the // LICENSE.md file distributed with the sources of this project regarding your // rights to use or distribute this software. package client import ( "context" "errors" "fmt" "...
cwe
CWE-601
Go
/* 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-697
Python
CairoFont *CairoFont::create(GfxFont *gfxFont, XRef *xref, FT_Library lib, GBool useCIDs) { Ref embRef; Object refObj, strObj; GooString *tmpFileName, *fileName,*tmpFileName2; DisplayFontParam *dfp; FILE *tmpFile; int c, i, n; GfxFontType fontType; char **enc; char *name; FoFiTrueType *ff; FoFiTyp...
cwe
CWE-20
C/C++
/* Copyright 2016 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
static zend_bool add_post_var(zval *arr, post_var_data_t *var, zend_bool eof TSRMLS_DC) { char *ksep, *vsep, *val; size_t klen, vlen; /* FIXME: string-size_t */ unsigned int new_vlen; if (var->ptr >= var->end) { return 0; } vsep = memchr(var->ptr, '&', var->end - var->ptr); if (!vsep) { if (!eof) { ret...
cwe
CWE-400
Unknown
def rebuild_time required_parameters :repository, :arch load_packages_mainpage @repository = params[:repository] @arch = params[:arch] @hosts = begin Integer(params[:hosts] || '40') rescue 40 end @scheduler = params[:scheduler] || 'needed' bdep = find_cached(BuilddepInfo, :project => @proje...
cwe
CWE-78
Ruby
exif_mnote_data_canon_load (ExifMnoteData *ne, const unsigned char *buf, unsigned int buf_size) { ExifMnoteDataCanon *n = (ExifMnoteDataCanon *) ne; ExifShort c; size_t i, tcount, o, datao; if (!n || !buf || !buf_size) { exif_log (ne->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifMnoteCanon", "Short MakerNote"); ...
cwe
CWE-125
C/C++
static void stub_recv_cmd_submit(struct stub_device *sdev, struct usbip_header *pdu) { int ret; struct stub_priv *priv; struct usbip_device *ud = &sdev->ud; struct usb_device *udev = sdev->udev; int pipe = get_pipe(sdev, pdu->base.ep, pdu->base.direction); if (pipe == -1) return; priv = stub_priv_alloc(...
cwe
CWE-119
C/C++
func (v *VM) DumpByteCode(name string) string { b := new(bytes.Buffer) fmt.Fprintf(b, "Prog: %s\n", name) fmt.Fprintln(b, "Metrics") for i, m := range v.m { if m.Program == v.name { fmt.Fprintf(b, " %8d %s\n", i, m) } } fmt.Fprintln(b, "Regexps") for i, re := range v.re { fmt.Fprintf(b, " %8d /%s/\n", i...
cwe
CWE-79
Go
call_bind_status(struct rpc_task *task) { int status = -EIO; if (task->tk_status >= 0) { dprint_status(task); task->tk_status = 0; task->tk_action = call_connect; return; } switch (task->tk_status) { case -ENOMEM: dprintk("RPC: %5u rpcbind out of memory\n", task->tk_pid); rpc_delay(task, HZ >> 2); ...
cwe
CWE-400
C/C++
/* * ***** BEGIN LICENSE BLOCK ***** * Zimbra Collaboration Suite Server * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2013, 2014, 2016 Synacor, Inc. * * 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 Softw...
cwe
CWE-863
Java
function mjml2html(mjml, options = {}) { let content = '' let errors = [] if (typeof options.skeleton === 'string') { /* eslint-disable global-require */ /* eslint-disable import/no-dynamic-require */ options.skeleton = require(options.skeleton.charAt(0) === '.' ? path.resolve(process.cwd(), op...
cwe
CWE-22
JavaScript
void SoftMPEG2::setDecodeArgs( ivd_video_decode_ip_t *ps_dec_ip, ivd_video_decode_op_t *ps_dec_op, OMX_BUFFERHEADERTYPE *inHeader, OMX_BUFFERHEADERTYPE *outHeader, size_t timeStampIx) { size_t sizeY = outputBufferWidth() * outputBufferHeight(); size_t sizeUV; u...
cwe
CWE-20
C/C++
void free_pipe_info(struct pipe_inode_info *pipe) { int i; for (i = 0; i < pipe->buffers; i++) { struct pipe_buffer *buf = pipe->bufs + i; if (buf->ops) buf->ops->release(pipe, buf); } if (pipe->tmp_page) __free_page(pipe->tmp_page); kfree(pipe->bufs); kfree(pipe); }
cwe
CWE-399
C/C++
'use strict'; /** * Share application. */ angular.module('share', // Dependencies ['ui.router', 'ui.bootstrap', 'restangular', 'ngSanitize', 'ngTouch', 'pascalprecht.translate', 'tmh.dynamicLocale'] ) /** * Configuring modules. */ .config(function($locationProvider, $stateProvider, $httpProvider, Restan...
cwe
CWE-79
Java
void CUtf8Converter::GetUnicodeStringFromUTF8_2bytes( BYTE* pBuffer, LONG lCount, std::wstring& sOutput ) { WCHAR* pUnicodeString = new WCHAR[lCount + 1]; WCHAR* pStart = pUnicodeString; LONG lIndex = 0; while (lIndex < lCount) { BYTE byteMain = pBuffer[lIndex]; ...
cwe
CWE-787
C/C++
flatpak_run_app (FlatpakDecomposed *app_ref, FlatpakDeploy *app_deploy, FlatpakContext *extra_context, const char *custom_runtime, const char *custom_runtime_version, const char *custom_runtime_commit, ...
cwe
CWE-74
Unknown
#include "xmemfile.h" ////////////////////////////////////////////////////////// CxMemFile::CxMemFile(uint8_t* pBuffer, uint32_t size) { m_pBuffer = pBuffer; m_Position = 0; m_Size = m_Edge = size; m_bFreeOnClose = (bool)(pBuffer==0); m_bEOF = false; } ////////////////////////////////////////////////////////// C...
cwe
CWE-787
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++
function I(){var b,c,d,e,f;if(Bc++,b=vc,c=[],d=vc,e=vc,Bc++,f=M(),Bc--,f===X?e=da:(vc=e,e=aa),e!==X?(f=J(),f===X&&(Ib.test(a.charAt(vc))?(f=a.charAt(vc),vc++):(f=X,0===Bc&&g(Jb))),f!==X?(wc=d,e=Fb(f),d=e):(vc=d,d=aa)):(vc=d,d=aa),d!==X)for(;d!==X;)c.push(d),d=vc,e=vc,Bc++,f=M(),Bc--,f===X?e=da:(vc=e,e=aa),e!==X?(f=J(),...
cwe
CWE-1321
JavaScript
from pathlib import Path from vantage6.common.globals import APPNAME # # NODE SETTINGS # DEFAULT_NODE_SYSTEM_FOLDERS = False DEFAULT_NODE_ENVIRONMENT = "application" # # INSTALLATION SETTINGS # PACKAGE_FOLDER = Path(__file__).parent.parent.parent NODE_PROXY_SERVER_HOSTNAME = "proxyserver" DATA_FOLDER = PACKAG...
cwe
CWE-613
Python
DeepTiledInputFile::DeepTiledInputFile (InputPartData* part) : _data (new Data (part->numThreads)) { _data->_deleteStream=false; multiPartInitialize(part); }
cwe
CWE-125
Unknown
/** @module bodymen */ import _ from 'lodash' import Param from 'rich-param' import Schema from './bodymen-schema' export { Param, Schema } export const handlers = { formatters: {}, validators: {} } /** * Get or set a handler. * @memberof bodymen * @param {string} type - Handler type. * @param {string} name ...
cwe
CWE-74
JavaScript
/** * @file tree_schema.c * @author Radek Krejci <rkrejci@cesnet.cz> * @brief Manipulation with libyang schema data structures * * 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 Lic...
cwe
CWE-119
C/C++
struct timespec ns_to_timespec(const s64 nsec) { struct timespec ts; if (!nsec) return (struct timespec) {0, 0}; ts.tv_sec = div_long_long_rem_signed(nsec, NSEC_PER_SEC, &ts.tv_nsec); if (unlikely(nsec < 0)) set_normalized_timespec(&ts, ts.tv_sec, ts.tv_nsec); return ts; }
cwe
CWE-189
C/C++
SetWALFileNameForCleanup(void) { uint32 tli = 1, log = 0, seg = 0; uint32 log_diff = 0, seg_diff = 0; bool cleanup = false; if (restartWALFileName) { /* * Don't do cleanup if the restartWALFileName provided is later than * the xlog file requested. This is an error and we must not remove ...
cwe
CWE-119
Unknown
this.setPersistentToken(JSON.stringify(n),!n.remember));e();return}}catch(v){}f({message:mxResources.get("unknownError")+" (Code: "+c.getStatus()+")"})}),f)};OneDriveClient.prototype.executeRequest=function(e,f,c){var m=mxUtils.bind(this,function(n){var v=!0,d=window.setTimeout(mxUtils.bind(this,function(){v=!1;c({code...
cwe
CWE-20
JavaScript
TfLiteStatus MaxEval(TfLiteContext* context, TfLiteNode* node) { auto* params = reinterpret_cast<TfLitePoolParams*>(node->builtin_data); OpData* data = reinterpret_cast<OpData*>(node->user_data); TfLiteTensor* output = GetOutput(context, node, 0); const TfLiteTensor* input = GetInput(context, node, 0); switc...
cwe
CWE-787
C/C++
function parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){ function fixedFromCharCode(code) { // String.prototype.fromCharCode does not supports // > 2 bytes unicode chars directly if (code > 0xffff) { code -= 0x10000; var surrogate1 = 0xd800 + (code >> 10) , surrogate2 = 0xdc00 + (code...
cwe
CWE-1321
JavaScript