code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
public static function startup() { //Override the default expire time of token \CsrfMagic\Csrf::$expires = 259200; \CsrfMagic\Csrf::$callback = function ($tokens) { throw new \App\Exceptions\AppException('Invalid request - Response For Illegal Access', 403); }; $js = 'vendor/yetiforce/csrf-magic/src/Csrf....
cwe
CWE-352
PHP
static Image *ReadVIFFImage(const ImageInfo *image_info, ExceptionInfo *exception) { #define VFF_CM_genericRGB 15 #define VFF_CM_ntscRGB 1 #define VFF_CM_NONE 0 #define VFF_DEP_DECORDER 0x4 #define VFF_DEP_NSORDER 0x8 #define VFF_DES_RAW 0 #define VFF_LOC_IMPLICIT 1 #define VFF_MAPTYP_NONE 0 #define VFF_MAP...
cwe
CWE-284
C/C++
int DSA_verify(int type, const unsigned char *dgst, int dgst_len, const unsigned char *sigbuf, int siglen, DSA *dsa) { DSA_SIG *s; int ret=-1; s = DSA_SIG_new(); if (s == NULL) return(ret); if (d2i_DSA_SIG(&s,&sigbuf,siglen) == NULL) goto err; ret=DSA_do_verify(dgst,dgst_len,s,dsa); err: DSA_SIG_free(s);...
cwe
CWE-310
C/C++
/* * Common Block IO controller cgroup interface * * Based on ideas and code from CFQ, CFS and BFQ: * Copyright (C) 2003 Jens Axboe <axboe@kernel.dk> * * Copyright (C) 2008 Fabio Checconi <fabio@gandalf.sssup.it> * Paolo Valente <paolo.valente@unimore.it> * * Copyright (C) 2009 Vivek Goyal <vgoyal@redha...
cwe
CWE-415
C/C++
static int do_session_handshake (lua_State *L, int status, lua_KContext ctx) { int rc; struct ssh_userdata *sshu = NULL; assert(lua_gettop(L) == 4); sshu = (struct ssh_userdata *) nseU_checkudata(L, 3, SSH2_UDATA, "ssh2"); while ((rc = libssh2_session_handshake(sshu->session, sshu->sp[0])) == LIBS...
cwe
CWE-415
C/C++
private void securityCheck(String filename) { Assert.doesNotContain(filename, ".."); }
cwe
CWE-22
Java
SYSCALL_DEFINE5(waitid, int, which, pid_t, upid, struct siginfo __user *, infop, int, options, struct rusage __user *, ru) { struct rusage r; struct waitid_info info = {.status = 0}; long err = kernel_waitid(which, upid, &info, options, ru ? &r : NULL); int signo = 0; if (err > 0) { signo = SIGCHLD; err = 0...
cwe
CWE-20
Unknown
public function display_sdm_thumbnail_meta_box($post) { // Thumbnail upload metabox $old_thumbnail = get_post_meta($post->ID, 'sdm_upload_thumbnail', true); $old_value = isset($old_thumbnail) ? $old_thumbnail : ''; _e('Manually enter a valid URL, or click "Select Image" to upload (or choose) the file thumbnail imag...
cwe
CWE-79
PHP
from pypika import Parameter, functions from pypika.enums import SqlTypes from pypika.terms import Criterion from tortoise import Model from tortoise.backends.base.executor import BaseExecutor from tortoise.fields import BigIntField, Field, IntField, SmallIntField from tortoise.filters import ( contains, ends_...
cwe
CWE-89
Python
public function handle($stanza, $parent = false) { $message = $stanza->forwarded->message; $jid = explode('/',(string)$message->attributes()->from); $to = current(explode('/',(string)$message->attributes()->to)); if($message->composing) $this->event('composing', array($...
cwe
CWE-20
PHP
PJ_DEF(pj_status_t) pjmedia_rtcp_fb_build_pli( pjmedia_rtcp_session *session, void *buf, pj_size_t *length) { pjmedia_rtcp_common *hdr; unsigned len; PJ_ASSERT_RETURN(session && buf && length, PJ_EINVAL); len = 12; if (len > *length) return PJ_ETOOSMALL; /* Build RTCP-FB PLI ...
cwe
CWE-125
C/C++
def self.included(base) base.class_eval do has_many :search_parameters, :class_name => 'Parameter', :foreign_key => :reference_id belongs_to :search_users, :class_name => 'User', :foreign_key => :owner_id scoped_search :on => :name, :complete_value => true, :default_order => true...
cwe
CWE-89
Ruby
exports.deepCopy = function(target, source) { for (var name in source) { var tval = target[name], sval = source[name]; if (tval !== sval) { if (shouldDeepCopy(sval)) { if (Object.prototype.toString.call(sval) === '[object Date]') { // use this date test to handle crossing frame boundaries ...
cwe
CWE-94
JavaScript
import certifi import requests from flask import request, session as flask_session, redirect import flask_login from requests_oauthlib import OAuth2Session from app.db import with_session, DBSession from env import QuerybookSettings from lib.logger import get_logger from logic.user import ( get_user_by_name, ...
cwe
CWE-79
Python
def load_yaml_from(path) YAML.load(File.read(path)) end
cwe
CWE-502
Ruby
function gotoelement(id) { var gotoElement = document.getElementById('current_record').value; var no_of_records = document.getElementById('totRecords').value; var uploadedFile = document.getElementById('uploadedFile').value; var delim = document.getElementById('select_delimeter').value; var checkmod...
cwe
CWE-352
JavaScript
/*! * merge-deep <https://github.com/jonschlinkert/merge-deep> * * Copyright (c) 2014-2015, Jon Schlinkert. * Licensed under the MIT License. */ 'use strict'; var union = require('arr-union'); var clone = require('clone-deep'); var typeOf = require('kind-of'); module.exports = function mergeDeep(orig, objects) ...
cwe
CWE-915
JavaScript
import { FlowRouter } from 'meteor/ostrio:flow-router-extra' import dayjs from 'dayjs' import utc from 'dayjs/plugin/utc' import customParseFormat from 'dayjs/plugin/customParseFormat' import randomColor from 'randomcolor' import { t } from '../../utils/i18n.js' import { emojify, getUserSetting, getGlobalSetting,...
cwe
CWE-1236
JavaScript
static int vol_prc_lib_release(effect_handle_t handle) { struct listnode *node, *temp_node_next; vol_listener_context_t *context = NULL; vol_listener_context_t *recv_contex = (vol_listener_context_t *)handle; int status = -1; bool recompute_flag = false; int active_stream_count = 0; A...
cwe
CWE-119
C/C++
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
cwe
CWE-119
C/C++
feed_table_block_tag(struct table *tbl, char *line, struct table_mode *mode, int indent, int cmd) { int offset; if (mode->indent_level <= 0 && indent == -1) return; if (mode->indent_level >= CHAR_MAX && indent == 1) return; setwidth(tbl, mode); feed_table_inline_tag(tbl, line, mode, -1); ...
cwe
CWE-835
C/C++
/* * Copyright (c) 2005-2006 Network Appliance, Inc. All rights reserved. * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU * General Public License (GPL) Version 2, available from the file * COPYING in the main directory of th...
cwe
CWE-404
C/C++
bilinear_box_make_weights (PixopsFilterDimension *dim, double scale) { int n = ceil (1/scale + 3.0); double *pixel_weights = g_malloc_n (sizeof (double) * SUBSAMPLE, n); double w; int offset, i; dim->offset = -1.0; dim->n = n; dim->weights = pixel_weights; for (offset = 0; offset...
cwe
CWE-119
Unknown
void MessageService::OpenChannelToTab( int source_process_id, int source_routing_id, int receiver_port_id, int tab_id, const std::string& extension_id, const std::string& channel_name) { content::RenderProcessHost* source = content::RenderProcessHost::FromID(source_process_id); if (!source) re...
cwe
CWE-264
C/C++
CollationCreate(const char *collname, Oid collnamespace, Oid collowner, char collprovider, bool collisdeterministic, int32 collencoding, const char *collcollate, const char *collctype, const char *colliculocale, const char *collversion, bool if_not_exists, bool quiet) { Relation rel...
cwe
CWE-94
Unknown
function headerValueNormalize (potentialValue) { // To normalize a byte sequence potentialValue, remove // any leading and trailing HTTP whitespace bytes from // potentialValue. return potentialValue.replace( /^[\r\n\t ]+|[\r\n\t ]+$/g, '' ) }
cwe
CWE-1333
JavaScript
function s(e,i){var s=i===o?a&&a.array:e&&e.array,u=i>n?0:n-i,c=r-i;return c>g&&(c=g),function(){if(u===c)return It;var e=t?--c:u++;return s&&s[e]}}
cwe
CWE-451
JavaScript
package basichost import ( "context" "errors" "fmt" "io" "net" "sync" "time" "github.com/libp2p/go-libp2p/p2p/host/autonat" "github.com/libp2p/go-libp2p/p2p/host/pstoremanager" "github.com/libp2p/go-libp2p/p2p/host/relaysvc" relayv2 "github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/relay" "github.com/li...
cwe
CWE-400
Go
static int __init ipip_init(void) { int err; printk(banner); if (xfrm4_tunnel_register(&ipip_handler, AF_INET)) { printk(KERN_INFO "ipip init: can't register tunnel\n"); return -EAGAIN; } err = register_pernet_device(&ipip_net_ops); if (err) xfrm4_tunnel_deregister(&ipip_handler, AF_INET); return err; ...
cwe
CWE-362
C/C++
ServiceWorkerContainer* NavigatorServiceWorker::serviceWorker(Navigator& navigator, ExceptionState& exceptionState) { return NavigatorServiceWorker::from(navigator).serviceWorker(exceptionState); }
cwe
CWE-264
C/C++
/* * Copyright (c) 2014-2019 Hong Xu <hong AT topbug DOT net> * Copyright (c) 2018 Sven Strickroth <email AT cs-ware DOT de> * 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. Redistri...
cwe
CWE-787
C/C++
/******************************************************************************* * This file is part of OpenNMS(R). * * Copyright (C) 2002-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-352
Java
void kvm_lapic_reset(struct kvm_vcpu *vcpu, bool init_event) { struct kvm_lapic *apic = vcpu->arch.apic; int i; if (!init_event) { vcpu->arch.apic_base = APIC_DEFAULT_PHYS_BASE | MSR_IA32_APICBASE_ENABLE; if (kvm_vcpu_is_reset_bsp(vcpu)) vcpu->arch.apic_base |= MSR_IA32_APICBASE_BSP; } if (!api...
cwe
CWE-459
Unknown
/* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** *******************...
cwe
CWE-674
C/C++
import error from './error'; import objectHelper from './object'; function wrapCallback(cb, options) { options = options || {}; options.ignoreCasing = options.ignoreCasing ? options.ignoreCasing : false; return function(err, data) { var errObj; if (!err && !data) { return cb(error.buildResponse('...
cwe
CWE-522
JavaScript
const _ = require('lodash'); /** * Iterates over connection object, replacing any template strings with values from user * This allows dynamic values inserted based on logged in user * This uses a mustache-like syntax, using double mustaches. * User variables can be referenced in connection strings using dot notat...
cwe
CWE-94
JavaScript
/* * 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
Status TensorSliceReader::GetTensor( const string& name, std::unique_ptr<tensorflow::Tensor>* out_tensor) const { DataType type; TensorShape shape; TensorSlice slice; { mutex_lock l(mu_); const TensorSliceSet* tss = gtl::FindPtrOrNull(tensors_, name); if (tss == nullptr) { return errors::N...
cwe
CWE-345
C/C++
// 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
jas_stream_t *jas_stream_memopen(char *buf, int bufsize) { jas_stream_t *stream; jas_stream_memobj_t *obj; JAS_DBGLOG(100, ("jas_stream_memopen(%p, %d)\n", buf, bufsize)); if (!(stream = jas_stream_create())) { return 0; } /* A stream associated with a memory buffer is always opened for both reading and wri...
cwe
CWE-190
Unknown
/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. Copyright (c) 2008, 2015, SkySQL Ab. 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; version 2 of the License. This program ...
cwe
CWE-362
C/C++
processInitRequest(struct module_qstate* qstate, struct iter_qstate* iq, struct iter_env* ie, int id) { uint8_t* delname, *dpname=NULL; size_t delnamelen, dpnamelen=0; struct dns_msg* msg = NULL; log_query_info(VERB_DETAIL, "resolving", &qstate->qinfo); /* check effort */ /* We enforce a maximum number of quer...
cwe
CWE-703
Unknown
static ssize_t ocfs2_direct_IO(struct kiocb *iocb, struct iov_iter *iter) { struct file *file = iocb->ki_filp; struct inode *inode = file->f_mapping->host; struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); get_block_t *get_block; /* * Fallback to buffered I/O if we see an inode without * extents. */ if (OCF...
cwe
CWE-362
C/C++
dtls1_buffer_record(SSL *s, record_pqueue *queue, unsigned char *priority) { DTLS1_RECORD_DATA *rdata; pitem *item; /* Limit the size of the queue to prevent DOS attacks */ if (pqueue_size(queue->q) >= 100) return 0; rdata = OPENSSL_malloc(sizeof(DTLS1_RECORD_DATA)); item = pitem_new(priority, rdata); if ...
cwe
CWE-119
C/C++
############################################################################## # # Copyright (c) 2001 Zope Foundation and Contributors # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this # distribution. # THIS SOFTWARE IS PROVIDED "AS ...
cwe
CWE-601
Python
string_vformat(gstring * g, BOOL extend, const char *format, va_list ap) { enum ltypes { L_NORMAL=1, L_SHORT=2, L_LONG=3, L_LONGLONG=4, L_LONGDOUBLE=5, L_SIZE=6 }; int width, precision, off, lim; const char * fp = format; /* Deliberately not unsigned */ string_datestamp_offset = -1; /* Datestamp not inserted */ strin...
cwe
CWE-787
C/C++
function showRenderMsg(msg) { prevDiv.style.background = 'transparent'; prevDiv.innerHTML = ''; var status = document.createElement('div'); status.className = 'odPreviewStatus'; mxUtils.write(status, msg); prevDiv.appendChild(status); spinner.stop(); }
cwe
CWE-94
JavaScript
g_keyfile_settings_backend_constructed (GObject *object) { GKeyfileSettingsBackend *kfsb = G_KEYFILE_SETTINGS_BACKEND (object); if (kfsb->file == NULL) { char *filename = g_build_filename (g_get_user_config_dir (), "glib-2.0", "settings", "keyfile", ...
cwe
CWE-732
Unknown
package com.salesmanager.shop.store.controller.product.facade; import java.util.List; import com.salesmanager.core.model.merchant.MerchantStore; import com.salesmanager.core.model.reference.language.Language; import com.salesmanager.shop.model.catalog.product.attribute.optionset.PersistableProductOptionSet; import co...
cwe
CWE-639
Java
findoprnd(ITEM *ptr, int32 *pos) { #ifdef BS_DEBUG elog(DEBUG3, (ptr[*pos].type == OPR) ? "%d %c" : "%d %d", *pos, ptr[*pos].val); #endif if (ptr[*pos].type == VAL) { ptr[*pos].left = 0; (*pos)--; } else if (ptr[*pos].val == (int32) '!') { ptr[*pos].left = -1; (*pos)--; findoprnd(ptr, pos); } ...
cwe
CWE-189
C/C++
def update(request, pk): topic = Topic.objects.for_update_or_404(pk, request.user) category_id = topic.category_id form = TopicForm( user=request.user, data=post_data(request), instance=topic) if is_post(request) and form.is_valid(): topic = form.save() if topic.c...
cwe
CWE-601
Python
void CUser::SetClientEncoding(const CString& s) { m_sClientEncoding = s; for (CClient* pClient : GetAllClients()) { pClient->SetEncoding(s); } }
cwe
CWE-20
C/C++
"""Tornado handlers for cluster web service.""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import json from tornado import web from ...base.handlers import IPythonHandler #----------------------------------------------------------------------------- # Clust...
cwe
CWE-79
Python
processDataRcvd(ptcpsess_t *const __restrict__ pThis, char **buff, const int buffLen, struct syslogTime *stTime, const time_t ttGenTime, multi_submit_t *pMultiSub, unsigned *const __restrict__ pnMsgs) { DEFiRet; char c = **buff; int octatesToCopy, octatesToDiscard; if(pThis->inputState == eAtStrtFram) { if...
cwe
CWE-190
C/C++
/** * Copyright (c) 2006-2012, JGraph Ltd */ /** * Construcs a new toolbar for the given editor. */ function Toolbar(editorUi, container) { this.editorUi = editorUi; this.container = container; this.staticElements = []; this.init(); // Global handler to hide the current menu this.gestureHandler = mxUtils.bin...
cwe
CWE-79
JavaScript
struct ucounts *alloc_ucounts(struct user_namespace *ns, kuid_t uid) { struct hlist_head *hashent = ucounts_hashentry(ns, uid); struct ucounts *ucounts, *new; bool wrapped; spin_lock_irq(&ucounts_lock); ucounts = find_ucounts(ns, uid, hashent); if (!ucounts) { spin_unlock_irq(&ucounts_lock); new = kzalloc(s...
cwe
CWE-416
Unknown
TPMI_SH_POLICY_Unmarshal(TPMI_SH_POLICY *target, BYTE **buffer, INT32 *size) { TPM_RC rc = TPM_RC_SUCCESS; if (rc == TPM_RC_SUCCESS) { rc = TPM_HANDLE_Unmarshal(target, buffer, size); } if (rc == TPM_RC_SUCCESS) { BOOL isNotPolicySession = (*target < POLICY_SESSION_FIRST) || (*target > POLICY_S...
cwe
CWE-787
Unknown
function sqlrequest($database,$sql,$id=false){ // Get the global value global $database_host; global $database_username; global $database_password; $connexion = mysqli_connect($database_host, $database_username, $database_password, $database); if (!$connexion) { echo "<ul>"; echo "<li class='msg_title'>Aler...
cwe
CWE-78
PHP
$files[$i] = '.' . DIRECTORY_SEPARATOR . basename($file); } $files = array_map('escapeshellarg', $files); $cmd = $arc['cmd'] . ' ' . $arc['argc'] . ' ' . escapeshellarg($name) . ' ' . implode(' ', $files); $err_out = ''; $this->procExec($c...
cwe
CWE-78
PHP
void Archive::ProcessExtra50(RawRead *Raw,size_t ExtraSize,BaseBlock *bb) { // Read extra data from the end of block skipping any fields before it. size_t ExtraStart=Raw->Size()-ExtraSize; if (ExtraStart<Raw->GetPos()) return; Raw->SetPos(ExtraStart); while (Raw->DataLeft()>=2) { int64 FieldSize=Raw...
cwe
CWE-787
C/C++
ssize_t v9fs_list_xattr(FsContext *ctx, const char *path, void *value, size_t vsize) { ssize_t size = 0; void *ovalue = value; XattrOperations *xops; char *orig_value, *orig_value_start; ssize_t xattr_len, parsed_len = 0, attr_len; char *dirpath, *name; int dirfd; ...
cwe
CWE-772
C/C++
uint32_t virtio_config_readw(VirtIODevice *vdev, uint32_t addr) { VirtioDeviceClass *k = VIRTIO_DEVICE_GET_CLASS(vdev); uint16_t val; k->get_config(vdev, vdev->config); if (addr > (vdev->config_len - sizeof(val))) return (uint32_t)-1; val = lduw_p(vdev->config + addr); return val; }
cwe
CWE-269
C/C++
LPSTR tr_esc_str(LPCSTR arg, bool format) { LPSTR tmp = NULL; size_t cs = 0, x, ds, len; size_t s; if (NULL == arg) return NULL; s = strlen(arg); /* Find trailing whitespaces */ while ((s > 0) && isspace(arg[s - 1])) s--; /* Prepare a initial buffer with the size of the result string. */ ds = s + 1; ...
cwe
CWE-401
Unknown
@app.route('/api/uploads/<sid>/logs') def get_logs(sid): if '/' not in sid: path = os.path.join(app.config['UPLOAD_FOLDER'], sid) if os.path.isfile(os.path.join(path, app.config['LOG_FILE'])): return send_from_directory(directory=path, filename=app...
cwe
CWE-78
Python
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) { auto* params = reinterpret_cast<TfLiteMulParams*>(node->builtin_data); OpData* data = reinterpret_cast<OpData*>(node->user_data); TF_LITE_ENSURE_EQ(context, NumInputs(node), 2); TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1); const TfLiteTens...
cwe
CWE-125
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
/** * Testing dockable windows. */ EditorUi.windowed = urlParams['windows'] != '0'; /** * Code for the minimal UI theme. */ EditorUi.initMinimalTheme = function() { // Disabled in lightbox and chromeless mode if (urlParams['lightbox'] == '1' || urlParams['chrome'] == '0' || typeof window.Format === 'undefined' |...
cwe
CWE-284
Java
var N=mxText.prototype.redraw;mxText.prototype.redraw=function(){N.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};Graph.prototype.createTagsDialog=function(n,D,I){function S(){for(var ma=T.getSelectionCells(),ya=[],Ba=0;Ba<ma.length;Ba++)T.isCellVisible(ma[Ba])...
cwe
CWE-94
JavaScript
int gnutls_pcert_import_openpgp (gnutls_pcert_st* pcert, gnutls_openpgp_crt_t crt, unsigned int flags) { int ret; size_t sz; memset(pcert, 0, sizeof(*pcert)); pcert->type = GNUTLS_CRT_OPENPGP; pcert->cert.data = NULL; sz = 0; ret = gnutls_openpgp_crt_export(crt, GNUTLS_OPENPGP_FMT_RAW, NULL, &sz); if (r...
cwe
CWE-399
Unknown
XLogRestorePoint(const char *rpName) { XLogRecPtr RecPtr; XLogRecData rdata; xl_restore_point xlrec; xlrec.rp_time = GetCurrentTimestamp(); strncpy(xlrec.rp_name, rpName, MAXFNAMELEN); rdata.buffer = InvalidBuffer; rdata.data = (char *) &xlrec; rdata.len = sizeof(xl_restore_point); rdata.next = NULL; RecPt...
cwe
CWE-119
Unknown
public BigInteger calculateAgreement( CipherParameters pubKey) { DHPublicKeyParameters pub = (DHPublicKeyParameters)pubKey; if (!pub.getParameters().equals(dhParams)) { throw new IllegalArgumentException("Diffie-Hellman public key has wrong parameters."); } ...
cwe
CWE-320
Java
static int attach_child_main(void* data) { struct attach_clone_payload* payload = (struct attach_clone_payload*)data; int ipc_socket = payload->ipc_socket; lxc_attach_options_t* options = payload->options; struct lxc_proc_context_info* init_ctx = payload->init_ctx; #if HAVE_SYS_PERSONALITY_H long new_personality; ...
cwe
CWE-17
Unknown
# -*- 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
async function runApp() { let app = express(); app.set('port', process.env.PORT ?? 8080); let sessionStore = new session.MemoryStore(); let secret = Math.random().toString(); app.use(session({store: sessionStore, resave: true, saveUninitialized: true, secret: secret, cookie: { maxAge: 10000 }, key: 'sid'})); l...
cwe
CWE-352
JavaScript
void CalculateOutputIndexRowSplit( const RowPartitionTensor& row_split, const vector<INDEX_TYPE>& parent_output_index, INDEX_TYPE output_index_multiplier, INDEX_TYPE output_size, vector<INDEX_TYPE>* result) { INDEX_TYPE row_split_size = row_split.size(); if (row_split_size > 0) { r...
cwe
CWE-131
C/C++
PassRefPtr<Attr> Element::setAttributeNode(Attr* attrNode, ExceptionCode& ec) { if (!attrNode) { ec = TYPE_MISMATCH_ERR; return 0; } RefPtr<Attr> oldAttrNode = attrIfExists(attrNode->qualifiedName()); if (oldAttrNode.get() == attrNode) return attrNode; // This Attr is already at...
cwe
CWE-399
C/C++
fmgr_sql_validator(PG_FUNCTION_ARGS) { Oid funcoid = PG_GETARG_OID(0); HeapTuple tuple; Form_pg_proc proc; List *raw_parsetree_list; List *querytree_list; ListCell *lc; bool isnull; Datum tmp; char *prosrc; parse_error_callback_arg callback_arg; ErrorContextCallback sqlerrcontext; bool haspo...
cwe
CWE-264
Unknown
long Cluster::Parse(long long& pos, long& len) const { long status = Load(pos, len); if (status < 0) return status; assert(m_pos >= m_element_start); assert(m_timecode >= 0); const long long cluster_stop = (m_element_size < 0) ? -1 : m_element_start + m_element_size; if ((cluster_stop >= 0) && (m_pos >= c...
cwe
CWE-20
C/C++
void close_thread_table(THD *thd, TABLE **table_ptr) { TABLE *table= *table_ptr; DBUG_ENTER("close_thread_table"); DBUG_PRINT("tcache", ("table: '%s'.'%s' %p", table->s->db.str, table->s->table_name.str, table)); DBUG_ASSERT(!table->file->keyread_enabled()); DBUG_ASSERT(!table->file ||...
cwe
CWE-416
Unknown
void Dispatcher::RegisterNativeHandlers(ModuleSystem* module_system, ScriptContext* context, Dispatcher* dispatcher, RequestSender* request_sender, V8SchemaReg...
cwe
CWE-254
C/C++
static int xar_hash_check(int hash, const void * result, const void * expected) { int len; if (!result || !expected) return 1; switch (hash) { case XAR_CKSUM_SHA1: len = SHA1_HASH_SIZE; break; case XAR_CKSUM_MD5: len = CLI_HASH_MD5; break; case XAR_CKSUM_...
cwe
CWE-125
C/C++
static inline bool isMountable(const RemoteFsDevice::Details &d) { return RemoteFsDevice::constSshfsProtocol==d.url.scheme() || RemoteFsDevice::constSambaProtocol==d.url.scheme() || RemoteFsDevice::constSambaAvahiProtocol==d.url.scheme(); }
cwe
CWE-22
Unknown
/* SPDX-License-Identifier: BSD-2-Clause */ /******************************************************************************* * Copyright 2018-2019, Fraunhofer SIT sponsored by Infineon Technologies AG * All rights reserved. *******************************************************************************/ #ifdef HAVE...
cwe
CWE-909
C/C++
int blkcg_init_queue(struct request_queue *q) { struct blkcg_gq *new_blkg, *blkg; bool preloaded; int ret; new_blkg = blkg_alloc(&blkcg_root, q, GFP_KERNEL); if (!new_blkg) return -ENOMEM; preloaded = !radix_tree_preload(GFP_KERNEL); /* * Make sure the root blkg exists and count the existing blkgs. As ...
cwe
CWE-415
C/C++
emStrong(src, maskedSrc, prevChar = '') { console.log("trying to match:"); console.log(src); let match = this.rules.inline.emStrong.lDelim.exec(src); console.log(match); console.log(src); if (!match) { return; } let lLength, rLength; let delimTotal = 0; let bothDelimTotal ...
cwe
CWE-400
JavaScript
static void vmx_set_msr_bitmap(struct kvm_vcpu *vcpu) { unsigned long *msr_bitmap; if (is_guest_mode(vcpu)) msr_bitmap = vmx_msr_bitmap_nested; else if (vcpu->arch.apic_base & X2APIC_ENABLE) { if (is_long_mode(vcpu)) msr_bitmap = vmx_msr_bitmap_longmode_x2apic; else msr_bitmap = vmx_msr_bitmap_legacy_x2...
cwe
CWE-264
C/C++
bool __skb_flow_dissect(const struct sk_buff *skb, struct flow_dissector *flow_dissector, void *target_container, void *data, __be16 proto, int nhoff, int hlen, unsigned int flags) { struct flow_dissector_key_control *key_control; struct flow_dissector_key_basic *key_basic; struct flow_dissector_key_addr...
cwe
CWE-665
C/C++
function Xe(e,t){t.unobserve()}
cwe
CWE-601
JavaScript
TerminalUserInfo UserTerminalRouter::getInfoForId(const string &id) { auto it = idInfoMap.find(id); if (it == idInfoMap.end()) { STFATAL << " Tried to read from an id that no longer exists"; } return it->second; }
cwe
CWE-362
C/C++
'use strict'; 'require baseclass'; 'require view'; 'require fs'; 'require ui'; var isReadonlyView = !L.hasViewPermission() || null; var SSHPubkeyDecoder = baseclass.singleton({ lengthDecode: function(s, off) { var l = (s.charCodeAt(off++) << 24) | (s.charCodeAt(off++) << 16) | (s.charCodeAt(off++) << 8) ...
cwe
CWE-79
JavaScript
/* radare - LGPL - Copyright 2009-2022 - pancake, nibble */ #include <r_types.h> #include <r_list.h> #include <r_flag.h> #include <r_core.h> #include <r_bin.h> #include <ht_uu.h> #include <r_util/r_graph_drawable.h> #include <string.h> HEAPTYPE (ut64); // used to speedup strcmp with rconfig.get in loops enum { R2_...
cwe
CWE-416
C/C++
IMPEG2D_ERROR_CODES_T impeg2d_dec_pic_hdr(dec_state_t *ps_dec) { stream_t *ps_stream; ps_stream = &ps_dec->s_bit_stream; impeg2d_bit_stream_flush(ps_stream,START_CODE_LEN); /* Flush temporal reference */ impeg2d_bit_stream_get(ps_stream,10); /* Picture type */ ps_dec->e_pic_type = (e_pic_type_t)imp...
cwe
CWE-200
C/C++
long ContentEncoding::ParseContentEncAESSettingsEntry( long long start, long long size, IMkvReader* pReader, ContentEncAESSettings* aes) { assert(pReader); assert(aes); long long pos = start; const long long stop = start + size; while (pos < stop) { long long id, size; const long status = ParseElementHeade...
cwe
CWE-20
C/C++
duint32 dwgCompressor::twoByteOffset(duint32 *ll){ duint32 cont = 0; duint8 fb = bufC[pos++]; cont = (fb >> 2) | (bufC[pos++] << 6); *ll = (fb & 0x03); return cont; }
cwe
CWE-191
Unknown
flatpak_run_add_environment_args (FlatpakBwrap *bwrap, const char *app_info_path, FlatpakRunFlags flags, const char *app_id, FlatpakContext *context, ...
cwe
CWE-94
Unknown
static __init int hardware_setup(void) { int r = -ENOMEM, i, msr; rdmsrl_safe(MSR_EFER, &host_efer); for (i = 0; i < ARRAY_SIZE(vmx_msr_index); ++i) kvm_define_shared_msr(i, vmx_msr_index[i]); vmx_io_bitmap_a = (unsigned long *)__get_free_page(GFP_KERNEL); if (!vmx_io_bitmap_a) return r; vmx_io_bitmap_b =...
cwe
CWE-264
C/C++
/* Copyright 2020 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
cwe
CWE-20
C/C++
void t_cpp_generator::generate_struct_reader(ofstream& out, t_struct* tstruct, bool pointers) { if (gen_templates_) { out << indent() << "template <class Protocol_>" << endl << indent() << "uint32_t " << tstruct->get_name() << "::read(Protocol_* iprot) {" << endl; } else { indent(out) << "uint32_t "...
cwe
CWE-20
Unknown
static MagickBooleanType WriteHDRImage(const ImageInfo *image_info,Image *image, ExceptionInfo *exception) { char header[MagickPathExtent]; const char *property; MagickBooleanType status; register const Quantum *p; register ssize_t i, x; size_t length; ssize_t count...
cwe
CWE-125
C/C++
struct vfsmount *clone_private_mount(const struct path *path) { struct mount *old_mnt = real_mount(path->mnt); struct mount *new_mnt; if (IS_MNT_UNBINDABLE(old_mnt)) return ERR_PTR(-EINVAL); new_mnt = clone_mnt(old_mnt, path->dentry, CL_PRIVATE); if (IS_ERR(new_mnt)) return ERR_CAST(new_mnt); /* Longterm m...
cwe
CWE-200
C/C++