code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
mswin_handle_fopen(gx_io_device * iodev, const char *fname, const char *access, gp_file ** pfile, char *rfname, uint rnamelen, gs_memory_t *mem) { int fd; long hfile; /* Correct for Win32, may be wrong for Win64 */ gs_lib_ctx_t *ctx = mem->gs_lib_ctx; gs_fs_list_t *fs = ctx->core->fs;...
cwe
CWE-20
Unknown
function I(ia){v&&(Aa.scrollTop=0,ea.innerHTML="",Ha.spin(ea),U=!1,V=!0,ha.innerHTML=mxUtils.htmlEntities(mxResources.get("recentDiag")),ba=null,v(ua,function(){z(mxResources.get("cannotLoad"));ua([])},ia?null:n))}
cwe
CWE-94
JavaScript
vlog_message(const int facility, const char* format, va_list args) { #if !HAVE_VSYSLOG char buf[MAX_LOG_MSG+1]; vsnprintf(buf, sizeof(buf), format, args); #endif /* Don't write syslog if testing configuration */ if (__test_bit(CONFIG_TEST_BIT, &debug)) return; if (log_file || (__test_bit(DONT_FORK_BIT, &debug...
cwe
CWE-200
Unknown
/* radare - LGPL - Copyright 2022 - jmaselbas */ #include "kvx.h" #include "kvx-reg.h" #include <stdio.h> #include <string.h> #include <r_anal.h> const opc_t kv3_opc[] = { #include "kv3.opc" }; #define KV3_OPC_COUNT R_ARRAY_SIZE(kv3_opc) int kvx_instr_print(insn_t *insn, ut64 offset, char *buf, size_t len) { const ...
cwe
CWE-416
C/C++
/* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #define DEBUG_TYPE "vm" #include "hermes/VM/Interpreter.h" #include "hermes/VM/Runtime.h" #include "hermes/Inst/InstDecode.h" #inc...
cwe
CWE-681
C/C++
int megasas_alloc_cmds(struct megasas_instance *instance) { int i; int j; u16 max_cmd; struct megasas_cmd *cmd; max_cmd = instance->max_mfi_cmds; /* * instance->cmd_list is an array of struct megasas_cmd pointers. * Allocate the dynamic array first and then allocate individual * commands. */ instance->...
cwe
CWE-476
C/C++
QPDFObjectHandle::parseContentStream_internal(PointerHolder<Buffer> stream_data, std::string const& description, ParserCallbacks* callbacks) { size_t length = stream_data->getSize(); PointerHolder<InputSource> input = ...
cwe
CWE-20
Unknown
""" Custom Authenticator to use Bitbucket OAuth with JupyterHub """ import json import urllib from tornado.auth import OAuth2Mixin from tornado import web from tornado.httputil import url_concat from tornado.httpclient import HTTPRequest, AsyncHTTPClient from jupyterhub.auth import LocalAuthenticator from traitlet...
cwe
CWE-863
Python
package api type Shortcut struct { ID int `json:"id"` // Standard fields RowStatus RowStatus `json:"rowStatus"` CreatorID int `json:"creatorId"` CreatedTs int64 `json:"createdTs"` UpdatedTs int64 `json:"updatedTs"` // Domain specific fields Title string `json:"title"` Payload string `json:"p...
cwe
CWE-287
Go
package api import ( "fmt" ) // Role is the type of a role. type Role string const ( // Host is the HOST role. Host Role = "HOST" // Admin is the ADMIN role. Admin Role = "ADMIN" // NormalUser is the USER role. NormalUser Role = "USER" ) func (e Role) String() string { switch e { case Host: return "HOST"...
cwe
CWE-287
Go
/* ** $Id: ltm.c $ ** Tag methods ** See Copyright Notice in lua.h */ #define ltm_c #define LUA_CORE #include "lprefix.h" #include <string.h> #include "lua.h" #include "ldebug.h" #include "ldo.h" #include "lgc.h" #include "lobject.h" #include "lstate.h" #include "lstring.h" #include "ltable.h" #include "ltm.h" #i...
cwe
CWE-120
C/C++
static Maybe<int64_t> IndexOfValueImpl(Isolate* isolate, Handle<JSObject> receiver, Handle<Object> value, uint32_t start_from, uint32_t length) { DCHECK(JSObject::PrototypeHasNoElements(isolate, *receiver)); Handle<SeededNumberDictionary> dictionary( See...
cwe
CWE-704
C/C++
rpl_print(netdissect_options *ndo, const struct icmp6_hdr *hdr, const u_char *bp, u_int length) { int secured = hdr->icmp6_code & 0x80; int basecode= hdr->icmp6_code & 0x7f; if(secured) { ND_PRINT((ndo, ", (SEC) [worktodo]")); /* XXX ...
cwe
CWE-125
C/C++
/* * MinIO Cloud Storage, (C) 2015-2020 MinIO, 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 applicab...
cwe
CWE-863
Go
public void addSynchronously(MediaPackage mediaPackage) throws SearchException, MediaPackageException, IllegalArgumentException, UnauthorizedException { if (mediaPackage == null) { throw new IllegalArgumentException("Unable to add a null mediapackage"); } logger.debug("Attempting to add medi...
cwe
CWE-863
Java
public function validateReference() { $docElem = $this->sigNode->ownerDocument->documentElement; if (! $docElem->isSameNode($this->sigNode)) { if ($this->sigNode->parentNode != null) { $this->sigNode->parentNode->removeChild($this->sigNode); } } ...
cwe
CWE-347
PHP
ZSTD_compressSequences_internal(seqStore_t* seqStorePtr, ZSTD_entropyCTables_t const* prevEntropy, ZSTD_entropyCTables_t* nextEntropy, ZSTD_CCtx_params const* cctxParams, void* dst, size_t dstCapacity...
cwe
CWE-362
C/C++
function I(ia){v&&(Aa.scrollTop=0,ea.innerHTML="",Ha.spin(ea),U=!1,V=!0,ha.innerHTML=mxUtils.htmlEntities(mxResources.get("recentDiag")),ba=null,v(ua,function(){z(mxResources.get("cannotLoad"));ua([])},ia?null:n))}
cwe
CWE-94
JavaScript
Graph.sanitizeHtml=function(b,e){return DOMPurify.sanitize(b,{ADD_ATTR:["target"],FORBID_TAGS:["form"],ALLOWED_URI_REGEXP:/^(?:(?:https?|mailto|tel|callto|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i})};Graph.sanitizeSvg=function(b){return DOMPurify.sanitize(b,{IN_PLACE:!0})};
cwe
CWE-918
JavaScript
static int tc_new_tfilter(struct sk_buff *skb, struct nlmsghdr *n, struct netlink_ext_ack *extack) { struct net *net = sock_net(skb->sk); struct nlattr *tca[TCA_MAX + 1]; char name[IFNAMSIZ]; struct tcmsg *t; u32 protocol; u32 prio; bool prio_allocate; u32 parent; u32 chain_index; struct Qdisc *q = NULL;...
cwe
CWE-416
C/C++
search_in_range(regex_t* reg, const UChar* str, const UChar* end, const UChar* start, const UChar* range, /* match start range */ const UChar* data_range, /* subject string range */ OnigRegion* region, OnigOptionType option, OnigMatchParam* mp) { int r; ...
cwe
CWE-125
Unknown
const bootbox = require('bootbox'); require('../services/Requisitions'); require('../services/Synchronize'); /** * @author Alejandro Galue <agalue@opennms.org> * @copyright 2014 The OpenNMS Group, Inc. */ (function() { 'use strict'; const quickAddNodeView = require('../../views/quick-add-node.html'); const c...
cwe
CWE-352
Java
package io.hawt.web.proxy; import java.io.IOException; import java.io.OutputStream; import java.net.ConnectException; import java.net.URI; import java.net.URISyntaxException; import java.net.UnknownHostException; import java.security.KeyManagementException; import java.security.KeyStoreException; import java.security....
cwe
CWE-918
Java
/* 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-415
Python
int yyparse (void *yyscanner, YR_COMPILER* compiler) { /* The lookahead symbol. */ int yychar; /* The semantic value of the lookahead symbol. */ /* Default value used for initialization, for pacifying older GCCs or non-GCC compilers. */ YY_INITIAL_VALUE (static YYSTYPE yyval_default;) YYSTYPE yylval YY_INITIAL_...
cwe
CWE-416
Unknown
pci_lintr_deassert(struct pci_vdev *dev) { assert(dev->lintr.pin > 0); pthread_mutex_lock(&dev->lintr.lock); if (dev->lintr.state == ASSERTED) { dev->lintr.state = IDLE; pci_irq_deassert(dev); } else if (dev->lintr.state == PENDING) dev->lintr.state = IDLE; pthread_mutex_unlock(&dev->lintr.lock); }
cwe
CWE-617
C/C++
public static function scanFile($path){ $file=OC_Filesystem::getLocalFile($path); if(!self::isMusic($path)){ return; } if(!self::$getID3){ self::$getID3=@new getID3(); self::$getID3->encoding='UTF-8'; } $data=@self::$getID3->analyze($file); getid3_lib::CopyTagsToComments($data); if(!isset($data...
cwe
CWE-79
PHP
static js_Ast *shift(js_State *J) { js_Ast *a = additive(J); loop: if (jsP_accept(J, TK_SHL)) { a = EXP2(SHL, a, additive(J)); goto loop; } if (jsP_accept(J, TK_SHR)) { a = EXP2(SHR, a, additive(J)); goto loop; } if (jsP_accept(J, TK_USHR)) { a = EXP2(USHR, a, additive(J)); goto loop; } return a; }
cwe
CWE-674
Unknown
var fillTable = function(chart_data) { var tableRows = [], rowData, rowId; for(i=0; i<chart_data.length; i++) { rowData = chart_data[i]; rowId = typeof rowData.userId != 'undefined' ? rowData.userId : rowData.groupId; ...
cwe
CWE-116
JavaScript
def root(req, res) reset_gems add_date res raise WEBrick::HTTPStatus::NotFound, "`#{req.path}' not found." unless req.path == '/' specs = [] total_file_count = 0 Gem::Specification.each do |spec| total_file_count += spec.files.size deps = spec.dependencies.map { |dep| ...
cwe
CWE-79
Ruby
TfLiteStatus L2Eval(TfLiteContext* context, TfLiteNode* node) { auto* params = reinterpret_cast<TfLitePoolParams*>(node->builtin_data); OpData* data = reinterpret_cast<OpData*>(node->user_data); TfLiteTensor* output = GetOutput(context, node, 0); const TfLiteTensor* input = GetInput(context, node, 0); switch...
cwe
CWE-787
C/C++
import asyncio import contextlib import logging from datetime import datetime, timedelta, timezone from typing import Optional, Tuple, Union import discord from redbot.core import commands, i18n, checks, modlog from redbot.core.commands import UserInputOptional from redbot.core.utils import AsyncIter from redbot.core....
cwe
CWE-863
Python
void SpatialAvgPool(OpKernelContext* context, Tensor* output, const Tensor& input, const PoolParameters& params, const Padding& padding) { typedef Eigen::Map<const Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>> ConstEigenMatrixMap; typedef Eigen::Map<Eigen::Matrix<T,...
cwe
CWE-354
Unknown
static uint32_t select_lease_time(struct dhcp_packet *packet) { uint32_t lease_time_sec = server_config.max_lease_sec; uint8_t *lease_time_opt = udhcp_get_option(packet, DHCP_LEASE_TIME); if (lease_time_opt) { move_from_unaligned32(lease_time_sec, lease_time_opt); lease_time_sec = ntohl(lease_time_sec); if (le...
cwe
CWE-125
Unknown
vcard_apdu_new(unsigned char *raw_apdu, int len, vcard_7816_status_t *status) { VCardAPDU *new_apdu; *status = VCARD7816_STATUS_EXC_ERROR_MEMORY_FAILURE; if (len < 4) { *status = VCARD7816_STATUS_ERROR_WRONG_LENGTH; return NULL; } new_apdu = g_new(VCardAPDU, 1); new_apdu->a_dat...
cwe
CWE-772
Unknown
static MagickBooleanType WriteINLINEImage(const ImageInfo *image_info, Image *image,ExceptionInfo *exception) { char *base64, message[MagickPathExtent]; const MagickInfo *magick_info; Image *write_image; ImageInfo *write_info; MagickBooleanType status; size_t blob_length, ...
cwe
CWE-401
Unknown
request_env(agooReq req, VALUE self) { if (Qnil == (VALUE)req->env) { volatile VALUE env = rb_hash_new(); // As described by // http://www.rubydoc.info/github/rack/rack/master/file/SPEC and // https://github.com/rack/rack/blob/master/SPEC. rb_hash_aset(env, request_method_val, req_method(req)); rb_hash_aset...
cwe
CWE-444
Unknown
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
cwe
CWE-119
C/C++
pub fn dapps_middleware( deps: Dependencies, dapps_path: PathBuf, extra_dapps: Vec<PathBuf>, dapps_domain: String, ) -> Result<Middleware, String> { let signer = deps.signer; let parity_remote = parity_reactor::Remote::new(deps.remote.clone()); let web_proxy_tokens = Arc::new(move |token| signer.is_valid...
cwe
CWE-346
Rust
process_abbrev_set (struct dwarf_section *section, unsigned char *start, unsigned char *end) { abbrev_list *list = xmalloc (sizeof (*list)); list->first_abbrev = NULL; list->last_abbrev = NULL; while (start < end) { unsigned long entry; unsigned long tag; unsigned long attribu...
cwe
CWE-703
Unknown
int oidc_handle_redirect_uri_request(request_rec *r, oidc_cfg *c, oidc_session_t *session) { if (oidc_proto_is_redirect_authorization_response(r, c)) { /* this is an authorization response from the OP using the Basic Client profile or a Hybrid flow*/ return oidc_handle_redirect_authorization_response(r, c, ses...
cwe
CWE-20
C/C++
static bool set_reg_profile(RAnal *anal) { const char *p = \ "=PC pc\n" "=SP sp\n" // this is the "new" ABI, the old was reverse order "=A0 r12\n" "=A1 r13\n" "=A2 r14\n" "=A3 r15\n" "gpr r0 .16 0 0\n" "gpr r1 .16 2 0\n" "gpr r2 .16 4 0\n" "gpr r3 .16 6 0\n" "gpr r4 .16 8 0\n" "gpr ...
cwe
CWE-787
Unknown
// Copyright 2015 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 "extensions/browser/guest_view/extensions_guest_view_message_filter.h" #include "base/guid.h" #include "base/no_destructor.h" #include "base/stl...
cwe
CWE-362
C/C++
Pl_ASCIIHexDecoder::flush() { if (this->pos == 0) { QTC::TC("libtests", "Pl_ASCIIHexDecoder no-op flush"); return; } int b[2]; for (int i = 0; i < 2; ++i) { if (this->inbuf[i] >= 'A') { b[i] = this->inbuf[i] - 'A' + 10; } else { b[i] = this->inbuf[i] - '0'; } } unsigned...
cwe
CWE-787
C/C++
/* * The MIT License * * Copyright (c) 2004-2010, Sun Microsystems, Inc., Kohsuke Kawaguchi, Stephen Connolly, Tom Huybrechts * * 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 ...
cwe
CWE-79
Java
void __sock_recv_timestamp(struct msghdr *msg, struct sock *sk, struct sk_buff *skb) { int need_software_tstamp = sock_flag(sk, SOCK_RCVTSTAMP); struct scm_timestamping tss; int empty = 1; struct skb_shared_hwtstamps *shhwtstamps = skb_hwtstamps(skb); /* Race occurred between timestamp enabling and packet ...
cwe
CWE-125
Unknown
'use strict' const BB = require('bluebird') const stat = BB.promisify(require('graceful-fs').stat) const gentlyRm = BB.promisify(require('../../utils/gently-rm.js')) const correctMkdir = BB.promisify(require('../../utils/correct-mkdir')) const moduleStagingPath = require('../module-staging-path.js') const move = requ...
cwe
CWE-284
JavaScript
/* =========================================================================== Copyright (C) 1999-2005 Id Software, Inc. This file is part of Quake III Arena source code. Quake III Arena source code is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as publish...
cwe
CWE-254
C/C++
# -*- coding: utf-8 -*- # This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web) # Copyright (C) 2018-2019 OzzieIsaacs, cervinko, jkrehm, bodybybuddha, ok11, # andy29485, idalin, Kyosfonica, wuqi, Kennyl, lemmsh, # falgh1, grunjol, csitk...
cwe
CWE-918
Python
int mpol_parse_str(char *str, struct mempolicy **mpol) { struct mempolicy *new = NULL; unsigned short mode_flags; nodemask_t nodes; char *nodelist = strchr(str, ':'); char *flags = strchr(str, '='); int err = 1, mode; if (flags) *flags++ = '\0'; /* terminate mode string */ if (nodelist) { /* NUL-terminate...
cwe
CWE-787
C/C++
static int icccomponents(i_ctx_t * i_ctx_p, ref *space, int *n) { int code = 0; ref *tempref, ICCdict; code = array_get(imemory, space, 1, &ICCdict); if (code < 0) return code; code = dict_find_string(&ICCdict, "N", &tempref); if (code < 0) return code; if (code == 0) ...
cwe
CWE-704
Unknown
static int filter_frame(AVFilterLink *inlink, AVFrame *frame) { AVFilterContext *ctx = inlink->dst; FieldOrderContext *s = ctx->priv; AVFilterLink *outlink = ctx->outputs[0]; int h, plane, line_step, line_size, line; uint8_t *data; if (!frame->interlaced_frame || frame-...
cwe
CWE-119
Unknown
@app.route('/top_proxies') def top_proxies(): con = psycopg2.connect(**config.POSTGRES) cur = con.cursor() query = "SELECT sum(amount) FROM holders" cur.execute(query) total = cur.fetchone() total_votes = total[0] query = "SELECT voting_as FROM holders WHERE voting_as<>'1.2.5' group by vot...
cwe
CWE-89
Python
//////////////////////////////////////////////////////////////////////////////// /// DISCLAIMER /// /// Copyright 2014-2021 ArangoDB GmbH, Cologne, Germany /// Copyright 2004-2014 triAGENS GmbH, Cologne, Germany /// /// Licensed under the Apache License, Version 2.0 (the "License"); /// you may not use this file except...
cwe
CWE-613
C/C++
static MagickBooleanType GetMagickModulePath(const char *filename, MagickModuleType module_type,char *path,ExceptionInfo *exception) { char *module_path; assert(filename != (const char *) NULL); (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",filename); assert(path != (char *) NULL); assert(exc...
cwe
CWE-22
C/C++
protected function getSubtask() { $subtask = $this->subtaskModel->getById($this->request->getIntegerParam('subtask_id')); if (empty($subtask)) { throw new PageNotFoundException(); } return $subtask; }
cwe
CWE-639
PHP
static void pdf_handle_enc(struct pdf_struct *pdf) { struct pdf_obj *obj; uint32_t len, required_flags, n, R, P, length, EM, i, oulen; char *O, *U; const char *q, *q2; if (pdf->enc_objid == ~0u) return; if (!pdf->fileID) { cli_dbgmsg("cli_pdf: pdf_handle_enc no file ID\n"); return; } ...
cwe
CWE-189
Unknown
/************************************************************************ * 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
/* * * 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++
/* * Copyright (C) 2015-present ScyllaDB */ /* * SPDX-License-Identifier: AGPL-3.0-or-later */ #include "server.hh" #include <boost/bimap/unordered_set_of.hpp> #include <boost/range/irange.hpp> #include <boost/bimap.hpp> #include <boost/assign.hpp> #include <boost/range/adaptor/sliced.hpp> #include "cql3/statem...
cwe
CWE-908
C/C++
def get_corosync_nodes() stdout, stderror, retval = run_cmd( PCSAuth.getSuperuserSession, PCS, "status", "nodes", "corosync" ) if retval != 0 return [] end stdout.each {|x| x.strip!} corosync_online = stdout[1].sub(/^.*Online:/,"").strip corosync_offline = stdout[2].sub(/^.*Offline:/,"").strip ...
cwe
CWE-384
Ruby
psutil_proc_connections(PyObject *self, PyObject *args) { long pid; int pidinfo_result; int iterations; int i; unsigned long nb; struct proc_fdinfo *fds_pointer = NULL; struct proc_fdinfo *fdp_pointer; struct socket_fdinfo si; PyObject *py_retlist = PyList_New(0); PyObject *py_...
cwe
CWE-415
Unknown
def update_order Log.add_info(request, params.inspect) mail_account_id = params[:mail_account_id] order_ary = params[:mail_filters_order] @mail_account = MailAccount.find_by_id(mail_account_id) if @mail_account.user_id != @login_user.id render(:text => 'ERROR:' + t('msg.need_to_be_owner')) ...
cwe
CWE-89
Ruby
/* 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-20
Python
const get = async (req, res) => { logger.debug('URL file import handler running', null, req.id) const { debug } = req.companion.options if (!validateURL(req.body.url, debug)) { logger.debug('Invalid request body detected. Exiting url import handler.', null, req.id) res.status(400).json({ error: 'Invalid r...
cwe
CWE-918
JavaScript
seamless_process(STREAM s) { unsigned int pkglen; char *buf; pkglen = s->end - s->p; /* str_handle_lines requires null terminated strings */ buf = xmalloc(pkglen + 1); STRNCPY(buf, (char *) s->p, pkglen + 1); #if 0 printf("seamless recv:\n"); hexdump(s->p, pkglen); #endif str_handle_lines(buf, &seamless_rest...
cwe
CWE-787
Unknown
function XMLRPCremoveUserGroupPriv($name, $affiliation, $nodeid, $permissions){ require_once(".ht-inc/privileges.php"); global $user; if(! checkUserHasPriv("userGrant", $user['id'], $nodeid)){ return array('status' => 'error', 'errorcode' => 53, 'errormsg' => 'Unabl...
cwe
CWE-20
PHP
static HashTable *com_properties_get(zval *object) { /* TODO: use type-info to get all the names and values ? * DANGER: if we do that, there is a strong possibility for * infinite recursion when the hash is displayed via var_dump(). * Perhaps it is best to leave it un-implemented. */ return NULL; }
cwe
CWE-502
Unknown
static Image *ReadMATImage(const ImageInfo *image_info,ExceptionInfo *exception) { Image *image, *image2=NULL, *rotated_image; register Quantum *q; unsigned int status; MATHeader MATLAB_HDR; size_t size; size_t CellType; QuantumInfo *quantum_info; ImageInfo *clone_info; int i; ssize_t ldblk; u...
cwe
CWE-772
C/C++
explicit HashContext(const HashContext* ctx) { assert(ctx->ops); assert(ctx->ops->context_size >= 0); ops = ctx->ops; context = malloc(ops->context_size); ops->hash_copy(context, ctx->context); options = ctx->options; key = ctx->key ? strdup(ctx->key) : nullptr; }
cwe
CWE-200
C/C++
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
cwe
CWE-122
C/C++
@bot.message_handler(commands=['stats']) def stats(message): settings = sqlite3.connect(os.path.abspath(os.path.dirname(__file__)) + "\\bases\\settings.db") conn = settings.cursor() conn.execute("select * from users where chat_id = '" + str(message.chat.id) + "'") name = conn.fetchone() settings.clo...
cwe
CWE-89
Python
static int mov_write_audio_tag(AVFormatContext *s, AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track) { int64_t pos = avio_tell(pb); int version = 0; uint32_t tag = track->tag; if (track->mode == MODE_MOV) { if (track->timescale > UINT16_MAX) { if (mov_get_lpcm_flags(track->par->...
cwe
CWE-369
C/C++
public static synchronized InitialContext getInitialContext(final Hints hints) throws NamingException { return getInitialContext(); }
cwe
CWE-20
Java
/* * VC3/DNxHD decoder. * Copyright (c) 2007 SmartJog S.A., Baptiste Coudurier <baptiste dot coudurier at smartjog dot com> * Copyright (c) 2011 MirriAd Ltd * Copyright (c) 2015 Christophe Gisquet * * 10 bit support added by MirriAd Ltd, Joseph Artsimovich <joseph@mirriad.com> * Slice multithreading and MB inter...
cwe
CWE-252
C/C++
/* asn.c * * Copyright (C) 2006-2021 wolfSSL Inc. * * This file is part of wolfSSL. * * wolfSSL 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) a...
cwe
CWE-345
C/C++
function addStyle(styleInfo) { var stylens = "urn:oasis:names:tc:opendocument:xmlns:style:1.0", newStyleElement; if (styleInfo.family !== 'paragraph') { return; } newStyleElement = editorSession.getParagraphStyleElement(styleInfo.name); ...
cwe
CWE-79
JavaScript
WERROR dns_common_replace(struct ldb_context *samdb, TALLOC_CTX *mem_ctx, struct ldb_dn *dn, bool needs_add, uint32_t serial, struct dnsp_DnssrvRpcRecord *records, uint16_t rec_count) { const struct timeval start = timeval_current(); struct ldb_message_element *el; uint16_t i; int ret;...
cwe
CWE-200
Unknown
umount_one (const char *spec, const char *node, const char *type, const char *opts, struct mntentchn *mc) { int umnt_err = 0; int isroot; int res = 0; int status; int extra_flags = 0; const char *loopdev, *target = node; char *targetbuf = NULL; int myloop = 0; /* Special case for root. As of 0.99pl10 we...
cwe
CWE-399
C/C++
static int __br_mdb_del(struct net_bridge *br, struct br_mdb_entry *entry) { struct net_bridge_mdb_htable *mdb; struct net_bridge_mdb_entry *mp; struct net_bridge_port_group *p; struct net_bridge_port_group __rcu **pp; struct br_ip ip; int err = -EINVAL; if (!netif_running(br->dev) || br->multicast_disabled) ...
cwe
CWE-20
C/C++
/* Copyright 2016 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
cwe
CWE-125
Python
function addButton(data, mimeType, x, y, w, h, img, aspect, title) { // Ignores duplicates try { editorUi.spinner.stop(); if (mimeType == null || mimeType.substring(0, 6) == 'image/') { if ((data == null && img != null) || entries[data] == null) { div.style.backgroundImage = ''; bg...
cwe
CWE-94
JavaScript
/* Unicorn Emulator Engine */ /* By Nguyen Anh Quynh, 2015 */ /* Sample code to demonstrate how to emulate ARM code */ #include <unicorn/unicorn.h> #include <string.h> // code to be emulated #define ARM_CODE "\x37\x00\xa0\xe3\x03\x10\x42\xe0" // mov r0, #0x37; sub r1, r2, r3 #define THUMB_CODE "\x83\xb0" // sub ...
cwe
CWE-787
C/C++
/* ** $Id: lvm.c $ ** Lua virtual machine ** See Copyright Notice in lua.h */ #define lvm_c #define LUA_CORE #include "lprefix.h" #include <float.h> #include <limits.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include "lua.h" #include "ldebug.h" #include "ldo.h" #include "lfunc...
cwe
CWE-787
C/C++
// Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build ignore // mkasm_darwin.go generates assembly trampolines to call libSystem routines from Go. //This program must be run after mksyscall.go. package m...
cwe
CWE-287
Go
void MediaElementAudioSourceHandler::OnCurrentSrcChanged( const KURL& current_src) { DCHECK(IsMainThread()); Locker<MediaElementAudioSourceHandler> locker(*this); passes_current_src_cors_access_check_ = PassesCurrentSrcCORSAccessCheck(current_src); maybe_print_cors_message_ = !passes_current_src_c...
cwe
CWE-20
C/C++
def self.generate_key_pair(key_base_name, recipient, real_name) public_key_file_name = "#{key_base_name}.pub" private_key_file_name = "#{key_base_name}.sec" script = generate_key_script(public_key_file_name, private_key_file_name, recipient, real_name) script_file = Tempfile.new('gpg-script') ...
cwe
CWE-94
Ruby
QPDFWriter::writeObjectStreamOffsets(std::vector<qpdf_offset_t>& offsets, int first_obj) { for (unsigned int i = 0; i < offsets.size(); ++i) { if (i != 0) { writeStringQDF("\n"); writeStringNoQDF(" "); } writeString(QUtil::int_to_string(i + first_obj)); writeString(" "); writeString(QUt...
cwe
CWE-787
Unknown
/* ** vm.c - virtual machine for mruby ** ** See Copyright Notice in mruby.h */ #include <mruby.h> #include <mruby/array.h> #include <mruby/class.h> #include <mruby/hash.h> #include <mruby/irep.h> #include <mruby/numeric.h> #include <mruby/proc.h> #include <mruby/range.h> #include <mruby/string.h> #include <mruby/vari...
cwe
CWE-119
C/C++
def remote_remove_node(params, request, session) if not allowed_for_local_cluster(session, Permissions::FULL) return 403, 'Permission denied' end if params[:remove_nodename] != nil retval, output = remove_node(session, params[:remove_nodename]) else return 400, "No nodename specified" end if re...
cwe
CWE-384
Ruby
static MagickBooleanType WriteIPLImage(const ImageInfo *image_info,Image *image) { ExceptionInfo *exception; IPLInfo ipl_info; MagickBooleanType status; MagickOffsetType scene; register const PixelPacket *p; QuantumInfo *quantum_info; ssize_t y; unsigned char *pixe...
cwe
CWE-284
Unknown
static int sd_compat_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, unsigned long arg) { struct scsi_device *sdev = scsi_disk(bdev->bd_disk)->device; /* * If we are in the middle of error recovery, don't let anyone * else try and use this device. Also, if error recovery fails, it * may...
cwe
CWE-264
Unknown
static Image *ReadPSImage(const ImageInfo *image_info,ExceptionInfo *exception) { #define BoundingBox "BoundingBox:" #define BeginDocument "BeginDocument:" #define BeginXMPPacket "<?xpacket begin=" #define EndXMPPacket "<?xpacket end=" #define ICCProfile "BeginICCProfile:" #define CMYKCustomColor "CMYKCustomColor:...
cwe
CWE-399
C/C++
/* ** vm.c - virtual machine for mruby ** ** See Copyright Notice in mruby.h */ #include <mruby.h> #include <mruby/array.h> #include <mruby/class.h> #include <mruby/hash.h> #include <mruby/irep.h> #include <mruby/numeric.h> #include <mruby/proc.h> #include <mruby/range.h> #include <mruby/string.h> #include <mruby/vari...
cwe
CWE-476
C/C++
SockParse(Sock *sockPtr) { const Tcl_DString *bufPtr; const Driver *drvPtr; Request *reqPtr; char save; SockState result; NS_NONNULL_ASSERT(sockPtr != NULL); drvPtr = sockPtr->drvPtr; NsUpdateProgress((Ns_Sock *) sockPtr); reqPtr = sockPt...
cwe
CWE-787
C/C++
static gboolean cosine_read(wtap *wth, int *err, gchar **err_info, gint64 *data_offset) { gint64 offset; int pkt_len; char line[COSINE_LINE_LENGTH]; /* Find the next packet */ offset = cosine_seek_next_packet(wth, err, err_info, line); if (offset < 0) return FALSE; *data_offset = offset; /* Parse the he...
cwe
CWE-119
C/C++
R_API RBinJavaAttrInfo *r_bin_java_stack_map_table_attr_new(RBinJavaObj *bin, ut8 *buffer, ut64 sz, ut64 buf_offset) { ut32 i = 0; ut64 offset = 0; RBinJavaStackMapFrame *stack_frame = NULL, *new_stack_frame = NULL; if (sz < 10) { return NULL; } RBinJavaAttrInfo *attr = r_bin_java_default_attr_new (bin, buffer,...
cwe
CWE-119
C/C++
static struct l2cap_chan *l2cap_connect(struct l2cap_conn *conn, struct l2cap_cmd_hdr *cmd, u8 *data, u8 rsp_code, u8 amp_id) { struct l2cap_conn_req *req = (struct l2cap_conn_req *) data; struct l2cap_conn_rsp rsp; struct l2cap_chan *chan = NULL, *pchan; int result, status = L2CAP_CS_NO_INFO; u16 dcid ...
cwe
CWE-787
Unknown
static Image *ReadDPXImage(const ImageInfo *image_info,ExceptionInfo *exception) { char magick[4], value[MagickPathExtent]; DPXInfo dpx; Image *image; MagickBooleanType status; MagickOffsetType offset; QuantumInfo *quantum_info; QuantumType quantum_type; register s...
cwe
CWE-834
C/C++
static jpc_enc_rlvl_t *rlvl_create(jpc_enc_rlvl_t *rlvl, jpc_enc_cp_t *cp, jpc_enc_tcmpt_t *tcmpt, jpc_tsfb_band_t *bandinfos) { uint_fast16_t rlvlno; uint_fast32_t tlprctlx; uint_fast32_t tlprctly; uint_fast32_t brprcbrx; uint_fast32_t brprcbry; uint_fast16_t bandno; jpc_enc_band_t *band; /* Deduce the reso...
cwe
CWE-189
Unknown