code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
// mkerrors.sh -m32 // Code generated by the command above; see README.md. DO NOT EDIT. // +build 386,freebsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -m32 _const.go package unix import "syscall" const ( AF_APPLETALK = 0x10 AF_ARP = 0x23 AF_A...
cwe
CWE-287
Go
static void scalar32_min_max_and(struct bpf_reg_state *dst_reg, struct bpf_reg_state *src_reg) { bool src_known = tnum_subreg_is_const(src_reg->var_off); bool dst_known = tnum_subreg_is_const(dst_reg->var_off); struct tnum var32_off = tnum_subreg(dst_reg->var_off); s32 smin_val = src_reg->s32_min_value; u32 u...
cwe
CWE-125
Unknown
import json from tornado import web from ...base.handlers import IPythonHandler, json_errors class NbconvertRootHandler(IPythonHandler): SUPPORTED_METHODS = ('GET',) @web.authenticated @json_errors def get(self): try: from IPython.nbconvert.exporters.export import exporter_map ...
cwe
CWE-79
Python
'use strict'; var is = require('is'); var keys = require('object-keys'); var tag = require('./tag'); var dataRegExp = /^data-[a-z]+([-][a-z]+)*$/; var ariaRegExp = /^aria-[a-z]+$/; var legalAttrs = ['autocomplete', 'autocorrect', 'autofocus', 'autosuggest', 'checked', 'dirname', 'disabled', 'tabindex', 'list', 'max',...
cwe
CWE-79
JavaScript
package server import ( "context" "fmt" "net" "net/http" "net/netip" "reflect" "strconv" "time" "github.com/go-errors/errors" grpc_validator "github.com/grpc-ecosystem/go-grpc-middleware/validator" "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" httpmiddleware "github.com/openfga/openfga/internal/midd...
cwe
CWE-863
Go
gtls_connect_step1(struct Curl_easy *data, struct connectdata *conn, int sockindex) { struct ssl_connect_data *connssl = &conn->ssl[sockindex]; struct ssl_backend_data *backend = connssl->backend; unsigned int init_flags; gnutls_session_t session; int rc; bool sni = TRU...
cwe
CWE-290
Unknown
CURLFORMcode FormAdd(struct curl_httppost **httppost, struct curl_httppost **last_post, va_list params) { FormInfo *first_form, *current_form, *form = NULL; CURLFORMcode return_value = CURL_FORMADD_OK; const char *prevtype = NULL; struct curl_httppost *post = NULL; CU...
cwe
CWE-200
Unknown
IMPEG2D_ERROR_CODES_T impeg2d_vld_decode( dec_state_t *ps_dec, WORD16 *pi2_outAddr, /*!< Address where decoded symbols will be stored */ const UWORD8 *pu1_scan, /*!< Scan table to be used */ UWORD8 *pu1_pos, /*!< Scan table to be used */ UWORD16 u2_intra_flag, /*!< Intra Macroblock or not */...
cwe
CWE-200
Unknown
gst_matroska_demux_parse_stream (GstMatroskaDemux * demux, GstEbmlRead * ebml, GstMatroskaTrackContext ** dest_context) { GstMatroskaTrackContext *context; GstCaps *caps = NULL; GstTagList *cached_taglist; GstFlowReturn ret; guint32 id, riff_fourcc = 0; guint16 riff_audio_fmt = 0; gchar *codec = NULL;...
cwe
CWE-787
C/C++
def get(self, key): """ Gets the object specified by key. It will also unpickle the object before returning if it is pickled in memcache. :param key: key :returns: value of the key in memcache """ key = md5hash(key) value = None for (server, fp, ...
cwe
CWE-502
Python
lasso_saml20_login_process_response_status_and_assertion(LassoLogin *login) { LassoSamlp2StatusResponse *response; LassoSamlp2Response *samlp2_response = NULL; LassoProfile *profile; char *status_value; lasso_error_t rc = 0; lasso_error_t assertion_signature_status = 0; LassoProfileSignatureVerifyHint verify_hin...
cwe
CWE-347
Unknown
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) { TF_LITE_ENSURE_EQ(context, NumInputs(node), 2); TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1); // Reinterprete the opaque data provided by user. OpData* data = reinterpret_cast<OpData*>(node->user_data); const TfLiteTensor* input1 = GetInput...
cwe
CWE-787
C/C++
logW(`weakSessionId missing [TyE0WKSID]: ${JSON.stringify(eventData)}`); if (isUndef) { debugger; } } else { // This re-inserts our session (3548236), if we just sent a 'resumeWeakSession' // message to the iframe and then removed it from theStorage —...
cwe
CWE-613
Scala
void BinaryProtocolReader::readStringBody(StrType& str, int32_t size) { checkStringSize(size); // Catch empty string case if (size == 0) { str.clear(); return; } if (static_cast<int32_t>(in_.length()) < size) { str.reserve(size); // only reserve for multi iter case below } str.clear(); siz...
cwe
CWE-703
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( fil...
cwe
CWE-269
C/C++
void Compute(OpKernelContext* ctx) override { const Tensor& sorted_inputs_t = ctx->input(0); const Tensor& values_t = ctx->input(1); // must have same batch dim_size for both OP_REQUIRES(ctx, sorted_inputs_t.dim_size(0) == values_t.dim_size(0), Status(error::INVALID_ARGUMENT, ...
cwe
CWE-369
Unknown
mpls_print(netdissect_options *ndo, const u_char *bp, u_int length) { const u_char *p; uint32_t label_entry; uint16_t label_stack_depth = 0; enum mpls_packet_type pt = PT_UNKNOWN; p = bp; ND_PRINT((ndo, "MPLS")); do { ND_TCHECK2(*p, sizeof(label_entry)); if (length < sizeof(label_entry)) { ND_PRINT((ndo,...
cwe
CWE-787
Unknown
def markPageAsSeen(pageId: PageId): Action[JsValue] = PostJsonAction(NoRateLimits, maxBytes = 2) { request => val watchbar = request.dao.getOrCreateWatchbar(request.theUserId) val newWatchbar = watchbar.markPageAsSeen(pageId) request.dao.saveWatchbar(request.theUserId, newWatchbar) Ok } pr...
cwe
CWE-613
Scala
static void ath10k_usb_free_urb_to_pipe(struct ath10k_usb_pipe *pipe, struct ath10k_urb_context *urb_context) { unsigned long flags; spin_lock_irqsave(&pipe->ar_usb->cs_lock, flags); pipe->urb_cnt++; list_add(&urb_context->link, &pipe->urb_list_head); spin_unlock_irqrestore(&pipe->ar_usb->cs_lock, flags); ...
cwe
CWE-476
Unknown
import ExcelTemplateAdapter from '~/components/import/templateParsers/ExcelTemplateAdapter' export default class ExcelUrlTemplateAdapter extends ExcelTemplateAdapter { constructor(url, $store, parserConfig, $api) { const name = url.split('/').pop() super(name, null, parserConfig) this.url = url this....
cwe
CWE-400
JavaScript
redirect: `${url}/error?${new URLSearchParams({ error: error as string, })}`, } } try { const redirect = await emailSignin(email, options) return { redirect } } catch (error) { logger.error("SIGNIN_EMAIL_ERROR", { error: error as Error, providerId: ...
cwe
CWE-20
JavaScript
createBoard({ commit }, boardData) { apiClient.createBoard(boardData) .then((board) => { commit('addBoard', board) }) }
cwe
CWE-400
JavaScript
/* 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
Python
"default")},ma.addListener("stateChanged",ca),H.addListener("enabledChanged",ca),ca());return oa}function G(ca,ba,ja){ja=document.createElement("div");ja.className="geMenuItem";ja.style.display="inline-block";ja.style.verticalAlign="top";ja.style.marginRight="6px";ja.style.padding="0 4px 0 4px";ja.style.height="30px";j...
cwe
CWE-20
JavaScript
parsegid(const char *s, gid_t *gid) { struct group *gr; const char *errstr; if ((gr = getgrnam(s)) != NULL) { *gid = gr->gr_gid; return 0; } #if !defined(__linux__) && !defined(__NetBSD__) *gid = strtonum(s, 0, GID_MAX, &errstr); #else sscanf(s, "%d", gid); #endif if (errstr) return -1; return 0; }
cwe
CWE-754
C/C++
function scheduleLivePoll() { let ti = parseInt(localStorage.sidekiqTimeInterval) || 5000; livePollTimer = setTimeout(livePollCallback, ti); }
cwe
CWE-345
JavaScript
base::string16 GetAppForProtocolUsingAssocQuery(const GURL& url) { base::string16 url_scheme = base::ASCIIToUTF16(url.scheme()); if (url_scheme.empty()) return base::string16(); wchar_t out_buffer[1024]; DWORD buffer_size = arraysize(out_buffer); HRESULT hr = AssocQueryString(ASSOCF_IS_PROTOCOL, ...
cwe
CWE-20
C/C++
/* ** $Id: lparser.c $ ** Lua Parser ** See Copyright Notice in lua.h */ #define lparser_c #define LUA_CORE #include "lprefix.h" #include <limits.h> #include <string.h> #include "lua.h" #include "lcode.h" #include "ldebug.h" #include "ldo.h" #include "lfunc.h" #include "llex.h" #include "lmem.h" #include "lobject...
cwe
CWE-125
C/C++
#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-287
Python
static int collect_syscall(struct task_struct *target, struct syscall_info *info) { struct pt_regs *regs; if (!try_get_task_stack(target)) { /* Task has no stack, so the task isn't in a syscall. */ memset(info, 0, sizeof(*info)); info->data.nr = -1; return 0; } regs = task_pt_regs(target); if (unlikely(!...
cwe
CWE-681
C/C++
static int server_process_entry( Server *s, const void *buffer, size_t *remaining, ClientContext *context, const struct ucred *ucred, const struct timeval *tv, const char *label, size_t label_len) { /* Process a sin...
cwe
CWE-770
C/C++
packet_setsockopt(struct socket *sock, int level, int optname, char __user *optval, unsigned int optlen) { struct sock *sk = sock->sk; struct packet_sock *po = pkt_sk(sk); int ret; if (level != SOL_PACKET) return -ENOPROTOOPT; switch (optname) { case PACKET_ADD_MEMBERSHIP: case PACKET_DROP_MEMBERSHIP: { s...
cwe
CWE-119
Unknown
delete_sig_subpkt (subpktarea_t *area, sigsubpkttype_t reqtype ) { int buflen; sigsubpkttype_t type; byte *buffer, *bufstart; size_t n; size_t unused = 0; int okay = 0; if( !area ) return 0; buflen = area->len; buffer = area->data; for(;;) { if( !buflen ) { okay = ...
cwe
CWE-20
Unknown
@tornado.web.asynchronous def connect(self): """Gets called when a connect request is received. * The host and port are obtained from the request uri * A socket is created, wrapped in ssl and then added to SSLIOStream * This stream is used to connect to speak to the remote host on g...
cwe
CWE-327
Python
ImagingNew(const char* mode, int xsize, int ysize) { int bytes; Imaging im; if (strlen(mode) == 1) { if (mode[0] == 'F' || mode[0] == 'I') bytes = 4; else bytes = 1; } else bytes = strlen(mode); /* close enough */ if ((int64_t) xsize * (int64_t) ysiz...
cwe
CWE-284
C/C++
def remove_constraint_rule_remote(params, request, session) if not allowed_for_local_cluster(session, Permissions::WRITE) return 403, 'Permission denied' end if params[:rule_id] retval = remove_constraint_rule(session, params[:rule_id]) if retval == 0 return "Constraint rule #{params[:rule_id]} ...
cwe
CWE-384
Ruby
public String findFilter( String url_suffix ) { if( url_suffix == null ) { throw new IllegalArgumentException( "The url_suffix must not be null." ); } CaptureType type = em.find( CaptureType.class, url_suffix ); if( type != null ) { ...
cwe
CWE-754
Java
pci_lintr_request(struct pci_vdev *dev) { struct businfo *bi; struct slotinfo *si; int bestpin, bestcount, pin; bi = pci_businfo[dev->bus]; assert(bi != NULL); /* * Just allocate a pin from our slot. The pin will be * assigned IRQs later when interrupts are routed. */ si = &bi->slotinfo[dev->slot]; bes...
cwe
CWE-617
C/C++
static inline signed short ReadProfileShort(const EndianType endian, unsigned char *buffer) { union { unsigned int unsigned_value; signed int signed_value; } quantum; unsigned short value; if (endian == LSBEndian) { value=(unsigned short) ((buffer[1] << 8) | buffer[0]); ...
cwe
CWE-190
C/C++
void SparseFillEmptyRowsOpImpl(OpKernelContext* context, AsyncOpKernel::DoneCallback done = nullptr) { // Note that setting this empty lambda as the default parameter value directly // can cause strange compiler/linker errors, so we do it like this instead. if (!done) { done = [...
cwe
CWE-125
Unknown
/* * jdapistd.c * * This file was part of the Independent JPEG Group's software: * Copyright (C) 1994-1996, Thomas G. Lane. * libjpeg-turbo Modifications: * Copyright (C) 2010, 2015-2018, D. R. Commander. * Copyright (C) 2015, Google, Inc. * For conditions of distribution and use, see the accompanying README.ij...
cwe
CWE-476
C/C++
static int h264_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; H264Context *h = avctx->priv_data; AVFrame *pict = data; int buf_index = 0; int ret; ...
cwe
CWE-787
Unknown
f-10+"px")};Toolbar.prototype.setFontName=function(a){if(null!=this.fontMenu){this.fontMenu.innerHTML="";var b=document.createElement("div");b.style.display="inline-block";b.style.overflow="hidden";b.style.textOverflow="ellipsis";b.style.maxWidth="66px";mxUtils.write(b,a);this.fontMenu.appendChild(b);this.appendDropDow...
cwe
CWE-94
JavaScript
static void simple_decode_row(x3f_info_t *I, x3f_directory_entry_t *DE, int bits, int row, int row_stride) { x3f_directory_entry_header_t *DEH = &DE->header; x3f_image_data_t *ID = &DEH->data_subsection.image_data; x3f_huffman_t *HUF = ID->huffman; uint32_t *data = (uint32_t *)((u...
cwe
CWE-125
Unknown
virtual void ComputeWithReservedSpace(OpKernelContext* context, bool use_reserved_space) { Tensor x = context->input(0); const Tensor& scale = context->input(1); const Tensor& offset = context->input(2); const Tensor& estimated_mean = context->input(3); const ...
cwe
CWE-703
Unknown
grantpt (int fd) { int retval = -1; #ifdef PATH_MAX char _buf[PATH_MAX]; #else char _buf[512]; #endif char *buf = _buf; struct stat64 st; if (__builtin_expect (pts_name (fd, &buf, sizeof (_buf), &st), 0)) { int save_errno = errno; /* Check, if the file descriptor is valid. pts_name return...
cwe
CWE-284
Unknown
int_ossl_asn1_decode0_cons(unsigned char **pp, long max_len, long length, long *offset, int depth, int yield, int j, int tag, VALUE tc, long *num_read) { VALUE value, asn1data, ary; int infinite; long off = *offset; infinite = (j == 0x21); ary = rb_ary_new(); while (length > 0 || i...
cwe
CWE-119
Unknown
static Image *ReadFITSImage(const ImageInfo *image_info, ExceptionInfo *exception) { typedef struct _FITSInfo { MagickBooleanType extend, simple; int bits_per_pixel, columns, rows, number_axes, number_planes; double min_data, max_data, zero...
cwe
CWE-120
C/C++
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % M M AAA TTTTT L AAA BBBB ...
cwe
CWE-772
C/C++
void Compute(OpKernelContext* context) override { // There are two steps when calculating gradient for FractionalMaxPool. // 1) Walk through the process of calculating fractional pooling given // pooling region; however, in the process, keep track of where the max // element comes from. (arg_max) ...
cwe
CWE-703
Unknown
'use strict' // npm install <pkg> <pkg> <pkg> // // See doc/cli/npm-install.md for more description // // Managing contexts... // there's a lot of state associated with an "install" operation, including // packages that are already installed, parent packages, current shrinkwrap, and // so on. We maintain this state in ...
cwe
CWE-284
JavaScript
/* ============================================================================== This file is part of the JUCE library. Copyright (c) 2020 - Raw Material Software Limited JUCE is an open source library subject to commercial or open-source licensing. The code included in this file is provided under ...
cwe
CWE-59
C/C++
long keyctl_read_key(key_serial_t keyid, char __user *buffer, size_t buflen) { struct key *key; key_ref_t key_ref; long ret; /* find the key first */ key_ref = lookup_user_key(keyid, 0, 0); if (IS_ERR(key_ref)) { ret = -ENOKEY; goto error; } key = key_ref_to_ptr(key_ref); if (test_bit(KEY_FLAG_NEGATIVE,...
cwe
CWE-20
C/C++
nfs_printfh(netdissect_options *ndo, register const uint32_t *dp, const u_int len) { my_fsid fsid; uint32_t ino; const char *sfsname = NULL; char *spacep; if (ndo->ndo_uflag) { u_int i; char const *sep = ""; ND_PRINT((ndo, " fh[")); for (i=0; i<len; i++) { ND_PRINT((ndo, "%s%x", sep, dp[i]...
cwe
CWE-125
C/C++
autoar_extractor_step_extract (AutoarExtractor *self) { /* Step 3: Extract files * We have to re-open the archive to extract files */ struct archive *a; struct archive_entry *entry; int r; g_debug ("autoar_extractor_step_extract: called"); r = libarchive_create_read_object (self->use_raw_format, s...
cwe
CWE-59
Unknown
struct request *blk_mq_tag_to_rq(struct blk_mq_tags *tags, unsigned int tag) { struct request *rq = tags->rqs[tag]; /* mq_ctx of flush rq is always cloned from the corresponding req */ struct blk_flush_queue *fq = blk_get_flush_queue(rq->q, rq->mq_ctx); if (!is_flush_request(rq, fq, tag)) return rq; return fq-...
cwe
CWE-362
Unknown
package fleet const ( // ActionRead refers to reading an entity. ActionRead = "read" // ActionList refers to listing an entity. ActionList = "list" // ActionWrite refers to writing (CRUD operations) an entity. ActionWrite = "write" // ActionWriteRole is a write to a user's global roles and teams. ActionWriteRo...
cwe
CWE-863
Go
MagickBooleanType sixel_decode(unsigned char /* in */ *p, /* sixel bytes */ unsigned char /* out */ **pixels, /* decoded pixels */ size_t /* out */ *pwidth, /* image width */ ...
cwe
CWE-119
Unknown
void writeStats(Array& /*ret*/) override { fprintf(stderr, "writeStats start\n"); // RetSame: the return value is the same instance every time // HasThis: call has a this argument // AllSame: all returns were the same data even though args are different // MemberCount: number of different arg sets (...
cwe
CWE-122
C/C++
def GetActionAllowAnyone(f: GetRequest => Result): Action[Unit] = PlainApiAction(cc.parsers.empty, NoRateLimits, allowAnyone = true)(f)
cwe
CWE-613
Scala
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { const TfLiteTensor* params; TF_LITE_ENSURE_OK(context, GetInputSafe(context, node, kParams, &params)); const TfLiteTensor* indices; TF_LITE_ENSURE_OK(context, GetInputSafe(context, node, kIndices, &indices)); TfLiteTensor* output; TF_LITE_ENSURE_...
cwe
CWE-369
Unknown
m,q)}),aa,mxResources.get("changeUser"),mxUtils.bind(this,function(){function Y(){ea.innerHTML="";for(var ka=0;ka<pa.length;ka++){var ja=document.createElement("option");mxUtils.write(ja,pa[ka].displayName);ja.value=ka;ea.appendChild(ja);ja=document.createElement("option");ja.innerHTML="&nbsp;&nbsp;&nbsp;";mxUtils.writ...
cwe
CWE-94
JavaScript
package com.salesmanager.shop.admin.model.permission; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonPrope...
cwe
CWE-639
Java
/* * Copyright (C) 2016 Southern Storm Software, Pty Ltd. * * 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-119
Java
static int print_media_desc(const pjmedia_sdp_media *m, char *buf, pj_size_t len) { char *p = buf; char *end = buf+len; unsigned i; int printed; /* check length for the "m=" line. */ if (len < (pj_size_t)m->desc.media.slen+m->desc.transport.slen+12+24) { return -1; } *p++ = 'm'; /*...
cwe
CWE-120
C/C++
function populateStyles() { var i, selectionList, availableStyles; // Populate the Default Style always selectionList = [{ label: runtime.tr("Default Style"), value: defaultStyleUIId }]; availableStyles = editorSession ? edito...
cwe
CWE-79
JavaScript
snmp_mib_find_next(uint32_t *oid) { snmp_mib_resource_t *resource; resource = NULL; for(resource = list_head(snmp_mib); resource; resource = resource->next) { if(snmp_oid_cmp_oid(resource->oid, oid) > 0) { return resource; } } return NULL; }
cwe
CWE-125
C/C++
/* 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-125
C/C++
export function logoutClientSideOnly(ps: { goTo?: St, skipSend?: Bo } = {}) { Server.deleteTempSessId(); ReactDispatcher.handleViewAction({ actionType: actionTypes.Logout }); if (eds.isInEmbeddedCommentsIframe && !ps.skipSend) { // Tell the editor iframe that we've logged out. // And maybe we'll r...
cwe
CWE-613
Scala
merge_selfsigs_subkey (KBNODE keyblock, KBNODE subnode) { PKT_public_key *mainpk = NULL, *subpk = NULL; PKT_signature *sig; KBNODE k; u32 mainkid[2]; u32 sigdate = 0; KBNODE signode; u32 curtime = make_timestamp (); unsigned int key_usage = 0; u32 keytimestamp = 0; u32 key_expire = 0; const byte *...
cwe
CWE-20
Unknown
package io.onedev.server.web.component.markdown; import java.io.IOException; import java.net.URLDecoder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import javax.inject.Singleton; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServ...
cwe
CWE-74
Java
# Copyright (c) 2022 PaddlePaddle 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 applic...
cwe
CWE-94
Python
// // PDF file functions for PDFio. // // Copyright © 2021-2022 by Michael R Sweet. // // Licensed under Apache License v2.0. See the file "LICENSE" for more // information. // // // Include necessary headers... // #include "pdfio-private.h" #ifndef O_BINARY # define O_BINARY 0 #endif // !O_BINARY // // Local fun...
cwe
CWE-835
C/C++
static void cliRefreshPrompt(void) { int len; if (config.eval_ldb) return; if (config.hostsocket != NULL) len = snprintf(config.prompt,sizeof(config.prompt),"redis %s", config.hostsocket); else len = anetFormatAddr(config.prompt, sizeof(config.prompt), ...
cwe
CWE-119
Unknown
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
cwe
CWE-787
C/C++
public function html() { global $wp_locale; $wp_version = get_bloginfo( 'version' ); // Get data, new (POST) and old (GET). $data = $this->merge_or_fetch_data(); $post_title = $this->get_suggested_title( $data ); $post_content = $this->get_suggested_content( $data ); // Get site settings array/data. ...
cwe
CWE-200
PHP
/** * 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 m...
cwe
CWE-89
Java
/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* kdc/do_as_req.c */ /* * Portions Copyright (C) 2007 Apple Inc. * Copyright 1990, 1991, 2007, 2008, 2009, 2013, 2014 by the * Massachusetts Institute of Technology. All Rights Reserved. * * Export of this software from the United States of America ...
cwe
CWE-20
C/C++
int read_password(unsigned char* buffer, encryptmode_t mode) { #ifndef WIN32 #define PASS_EOF EOF struct termios t; /* Used to set ECHO attribute */ int echo_enabled; /* Was echo enabled? */ int tty; /* File descriptor for tty */ FILE* ftty;...
cwe
CWE-120
C/C++
import { FlowRouter } from 'meteor/ostrio:flow-router-extra' import dayjs from 'dayjs' import utc from 'dayjs/plugin/utc' import Bootstrap from 'bootstrap' import { i18nReady, t } from '../../utils/i18n.js' import './projectTasks.html' import Tasks from '../../api/tasks/tasks' import './taskModal.js' import { addTool...
cwe
CWE-285
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
OMX_BUFFERHEADERTYPE *OMXNodeInstance::findBufferHeader(OMX::buffer_id buffer) { if (buffer == 0) { return NULL; } Mutex::Autolock autoLock(mBufferIDLock); ssize_t index = mBufferIDToBufferHeader.indexOfKey(buffer); if (index < 0) { CLOGW("findBufferHeader: buffer %u not found", buffer);...
cwe
CWE-119
C/C++
sds _sdsnewlen(const void *init, size_t initlen, int trymalloc) { void *sh; sds s; char type = sdsReqType(initlen); /* Empty strings are usually created in order to append. Use type 8 * since type 5 is not good at this. */ if (type == SDS_TYPE_5 && initlen == 0) type = SDS_TYPE_8; int hdrle...
cwe
CWE-190
Unknown
static int snd_pcm_control_ioctl(struct snd_card *card, struct snd_ctl_file *control, unsigned int cmd, unsigned long arg) { switch (cmd) { case SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE: { int device; if (get_user(device, (int __user *)arg)) return -EFAULT; mutex_lock(&register_mutex); device = sn...
cwe
CWE-416
C/C++
_bdf_parse_glyphs( char* line, unsigned long linelen, unsigned long lineno, void* call_data, void* client_data ) { int c, mask_index; char* s; unsigned char* bp;...
cwe
CWE-119
Unknown
func (d *partialArray) add(key string, val *lazyNode) error { if key == "-" { *d = append(*d, val) return nil } idx, err := strconv.Atoi(key) if err != nil { return err } ary := make([]*lazyNode, len(*d)+1) cur := *d if idx < 0 { idx *= -1 if idx > len(ary) { return fmt.Errorf("Unable to acces...
cwe
CWE-787
Go
flatpak_pull_from_bundle (OstreeRepo *repo, GFile *file, const char *remote, const char *ref, gboolean require_gpg_signature, GCancellable *cancellable, ...
cwe
CWE-276
C/C++
static RzList *strings(RzBinFile *bf) { if (!bf) { return NULL; } LuacBinInfo *bin_info_obj = GET_INTERNAL_BIN_INFO_OBJ(bf); if (!bin_info_obj) { return NULL; } return bin_info_obj->string_list; }
cwe
CWE-200
Unknown
void *create_directory_config(apr_pool_t *mp, char *path) { directory_config *dcfg = (directory_config *)apr_pcalloc(mp, sizeof(directory_config)); if (dcfg == NULL) return NULL; #ifdef DEBUG_CONF ap_log_perror(APLOG_MARK, APLOG_STARTUP|APLOG_NOERRNO, 0, mp, "Created directory config %pp path %s", dcfg...
cwe
CWE-20
Unknown
/* * 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. */ #include "hermes/VM/JSObject.h" #include "hermes/VM/BuildMetadata.h" #include "hermes/VM/Callable.h" #include "hermes/VM/HostModel...
cwe
CWE-125
C/C++
@Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setHeader("Cache-Control", "no-cache"); response.setHeader("Pragma", "no-cache"); response.setDateHeader("Expires", -1); String name = request.getParameter("name");...
cwe
CWE-79
Java
function simpleContent(a,d,e){var b=document.getElementsByTagName("body")[0],e=e||findNWC(b,compId),h,c,k,g;if(e){if(e.style.position!="absolute"&&e.style.position!="relative")e.style.position="relative"}else e=b;for(var m=0;m<a.length;m++){b=a[m];b.type=="image"?(h=document.createElement("img"),h.src=b.fill[1]):h=docu...
cwe
CWE-79
JavaScript
/* * @copyright 2016- commenthol * @license MIT */ 'use strict' // dependencies var util = require('./internal/utils') var Ref = require('./internal/reference') /** * serializes an object to javascript * * @example <caption>serializing regex, date, buffer, ...</caption> * var serialize = require('serialize-to...
cwe
CWE-79
JavaScript
void TLSOutStream::flush() { U8* sentUpTo = start; while (sentUpTo < ptr) { int n = writeTLS(sentUpTo, ptr - sentUpTo); sentUpTo += n; offset += n; } ptr = start; out->flush(); }
cwe
CWE-787
C/C++
static void exif_iif_add_value(image_info_type *image_info, int section_index, char *name, int tag, int format, int length, void* value, int motorola_intel) { size_t idex; void *vptr; image_info_value *info_value; image_info_data *info_data; image_info_data *list; if (length < 0) { return; } list = safe_e...
cwe
CWE-125
C/C++
void ipv4_pktinfo_prepare(const struct sock *sk, struct sk_buff *skb) { struct in_pktinfo *pktinfo = PKTINFO_SKB_CB(skb); bool prepare = (inet_sk(sk)->cmsg_flags & IP_CMSG_PKTINFO) || ipv6_sk_rxinfo(sk); if (prepare && skb_rtable(skb)) { /* skb->cb is overloaded: prior to this point it is IP{6}CB * wh...
cwe
CWE-284
Unknown
jbig2_image_resize(Jbig2Ctx *ctx, Jbig2Image *image, int width, int height) { if (width == image->width) { /* check for integer multiplication overflow */ int64_t check = ((int64_t) image->stride) * ((int64_t) height); if (check != (int)check) { jbig2_error(ctx, JBIG2_SEVERIT...
cwe
CWE-190
C/C++
_gnutls_x509_verify_certificate (const gnutls_x509_crt_t * certificate_list, int clist_size, const gnutls_x509_crt_t * trusted_cas, int tcas_size, const gnutls_x509_crl_t * CRLs, int crls_size, unsigned int flags) { int i = 0, ret; unsigned int status = 0, output; if (clist_size > 1) ...
cwe
CWE-264
C/C++
rsa_oaep_sha256_decrypt(const struct rsa_private_key *key, size_t label_length, const uint8_t *label, size_t *length, uint8_t *message, const mpz_t gibberish) { mpz_t m; int res; struct sha256_ctx ctx; mpz_init(m); rsa_compute_root(key, m, gibberish); res = pkcs1_oaep_decrypt (key->size, m,...
cwe
CWE-703
Unknown
nv_brackets(cmdarg_T *cap) { pos_T prev_pos; pos_T *pos = NULL; // init for GCC pos_T old_pos; // cursor position before command int flag; long n; cap->oap->motion_type = MCHAR; cap->oap->inclusive = FALSE; old_pos = curwin->w_cursor; curwin->w_cursor.coladd = 0; // TODO...
cwe
CWE-416
C/C++