code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
/* ELF program property support. Copyright (C) 2017-2020 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. 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 Softwa...
cwe
CWE-476
C/C++
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ #line 2 "ls-sfparser.c" #line 2 "ls-sfparser.l" /* MIT License Copyright (c) 2020 LiteSpeed Technologies Inc Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "...
cwe
CWE-476
C/C++
/*! * deps/forge.js - Forge Package Customization * * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file. */ "use strict"; var forge = require("node-forge/lib/forge"); require("node-forge/lib/aes"); require("node-forge/lib/asn1"); require("node-forge/lib/cipher"); require("node-forge/lib/hmac"); require("nod...
cwe
CWE-835
JavaScript
TPMA_CC_Unmarshal(TPMA_CC *target, BYTE **buffer, INT32 *size) { TPM_RC rc = TPM_RC_SUCCESS; if (rc == TPM_RC_SUCCESS) { rc = UINT32_Unmarshal((UINT32 *)target, buffer, size); /* libtpms changed */ } if (rc == TPM_RC_SUCCESS) { if (*target & TPMA_CC_reserved) { rc = TPM_RC_RESERVED_BITS; } ...
cwe
CWE-787
Unknown
void SetPreviewDataForIndex(int index, const base::RefCountedBytes* data) { if (index != printing::COMPLETE_PREVIEW_DOCUMENT_INDEX && index < printing::FIRST_PAGE_INDEX) { return; } page_data_map_[index] = const_cast<base::RefCountedBytes*>(data); }
cwe
CWE-200
C/C++
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
cwe
CWE-772
C/C++
'use strict'; const CDP = require('chrome-remote-interface'); class Renderer { _loadPage(client, url, options, config) { /** * Finds any meta tags setting the status code. * @return {?number} status code */ function getStatusCode() { const metaElement = document.querySelector('meta[name...
cwe
CWE-79
JavaScript
PHP_FUNCTION(locale_get_display_region) { get_icu_disp_value_src_php( LOC_REGION_TAG , INTERNAL_FUNCTION_PARAM_PASSTHRU ); }
cwe
CWE-125
C/C++
package server import ( "context" "encoding/json" "errors" "fmt" "io" "io/fs" "io/ioutil" "log" "net/http" "strconv" "strings" charmfs "github.com/charmbracelet/charm/fs" charm "github.com/charmbracelet/charm/proto" "github.com/charmbracelet/charm/server/db" "github.com/charmbracelet/charm/server/stora...
cwe
CWE-918
Go
static sctp_disposition_t sctp_sf_violation_paramlen( const struct sctp_endpoint *ep, const struct sctp_association *asoc, const sctp_subtype_t type, void *arg, sctp_cmd_seq_t *commands) { static const char err_str[] = "The following parameter had invalid length:"; return...
cwe
CWE-20
Unknown
send(data, allDevices) { let coreData = data.data; let expirationTime = data['expiration_time'] || coreData['expiration_time']; let collapseId = data['collapse_id'] || coreData['collapse_id']; let pushType = data['push_type'] || coreData['push_type']; let priority = data['priority'] || coreData['pri...
cwe
CWE-20
JavaScript
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
cwe
CWE-119
C/C++
#include "cache.h" #include "dir.h" #include "iterator.h" #include "dir-iterator.h" struct dir_iterator_level { DIR *dir; /* * The length of the directory part of path at this level * (including a trailing '/'): */ size_t prefix_len; }; /* * The full data structure used to manage the internal directory * ...
cwe
CWE-22
C/C++
def create_workflow Log.add_info(request, params.inspect) @tmpl_folder, @tmpl_workflows_folder = TemplatesHelper.get_tmpl_subfolder(TemplatesHelper::TMPL_WORKFLOWS) @group_id = params[:group_id] if @group_id.nil? or @group_id.empty? @group_id = '0' # '0' for ROOT elsif @group_id == '0' ...
cwe
CWE-89
Ruby
xsltAttrTemplateProcess(xsltTransformContextPtr ctxt, xmlNodePtr target, xmlAttrPtr attr) { const xmlChar *value; xmlAttrPtr ret; if ((ctxt == NULL) || (attr == NULL) || (target == NULL)) return(NULL); if (attr->type != XML_ATTRIBUTE_NODE) return(NULL); /* * Skip all XS...
cwe
CWE-399
C/C++
STATIC ptr_t GC_alloc_large_and_clear(size_t lb, int k, unsigned flags) { ptr_t result; word n_blocks = OBJ_SZ_TO_BLOCKS(lb); GC_ASSERT(I_HOLD_LOCK()); result = GC_alloc_large(lb, k, flags); if (result != NULL && (GC_debugging_started || GC_obj_kinds[k].ok_init)) { /* Clear the wh...
cwe
CWE-119
Unknown
package rpcclient import ( "bytes" "encoding/json" "fmt" "io/ioutil" "net" "net/http" "net/url" "reflect" "strings" "github.com/pkg/errors" amino "github.com/tendermint/go-amino" types "github.com/tendermint/tendermint/rpc/lib/types" ) const ( protoHTTP = "http" protoHTTPS = "https" protoWSS = "ws...
cwe
CWE-400
Go
void native_tss_update_io_bitmap(void) { struct tss_struct *tss = this_cpu_ptr(&cpu_tss_rw); struct thread_struct *t = &current->thread; u16 *base = &tss->x86_tss.io_bitmap_base; if (!test_thread_flag(TIF_IO_BITMAP)) { tss_invalidate_io_bitmap(tss); return; } if (IS_ENABLED(CONFIG_X86_IOPL_IOPERM) && t->iop...
cwe
CWE-276
Unknown
import itertools import random from typing import Union import aiohttp import discord import inflection from redbot.core import Config, checks, commands from redbot.core.i18n import get_locale from redbot.core.utils.chat_formatting import italics from .helpers import * class Act(commands.Cog): """ This cog ...
cwe
CWE-502
Python
void bn_sqr_comba8(BN_ULONG *r, const BN_ULONG *a) { BN_ULONG t1,t2; BN_ULONG c1,c2,c3; c1=0; c2=0; c3=0; sqr_add_c(a,0,c1,c2,c3); r[0]=c1; c1=0; sqr_add_c2(a,1,0,c2,c3,c1); r[1]=c2; c2=0; sqr_add_c(a,1,c3,c1,c2); sqr_add_c2(a,2,0,c3,c1,c2); r[2]=c3; c3=0; sqr_add_c2(a,3,0,c1,c2,c3); sqr_add_c2(a...
cwe
CWE-310
C/C++
/* radare - LGPL - Copyright 2015-2018 - pancake */ #include <stdio.h> #include <string.h> #include <ctype.h> #include <stdlib.h> #include <r_util.h> typedef enum optype_t { ARM_NOTYPE = -1, ARM_GPR = 1, ARM_CONSTANT = 2, ARM_FP = 4, ARM_MEM_OPT = 8 } OpType; typedef enum regtype_t { ARM_UNDEFINED = -1, ARM_R...
cwe
CWE-125
C/C++
PJ_DEF(pj_status_t) pjsip_endpt_send_request_stateless(pjsip_endpoint *endpt, pjsip_tx_data *tdata, void *token, pjsip_send_callback cb) { pjsip_host_info dest_info; pjsip_send_state *stateless_data; pj_status_t status; PJ_ASSERT_RETURN(endpt && tdata, PJ_EINVAL); /* Get dest...
cwe
CWE-295
C/C++
fr_print(netdissect_options *ndo, register const u_char *p, u_int length) { int ret; uint16_t extracted_ethertype; u_int dlci; u_int addr_len; uint16_t nlpid; u_int hdr_len; uint8_t flags[4]; ret = parse_q922_addr(ndo, p, &dlci, &addr_len, flags, length); if (ret == -1) goto trunc; if (ret == 0) {...
cwe
CWE-125
C/C++
// SPDX-FileCopyrightText: 2016-2018 pancake <pancake@nopcode.org> // SPDX-License-Identifier: LGPL-3.0-only #include <rz_io.h> #include <rz_debug.h> static int __io_step(RzDebug *dbg) { free(dbg->iob.system(dbg->iob.io, "ds")); return true; } static int __io_step_over(RzDebug *dbg) { free(dbg->iob.system(dbg->io...
cwe
CWE-787
C/C++
static int fib6_add_rt2node(struct fib6_node *fn, struct rt6_info *rt, struct nl_info *info) { struct rt6_info *iter = NULL; struct rt6_info **ins; int replace = (info->nlh && (info->nlh->nlmsg_flags & NLM_F_REPLACE)); int add = (!info->nlh || (info->nlh->nlmsg_flags & NLM_F_CREATE)); int foun...
cwe
CWE-399
Unknown
int imap_subscribe (char *path, int subscribe) { IMAP_DATA *idata; char buf[LONG_STRING]; char mbox[LONG_STRING]; char errstr[STRING]; BUFFER err, token; IMAP_MBOX mx; if (!mx_is_imap (path) || imap_parse_path (path, &mx) || !mx.mbox) { mutt_error (_("Bad mailbox name")); return -1; } if (!...
cwe
CWE-78
C/C++
gst_riff_create_audio_caps (guint16 codec_id, gst_riff_strh * strh, gst_riff_strf_auds * strf, GstBuffer * strf_data, GstBuffer * strd_data, char **codec_name, gint channel_reorder_map[18]) { gboolean block_align = FALSE, rate_chan = TRUE; GstCaps *caps = NULL; gint i; if (channel_reorder_map) ...
cwe
CWE-369
Unknown
pci_lintr_release(struct pci_vdev *dev) { struct businfo *bi; struct slotinfo *si; int pin; bi = pci_businfo[dev->bus]; assert(bi != NULL); si = &bi->slotinfo[dev->slot]; for (pin = 1; pin < 4; pin++) { si->si_intpins[pin].ii_count = 0; si->si_intpins[pin].ii_pirq_pin = 0; si->si_intpins[pin].ii_ioapic_...
cwe
CWE-617
C/C++
double ConvertAnyFormat(void * ValuePtr, int Format) { double Value; Value = 0; switch(Format){ case FMT_SBYTE: Value = *(signed char *)ValuePtr; break; case FMT_BYTE: Value = *(uchar *)ValuePtr; break; case FMT_USHORT: Value = Get16u(ValuePtr); break; ...
cwe
CWE-703
Unknown
ldap_X509dn2bv( void *x509_name, struct berval *bv, LDAPDN_rewrite_func *func, unsigned flags ) { LDAPDN newDN; LDAPRDN newRDN; LDAPAVA *newAVA, *baseAVA; BerElementBuffer berbuf; BerElement *ber = (BerElement *)&berbuf; char oids[8192], *oidptr = oids, *oidbuf = NULL; void *ptrs[2048]; char *dn_end, *rdn_end;...
cwe
CWE-843
C/C++
package lz4 // #cgo CFLAGS: -O3 // #include "src/lz4.h" // #include "src/lz4.c" import "C" import ( "fmt" "unsafe" ) // p gets a char pointer to the first byte of a []byte slice func p(in []byte) *C.char { if len(in) == 0 { return (*C.char)(unsafe.Pointer(nil)) } return (*C.char)(unsafe.Pointer(&in[0])) } //...
cwe
CWE-787
C/C++
def self.get_using_size(mail_account_id, add_con=nil) SqlHelper.validate_token([mail_account_id]) con = [] con << "(mail_account_id=#{mail_account_id})" con << "(#{add_con})" unless add_con.nil? or add_con.empty? return (Email.count_by_sql("select SUM(size) from emails where #{con.join(' and ')}"...
cwe
CWE-89
Ruby
static int l2tp_ip_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len) { struct inet_sock *inet = inet_sk(sk); struct sockaddr_l2tpip *addr = (struct sockaddr_l2tpip *) uaddr; struct net *net = sock_net(sk); int ret; int chk_addr_ret; if (!sock_flag(sk, SOCK_ZAPPED)) return -EINVAL; if (addr_len <...
cwe
CWE-416
C/C++
static apr_status_t unschedule_slow_tasks(h2_mplx *m) { h2_stream *stream; int n; /* Try to get rid of streams that occupy workers. Look for safe requests * that are repeatable. If none found, fail the connection. */ n = (m->tasks_active - m->limit_active - (int)h2_ihash_count(m->sredo))...
cwe
CWE-770
Unknown
static BT_HDR *create_pbuf(UINT16 len, UINT8 *data) { BT_HDR* p_buf = GKI_getbuf((UINT16) (len + BTA_HH_MIN_OFFSET + sizeof(BT_HDR))); if (p_buf) { UINT8* pbuf_data; p_buf->len = len; p_buf->offset = BTA_HH_MIN_OFFSET; pbuf_data = (UINT8*) (p_buf + 1) + p_buf->offset; ...
cwe
CWE-362
C/C++
jbig2_end_of_stripe(Jbig2Ctx *ctx, Jbig2Segment *segment, const uint8_t *segment_data) { Jbig2Page page = ctx->pages[ctx->current_page]; int end_row; end_row = jbig2_get_int32(segment_data); if (end_row < page.end_row) { jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number, ...
cwe
CWE-119
C/C++
static int unix_dgram_sendmsg(struct kiocb *kiocb, struct socket *sock, struct msghdr *msg, size_t len) { struct sock_iocb *siocb = kiocb_to_siocb(kiocb); struct sock *sk = sock->sk; struct net *net = sock_net(sk); struct unix_sock *u = unix_sk(sk); struct sockaddr_un *sunaddr=msg->msg_name; struct sock ...
cwe
CWE-399
Unknown
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) { auto* params = reinterpret_cast<TfLiteConcatenationParams*>(node->builtin_data); int axis = params->axis; int num_inputs = node->inputs->size; // The number of dimensions of the input tensors must match, and all // dimensions except 'axis...
cwe
CWE-787
C/C++
crypto_bob2( struct exten *ep, /* extension pointer */ struct value *vp /* value pointer */ ) { RSA *rsa; /* GQ parameters */ DSA_SIG *sdsa; /* DSA parameters */ BN_CTX *bctx; /* BIGNUM context */ EVP_MD_CTX ctx; /* signature context */ tstamp_t tstamp; /* NTP timestamp */ BIGNUM *r, *k, *g, *y; u_char *p...
cwe
CWE-20
Unknown
/*! Copyright (c) REBUILD <https://getrebuild.com/> and/or its owners. All rights reserved. rebuild is dual-licensed under commercial and open source licenses (GPLv3). See LICENSE and COMMERCIAL in the project root for license information. */ // 字段类型 // eslint-disable-next-line no-unused-vars const FIELD_TYPES = { ...
cwe
CWE-89
Java
/* * RELIC is an Efficient LIbrary for Cryptography * Copyright (C) 2007-2020 RELIC Authors * * This file is part of RELIC. RELIC is legal property of its developers, * whose names are not listed here. Please refer to the COPYRIGHT file * for contact information. * * RELIC is free software; you can redistribute...
cwe
CWE-120
C/C++
package com.salesmanager.shop.model.catalog.product.product.definition; import com.salesmanager.shop.model.entity.Entity; /** * Applies to product version 2 management * @author carlsamson * */ public class ProductDefinition extends Entity { /** * */ private static final long serialVersionUID = 1L; priva...
cwe
CWE-639
Java
static int pcd_detect(void) { char id[18]; int k, unit; struct pcd_unit *cd; printk("%s: %s version %s, major %d, nice %d\n", name, name, PCD_VERSION, major, nice); par_drv = pi_register_driver(name); if (!par_drv) { pr_err("failed to register %s driver\n", name); return -1; } k = 0; if (pcd_dri...
cwe
CWE-476
C/C++
zfs_fuid_map_id(zfsvfs_t *zfsvfs, uint64_t fuid, cred_t *cr, zfs_fuid_type_t type) { #ifdef HAVE_KSID uint32_t index = FUID_INDEX(fuid); const char *domain; uid_t id; if (index == 0) return (fuid); domain = zfs_fuid_find_by_idx(zfsvfs, index); ASSERT(domain != NULL); if (type == ZFS_OWNER || type == ZFS...
cwe
CWE-863
C/C++
export function isOriginPotentiallyTrustworthy(url) { // 1. If origin is an opaque origin, return "Not Trustworthy". // Not applicable // 2. Assert: origin is a tuple origin. // Not for implementations // 3. If origin's scheme is either "https" or "wss", return "Potentially Trustworthy". if (/^(http|ws)s:$/.tes...
cwe
CWE-1333
JavaScript
function getResourceGroupID($groupdname) { list($type, $name) = explode('/', $groupdname); $query = "SELECT g.id " . "FROM resourcegroup g, " . "resourcetype t " . "WHERE g.name = '$name' AND " . "t.name = '$type' AND " . "g.resourcetypeid = t.id"; $qh = doQue...
cwe
CWE-264
PHP
static parseChunkToInt(intBytes: Buffer, minByteLen: number, maxByteLen: number, raise_on_Null = false) { // # Parse data as unsigned-big-endian encoded integer. // # For empty data different possibilities may occur: // # minByteLen <= 0 : return 0 // # raise_on_Null == False a...
cwe
CWE-20
JavaScript
/** * Jooby https://jooby.io * Apache License Version 2.0 https://jooby.io/LICENSE.txt * Copyright 2014 Edgar Espina */ package io.jooby.internal.netty; import com.typesafe.config.Config; import io.jooby.Body; import io.jooby.ByteRange; import io.jooby.Context; import io.jooby.Cookie; import io.jooby.DefaultContex...
cwe
CWE-74
Java
static int qcow2_open(BlockDriverState *bs, QDict *options, int flags, Error **errp) { BDRVQcowState *s = bs->opaque; unsigned int len, i; int ret = 0; QCowHeader header; QemuOpts *opts; Error *local_err = NULL; uint64_t ext_end; uint64_t l1_vm_state_index; cons...
cwe
CWE-190
Unknown
public function column_title( $post ) { list( $mime ) = explode( '/', $post->post_mime_type ); $title = _draft_or_post_title(); $thumb = wp_get_attachment_image( $post->ID, array( 60, 60 ), true, array( 'alt' => '' ) ); $link_start = $link_end = ''; if ( current_user_can( 'edit_post', $post->ID ) && ! $this...
cwe
CWE-79
PHP
Http::FilterTrailersStatus Context::onResponseTrailers() { if (!wasm_->onResponseTrailers_) { return Http::FilterTrailersStatus::Continue; } if (wasm_->onResponseTrailers_(this, id_).u64_ == 0) { return Http::FilterTrailersStatus::Continue; } return Http::FilterTrailersStatus::StopIteration; }
cwe
CWE-476
C/C++
void *GENERAL_NAME_get0_value(const GENERAL_NAME *a, int *ptype) { if (ptype) *ptype = a->type; switch (a->type) { case GEN_X400: case GEN_EDIPARTY: return a->d.other; case GEN_OTHERNAME: return a->d.otherName; case GEN_EMAIL: case GEN_DNS: case GEN_URI: ...
cwe
CWE-476
Unknown
function addDependency(asset, node, opts = {}) { // Don't bundle node builtins if (asset.options.target === 'node' && node.value in nodeBuiltins) { return; } if (!asset.options.bundleNodeModules) { const isRelativeImport = /^[/~.]/.test(node.value); if (!isRelativeImport) return; } opts.loc = ...
cwe
CWE-200
JavaScript
static void virtio_blk_handle_write(VirtIOBlockReq *req, MultiReqBuffer *mrb) { BlockRequest *blkreq; uint64_t sector; sector = ldq_p(&req->out->sector); trace_virtio_blk_handle_write(req, sector, req->qiov.size / 512); if (sector & req->dev->sector_mask) { virtio_blk_rw_complete(req, -EI...
cwe
CWE-119
Unknown
static void parse_rotation_parameter(Options& o, std::string const& parameter) { std::string angle_str; std::string range; size_t colon = parameter.find(':'); int relative = 0; if (colon != std::string::npos) { if (colon > 0) { angle_str = parameter.substr(0, colon); ...
cwe
CWE-125
Unknown
import os import time import json from secrets import token_bytes, token_hex, randbits from hashlib import sha256 import asyncio import aiosqlite as sql from responses import * class Database: def __init__(self, session): loop = asyncio.get_event_loop() # lock to prevent race conditions when SELECT...
cwe
CWE-287
Python
function VirtualBackground({ _jitsiTrack, _selectedThumbnail, _virtualSource, dispatch, t }: Props) { const [ options, setOptions ] = useState({}); const localImages = jitsiLocalStorage.getItem('virtualBackgrounds'); const [ storedImages, setStoredImages ] = useState((localImages && JSON.parse(localImages))...
cwe
CWE-1321
JavaScript
int main(int argc, char **argv) { int error; my_bool first_argument_uses_wildcards=0; char *wild; MYSQL mysql; MY_INIT(argv[0]); if (load_defaults("my",load_default_groups,&argc,&argv)) exit(1); get_options(&argc,&argv); wild=0; if (argc) { char *pos= argv[argc-1], *to; for (to= pos ; ...
cwe
CWE-319
Unknown
function format(s, style, color, background, _class, data_text, text) { function pre_process_link(data) { var result; if (data.match(email_re)) { result = '<a href="mailto:' + data + '"'; } else { ...
cwe
CWE-79
JavaScript
#coding:utf-8 import os import string import sys import time import re import StringIO import tempfile import threading import traceback import select import pgpdump import base64 import quopri from datetime import datetime from email.parser import Parser from email.message import Message from threading import Thread ...
cwe
CWE-310
Python
static int ossl_new_session_cb(SSL *ssl, SSL_SESSION *ssl_sessionid) { int res = 0; struct connectdata *conn; struct Curl_easy *data; int sockindex; curl_socket_t *sockindex_ptr; int data_idx = ossl_get_ssl_data_index(); int connectdata_idx = ossl_get_ssl_conn_index(); int sockindex_idx = ossl_get_ssl_s...
cwe
CWE-290
Unknown
read_fru_area_section(struct ipmi_intf * intf, struct fru_info *fru, uint8_t id, uint32_t offset, uint32_t length, uint8_t *frubuf) { static uint32_t fru_data_rqst_size = 20; uint32_t off = offset, tmp, finish; struct ipmi_rs * rsp; struct ipmi_rq req; uint8_t msg_data[4]; if (offset > fru->size) { lprintf(...
cwe
CWE-120
C/C++
void KioskNextHomeInterfaceBrokerImpl::GetAppController( mojom::AppControllerRequest request) { app_controller_->BindRequest(std::move(request)); }
cwe
CWE-416
C/C++
func p224AlternativeToBig(in *p224FieldElement) *big.Int { ret := new(big.Int) tmp := new(big.Int) for i := uint(0); i < 8; i++ { tmp.SetInt64(int64(in[i])) tmp.Lsh(tmp, 28*i) ret.Add(ret, tmp) } ret.Mod(ret, p224.P) return ret }
cwe
CWE-682
Go
static bool reconstruct_chained_fixup(struct MACH0_(obj_t) * bin) { if (!bin->dyld_info) { return false; } if (!bin->nsegs) { return false; } bin->nchained_starts = bin->nsegs; bin->chained_starts = RZ_NEWS0(struct rz_dyld_chained_starts_in_segment *, bin->nchained_starts); if (!bin->chained_starts) { retu...
cwe
CWE-787
C/C++
private def urlEncodeCookie(name: String, value: String, maxAgeSecs: Option[Int] = None) = Cookie(
cwe
CWE-613
Scala
parseURL(char *url, ParsedURL *p_url, ParsedURL *current) { char *p, *q, *qq; Str tmp; url = url_quote(url); /* quote 0x01-0x20, 0x7F-0xFF */ p = url; copyParsedURL(p_url, NULL); p_url->scheme = SCM_MISSING; /* RFC1808: Relative Uniform Resource Locators * 4. Resolving Relative URLs...
cwe
CWE-119
C/C++
/* * Dragonfly - Runtime dependency management library * Copyright (c) 2021 Joshua Sing <joshua@hypera.dev> * * 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, in...
cwe
CWE-611
Java
static int send_full_color_rect(VncState *vs, int x, int y, int w, int h) { int stream = 0; ssize_t bytes; #ifdef CONFIG_VNC_PNG if (tight_can_send_png_rect(vs, w, h)) { return send_png_rect(vs, x, y, w, h, NULL); } #endif vnc_write_u8(vs, stream << 4); /* no flushing, no filter */ if...
cwe
CWE-401
Unknown
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
cwe
CWE-190
C/C++
static int read_user_chunk_callback(png_struct *ping, png_unknown_chunkp chunk) { Image *image; /* The unknown chunk structure contains the chunk data: png_byte name[5]; png_byte *data; png_size_t size; Note that libpng has already taken care of the CRC handling. Returns one of the ...
cwe
CWE-787
Unknown
$refClass = new \ReflectionClass($container->getParameterBag()->resolveValue($def->getClass()));
cwe
CWE-89
JavaScript
(function() { Sidebar.prototype.addFluidPowerPalette = function() { var w = 2; var h = 2; var s = mxConstants.STYLE_VERTICAL_LABEL_POSITION + '=bottom;aspect=fixed;html=1;' + mxConstants.STYLE_VERTICAL_ALIGN + '=top;strokeColor=#000000;fillColor=#000000;align=center;outlineConnect=0;shape=mxgraph.fluid_power.';...
cwe
CWE-79
Java
__author__ = "Gina Häußge <osd@foosel.net>" __license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html" __copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License" import logging from flask import ( Blueprint, Response, abort, cur...
cwe
CWE-307
Python
static void destroy_super(struct super_block *s) { int i; list_lru_destroy(&s->s_dentry_lru); list_lru_destroy(&s->s_inode_lru); #ifdef CONFIG_SMP free_percpu(s->s_files); #endif for (i = 0; i < SB_FREEZE_LEVELS; i++) percpu_counter_destroy(&s->s_writers.counter[i]); security_sb_free(s); WARN_ON(!list_em...
cwe
CWE-17
C/C++
static QSvgNode *createPathNode(QSvgNode *parent, const QXmlStreamAttributes &attributes, QSvgHandler *) { QStringView data = attributes.value(QLatin1String("d")); QPainterPath qpath; qpath.setFillRule(Qt::WindingFill); //XXX do error hand...
cwe
CWE-787
C/C++
def sso_login raise Discourse::NotFound unless SiteSetting.enable_discourse_connect raise Discourse::ReadOnly if @readonly_mode && !staff_writes_only_mode? params.require(:sso) params.require(:sig) begin sso = DiscourseConnect.parse(request.query_string, secure_session: secure_session) r...
cwe
CWE-285
Ruby
/** * FreeRDP: A Remote Desktop Protocol Implementation * Serial Port Device Service Virtual Channel * * Copyright 2011 O.S. Systems Software Ltda. * Copyright 2011 Eduardo Fiss Beloni <beloni@ossystems.com.br> * Copyright 2014 Hewlett-Packard Development Company, L.P. * * Licensed under the Apache License, Ver...
cwe
CWE-125
C/C++
formatResult: function (circle) { return circle.name; },
cwe
CWE-79
JavaScript
int PDFiumEngine::GetVisiblePageIndex(FPDF_PAGE page) { for (int page_index : visible_pages_) { if (pages_[page_index]->GetPage() == page) return page_index; } return -1; }
cwe
CWE-20
C/C++
static int do_ip_getsockopt(struct sock *sk, int level, int optname, char __user *optval, int __user *optlen) { struct inet_sock *inet = inet_sk(sk); int val; int len; if (level != SOL_IP) return -EOPNOTSUPP; if (ip_mroute_opt(optname)) return ip_mroute_getsockopt(sk, optname, optval, optlen); if (g...
cwe
CWE-362
Unknown
/* =========================================================================== 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-269
C/C++
$cols .= '\'' . Util::sqlAddSlashes($col_select) . '\','; } $cols = trim($cols, ','); $has_list = PMA_findExistingColNames($db, $cols); foreach ($field_select as $column) { if (!in_array($column, $has_list)) { $colNotExist[] = "'" . $column . "'"; ...
cwe
CWE-89
PHP
(function (tree) { var parseCopyProperties = [ 'paths', // option - unmodified - paths to search for imports on 'optimization', // option - optimization level (for the chunker) 'files', // list of files that have been imported, used for import-once 'content...
cwe
CWE-74
Java
var ColorDialog = function(editorUi, color, apply, cancelFn) { this.editorUi = editorUi; var input = document.createElement('input'); input.style.marginBottom = '10px'; input.style.width = '216px'; // Required for picker to render in IE if (mxClient.IS_IE) { input.style.marginTop = '10px'; document.body....
cwe
CWE-79
JavaScript
dns_resolve(edge_connection_t *exitconn) { or_circuit_t *oncirc = TO_OR_CIRCUIT(exitconn->on_circuit); int is_resolve, r; char *hostname = NULL; is_resolve = exitconn->_base.purpose == EXIT_PURPOSE_RESOLVE; r = dns_resolve_impl(exitconn, is_resolve, oncirc, &hostname); switch (r) { case 1: /* We...
cwe
CWE-399
Unknown
static SharedMemorySupport DoQuerySharedMemorySupport(Display* dpy) { int dummy; Bool pixmaps_supported; if (!XShmQueryVersion(dpy, &dummy, &dummy, &pixmaps_supported)) return SHARED_MEMORY_NONE; #if defined(OS_FREEBSD) int allow_removed; size_t length = sizeof(allow_removed); if ((sysctlbyname("kern....
cwe
CWE-264
C/C++
def remove_constraint_remote(params, request, session) if not allowed_for_local_cluster(session, Permissions::WRITE) return 403, 'Permission denied' end if params[:constraint_id] retval = remove_constraint(session, params[:constraint_id]) if retval == 0 return "Constraint #{params[:constraint_id...
cwe
CWE-384
Ruby
static const char *findvararg (CallInfo *ci, int n, StkId *pos) { if (clLvalue(s2v(ci->func))->p->is_vararg) { int nextra = ci->u.l.nextraargs; if (n <= nextra) { *pos = ci->func - nextra + (n - 1); return "(vararg)"; /* generic name for any vararg */ } } return NULL; /* no such vararg *...
cwe
CWE-191
C/C++
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-346
Python
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { OpData* data = reinterpret_cast<OpData*>(node->user_data); const TfLiteTensor* input1 = GetInput(context, node, kInputTensor1); const TfLiteTensor* input2 = GetInput(context, node, kInputTensor2); TfLiteTensor* output = GetOutput(context, node, kOut...
cwe
CWE-787
C/C++
static inline void ModulateHSL(const double percent_hue, const double percent_saturation,const double percent_lightness,double *red, double *green,double *blue) { double hue, lightness, saturation; /* Increase or decrease color lightness, saturation, or hue. */ ConvertRGBToHSL(*red,*green,*...
cwe
CWE-835
Unknown
static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb) { BUF_MEM *b; unsigned char *p; int i; size_t want = HEADER_SIZE; int eos = 0; size_t off = 0; size_t len = 0; const unsigned char *q; long slen; int inf, tag, xclass; b = BUF_MEM_new(); if (b == NULL) { ASN1er...
cwe
CWE-399
Unknown
pixReadFromTiffStream(TIFF *tif) { char *text; l_uint8 *linebuf, *data, *rowptr; l_uint16 spp, bps, photometry, tiffcomp, orientation, sample_fmt; l_uint16 *redmap, *greenmap, *bluemap; l_int32 d, wpl, bpl, comptype, i, j, k, ncolors, rval, gval, bval, aval; l_int32 xres, yres, tiffbpl, packedbpl, half...
cwe
CWE-125
C/C++
inline TfLiteIntArray* GetOutputShapeFromTensor(TfLiteContext* context, TfLiteNode* node) { const TfLiteTensor* shape = GetInput(context, node, kShapeTensor); TfLiteIntArray* output_shape = TfLiteIntArrayCreate(shape->dims->data[0]); for (int i = 0; i < output_shap...
cwe
CWE-125
Unknown
// SPDX-License-Identifier: GPL-2.0 /* * Shared application/kernel submission and completion ring pairs, for * supporting fast/efficient IO. * * A note on the read/write ordering memory barriers that are matched between * the application and kernel side. * * After the application reads the CQ ring tail, it must ...
cwe
CWE-416
Go
static long __tun_chr_ioctl(struct file *file, unsigned int cmd, unsigned long arg, int ifreq_len) { struct tun_file *tfile = file->private_data; struct tun_struct *tun; void __user* argp = (void __user*)arg; struct sock_fprog fprog; struct ifreq ifr; int sndbuf; int vnet_hdr_sz; int ret; if (cmd == TU...
cwe
CWE-200
C/C++
static inline const unsigned char *ReadResourceShort(const unsigned char *p, unsigned short *quantum) { *quantum=(unsigned short) (*p++ << 8); *quantum|=(unsigned short) (*p++ << 0); return(p); }static inline void WriteResourceLong(unsigned char *p,
cwe
CWE-190
C/C++
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
cwe
CWE-119
C/C++
readScanline(T& in, bool reduceMemory , bool reduceTime) { bool threw = false; try { const Box2i &dw = in.header().dataWindow(); int w = dw.max.x - dw.min.x + 1; int dx = dw.min.x; if (reduceMemory && w > (1 << 10)) { return false; } F...
cwe
CWE-787
Unknown