code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
$('#frm_endpoint').on('submit', (e) => { e.preventDefault(); const server_url = $server_url.val().trim().toLowerCase(); const app_id = $app_id.val().trim(); if (server_url) localStorage.setItem('config.server_url', server_url); if (app_id && !isNaN(app_id)...
cwe
CWE-79
JavaScript
v8::Local<v8::Value> V8Debugger::collectionEntries(v8::Local<v8::Context> context, v8::Local<v8::Object> object) { if (!enabled()) { NOTREACHED(); return v8::Undefined(m_isolate); } v8::Local<v8::Value> argv[] = { object }; v8::Local<v8::Value> entriesValue = callDebuggerMethod("getCo...
cwe
CWE-79
C/C++
libxlLoggerFree(libxlLogger *logger) { xentoollog_logger *xtl_logger = (xentoollog_logger*)logger; if (logger->defaultLogFile) VIR_FORCE_FCLOSE(logger->defaultLogFile); g_clear_pointer(&logger->files, g_hash_table_unref); xtl_logger_destroy(xtl_logger); }
cwe
CWE-703
Unknown
BGD_DECLARE(void) gdImageGifCtx(gdImagePtr im, gdIOCtxPtr out) { gdImagePtr pim = 0, tim = im; int interlace, BitsPerPixel; interlace = im->interlace; if(im->trueColor) { /* Expensive, but the only way that produces an acceptable result: mix down to a palette based temporary image. */ pim = gdImageCreatePa...
cwe
CWE-415
Unknown
void CNB::SetupLSO(virtio_net_hdr_basic *VirtioHeader, PVOID IpHeader, ULONG EthPayloadLength) const { PopulateIPLength(reinterpret_cast<IPv4Header*>(IpHeader), static_cast<USHORT>(EthPayloadLength)); tTcpIpPacketParsingResult packetReview; packetReview = ParaNdis_CheckSumVerifyFlat(reinterpret_cast<IPv4He...
cwe
CWE-20
Unknown
MYSQL *mysql_connect_ssl_check(MYSQL *mysql_arg, const char *host, const char *user, const char *passwd, const char *db, uint port, const char *unix_socket, ulong client_flag, my_bool ssl_required...
cwe
CWE-319
Unknown
static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception) { char format; double quantum_scale; Image *image; MagickBooleanType status; QuantumAny max_value; QuantumInfo *quantum_info; QuantumType quantum_type; size_t depth, extent, pa...
cwe
CWE-190
C/C++
if(!self.define){const e=e=>{"require"!==e&&(e+=".js");let i=Promise.resolve();return r[e]||(i=new Promise((async i=>{if("document"in self){const r=document.createElement("script");r.src=e,document.head.appendChild(r),r.onload=i}else importScripts(e),i()}))),i.then((()=>{if(!r[e])throw new Error(`Module ${e} didn’t reg...
cwe
CWE-79
JavaScript
static int translate_compat_table(struct net *net, struct xt_table_info **pinfo, void **pentry0, const struct compat_arpt_replace *compatr) { unsigned int i, j; struct xt_table_info *newinfo, *info; void *pos, *entry0, *entry1; struct compat_arpt_entry *iter0; struct arpt_replace repl; unsigned ...
cwe
CWE-787
Unknown
bool CSSStyleSheet::CanAccessRules() const { if (enable_rule_access_for_inspector_) return true; if (is_inline_stylesheet_) return true; KURL base_url = contents_->BaseURL(); if (base_url.IsEmpty()) return true; Document* document = OwnerDocument(); if (!document) return true; if (doc...
cwe
CWE-200
C/C++
public function isAllowedFilename($filename){ $allow_array = array( '.jpg','.jpeg','.png','.bmp','.gif','.ico','.webp', '.mp3','.wav','.m4a','.ogg','.webma','.mp4','.flv', '.mov','.webmv','.flac','.mkv', '.zip','.tar','.gz','.tgz','.ipa','.apk','.rar','.iso','.bz2','.epub', '.pdf','.ofd','.swf','.epub'...
cwe
CWE-79
PHP
evbuffer_chain_new(size_t size) { struct evbuffer_chain *chain; size_t to_alloc; size += EVBUFFER_CHAIN_SIZE; /* get the next largest memory that can hold the buffer */ to_alloc = MIN_BUFFER_SIZE; while (to_alloc < size) to_alloc <<= 1; /* we get everything in one chunk */ if ((chain = mm_malloc(to_alloc))...
cwe
CWE-189
Unknown
package install import ( "fmt" "net/url" "strings" "github.com/answerdev/answer/internal/base/reason" "github.com/answerdev/answer/internal/base/validator" "github.com/answerdev/answer/pkg/checker" "github.com/segmentfault/pacman/errors" "xorm.io/xorm/schemas" ) // CheckConfigFileResp check config file if ex...
cwe
CWE-79
Go
pidfile_write(const char *pid_file, int pid) { FILE *pidfile = NULL; int pidfd = creat(pid_file, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); if (pidfd != -1) pidfile = fdopen(pidfd, "w"); if (!pidfile) { log_message(LOG_INFO, "pidfile_write : Cannot open %s pidfile", pid_file); return 0; } fprintf(pidf...
cwe
CWE-59
C/C++
internals.batch = function (batchRequest, resultsData, pos, parts, callback) { var path = ''; var error = null; for (var i = 0, il = parts.length; i < il; ++i) { path += '/'; if (parts[i].type === 'ref') { var ref = resultsData.resultsMap[parts[i].index]; if (ref)...
cwe
CWE-94
JavaScript
Status ModularFrameDecoder::DecodeGroup(const Rect& rect, BitReader* reader, int minShift, int maxShift, const ModularStreamId& stream, bool zerofill, PassesDec...
cwe
CWE-787
Unknown
bool Item_field::fix_fields(THD *thd, Item **reference) { DBUG_ASSERT(fixed == 0); Field *from_field= (Field *)not_found_field; bool outer_fixed= false; SELECT_LEX *select= thd->lex->current_select; if (select && select->in_tvc) { my_error(ER_FIELD_REFERENCE_IN_TVC, MYF(0), full_name()); return(1);...
cwe
CWE-416
Unknown
/* * 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. * * RAW - implementation of IP "raw" sockets. * * Authors: Ross Biro * Fred N. van Kempen, <waltje@uWalt.NL.Mu...
cwe
CWE-362
C/C++
uppdateCard(id, asked, answered) { this.get( `SELECT * FROM flashcards WHERE id="${id}"`, (err, card) => { if (!card || !card.id) throw 'could not update the card'; this.run(`REPLACE INTO flashcards VALUES(${card.id}, ${card.user}, "${card.text}", "${card....
cwe
CWE-89
JavaScript
int ParseDsdiffHeaderConfig (FILE *infile, char *infilename, char *fourcc, WavpackContext *wpc, WavpackConfig *config) { int64_t infilesize, total_samples; DFFFileHeader dff_file_header; DFFChunkHeader dff_chunk_header; uint32_t bcount; infilesize = DoGetFileSize (infile); memcpy (&dff_file_hea...
cwe
CWE-125
C/C++
char* parseKey( char* ptr, FileNode& map_node, FileNode& value_placeholder ) { char c; char *endptr = ptr - 1, *saveptr; if( *ptr == '-' ) CV_PARSE_ERROR_CPP( "Key may not start with \'-\'" ); do c = *++endptr; while( cv_isprint(c) && c != ':' ); if( c ...
cwe
CWE-476
Unknown
/* * Copyright (c) 1994-2008 Carnegie Mellon University. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice,...
cwe
CWE-20
C/C++
check_entry_size_and_hooks(struct ipt_entry *e, struct xt_table_info *newinfo, const unsigned char *base, const unsigned char *limit, const unsigned int *hook_entries, const unsigned int *underflows, unsigned int valid_hooks) { unsigned int h; int err; if ((unsigned long)e % __al...
cwe
CWE-119
C/C++
EAS_BOOL WT_CheckSampleEnd (S_WT_VOICE *pWTVoice, S_WT_INT_FRAME *pWTIntFrame, EAS_BOOL update) { EAS_U32 endPhaseAccum; EAS_U32 endPhaseFrac; EAS_I32 numSamples; EAS_BOOL done = EAS_FALSE; /* check to see if we hit the end of the waveform this time */ /*lint -e{703} use shift for performance */ ...
cwe
CWE-119
C/C++
static netdev_tx_t veth_xmit(struct sk_buff *skb, struct net_device *dev) { struct net_device *rcv = NULL; struct veth_priv *priv, *rcv_priv; struct veth_net_stats *stats, *rcv_stats; int length; priv = netdev_priv(dev); rcv = priv->peer; rcv_priv = netdev_priv(rcv); stats = this_cpu_ptr(priv->stats); rcv_st...
cwe
CWE-399
C/C++
merged_2v_upsample(j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, JDIMENSION in_row_groups_avail, JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail) /* 2:1 vertical sampling case: may need a spare row. */ { m...
cwe
CWE-476
Unknown
private void doRequest(String method, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { int serviceId = 0; String proxyPath = ""; String queryString = ""; try { if (request.getQueryString() != null) { queryString = "?" + reque...
cwe
CWE-918
JavaScript
struct clock_source *dce80_clock_source_create( struct dc_context *ctx, struct dc_bios *bios, enum clock_source_id id, const struct dce110_clk_src_regs *regs, bool dp_clk_src) { struct dce110_clk_src *clk_src = kzalloc(sizeof(struct dce110_clk_src), GFP_KERNEL); if (!clk_src) return NULL; if (dce110_clk_s...
cwe
CWE-401
Unknown
static int cms_RecipientInfo_ktri_decrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri) { CMS_KeyTransRecipientInfo *ktri = ri->d.ktri; EVP_PKEY *pkey = ktri->pkey; unsigned char *ek = NULL; size_t eklen; int ret = 0; CMS_EncryptedContentInfo *ec; ec ...
cwe
CWE-327
Unknown
/******************************************************************************* * This file is part of OpenNMS(R). * * Copyright (C) 2009-2014 The OpenNMS Group, Inc. * OpenNMS(R) is Copyright (C) 1999-2014 The OpenNMS Group, Inc. * * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. * * OpenNMS(...
cwe
CWE-79
Java
def read_checksums gem Gem.load_yaml @checksums = gem.seek 'checksums.yaml.gz' do |entry| Zlib::GzipReader.wrap entry do |gz_io| YAML.load gz_io.read end end end
cwe
CWE-502
Ruby
# -*- coding: utf-8 -*- from pyshop.models import DBSession, ReleaseFile def get_release_file(root, request): session = DBSession() f = ReleaseFile.by_id(session, int(request.matchdict['file_id'])) rv = {'id': f.id, 'url': f.url, 'filename': f.filename, } f.downloads += ...
cwe
CWE-20
Python
require ('hazardous') // makes this module work when it's unpacked from the app.asar package when the app is packed with electron-build // it overloads path.join to change asar.app to asar.app.unpacked const path = require('path') const { exec, execSync } = require('child_process') const JSON5 = require('json5') // T...
cwe
CWE-77
JavaScript
/******************************************************************************* * This file is part of OpenNMS(R). * * Copyright (C) 2009-2014 The OpenNMS Group, Inc. * OpenNMS(R) is Copyright (C) 1999-2014 The OpenNMS Group, Inc. * * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. * * OpenNMS(...
cwe
CWE-79
Java
void __init(RBuffer *buf, r_bin_ne_obj_t *bin) { bin->header_offset = r_buf_read_le16_at (buf, 0x3c); bin->ne_header = R_NEW0 (NE_image_header); if (!bin->ne_header) { return; } bin->buf = buf; r_buf_read_at (buf, bin->header_offset, (ut8 *)bin->ne_header, sizeof (NE_image_header)); bin->alignment = 1 << bin->...
cwe
CWE-129
Unknown
static void perf_event_interrupt(struct pt_regs *regs) { int i; struct cpu_hw_events *cpuhw = &__get_cpu_var(cpu_hw_events); struct perf_event *event; unsigned long val; int found = 0; int nmi; if (cpuhw->n_limited) freeze_limited_counters(cpuhw, mfspr(SPRN_PMC5), mfspr(SPRN_PMC6)); perf_read_regs(regs...
cwe
CWE-189
C/C++
/** * @file * This file is NOT compiled and is run directly by Node.js. Make sure you are not using JavaScript features that * does not exist in Node.js runtime. */ /* eslint-disable no-console */ const morgan = require('morgan'); const express = require('express'); const env = require('./env'); const { applyMiddle...
cwe
CWE-918
JavaScript
package com.salesmanager.core.model.catalog.product.availability; import java.util.Date; import java.util.HashSet; import java.util.Set; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Embedded; import javax.persistence.Entity; import javax.persistence.FetchType; import...
cwe
CWE-639
Java
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
cwe
CWE-190
C/C++
/* * rfbserver.c - deal with server-side of the RFB protocol. */ /* * Copyright (C) 2011-2012 D. R. Commander * Copyright (C) 2005 Rohit Kumar, Johannes E. Schindelin * Copyright (C) 2002 RealVNC Ltd. * OSXvnc Copyright (C) 2001 Dan McGuirk <mcguirk@incompleteness.net>. * Original Xvnc code Copyright (C) 1...
cwe
CWE-476
C/C++
cache_fill_missing(struct module_env* env, uint16_t qclass, struct regional* region, struct delegpt* dp) { struct delegpt_ns* ns; struct msgreply_entry* neg; struct ub_packed_rrset_key* akey; time_t now = *env->now; for(ns = dp->nslist; ns; ns = ns->next) { akey = rrset_cache_lookup(env->rrset_cache, ns->name,...
cwe
CWE-400
Unknown
struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev, const struct pci_device_id *ent, const struct iwl_cfg_trans_params *cfg_trans) { struct iwl_trans_pcie *trans_pcie; struct iwl_trans *trans; int ret, addr_size; ret = pcim_enable_device(pdev); if (ret) return ERR_PTR(ret); if (cf...
cwe
CWE-476
C/C++
static function activate($uid, $karmalevel = 'pear.dev') { require_once 'Damblan/Karma.php'; global $dbh, $auth_user; $karma = new Damblan_Karma($dbh); $user = user::info($uid, null, 0); if (!isset($user['registered'])) { return false; } @$arr =...
cwe
CWE-640
PHP
// SPDX-License-Identifier: GPL-2.0 #include <linux/kernel.h> #include <linux/errno.h> #include <linux/file.h> #include <linux/slab.h> #include <linux/nospec.h> #include <linux/io_uring.h> #include <uapi/linux/io_uring.h> #include "io_uring.h" #include "rsrc.h" #include "filetable.h" #include "msg_ring.h" struct io_...
cwe
CWE-416
C/C++
bool Monitor::ms_verify_authorizer(Connection *con, int peer_type, int protocol, bufferlist& authorizer_data, bufferlist& authorizer_reply, bool& isvalid, CryptoKey& session_key) { dout(10) << "ms_verify_authorizer " << con->get_peer_addr() << " " << ceph_entity_type_name(peer_type) << " ...
cwe
CWE-284
Unknown
import json from flask import Response def http_error(status_code, title, detail=''): ''' Wrapper for error responce acoording with RFC 7807 (https://tools.ietf.org/html/rfc7807) :param status_code: int - http status code for response :param title: str :param detail: str :return...
cwe
CWE-22
Python
gre_print_0(netdissect_options *ndo, const u_char *bp, u_int length) { u_int len = length; uint16_t flags, prot; /* 16 bits ND_TCHECKed in gre_print() */ flags = EXTRACT_16BITS(bp); if (ndo->ndo_vflag) ND_PRINT((ndo, ", Flags [%s]", bittok2str(gre_flag_values,"none",flags)));...
cwe
CWE-125
C/C++
void Compute(OpKernelContext* c) override { core::RefCountPtr<Var> v; OP_REQUIRES_OK(c, LookupResource(c, HandleFromInput(c, 0), &v)); OP_REQUIRES_OK(c, EnsureSparseVariableAccess<Device, T>(c, v.get())); // NOTE: We hold the lock for the whole gather operation instead // of increasing the reference...
cwe
CWE-369
Unknown
def parse_jwt_token(request: func.HttpRequest) -> Result[UserInfo]: """Obtains the Access Token from the Authorization Header""" token_str = get_auth_token(request) if token_str is None: return Error( code=ErrorCode.INVALID_REQUEST, errors=["unable to find authorization token...
cwe
CWE-285
Python
/* $OpenBSD: x509_verify.c,v 1.60 2022/08/05 14:46:52 beck Exp $ */ /* * Copyright (c) 2020-2021 Bob Beck <beck@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission noti...
cwe
CWE-295
C/C++
/* * GPAC - Multimedia Framework C SDK * * Authors: Jean Le Feuvre * Copyright (c) Telecom ParisTech 2000-2012 * 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 under the terms of the GNU Lesser Gene...
cwe
CWE-476
C/C++
int parse_sequence_header(davs2_mgr_t *mgr, davs2_seq_t *seq, davs2_bs_t *bs) { static const float FRAME_RATE[8] = { 24000.0f / 1001.0f, 24.0f, 25.0f, 30000.0f / 1001.0f, 30.0f, 50.0f, 60000.0f / 1001.0f, 60.0f }; rps_t *p_rps = NULL; int i, j; int num_of_rps; bs->i_bit_pos += 32;...
cwe
CWE-787
Unknown
package io.onedev.server.rest; import java.util.Collection; import javax.inject.Inject; import javax.inject.Singleton; import javax.ws.rs.Consumes; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import javax.ws.rs.core.Context...
cwe
CWE-862
Java
SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree, struct cifs_tcon *tcon, const struct nls_table *cp) { struct smb2_tree_connect_req *req; struct smb2_tree_connect_rsp *rsp = NULL; struct kvec iov[2]; int rc = 0; int resp_buftype; int unc_path_len; struct TCP_Server_Info *server; __le...
cwe
CWE-399
C/C++
mprint(struct magic_set *ms, struct magic *m) { uint64_t v; float vf; double vd; int64_t t = 0; char buf[128], tbuf[26], sbuf[512], ebuf[512]; const char *desc; union VALUETYPE *p = &ms->ms_value; if (varexpand(ms, ebuf, sizeof(ebuf), m->desc) == -1) desc = m->desc; else desc = ebuf; switch (m->type)...
cwe
CWE-787
Unknown
TPMI_YES_NO_Unmarshal(TPMI_YES_NO *target, BYTE **buffer, INT32 *size) { TPM_RC rc = TPM_RC_SUCCESS; if (rc == TPM_RC_SUCCESS) { rc = UINT8_Unmarshal(target, buffer, size); } if (rc == TPM_RC_SUCCESS) { switch (*target) { case NO: case YES: break; default: rc = TPM_RC_VALUE; } ...
cwe
CWE-787
Unknown
/* 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-754
C/C++
users, err := ParsePasswdFilter(passwd, func(u User) bool { if userArg == "" { return u.Uid == user.Uid } return u.Name == userArg || strconv.Itoa(u.Uid) == userArg })
cwe
CWE-264
Go
#include "source/extensions/transport_sockets/tls/cert_validator/default_validator.h" #include <array> #include <deque> #include <functional> #include <string> #include <vector> #include "envoy/network/transport_socket.h" #include "envoy/ssl/context.h" #include "envoy/ssl/context_config.h" #include "envoy/ssl/private...
cwe
CWE-295
C/C++
public function attachLink(Request $request) { $pageId = $request->get('attachment_link_uploaded_to'); try { $this->validate($request, [ 'attachment_link_uploaded_to' => 'required|integer|exists:pages,id', 'attachment_link_name' => 'required|string|min:1|...
cwe
CWE-79
PHP
regional_alloc(struct regional *r, size_t size) { size_t a = ALIGN_UP(size, ALIGNMENT); void *s; /* large objects */ if(a > REGIONAL_LARGE_OBJECT_SIZE) { s = malloc(ALIGNMENT + size); if(!s) return NULL; r->total_large += ALIGNMENT+size; *(char**)s = r->large_list; r->large_list = (char*)s; return (char...
cwe
CWE-190
Unknown
/* * JBoss, Home of Professional Open Source. * Copyright 2014 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * 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 Licen...
cwe
CWE-400
Java
/* * 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
const assigner = ( ...args: any[] ) => { console.log( { args } ) return args.reduce( ( a, b ) => { if ( untracker.includes( a ) ) throw new TypeError( `can't convert ${a} to object` ) if ( useuntrack && untracker.includes( b ) ) return a Object.keys( b ).forEach( key => { if ( untracke...
cwe
CWE-1321
JavaScript
function peg$parsecontext() { var s0, s1, s2, s3; s0 = peg$currPos; s1 = peg$currPos; if (input.charCodeAt(peg$currPos) === 58) { s2 = peg$c16; peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c17); } } if (s2 !...
cwe
CWE-1321
JavaScript
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) { TF_LITE_ENSURE_EQ(context, NumInputs(node), 2); TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1); const TfLiteTensor* input = GetInput(context, node, kInputTensor); const TfLiteTensor* axis = GetInput(context, node, kAxis); // Make sure the axis...
cwe
CWE-125
C/C++
translate_input(int forward_translation, char *table_name) { char charbuf[BUFSIZE]; uint8_t *outputbuf; size_t outlen; widechar inbuf[BUFSIZE]; widechar transbuf[BUFSIZE]; int inlen; int translen; int k; int ch = 0; int result; while (1) { translen = BUFSIZE; k = 0; while ((ch = fgetc(input)) != '\n' &...
cwe
CWE-787
C/C++
b64decode(const uschar *code, uschar **ptr) { int x, y; uschar *result = store_get(3*(Ustrlen(code)/4) + 1); *ptr = result; /* Each cycle of the loop handles a quantum of 4 input bytes. For the last quantum this may decode to 1, 2, or 3 output bytes. */ while ((x = *code++) != 0) { if (isspace(x)) continue; /*...
cwe
CWE-119
C/C++
static php_stream * php_stream_url_wrap_rfc2397(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) /* {{{ */ { php_stream *stream; php_stream_temp_data *ts; char *comma, *semi, *sep, *key; size_t mlen, dlen, plen, vlen; off_t newo...
cwe
CWE-20
Unknown
function processHeader (request, key, val) { if (val && (typeof val === 'object' && !Array.isArray(val))) { throw new InvalidArgumentError(`invalid ${key} header`) } else if (val === undefined) { return } if ( request.host === null && key.length === 4 && key.toLowerCase() === 'host' ) { ...
cwe
CWE-74
JavaScript
/* Copyright The Helm Authors. 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 di...
cwe
CWE-74
Go
def render_POST(self, request): send_cors(request) if self.require_auth: authV2(self.sydent, request) args = get_args(request, ("medium", "address", "room_id", "sender",)) medium = args["medium"] address = args["address"] roomId = args["room_id"] sen...
cwe
CWE-20
Python
CmdResult Handle (const std::vector<std::string>& parameters, User *user) { /* Only allow AUTHENTICATE on unregistered clients */ if (user->registered != REG_ALL) { if (!cap.ext.get(user)) return CMD_FAILURE; SaslAuthenticator *sasl = authExt.get(user); if (!sasl) authExt.set(user, new SaslAuth...
cwe
CWE-264
Unknown
/*- * Copyright 2014 Square 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 agreed to...
cwe
CWE-190
Go
package artifacts import ( "context" "encoding/json" "errors" "fmt" "io" "io/fs" "net/http" "os" "path" "path/filepath" "strings" "time" "github.com/julienschmidt/httprouter" "github.com/nektos/act/pkg/common" ) type FileContainerResourceURL struct { FileContainerResourceURL string `json:"fileContaine...
cwe
CWE-434
Go
############################ # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (th...
cwe
CWE-116
Python
static void validate_mm(struct mm_struct *mm) { int bug = 0; int i = 0; unsigned long highest_address = 0; struct vm_area_struct *vma = mm->mmap; while (vma) { struct anon_vma *anon_vma = vma->anon_vma; struct anon_vma_chain *avc; if (anon_vma) { anon_vma_lock_read(anon_vma); list_for_each_entry(avc,...
cwe
CWE-119
Unknown
package com.salesmanager.shop.admin.model.web; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import com.fasterxml.jackson.annotation.JsonProperty; public class Menu implements Serializable { /** * */ private static final long serialVersionUID = 1L; private String code; ...
cwe
CWE-639
Java
int qtm_decompress(struct qtm_stream *qtm, off_t out_bytes) { unsigned int frame_start, frame_end, window_posn, match_offset, range; unsigned char *window, *i_ptr, *i_end, *runsrc, *rundest; int i, j, selector, extra, sym, match_length, ret; unsigned short H, L, C, symf; register unsigned int bit_buffer; r...
cwe
CWE-20
C/C++
# -*- 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
import { UITypes } from 'nocodb-sdk' import { uiTypes } from '@/components/project/spreadsheet/helpers/uiTypes' export default { props: { sqlUi: [Object, Function], column: Object }, computed: { uiDatatype() { return this.column && this.column.uidt }, uiDatatypeIcon() { const ui =...
cwe
CWE-918
JavaScript
long ssl3_ctrl(SSL *s, int cmd, long larg, void *parg) { int ret=0; #if !defined(OPENSSL_NO_DSA) || !defined(OPENSSL_NO_RSA) if ( #ifndef OPENSSL_NO_RSA cmd == SSL_CTRL_SET_TMP_RSA || cmd == SSL_CTRL_SET_TMP_RSA_CB || #endif #ifndef OPENSSL_NO_DSA cmd == SSL_CTRL_SET_TMP_DH || cmd == SSL_CTRL_SE...
cwe
CWE-310
Unknown
public static function validateRegex($path, $values) { $result = array($path => ''); if ($values[$path] == '') { return $result; } static::testPHPErrorMsg(); $matches = array(); // in libraries/ListDatabase.php _checkHideDatabase(), // a '/' is ...
cwe
CWE-200
PHP
v8::Local<v8::Object> V8Console::createCommandLineAPI(InspectedContext* inspectedContext) { v8::Local<v8::Context> context = inspectedContext->context(); v8::Isolate* isolate = context->GetIsolate(); v8::MicrotasksScope microtasksScope(isolate, v8::MicrotasksScope::kDoNotRunMicrotasks); v8::Local<v8...
cwe
CWE-79
C/C++
static u32 read_32(cdk_stream_t s) { byte buf[4]; size_t nread; assert(s != NULL); stream_read(s, buf, 4, &nread); if (nread != 4) return (u32) - 1; return buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3]; }
cwe
CWE-125
Unknown
func mountToRootfs(m *configs.Mount, c *mountConfig) error { rootfs := c.root mountLabel := c.label dest := m.Destination if !strings.HasPrefix(dest, rootfs) { dest = filepath.Join(rootfs, dest) } switch m.Device { case "proc", "sysfs": // If the destination already exists and is not a directory, we bail ...
cwe
CWE-362
Go
struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb) { struct tcp_options_received tcp_opt; struct inet_request_sock *ireq; struct tcp_request_sock *treq; struct ipv6_pinfo *np = inet6_sk(sk); struct tcp_sock *tp = tcp_sk(sk); const struct tcphdr *th = tcp_hdr(skb); __u32 cookie = ntohl(th->ack_seq...
cwe
CWE-264
C/C++
$params = ['uitype' => 71, 'displaytype' => 1, 'typeofdata' => 'N~O', 'isEditableReadOnly' => false, 'maximumlength' => '99999999999999999'];
cwe
CWE-20
PHP
// Code generated by go-swagger; DO NOT EDIT. // This file is part of MinIO Console Server // Copyright (c) 2021 MinIO, Inc. // // 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 ...
cwe
CWE-306
Go
xmlParseMisc(xmlParserCtxtPtr ctxt) { while (((RAW == '<') && (NXT(1) == '?')) || (CMP4(CUR_PTR, '<', '!', '-', '-')) || IS_BLANK_CH(CUR)) { if ((RAW == '<') && (NXT(1) == '?')) { xmlParsePI(ctxt); } else if (IS_BLANK_CH(CUR)) { NEXT; } else xmlParseComment(ctxt); ...
cwe
CWE-119
C/C++
ActionReply Smb4KMountHelper::mount(const QVariantMap &args) { ActionReply reply; reply.addData("mh_mountpoint", args["mh_mountpoint"]); command << args["mh_unc"].toString(); command << args["mh_mountpoint"].toString(); command << args["mh_options"].toStringList(); #elif defined(Q_OS_FREEBSD) || defined(Q_...
cwe
CWE-20
C/C++
function EventSource (url, eventSourceInitDict) { var readyState = EventSource.CONNECTING Object.defineProperty(this, 'readyState', { get: function () { return readyState } }) Object.defineProperty(this, 'url', { get: function () { return url } }) var self = this self.reconne...
cwe
CWE-212
JavaScript
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
cwe
CWE-755
C/C++
/* * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. */ /* * Licensed to Elasticsearch under one or more contributor * license agreements. See the NOTICE file distribute...
cwe
CWE-200
Java
TPM2B_ENCRYPTED_SECRET_Marshal(TPM2B_ENCRYPTED_SECRET *source, BYTE **buffer, INT32 *size) { UINT16 written = 0; written += TPM2B_Marshal(&source->b, buffer, size); return written; }
cwe
CWE-787
Unknown
TfLiteStatus Prepare(KernelType kernel_type, TfLiteContext* context, TfLiteNode* node) { auto* params = reinterpret_cast<TfLiteConvParams*>(node->builtin_data); OpData* data = reinterpret_cast<OpData*>(node->user_data); bool has_bias = node->inputs->size == 3; // Check number of inputs/out...
cwe
CWE-369
Unknown
/* * Copyright 2000-2020 Vaadin 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 applicable law or agreed to...
cwe
CWE-668
Java
function run(animation){ (function(compId){ window.AdobeEdge = window.AdobeEdge || {}; window.AdobeEdge.bootstrapLoading = true; // Include yepnope if(!AdobeEdge.yepnope) { /*yepnope1.5.x|WTFPL*/ (function(a,b,c){function d(a){retur...
cwe
CWE-79
JavaScript
EGexecute (char const *buf, size_t size, size_t *match_size, char const *start_ptr) { char const *buflim, *beg, *end, *match, *best_match, *mb_start; char eol = eolbyte; int backref, start, len, best_len; struct kwsmatch kwsm; size_t i, ret_val; if (MB_CUR_MAX > 1) { if (match_icase) ...
cwe
CWE-189
Unknown
//////////////////////////////////////////////////////////////////////////// // **** WAVPACK **** // // Hybrid Lossless Wavefile Compressor // // Copyright (c) 1998 - 2013 Conifer Software. // // ...
cwe
CWE-835
C/C++