code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
static NTSTATUS do_connect(TALLOC_CTX *ctx, const char *server, const char *share, const struct user_auth_info *auth_info, bool show_sessetup, bool force_encrypt, int max_protocol, int port, int name_type, struct cli_state **pcli) { struct cli_state *c = NULL; char *servic...
cwe
CWE-20
C/C++
compat_do_replace(struct net *net, void __user *user, unsigned int len) { int ret; struct compat_ip6t_replace tmp; struct xt_table_info *newinfo; void *loc_cpu_entry; struct ip6t_entry *iter; if (copy_from_user(&tmp, user, sizeof(tmp)) != 0) return -EFAULT; /* overflow check */ if (tmp.size >= INT_MAX / num...
cwe
CWE-200
Unknown
renderList(mentionChar, data, searchTerm) { if (data && data.length > 0) { this.removeLoading(); this.values = data; this.mentionList.innerHTML = ""; var initialSelection = -1; for (let i = 0; i < data.length; i += 1) { const li = document.createElement("li"); li.id ...
cwe
CWE-79
JavaScript
static void tcp_send_challenge_ack(struct sock *sk, const struct sk_buff *skb) { /* unprotected vars, we dont care of overwrites */ static u32 challenge_timestamp; static unsigned int challenge_count; struct tcp_sock *tp = tcp_sk(sk); u32 now; /* First check our per-socket dupack rate limit. */ if (tcp_oow_rate...
cwe
CWE-200
Unknown
/* * GPAC - Multimedia Framework C SDK * * Authors: Jean Le Feuvre * Copyright (c) Telecom ParisTech 2005-2012 * * This file is part of GPAC / MPEG2-TS sub-project * * GPAC is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as publishe...
cwe
CWE-416
C/C++
validate_event(struct pmu_hw_events *hw_events, struct perf_event *event) { struct arm_pmu *armpmu = to_arm_pmu(event->pmu); struct pmu *leader_pmu = event->group_leader->pmu; if (event->pmu != leader_pmu || event->state < PERF_EVENT_STATE_OFF) return 1; if (event->state == PERF_EVENT_STATE_OFF &&...
cwe
CWE-20
C/C++
/* * 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 n...
cwe
CWE-502
Java
static int create_new_entry(struct fuse_mount *fm, struct fuse_args *args, struct inode *dir, struct dentry *entry, umode_t mode) { struct fuse_entry_out outarg; struct inode *inode; struct dentry *d; int err; struct fuse_forget_link *forget; forget = fuse_alloc_forget(); if (!forget) return -EN...
cwe
CWE-459
Unknown
static int mp_get_count(struct sb_uart_state *state, struct serial_icounter_struct *icnt) { struct serial_icounter_struct icount; struct sb_uart_icount cnow; struct sb_uart_port *port = state->port; spin_lock_irq(&port->lock); memcpy(&cnow, &port->icount, sizeof(struct sb_uart_icount)); spin_unlock_irq(&port...
cwe
CWE-200
Unknown
//= require ./table_data_view var alias = Ember.computed.alias; var unbindScroll = function() { var scrollable = this.get('scrollable'); if (scrollable) { scrollable.off('scroll'); } }; Flame.TableView = Flame.View.extend(Flame.Statechart, { MIN_COLUMN_WIDTH: 30, classNames: ['flame-tabl...
cwe
CWE-79
JavaScript
int lzxd_decompress(struct lzxd_stream *lzx, off_t out_bytes) { /* bitstream and huffman reading variables */ register unsigned int bit_buffer; register int bits_left, i=0; unsigned char *i_ptr, *i_end; register unsigned short sym; int match_length, length_footer, extra, verbatim_bits, bytes_todo; int th...
cwe
CWE-119
Unknown
'use strict'; var tag = require('./tag'); var wrapWith = function (tagName) { return function (name, field, options) { var opt = options || {}; var wrappedContent = []; var errorHTML = opt.hideError ? '' : field.errorHTML(); if (field.widget.type === 'multipleCheckbox' || field.widg...
cwe
CWE-79
JavaScript
function Z(t){return!(tt(t)||Y(t)||Q(t)||K(t)||G(t)||X(t)||_(t))}
cwe
CWE-79
JavaScript
ignore_error_for_testing(char_u *error) { if (ignore_error_list.ga_itemsize == 0) ga_init2(&ignore_error_list, sizeof(char_u *), 1); if (STRCMP("RESET", error) == 0) ga_clear_strings(&ignore_error_list); else ga_add_string(&ignore_error_list, error); }
cwe
CWE-416
C/C++
/************************************************************************ * This file is part of EspoCRM. * * EspoCRM - Open Source CRM application. * Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko * Website: https://www.espocrm.com * * EspoCRM is free software: you can redistribute i...
cwe
CWE-79
JavaScript
static int adjust_insn_aux_data(struct bpf_verifier_env *env, u32 prog_len, u32 off, u32 cnt) { struct bpf_insn_aux_data *new_data, *old_data = env->insn_aux_data; if (cnt == 1) return 0; new_data = vzalloc(sizeof(struct bpf_insn_aux_data) * prog_len); if (!new_data) return -ENOMEM; memcpy(new_data...
cwe
CWE-20
C/C++
static INLINE BOOL RLEDECOMPRESS(const BYTE* pbSrcBuffer, UINT32 cbSrcBuffer, BYTE* pbDestBuffer, UINT32 rowDelta, UINT32 width, UINT32 height) { const BYTE* pbSrc = pbSrcBuffer; const BYTE* pbEnd; const BYTE* pbDestEnd; BYTE* pbDest = pbDestBuffer; PIXEL temp; PIXEL fgPel = WHITE...
cwe
CWE-125
C/C++
import { isTestSuiteActive } from "../../support/page_objects/projectConstants"; import { mainPage } from "../../support/page_objects/mainPage"; let storedURL = ""; // 0: all enabled // 1: field hide // 2: field sort // 3: field filter // 4: default (address table): for view operation validation // 5: default (countr...
cwe
CWE-400
JavaScript
function get_pie_chart(div, url) { if($("#"+div).length == 0) { $('body').append('<div id="' + div + '" class="modal fade"><div class="modal-dialog"><div class="modal-content"></div></div></div>'); $("#"+div+" .modal-content").append('<div class="modal-header"><button type="button" class="close" data-dismi...
cwe
CWE-79
JavaScript
prepend_args (char const *options, char *buf, char **argv) { char const *o = options; char *b = buf; int n = 0; for (;;) { while (c_isspace ((unsigned char) *o)) o++; if (!*o) return n; if (argv) argv[n] = b; n++; do if ((*b++ = *o++) == '\\' &...
cwe
CWE-189
Unknown
static RList *r_bin_wasm_get_global_entries (RBinWasmObj *bin, RBinWasmSection *sec) { RList *ret = NULL; RBinWasmGlobalEntry *ptr = NULL; int buflen = bin->buf->length; if (sec->payload_data + 32 > buflen) { return NULL; } if (!(ret = r_list_newf ((RListFree)free))) { return NULL; } ut8* buf = bin->buf->...
cwe
CWE-125
C/C++
renderError(t,e,n,r,s){const i=new Error(t);return i.exception=e||null,i.file=n||null,i.line=r||null,i.trace=s||[],i}
cwe
CWE-1321
JavaScript
xz_decomp(xz_statep state) { int ret; unsigned had; unsigned long crc, len; lzma_stream *strm = &(state->strm); lzma_action action = LZMA_RUN; /* fill output buffer up to end of deflate stream */ had = strm->avail_out; do { /* get more input for inflate() */ if (strm->a...
cwe
CWE-399
C/C++
/* * * Copyright 2019 Asylo 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 agree...
cwe
CWE-125
C/C++
// ParseServer - open-source compatible API Server for Parse apps var batch = require('./batch'), bodyParser = require('body-parser'), express = require('express'), middlewares = require('./middlewares'), Parse = require('parse/node').Parse, { parse } = require('graphql'), path = require('path'), fs = re...
cwe
CWE-290
JavaScript
(function(stylesheet, stencils) { // Callbacks: // mxClientOnLoad is called after the script is loaded with the stylesheet and the function to create a // graph (wich takes the container as an argument and returns the graph instance that was created). // mxClientOnCreate is called when a graph has been created...
cwe
CWE-79
JavaScript
static void vnc_zrle_stop(VncState *vs) { /* switch back to normal output/zlib buffers */ vs->zrle.zrle = vs->output; vs->output = vs->zrle.tmp; }
cwe
CWE-401
Unknown
static bool add_free_nid(struct f2fs_sb_info *sbi, nid_t nid, bool build) { struct f2fs_nm_info *nm_i = NM_I(sbi); struct free_nid *i; struct nat_entry *ne; int err; /* 0 nid should not be used */ if (unlikely(nid == 0)) return false; if (build) { /* do not add allocated nids */ ne = __lookup_nat...
cwe
CWE-362
C/C++
flatpak_run_setup_base_argv (FlatpakBwrap *bwrap, GFile *runtime_files, GFile *app_id_dir, const char *arch, FlatpakRunFlags flags, GError **err...
cwe
CWE-668
Unknown
QPDF::dumpHPageOffset() { HPageOffset& t = this->m->page_offset_hints; *this->m->out_stream << "min_nobjects: " << t.min_nobjects << std::endl << "first_page_offset: " << adjusted_offset(t.first_page_offset) << std::endl << "nbits_delta_nobjects: " << t.nbits_delta_nobjects << std::endl << "min_page_leng...
cwe
CWE-787
Unknown
public ResponseEntity<Resource> fetch(@PathVariable String key) { LitemallStorage litemallStorage = litemallStorageService.findByKey(key); if (key == null) { ResponseEntity.notFound(); } String type = litemallStorage.getType(); MediaType mediaType = MediaType.parseMed...
cwe
CWE-22
Java
package com.salesmanager.core.business.services.catalog.product.attribute; import java.util.List; import com.salesmanager.core.business.exception.ServiceException; import com.salesmanager.core.business.services.common.generic.SalesManagerEntityService; import com.salesmanager.core.model.catalog.product.Product; impor...
cwe
CWE-639
Java
static void ldap_encode_response(struct asn1_data *data, struct ldap_Result *result) { asn1_write_enumerated(data, result->resultcode); asn1_write_OctetString(data, result->dn, (result->dn) ? strlen(result->dn) : 0); asn1_write_OctetString(data, result->errormessage, ...
cwe
CWE-399
C/C++
show_signal_msg(struct pt_regs *regs, unsigned long error_code, unsigned long address, struct task_struct *tsk) { const char *loglvl = task_pid_nr(tsk) > 1 ? KERN_INFO : KERN_EMERG; if (!unhandled_signal(tsk, SIGSEGV)) return; if (!printk_ratelimit()) return; printk("%s%s[%d]: segfault at %lx ip %px sp %px...
cwe
CWE-20
Unknown
static int mbochs_probe(struct mdev_device *mdev) { const struct mbochs_type *type = &mbochs_types[mdev_get_type_group_id(mdev)]; struct device *dev = mdev_dev(mdev); struct mdev_state *mdev_state; int ret = -ENOMEM; if (type->mbytes + mbochs_used_mbytes > max_mbytes) return -ENOMEM; mdev_state = kzalloc(si...
cwe
CWE-401
Unknown
bool inode_capable(const struct inode *inode, int cap) { struct user_namespace *ns = current_user_ns(); return ns_capable(ns, cap) && kuid_has_mapping(ns, inode->i_uid); }
cwe
CWE-264
C/C++
static MagickBooleanType load_tile(Image *image,Image *tile_image, XCFDocInfo *inDocInfo,XCFLayerInfo *inLayerInfo,size_t data_length, ExceptionInfo *exception) { ssize_t y; register ssize_t x; register Quantum *q; ssize_t count; unsigned char *graydata; XCFPixelInfo *xcfda...
cwe
CWE-125
C/C++
public void write(SourceWriter w) { // class header String packageName = "it.geosolutions.jaiext.jiffle.runtime"; w.line("package " + packageName + ";"); w.newLine(); w.line("import java.util.List;"); w.line("import java.util.ArrayList;"); w.line("import java.util...
cwe
CWE-94
Java
def init_app(app): from redash.authentication import ( google_oauth, saml_auth, remote_user_auth, ldap_auth, ) login_manager.init_app(app) login_manager.anonymous_user = models.AnonymousUser login_manager.REMEMBER_COOKIE_DURATION = settings.REMEMBER_COOKIE_DURATION ...
cwe
CWE-352
Python
function Nr(t){if(t){if("object"==typeof t){var e={};return!1!==t.css&&A(e,Uu(t.name||"v")),A(e,t),e}return"string"==typeof t?Uu(t):void 0}}
cwe
CWE-79
JavaScript
PUBLIC int espLoadApp(HttpRoute *route) { #if !ME_STATIC EspRoute *eroute; eroute = route->eroute; if (!eroute->skipApps) { MprJson *preload, *item; cchar *errMsg, *source; char *kind; int i; /* Note: the config parser pauses G...
cwe
CWE-476
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-613
Python
# -*- 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 void asmlinkage smm_do_relocation(void *arg) { const struct smm_module_params *p; const struct smm_runtime *runtime; int cpu; uintptr_t curr_smbase; uintptr_t perm_smbase; p = arg; runtime = p->runtime; cpu = p->cpu; curr_smbase = runtime->smbase; if (cpu >= CONFIG_MAX_CPUS) { printk(BIOS_CRIT, ...
cwe
CWE-269
Unknown
/* globals ClipboardJS, inventreeFormDataUpload, inventreeGet, launchModalForm, user_settings, */ /* exported attachClipboard, enableDragAndDrop, exportFormatOptions, inventreeDocReady, inventreeLoad, inventreeSave, */ function attachClipboard(selector, containerselector, t...
cwe
CWE-1236
Python
ParseNodePtr Parser::ParseTerm(BOOL fAllowCall, LPCOLESTR pNameHint, uint32 *pHintLength, uint32 *pShortNameOffset, _Inout_opt_ IdentToken* pToken /*= nullptr*/, bool fUnaryOrParen /*= false*/, _Out_opt_ BOOL* pfCanAssign /*= nullptr*/, _Inout_opt_ BOOL* pfLikelyPattern /*= nullptr*/, _O...
cwe
CWE-119
Unknown
g_socket_client_proxy_connect_callback (GObject *object, GAsyncResult *result, gpointer user_data) { GSocketClientAsyncConnectData *data = user_data; g_object_unref (data->connection); data->connection = g_proxy_connect_finish (G_PROXY (object), result, &data->last_error);...
cwe
CWE-754
Unknown
status_t MediaPlayerService::Client::setNextPlayer(const sp<IMediaPlayer>& player) { ALOGV("setNextPlayer"); Mutex::Autolock l(mLock); sp<Client> c = static_cast<Client*>(player.get()); mNextClient = c; if (c != NULL) { if (mAudioOutput != NULL) { mAudioOutput->setNextOutput(c->...
cwe
CWE-264
C/C++
static function dropdown($options = []) { global $CFG_GLPI; // Default values $p = [ 'name' => 'users_id', 'value' => '', 'values' => [], 'right' => 'id', 'all' => 0, 'display...
cwe
CWE-639
PHP
int rds_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, size_t size, int msg_flags) { struct sock *sk = sock->sk; struct rds_sock *rs = rds_sk_to_rs(sk); long timeo; int ret = 0, nonblock = msg_flags & MSG_DONTWAIT; struct sockaddr_in *sin; struct rds_incoming *inc = NULL; /* udp_recvmsg(...
cwe
CWE-20
Unknown
/* * . .o8 oooo * .o8 "888 `888 * .o888oo oooo d8b oooo oooo .oooo888 .ooooo. .oooo.o 888 oooo * 888 `888""8P `888 `888 d88' `888 d88' `88b d88( "8 888 .8P' * 888 888 888 888 8...
cwe
CWE-79
JavaScript
TPM_CAP_Unmarshal(TPM_CAP *target, BYTE **buffer, INT32 *size) { TPM_RC rc = TPM_RC_SUCCESS; if (rc == TPM_RC_SUCCESS) { rc = UINT32_Unmarshal(target, buffer, size); } if (rc == TPM_RC_SUCCESS) { switch (*target) { case TPM_CAP_ALGS: case TPM_CAP_HANDLES: case TPM_CAP_COMMANDS: case TPM...
cwe
CWE-787
Unknown
/* * HTTP/2 mux-demux for connections * * Copyright 2017 Willy Tarreau <w@1wt.eu> * * 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)...
cwe
CWE-400
C/C++
static long madvise_willneed(struct vm_area_struct *vma, struct vm_area_struct **prev, unsigned long start, unsigned long end) { struct file *file = vma->vm_file; #ifdef CONFIG_SWAP if (!file) { *prev = vma; force_swapin_readahead(vma, start, end); return 0; } if (shmem_mapping(fil...
cwe
CWE-835
C/C++
/* Copyright 2018 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++
diff_mark_adjust_tp( tabpage_T *tp, int idx, linenr_T line1, linenr_T line2, long amount, long amount_after) { diff_T *dp; diff_T *dprev; diff_T *dnext; int i; int inserted, deleted; int n, off; linenr_T last; linenr_T lnum_deleted = line1; // lnum of remainin...
cwe
CWE-703
Unknown
GF_Err flac_dmx_process(GF_Filter *filter) { GF_FLACDmxCtx *ctx = gf_filter_get_udta(filter); GF_FilterPacket *pck, *dst_pck; u8 *output; u8 *start; Bool final_flush=GF_FALSE; u32 pck_size, remain, prev_pck_size; u64 cts = GF_FILTER_NO_TS; FLACHeader hdr; //always reparse duration if (!ctx->duration.num) f...
cwe
CWE-787
C/C++
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { auto* params = reinterpret_cast<TfLiteSequenceRNNParams*>(node->builtin_data); const TfLiteTensor* input = GetInput(context, node, kInputTensor); const TfLiteTensor* input_weights = GetInput(context, node, kWeightsTensor); const TfLiteTensor* recurre...
cwe
CWE-125
C/C++
static void virtqueue_map_desc(unsigned int *p_num_sg, hwaddr *addr, struct iovec *iov, unsigned int max_num_sg, bool is_write, hwaddr pa, size_t sz) { unsigned num_sg = *p_num_sg; assert(num_sg <= max_num_sg); while (sz) { hwaddr len = ...
cwe
CWE-20
Unknown
public function myaddressbook() { global $user; // check if the user is logged in. expQueue::flashIfNotLoggedIn('message',gt('You must be logged in to manage your address book.')); if (!$user->isAdmin() && $this->params['user_id'] != $user->id) { unset($this->params['user_id']); } e...
cwe
CWE-200
PHP
STATIC void GC_init_size_map(void) { int i; /* Map size 0 to something bigger. */ /* This avoids problems at lower levels. */ GC_size_map[0] = 1; for (i = 1; i <= GRANULES_TO_BYTES(TINY_FREELISTS-1) - EXTRA_BYTES; i++) { GC_size_map[i] = (unsigned)ROUNDED_UP_GR...
cwe
CWE-119
Unknown
void Con_Dump_f( void ) { int l, x, i; short *line; fileHandle_t f; int bufferlen; char *buffer; char filename[MAX_QPATH]; if ( Cmd_Argc() != 2 ) { Com_Printf( "usage: condump <filename>\n" ); return; } Q_strncpyz( filename, Cmd_Argv( 1 ), sizeof( filename ) ); COM_DefaultExtension( filename, sizeof(...
cwe
CWE-269
Unknown
/* Copyright The containerd 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...
cwe
CWE-400
Go
authtrust( keyid_t id, u_long trust ) { symkey ** bucket; symkey * sk; u_long lifetime; /* * Search bin for key; if it does not exist and is untrusted, * forget it. */ bucket = &key_hash[KEYHASH(id)]; for (sk = *bucket; sk != NULL; sk = sk->hlink) { if (id == sk->keyid) break; } if (!trust && ...
cwe
CWE-287
Unknown
/* * Fast and scalable bitmap tagging variant. Uses sparser bitmaps spread * over multiple cachelines to avoid ping-pong between multiple submitters * or submitter and completer. Uses rolling wakeups to avoid falling of * the scaling cliff when we run out of tags and have to start putting * submitters to sleep. *...
cwe
CWE-264
C/C++
fd_read_body (const char *downloaded_filename, int fd, FILE *out, wgint toread, wgint startpos, wgint *qtyread, wgint *qtywritten, double *elapsed, int flags, FILE *out2) { int ret = 0; #undef max #define max(a,b) ((a) > (b) ? (a) : (b)) int dlbufsize = max (BUFSIZ, 8 * 1024); char *d...
cwe
CWE-119
Unknown
local void init_block(s) deflate_state *s; { int n; /* iterates over tree elements */ /* Initialize the trees. */ for (n = 0; n < L_CODES; n++) s->dyn_ltree[n].Freq = 0; for (n = 0; n < D_CODES; n++) s->dyn_dtree[n].Freq = 0; for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0; s->dyn_...
cwe
CWE-284
Unknown
/* * FastCGI protocol processing * * Copyright (C) 2019 HAProxy Technologies, Christopher Faulet <cfaulet@haproxy.com> * * 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 restric...
cwe
CWE-459
C/C++
c=mb[c];return null!=c?c(this.state):null}}else Graph.createHandle=function(){},Graph.handleFactory={};var rb=new mxPoint(1,0),zb=new mxPoint(1,0),Bb=mxUtils.toRadians(-30);rb=mxUtils.getRotatedPoint(rb,Math.cos(Bb),Math.sin(Bb));var Ab=mxUtils.toRadians(-150);zb=mxUtils.getRotatedPoint(zb,Math.cos(Ab),Math.sin(Ab));mx...
cwe
CWE-20
JavaScript
/* * The MIT License * * Copyright 2010 Sony Ericsson Mobile Communications. All rights reserved. * Copyright 2013 Sony Mobile Communications AB. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "...
cwe
CWE-352
Java
"use strict"; var exec = require("child_process").exec; var fs = require("fs"); var flag = "--exists"; // Normally |pkg-config opencv ...| could report either OpenCV 2.x or OpenCV 3.y // depending on what is installed. To enable both 2.x and 3.y to co-exist on // the same machine, the opencv.pc for 3.y can be instal...
cwe
CWE-77
JavaScript
'use strict'; var ArgumentsError = require('../error/ArgumentsError'); var deepMap = require('../utils/collection/deepMap'); function factory (type, config, load, typed) { var AccessorNode = load(require('./node/AccessorNode')); var ArrayNode = load(require('./node/ArrayNode')); var Ass...
cwe
CWE-94
JavaScript
static int extract_or_test_entrylist(__G__ numchunk, pfilnum, pnum_bad_pwd, pold_extra_bytes, #ifdef SET_DIR_ATTRIB pnum_dirs, pdirlist, #endif error_in_archive) /* return PK-type error code */ __GDEF unsigned numchunk; ulg *pfilnum; ulg *pnum_bad_pwd; ...
cwe
CWE-400
Unknown
def update_video_positions(removed_position, db): db.execute("UPDATE video SET position = position - 1 WHERE position > {removed_position}".format( removed_position=removed_position))
cwe
CWE-89
Python
// Copyright 2021 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "components/permissions/chooser_title_util.h" #include "components/url_formatter/elide_url.h" #include "content/public/browser/render_frame_host...
cwe
CWE-732
C/C++
ft_smooth_render_generic( FT_Renderer render, FT_GlyphSlot slot, FT_Render_Mode mode, const FT_Vector* origin, FT_Render_Mode required_mode ) { FT_Error error; FT_Outline* out...
cwe
CWE-190
C/C++
public boolean checkObjectExecutePermission(Class clazz, String methodName) { if (Class.class.isAssignableFrom(clazz) && methodName != null && this.secureClassMethods.contains(methodName)) { return true; } else { return super.checkObjectExecutePermission(clazz, methodName); ...
cwe
CWE-22
Java
function expand_chart(ref){ var chart = $(ref); if (!chart.hasClass('statistics-pie')){ chart = chart.parent().find('.statistics-pie'); } var modal_id = chart[0].id+'_modal'; if($("#"+modal_id).length == 0) { var new_chart = chart.clone().empty().attr('id', modal_id + "_chart").removeClass('small');...
cwe
CWE-79
JavaScript
function handler (type, name, fn) { if (arguments.length > 2) { handlers[type][name] = fn } return handlers[type][name] }
cwe
CWE-74
JavaScript
$arcs['create']['application/x-rar'] = array('cmd' => ELFINDER_RAR_PATH, 'argc' => 'a -inul' . (defined('ELFINDER_RAR_MA4') && ELFINDER_RAR_MA4? ' -ma4' : ''), 'ext' => 'rar');
cwe
CWE-918
PHP
static int l2tp_ip6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) { struct ipv6_txoptions opt_space; DECLARE_SOCKADDR(struct sockaddr_l2tpip6 *, lsa, msg->msg_name); struct in6_addr *daddr, *final_p, final; struct ipv6_pinfo *np = inet6_sk(sk); struct ipv6_txoptions *opt = NULL; struct ip6_flowlabel *f...
cwe
CWE-284
Unknown
static void io_req_task_queue(struct io_kiocb *req) { int ret; init_task_work(&req->task_work, io_req_task_submit); ret = io_req_task_work_add(req, &req->task_work); if (unlikely(ret)) { struct task_struct *tsk; init_task_work(&req->task_work, io_req_task_cancel); tsk = io_wq_get_task(req->ctx->io_wq); t...
cwe
CWE-416
Unknown
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) { // Check we have all the inputs and outputs we need. TF_LITE_ENSURE_EQ(context, node->inputs->size, 5); TF_LITE_ENSURE_EQ(context, node->outputs->size, 1); const TfLiteTensor* input = GetInput(context, node, kInputTensor); const TfLiteTensor* i...
cwe
CWE-125
C/C++
int h2_make_htx_request(struct http_hdr *list, struct htx *htx, unsigned int *msgf, unsigned long long *body_len) { struct ist phdr_val[H2_PHDR_NUM_ENTRIES]; uint32_t fields; /* bit mask of H2_PHDR_FND_* */ uint32_t idx; int ck, lck; /* cookie index and last cookie index */ int phdr; int ret; int i; uint32_t us...
cwe
CWE-74
Unknown
PHP_FUNCTION(curl_unescape) { char *str = NULL, *out = NULL; size_t str_len = 0; int out_len; zval *zid; php_curl *ch; if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &zid, &str, &str_len) == FAILURE) { return; } if ((ch = (php_curl*)zend_fetch_resource(Z_RES_P(zid), le_curl_name, ...
cwe
CWE-119
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 / ISO Media File Format sub-project * * GPAC is free software; you can redistribute it and/or modify * it under the terms of the GNU L...
cwe
CWE-416
C/C++
/* +----------------------------------------------------------------------+ | HipHop for PHP | +----------------------------------------------------------------------+ | Copyright (c) 2010-present Facebook, Inc. (http://www.facebook.com) | +---------...
cwe
CWE-416
C/C++
import { mainPage } from "../../support/page_objects/mainPage"; import { loginPage } from "../../support/page_objects/navigation"; import { isTestSuiteActive } from "../../support/page_objects/projectConstants"; export const genTest = (apiType, dbType) => { if (!isTestSuiteActive(apiType, dbType)) return; des...
cwe
CWE-400
JavaScript
static int rose_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, size_t size, int flags) { struct sock *sk = sock->sk; struct rose_sock *rose = rose_sk(sk); struct sockaddr_rose *srose = (struct sockaddr_rose *)msg->msg_name; size_t copied; unsigned char *asmptr; struct sk_buff *skb; int n...
cwe
CWE-20
C/C++
TfLiteStatus GreaterEqualEval(TfLiteContext* context, TfLiteNode* node) { const TfLiteTensor* input1 = GetInput(context, node, kInputTensor1); const TfLiteTensor* input2 = GetInput(context, node, kInputTensor2); TfLiteTensor* output = GetOutput(context, node, kOutputTensor); bool requires_broadcast = !HaveSameS...
cwe
CWE-125
C/C++
# Copyright (c), Michael DeHaan <michael.dehaan@gmail.com>, 2012-2013 # Copyright (c), Toshio Kuratomi <tkuratomi@ansible.com> 2016 # Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause) from __future__ import absolute_import, division, print_function __metaclass__ =...
cwe
CWE-200
Python
static int ipxitf_ioctl(unsigned int cmd, void __user *arg) { int rc = -EINVAL; struct ifreq ifr; int val; switch (cmd) { case SIOCSIFADDR: { struct sockaddr_ipx *sipx; struct ipx_interface_definition f; rc = -EFAULT; if (copy_from_user(&ifr, arg, sizeof(ifr))) break; sipx = (struct sockaddr_ipx *)&...
cwe
CWE-416
Unknown
static void smp_task_done(struct sas_task *task) { if (!del_timer(&task->slow_task->timer)) return; complete(&task->slow_task->completion); }
cwe
CWE-416
C/C++
void publish(Topic *iterator, size_t start, size_t stop, std::string_view topic, std::pair<std::string_view, std::string_view> message) { /* If we already have 64 triggered topics make sure to drain it here */ if (numTriggeredTopics == 64) { drain(); } /* Iterate over all se...
cwe
CWE-787
C/C++
evdev_log_msg(struct evdev_device *device, enum libinput_log_priority priority, const char *format, ...) { va_list args; char buf[1024]; if (!is_logged(evdev_libinput_context(device), priority)) return; /* Anything info and above is user-visible, use the device name */ snprintf(buf, siz...
cwe
CWE-134
Unknown
# -*- coding: utf-8 -*- # Copyright 2014-2016 OpenMarket Ltd # Copyright 2017-2018 New Vector Ltd # Copyright 2019 The Matrix.org Foundation C.I.C. # # 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 Licens...
cwe
CWE-400
Python
bool Item_default_value::fix_fields(THD *thd, Item **items) { Item *real_arg; Item_field *field_arg; Field *def_field; DBUG_ASSERT(fixed == 0); DBUG_ASSERT(arg); /* DEFAULT() do not need table field so should not ask handler to bring field value (mark column for read) */ enum_column_usage save_...
cwe
CWE-416
Unknown
u32 h264bsdInitDpb( dpbStorage_t *dpb, u32 picSizeInMbs, u32 dpbSize, u32 maxRefFrames, u32 maxFrameNum, u32 noReordering) { /* Variables */ u32 i; /* Code */ ASSERT(picSizeInMbs); ASSERT(maxRefFrames <= MAX_NUM_REF_PICS); ASSERT(maxRefFrames <= dpbSize); ASSERT(maxFrameNum); A...
cwe
CWE-119
C/C++
static int hwahc_security_create(struct hwahc *hwahc) { int result; struct wusbhc *wusbhc = &hwahc->wusbhc; struct usb_device *usb_dev = hwahc->wa.usb_dev; struct device *dev = &usb_dev->dev; struct usb_security_descriptor *secd; struct usb_encryption_descriptor *etd; void *itr, *top; size_t itr_size, needed, b...
cwe
CWE-400
Unknown
public void nullHeaderNameNotAllowed() { newEmptyHeaders().add(null, "foo"); }
cwe
CWE-74
Java