code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
SPL_METHOD(SplObjectStorage, unserialize) { spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(getThis()); char *buf; size_t buf_len; const unsigned char *p, *s; php_unserialize_data_t var_hash; zval entry, inf; zval *pcount, *pmembers; spl_SplObjectStorageElement *element; zend_long count; if (zend_parse_par...
cwe
CWE-119
Unknown
PackLinuxElf64::elf_find_dynamic(unsigned int key) const { Elf64_Dyn const *dynp= dynseg; if (dynp) for (; (unsigned)((char const *)dynp - (char const *)dynseg) < sz_dynseg && Elf64_Dyn::DT_NULL!=dynp->d_tag; ++dynp) if (get_te64(&dynp->d_tag)==key) { upx_uint64_t const t= elf_get_offset...
cwe
CWE-190
C/C++
def misc_file_checks(self): print_header("MISC FILE CHECKS") # # Check for recommended and mandatory files # filenames = ("manifest.json", "LICENSE", "README.md", "scripts/install", "scripts/remove", "scripts/upgrade", ...
cwe
CWE-22
Python
void Compute(OpKernelContext* context) override { const Tensor& splits = context->input(0); const Tensor& values = context->input(1); const Tensor& weights = context->input(2); bool use_weights = weights.NumElements() > 0; bool is_1d = false; const auto splits_values = splits.flat<int64>(); ...
cwe
CWE-122
Unknown
/*! 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 TYPE_DOCS = ['.doc', '.docx', '.rtf', '.xls', '.xlsx',...
cwe
CWE-89
Java
"table": PMA_commonParams.get('table'), "step4": true }, function(data) { $("#mainContent legend").html(data.legendText); $("#mainContent h4").html(data.headText); $("#mainContent p").html(data.subText); $("#mainContent #extra").html(data.extra); ...
cwe
CWE-79
JavaScript
/* * This file is part of Espruino, a JavaScript interpreter for Microcontrollers * * Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk> * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http...
cwe
CWE-476
C/C++
cstrchr(char_u *s, int c) { char_u *p; int cc; if (!rex.reg_ic || (!enc_utf8 && mb_char2len(c) > 1)) return vim_strchr(s, c); // tolower() and toupper() can be slow, comparing twice should be a lot // faster (esp. when using MS Visual C++!). // For UTF-8 need to use folded case. if (enc_...
cwe
CWE-125
C/C++
certificateListValidate( Syntax *syntax, struct berval *in ) { BerElementBuffer berbuf; BerElement *ber = (BerElement *)&berbuf; ber_tag_t tag; ber_len_t len, wrapper_len; char *wrapper_start; int wrapper_ok = 0; ber_int_t version = SLAP_X509_V1; struct berval bvdn, bvtu; ber_init2( ber, in, LBER_USE_DER ); ...
cwe
CWE-617
C/C++
/* ** codegen.c - mruby code generator ** ** See Copyright Notice in mruby.h */ #include <mruby.h> #include <mruby/compile.h> #include <mruby/proc.h> #include <mruby/dump.h> #include <mruby/numeric.h> #include <mruby/string.h> #include <mruby/debug.h> #include <mruby/presym.h> #include "node.h" #include <mruby/opcode....
cwe
CWE-476
C/C++
void OAuth2Filter::finishFlow() { // We have fully completed the entire OAuth flow, whether through Authorization header or from // user redirection to the auth server. if (found_bearer_token_) { if (config_->forwardBearerToken()) { setBearerToken(*request_headers_, access_token_); } config_->s...
cwe
CWE-416
Unknown
on_handler_vanished(GDBusConnection *connection, const gchar *name, gpointer user_data) { struct tcmur_handler *handler = user_data; struct dbus_info *info = handler->opaque; if (info->register_invocation) { char *reason; reason = g_strdup_printf("Cannot find handler bus name: " "org...
cwe
CWE-476
Unknown
static PHP_FUNCTION(xmlwriter_open_uri) { char *valid_file = NULL; xmlwriter_object *intern; xmlTextWriterPtr ptr; char *source; char resolved_path[MAXPATHLEN + 1]; int source_len; #ifdef ZEND_ENGINE_2 zval *this = getThis(); ze_xmlwriter_object *ze_obj = NULL; #endif #ifndef ZEND_ENGINE_2 xmlOutputBufferPtr...
cwe
CWE-20
Unknown
package com.salesmanager.shop.model.catalog.product.attribute; public class ReadableProductOptionValue extends ProductOptionValue { /** * */ private static final long serialVersionUID = 1L; private String price; private String image; private String name; public String getName() { return name; } pu...
cwe
CWE-639
Java
static int get_indirect(struct vhost_virtqueue *vq, struct iovec iov[], unsigned int iov_size, unsigned int *out_num, unsigned int *in_num, struct vhost_log *log, unsigned int *log_num, struct vring_desc *indirect) { struct vring_desc desc; unsigned int i = 0, count, found = 0; u32 len = vhost32_to_cpu(v...
cwe
CWE-120
Unknown
/* 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-190
Python
function(){n=I.name;v="";L()})));k.appendChild(H)})(G[N],N);100==G.length&&(k.appendChild(z),A=function(){k.scrollTop>=k.scrollHeight-k.offsetHeight&&C()},mxEvent.addListener(k,"scroll",A))}}),y)}),M=mxUtils.bind(this,function(u){null==u&&(k.innerHTML="",u=1);var D=new mxXmlRequest(this.baseUrl+"/user/repos?per_page=10...
cwe
CWE-94
JavaScript
function compileBlocks(context) { var out = [], blocks = context.blocks, name; for (name in blocks) { out.push('"' + name + '":' + blocks[name]); } if (out.length) { context.blocks = 'ctx=ctx.shiftBlocks(blocks);'; return 'var blocks={' + out.join(',') + '};'; } el...
cwe
CWE-1321
JavaScript
# coding: utf-8 """ mistune ~~~~~~~ The fastest markdown parser in pure Python with renderer feature. :copyright: (c) 2014 - 2017 by Hsiaoming Yang. """ import re import inspect __version__ = '0.8' __author__ = 'Hsiaoming Yang <me@lepture.com>' __all__ = [ 'BlockGrammar', 'BlockLexer', 'Inli...
cwe
CWE-79
Python
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-120
C/C++
package main //VERSION var VERSION_APPLICATION = "1.4.27" //NAME var NAME_APPLICATION = "homer-app" func getVersion() string { return VERSION_APPLICATION } func getName() string { return NAME_APPLICATION }
cwe
CWE-798
Go
int pdf_load_xrefs(FILE *fp, pdf_t *pdf) { int i, ver, is_linear; long pos, pos_count; char x, *c, buf[256]; c = NULL; /* Count number of xrefs */ pdf->n_xrefs = 0; fseek(fp, 0, SEEK_SET); while (get_next_eof(fp) >= 0) ++pdf->n_xrefs; if (!pdf->n_xrefs) return 0; ...
cwe
CWE-787
Unknown
static void upnp_event_prepare(struct upnp_event_notify * obj) { static const char notifymsg[] = "NOTIFY %s HTTP/1.1\r\n" "Host: %s%s\r\n" #if (UPNP_VERSION_MAJOR == 1) && (UPNP_VERSION_MINOR == 0) "Content-Type: text/xml\r\n" /* UDA v1.0 */ #else "Content-Type: text/xml; charset=\"utf-8\"\r\n" /* UDA v1.1 or ...
cwe
CWE-200
C/C++
/* * Copyright (C) the libgit2 contributors. All rights reserved. * * This file is part of libgit2, distributed under the GNU GPL v2 with * a Linking Exception. For full terms see the included COPYING file. */ #include "index.h" #include <stddef.h> #include "repository.h" #include "tree.h" #include "tree-cache....
cwe
CWE-190
C/C++
var userfieldsTable = $('#userfields-table').DataTable({ 'order': [[1, 'asc']], 'columnDefs': [ { 'orderable': false, 'targets': 0 }, { 'searchable': false, "targets": 0 } ] }); $('#userfields-table tbody').removeClass("d-none"); userfieldsTable.columns.adjust().draw(); $("#search").on("keyup", Delay(function(...
cwe
CWE-79
JavaScript
*/ static void php_wddx_pop_element(void *user_data, const XML_Char *name) { st_entry *ent1, *ent2; wddx_stack *stack = (wddx_stack *)user_data; HashTable *target_hash; zend_class_entry *pce; zval obj; /* OBJECTS_FIXME */ if (stack->top == 0) { return; } if (!strcmp((char *)name, EL_STRING) || ...
cwe
CWE-476
C/C++
bool CBlock::ConnectBlock(CTxDB& txdb, CBlockIndex* pindex) { // Check it again in case a previous version let a bad block in if (!CheckBlock()) return false; // To avoid being on the short end of a block-chain split, // don't do secondary validation of pay-to-script-hash transactions // un...
cwe
CWE-787
Unknown
/* * 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-476
C/C++
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ #include <string.h> #include "lsquic.h" #include "lsquic_int_types.h" #include "lsquic_version.h" #if _MSC_VER #include "vc_compat.h" #endif static const unsigned char version_tags[N_LSQVER][4] = { [LSQVER_043] = { 'Q', '0', '4', '3', }, ...
cwe
CWE-476
C/C++
static int renameUnmapSelectCb(Walker *pWalker, Select *p){ Parse *pParse = pWalker->pParse; int i; if( pParse->nErr ) return WRC_Abort; if( ALWAYS(p->pEList) ){ ExprList *pList = p->pEList; for(i=0; i<pList->nExpr; i++){ if( pList->a[i].zName ){ sqlite3RenameTokenRemap(pParse, 0, (void*)p...
cwe
CWE-674
Unknown
int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args) { size_t retlen; int truncated; _dopr(&buf, NULL, &n, &retlen, &truncated, format, args); if (truncated) /* * In case of truncation, return -1 like traditional snprintf. * (Current drafts for ISO/IEC 989...
cwe
CWE-119
Unknown
void ipc_rcu_getref(void *ptr) { container_of(ptr, struct ipc_rcu_hdr, data)->refcount++; }
cwe
CWE-189
C/C++
auth_spa_server(auth_instance *ablock, uschar *data) { auth_spa_options_block *ob = (auth_spa_options_block *)(ablock->options_block); uint8x lmRespData[24]; uint8x ntRespData[24]; SPAAuthRequest request; SPAAuthChallenge challenge; SPAAuthResponse response; SPAAuthResponse *responseptr = &response; uschar msgbuf[204...
cwe
CWE-125
Unknown
TfLiteStatus CalculateOpData(TfLiteContext* context, TfLiteNode* node) { auto* params = reinterpret_cast<TfLiteDepthToSpaceParams*>(node->builtin_data); TF_LITE_ENSURE_EQ(context, NumInputs(node), 1); TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1); const TfLiteTensor* input; TF_LITE_ENSURE_OK(context...
cwe
CWE-369
Unknown
function updateReqsongs() { $.ajax({ data: { a: "listReqsong", channel: channel }, dataType: "json", url: "/botaction.php", success: function(data) { if (data.status == "success") { var reqsongs = data.reqsongs; ...
cwe
CWE-79
JavaScript
cleanup (struct query *z) { int j = 0, k = 0; dns_transmit_free (&z->dt); for (j = 0; j < QUERY_MAXALIAS; ++j) dns_domain_free (&z->alias[j]); for (j = 0; j < QUERY_MAXLEVEL; ++j) { dns_domain_free (&z->name[j]); for (k = 0; k < QUERY_MAXNS; ++k) dns_domain_free...
cwe
CWE-362
Unknown
DECLAREwriteFunc(writeBufferToContigTiles) { uint32 imagew = TIFFScanlineSize(out); uint32 tilew = TIFFTileRowSize(out); int iskew = imagew - tilew; tsize_t tilesize = TIFFTileSize(out); tdata_t obuf; uint8* bufp = (uint8*) buf; uint32 tl, tw; uint32 row; (void) spp; obuf = _TIFFmalloc(TIFFTileSize(out)); ...
cwe
CWE-119
C/C++
static int init_sig_algs(SSL *s, unsigned int context) { /* Clear any signature algorithms extension received */ OPENSSL_free(s->s3->tmp.peer_sigalgs); s->s3->tmp.peer_sigalgs = NULL; return 1; }
cwe
CWE-476
Unknown
pcsc_vendor_specific_init (int slot) { unsigned char buf[256]; pcsc_dword_t len; int sw; int vendor = 0; int product = 0; pcsc_dword_t get_tlv_ioctl = (pcsc_dword_t)-1; unsigned char *p; len = sizeof (buf); sw = control_pcsc (slot, CM_IOCTL_GET_FEATURE_REQUEST, NULL, 0, buf, &len); if (sw) { ...
cwe
CWE-20
Unknown
def send_cluster_request_with_token(session, cluster_name, request, post=false, data={}, remote=true, raw_data=nil) $logger.info("SCRWT: " + request) nodes = get_cluster_nodes(cluster_name) return send_nodes_request_with_token( session, nodes, request, post, data, remote, raw_data ) end
cwe
CWE-384
Ruby
static byte parseHexByte(const char * &str) { byte b = parseHexChar(str[0]); if (str[1] == ':' || str[1] == '\0') { str += 2; return b; } else { b = b << 4 | parseHexChar(str[1]); str += 3; return b; } }
cwe
CWE-200
Unknown
static inline void ext4_truncate_failed_write(struct inode *inode) { truncate_inode_pages(inode->i_mapping, inode->i_size); ext4_truncate(inode); }
cwe
CWE-362
Unknown
function escapeArgPowerShell(arg, interpolation, quoted) { let result = arg .replace(/\u0000/g, "") .replace(/`/g, "``") .replace(/\$/g, "`$"); if (interpolation) { result = result .replace(/\n|\r/g, " ") .replace(/(^|\s|\u0085)((?:\*|[1-6])?)(>)/g, "$1$2`$3") .replace(/(^|\s|\u00...
cwe
CWE-1333
JavaScript
int user_update(struct key *key, const void *data, size_t datalen) { struct user_key_payload *upayload, *zap; int ret; ret = -EINVAL; if (datalen <= 0 || datalen > 32767 || !data) goto error; /* construct a replacement payload */ ret = -ENOMEM; upayload = kmalloc(sizeof(*upayload) + datalen, GFP_KERNEL); if...
cwe
CWE-264
Unknown
// +build pam // Copyright 2014 The Gogs Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. package pam import ( "errors" "github.com/msteinert/pam" ) func PAMAuth(serviceName, userName, passwd string) error { t, err := pam.Start...
cwe
CWE-863
Go
/* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License (the "License"). * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolar...
cwe
CWE-476
C/C++
public static Descriptor find(String className) { return find(Jenkins.getInstance().getExtensionList(Descriptor.class),className); }
cwe
CWE-264
Java
is_link_trusted (NautilusFile *file, gboolean is_launcher) { GFile *location; gboolean res; if (!is_launcher) { return TRUE; } if (nautilus_file_can_execute (file)) { return TRUE; } res = FALSE; if (nautilus_file_is_local (file)) { ...
cwe
CWE-20
C/C++
public function chapterToContainedHtml(Chapter $chapter) { $pages = $chapter->getVisiblePages(); $pages->each(function ($page) { $page->html = (new PageContent($page))->render(); }); $html = view('chapters.export', [ 'chapter' => $chapter, 'pages' ...
cwe
CWE-79
PHP
USHORT CNB::QueryL4HeaderOffset(PVOID PacketData, ULONG IpHeaderOffset) const { USHORT Res; auto ppr = ParaNdis_ReviewIPPacket(RtlOffsetToPointer(PacketData, IpHeaderOffset), GetDataLength(), __FUNCTION__); if (ppr.ipStatus != ppresNotIP) { Res = static_cas...
cwe
CWE-20
C/C++
gss_wrap_iov (minor_status, context_handle, conf_req_flag, qop_req, conf_state, iov, iov_count) OM_uint32 * minor_status; gss_ctx_id_t context_handle; int conf_req_flag; gss_qop_t qop_req; int * conf_state; gss_iov_buffer_desc *...
cwe
CWE-415
C/C++
#ifndef JSI_LITE_ONLY #ifndef JSI_AMALGAMATION #include "jsiInt.h" #endif /******************* TREE ACCESS **********************/ Jsi_Value *Jsi_TreeObjGetValue(Jsi_Obj* obj, const char *key, int isstrkey) { Jsi_Tree *treePtr = obj->tree; if (!isstrkey) { Jsi_MapEntry *hPtr = Jsi_MapEntryFind(tr...
cwe
CWE-190
C/C++
cJSON *cJSON_CreateString( const char *string ) { cJSON *item = cJSON_New_Item(); if ( item ) { item->type = cJSON_String; item->valuestring = cJSON_strdup( string ); } return item; }
cwe
CWE-120
C/C++
buflist_match( regmatch_T *rmp, buf_T *buf, int ignore_case) // when TRUE ignore case, when FALSE use 'fic' { char_u *match; // First try the short file name, then the long file name. match = fname_match(rmp, buf->b_sfname, ignore_case); if (match == NULL) match = fname_match(rmp, buf->b...
cwe
CWE-476
C/C++
static void Launch(OpKernelContext* context, const Tensor& in_x, const Tensor& in_y, bool adjoint, bool lower, const MatMulBCast& bcast, Tensor* out) { // Number of banded matrix triangular solves i.e. size of the batch. const int64 batch_size = bcast.output_batch_size(...
cwe
CWE-197
C/C++
lambda_function_body( char_u **arg, typval_T *rettv, evalarg_T *evalarg, garray_T *newargs, garray_T *argtypes, int varargs, garray_T *default_args, char_u *ret_type) { int evaluate = (evalarg->eval_flags & EVAL_EVALUATE); garray_T *gap = &evalarg->eval_ga; garray_T *freeg...
cwe
CWE-416
C/C++
QPDFObjectHandle::parseInternal(PointerHolder<InputSource> input, std::string const& object_description, QPDFTokenizer& tokenizer, bool& empty, StringDecrypter* decrypter, QPDF* context, bool ...
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
this.user&&this.updateUser(this.emptyFn,this.emptyFn,!0),f(g)):n||401!==g.getStatus()&&400!==g.getStatus()?c(this.parseRequestText(g)):this.authenticate(function(){m(!0)},c,n))}),mxUtils.bind(this,function(g){window.clearTimeout(d);v&&c(g)}))});null==b||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(function(){m(...
cwe
CWE-20
JavaScript
OMX_ERRORTYPE omx_vdec::component_deinit(OMX_IN OMX_HANDLETYPE hComp) { (void) hComp; #ifdef _ANDROID_ if (iDivXDrmDecrypt) { delete iDivXDrmDecrypt; iDivXDrmDecrypt=NULL; } #endif //_ANDROID_ unsigned i = 0; if (OMX_StateLoaded != m_state) { DEBUG_PRINT_ERROR("WARNING:Rxd DeInit,OMX not in LOAD...
cwe
CWE-119
C/C++
(H.geometry.height-V[1].geometry.height)/2:(P.y+P.height)/R-O.y+-I.y+10);return x.addCells(V,U)}finally{x.model.endUpdate()}}function m(H,S,U){H=x.getOutgoingTreeEdges(H);U=x.view.getState(U);var Q=[];if(null!=U&&null!=H){for(var W=0;W<H.length;W++){var V=x.view.getState(x.model.getTerminal(H[W],!1));null!=V&&(!S&&Math...
cwe
CWE-20
JavaScript
bool define_fastly_sys(JSContext *cx, HandleObject global) { // Allocating the reusable hostcall buffer here means it's baked into the // snapshot, and since it's all zeros, it won't increase the size of the // snapshot. if (!OwnedHostCallBuffer::initialize(cx)) return false; if (!GlobalProperties::init(...
cwe
CWE-94
Unknown
this.user&&this.updateUser(this.emptyFn,this.emptyFn,!0),f(g)):n||401!==g.getStatus()&&400!==g.getStatus()?c(this.parseRequestText(g)):this.authenticate(function(){m(!0)},c,n))}),mxUtils.bind(this,function(g){window.clearTimeout(d);v&&c(g)}))});null==b||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(function(){m(...
cwe
CWE-20
JavaScript
/* Apache 2.0 - Copyright 2007-2018 - pancake and dso class.c rewrite: Adam Pridgen <dso@rice.edu || adam.pridgen@thecoverofnight.com> */ #include <stdio.h> #include <string.h> #include <stdlib.h> #include <stdarg.h> #include <r_types.h> #include <r_util.h> #include <r_bin.h> #include <math.h> #include <sdb.h> #inc...
cwe
CWE-787
C/C++
static int rndis_set_response(struct rndis_params *params, rndis_set_msg_type *buf) { u32 BufLength, BufOffset; rndis_set_cmplt_type *resp; rndis_resp_t *r; r = rndis_add_response(params, sizeof(rndis_set_cmplt_type)); if (!r) return -ENOMEM; resp = (rndis_set_cmplt_type *)r->buf; BufLength = le32_t...
cwe
CWE-200
C/C++
bool NormalPageArena::shrinkObject(HeapObjectHeader* header, size_t newSize) { ASSERT(header->checkHeader()); ASSERT(header->payloadSize() > newSize); size_t allocationSize = ThreadHeap::allocationSizeFromSize(newSize); ASSERT(header->size() > allocationSize); size_t shrinkSize = header->size() - allocatio...
cwe
CWE-787
C/C++
validate_group(struct perf_event *event) { struct perf_event *sibling, *leader = event->group_leader; struct pmu_hw_events fake_pmu; DECLARE_BITMAP(fake_used_mask, ARMPMU_MAX_HWEVENTS); /* * Initialise the fake PMU. We only need to populate the * used_mask for the purposes of validation. */ memset(fake_used...
cwe
CWE-264
C/C++
def login(): form = forms.UserForm() if form.validate_on_submit(): db = get_db() user = db.search( (Query().username == form.username.data) & (Query().type == "user") ) if user and check_password_hash(user[0]["hashed_password"], form.password.data): user ...
cwe
CWE-601
Python
exif_entry_get_value (ExifEntry *e, char *val, unsigned int maxlen) { unsigned int i, j, k; ExifShort v_short, v_short2, v_short3, v_short4; ExifByte v_byte; ExifRational v_rat; ExifSRational v_srat; char b[64]; const char *c; ExifByteOrder o; double d; ExifEntry *entry; static const struct { char label[5]...
cwe
CWE-125
C/C++
process_tgs_req(struct server_handle *handle, krb5_data *pkt, const krb5_fulladdr *from, krb5_data **response) { krb5_keyblock * subkey = 0; krb5_keyblock *header_key = NULL; krb5_kdc_req *request = 0; krb5_db_entry *server = NULL; krb5_db_entry *stkt_server = NULL; krb5_kdc_rep ...
cwe
CWE-617
Unknown
/* * Copyright (c) 2000 William C. Fenner. * All rights reserved. * * Kevin Steves <ks@hp.se> July 2000 * Modified to: * - print version, type string and packet length * - print IP address count if > 1 (-v) * - verify checksum (-v) * - print authentication string (-v) * * Redistribution and us...
cwe
CWE-125
C/C++
long Cluster::CreateBlockGroup(long long start_offset, long long size, long long discard_padding) { assert(m_entries); assert(m_entries_size > 0); assert(m_entries_count >= 0); assert(m_entries_count < m_entries_size); IMkvReader* const pReader = m_pSegment->m_pReader; long long pos = start_offset; const ...
cwe
CWE-20
C/C++
package docker import ( "context" "fmt" "io" "io/ioutil" "mime" "net/http" "net/url" "os" "strconv" "strings" "github.com/containers/image/v5/docker/reference" "github.com/containers/image/v5/manifest" "github.com/containers/image/v5/pkg/sysregistriesv2" "github.com/containers/image/v5/types" "github.c...
cwe
CWE-400
Go
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { auto* params = reinterpret_cast<TfLiteFullyConnectedParams*>(node->builtin_data); OpData* data = reinterpret_cast<OpData*>(node->user_data); const TfLiteTensor* input = GetInput(context, node, kInputTensor); const TfLiteTensor* filter = GetInp...
cwe
CWE-125
C/C++
def get_group_users Log.add_info(request, params.inspect) begin @folder = Folder.find(params[:id]) rescue => evar Log.add_error(request, evar) end @group_id = nil if !params[:thetisBoxSelKeeper].nil? @group_id = params[:thetisBoxSelKeeper].split(':').last elsif !params[:g...
cwe
CWE-89
Ruby
PHP_METHOD(Phar, offsetSet) { char *fname, *cont_str = NULL; size_t fname_len, cont_len; zval *zresource; PHAR_ARCHIVE_OBJECT(); if (PHAR_G(readonly) && !phar_obj->archive->is_data) { zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Write operations disabled by the php.ini setting phar.readonly"); r...
cwe
CWE-20
Unknown
async function getLatestTag(name) { try { const { stdout } = await execAsync(`npm view ${name} dist-tags --json`); const { latest } = JSON.parse(stdout); return latest; } catch (err) { throw new Error(`Failed to parse output from NPM view - ${err.toString()}`); } }
cwe
CWE-78
JavaScript
/* * Copyright 2020 ThoughtWorks, 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 * * Unless required by applicable law or agr...
cwe
CWE-668
Java
import asyncio import enum import inspect import json from typing import ( Any, Callable, Coroutine, Dict, List, Optional, Sequence, Set, Type, Union, ) from fastapi import params from fastapi.datastructures import Default, DefaultPlaceholder from fastapi.dependencies.models imp...
cwe
CWE-352
Python
/* * 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-285
Java
'use strict'; var required = require('requires-port') , qs = require('querystringify') , CRHTLF = /[\n\r\t]/g , slashes = /^[A-Za-z][A-Za-z0-9+-.]*:\/\// , protocolre = /^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i , windowsDriveLetter = /^[a-zA-Z]:/ , whitespace = /^[ \f\n\r\t\v\u00a0\u1680\u2000-\u2...
cwe
CWE-639
JavaScript
static ssize_t write_mem(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { phys_addr_t p = *ppos; ssize_t written, sz; unsigned long copied; void *ptr; if (p != *ppos) return -EFBIG; if (!valid_phys_addr_range(p, count)) return -EFAULT; written = 0; #ifdef __ARCH_HAS_NO_PAGE_ZE...
cwe
CWE-732
Unknown
@Override protected void configure(HttpSecurity http) throws Exception { http.authorizeRequests().anyRequest().authenticated() .and() .formLogin() .and() .httpBasic() .and() .csrf().disable(); //.csrf().csrfTokenRepository(Cooki...
cwe
CWE-352
Java
var ColorDialog = function(editorUi, color, apply, cancelFn) { this.editorUi = editorUi; var input = document.createElement('input'); input.style.marginBottom = '10px'; input.style.width = '216px'; // Required for picker to render in IE if (mxClient.IS_IE) { input.style.marginTop = '10px'; document.body....
cwe
CWE-20
JavaScript
# -*- 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
/* Copyright 2019 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-674
C/C++
static int __driver_rfc4106_decrypt(struct aead_request *req) { u8 one_entry_in_sg = 0; u8 *src, *dst, *assoc; unsigned long tempCipherLen = 0; __be32 counter = cpu_to_be32(1); int retval = 0; struct crypto_aead *tfm = crypto_aead_reqtfm(req); struct aesni_rfc4106_gcm_ctx *ctx = aesni_rfc4106_gcm_ctx_get(tfm); ...
cwe
CWE-119
C/C++
c => { // eslint-disable-next-line const r = (Math.random() * 16) | 0; // eslint-disable-next-line const v = c == "x" ? r : (r & 0x3) | 0x8; return v.toString(16); }
cwe
CWE-338
JavaScript
sig_handler handle_sigint(int sig) { char kill_buffer[40]; MYSQL *kill_mysql= NULL; /* terminate if no query being executed, or we already tried interrupting */ /* terminate if no query being executed, or we already tried interrupting */ if (!executing_query || (interrupted_query == 2)) { tee_fprintf(s...
cwe
CWE-319
Unknown
ciphertext_to_compressed (gnutls_session_t session, gnutls_datum_t *ciphertext, uint8_t * compress_data, int compress_size, uint8_t type, record_parameters_st * params, uint64* sequence) {...
cwe
CWE-310
C/C++
njs_object_iterate_reverse(njs_vm_t *vm, njs_iterator_args_t *args, njs_iterator_handler_t handler) { double idx; int64_t i, from, to, length; njs_int_t ret; njs_array_t *array, *keys; njs_value_t *entry, *value, prop, character, string_obj; ...
cwe
CWE-703
C/C++
static Image *ReadXPMImage(const ImageInfo *image_info,ExceptionInfo *exception) { char *grey, key[MagickPathExtent], target[MagickPathExtent], *xpm_buffer; Image *image; MagickBooleanType active, status; register char *next, *p, *q; register ssize_t x; regis...
cwe
CWE-772
C/C++
_XimOpen( Xim im) { CARD32 buf32[BUFSIZE/4]; CARD8 *buf = (CARD8 *)buf32; CARD8 *buf_b = &buf[XIM_HEADER_SIZE]; CARD16 *buf_s; INT16 len; CARD32 reply32[BUFSIZE/4]; char *reply = (char *)reply32; XPointer preply; int buf_size; int ret_code; char *loc...
cwe
CWE-190
Unknown
read_yin_leaflist(struct lys_module *module, struct lys_node *parent, struct lyxml_elem *yin, int options, struct unres_schema *unres) { struct ly_ctx *ctx = module->ctx; struct lys_node *retval; struct lys_node_leaflist *llist; struct lyxml_elem *sub, *next; const char *value; ...
cwe
CWE-252
Unknown
/* Copyright 2022 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
cwe
CWE-476
Python
void PrintMsg_Print_Params::Reset() { page_size = gfx::Size(); content_size = gfx::Size(); printable_area = gfx::Rect(); margin_top = 0; margin_left = 0; dpi = 0; min_shrink = 0; max_shrink = 0; desired_dpi = 0; document_cookie = 0; selection_only = false; supports_alpha_blend = false; prev...
cwe
CWE-200
C/C++
function finishView (view) { // todo list const lis = view.find('li.raw').removeClass('raw').sortByDepth().toArray() for (let li of lis) { let html = $(li).clone()[0].innerHTML const p = $(li).children('p') if (p.length === 1) { html = p.html() li = p[0] } html = replaceExtraTags(...
cwe
CWE-79
JavaScript
/* * Driver for Cadence QSPI Controller * * Copyright Altera Corporation (C) 2012-2014. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation. ...
cwe
CWE-119
C/C++
TPMI_ALG_KDF_Unmarshal(TPMI_ALG_KDF *target, BYTE **buffer, INT32 *size, BOOL allowNull) { TPM_RC rc = TPM_RC_SUCCESS; if (rc == TPM_RC_SUCCESS) { rc = TPM_ALG_ID_Unmarshal(target, buffer, size); } if (rc == TPM_RC_SUCCESS) { switch (*target) { #if ALG_MGF1 case TPM_ALG_MGF1: #endif #if ALG_KDF1...
cwe
CWE-787
Unknown
xmlParsePEReference(xmlParserCtxtPtr ctxt) { const xmlChar *name; xmlEntityPtr entity = NULL; xmlParserInputPtr input; if (RAW != '%') return; NEXT; name = xmlParseName(ctxt); if (name == NULL) { xmlFatalErrMsg(ctxt, XML_ERR_PEREF_NO_NAME, "PEReference: no name\n"); return; } ...
cwe
CWE-835
C/C++