code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
static int http_receive_data(HTTPContext *c) { HTTPContext *c1; int len, loop_run = 0; while (c->chunked_encoding && !c->chunk_size && c->buffer_end > c->buffer_ptr) { /* read chunk header, if present */ len = recv(c->fd, c->buffer_ptr, 1, 0); if (len < 0) { ...
cwe
CWE-119
C/C++
chunk_new_with_alloc_size(size_t alloc) { chunk_t *ch; ch = tor_malloc(alloc); ch->next = NULL; ch->datalen = 0; #ifdef DEBUG_CHUNK_ALLOC ch->DBG_alloc = alloc; #endif ch->memlen = CHUNK_SIZE_WITH_ALLOC(alloc); total_bytes_allocated_in_chunks += alloc; ch->data = &ch->mem[0]; return ch; }
cwe
CWE-119
C/C++
block_insert( oparg_T *oap, char_u *s, int b_insert, struct block_def *bdp) { int ts_val; int count = 0; // extra spaces to replace a cut TAB int spaces = 0; // non-zero if cutting a TAB colnr_T offset; // pointer along new line colnr_T startcol; // column where insert starts...
cwe
CWE-787
Unknown
R_API RBinJavaAttrInfo *r_bin_java_bootstrap_methods_attr_new(RBinJavaObj *bin, ut8 *buffer, ut64 sz, ut64 buf_offset) { ut32 i = 0; RBinJavaBootStrapMethod *bsm = NULL; ut64 offset = 0; RBinJavaAttrInfo *attr = r_bin_java_default_attr_new (bin, buffer, sz, buf_offset); offset += 6; if (attr) { attr->type = R_B...
cwe
CWE-125
C/C++
RenderWidgetHostView* RenderFrameHostManager::GetRenderWidgetHostView() const { if (interstitial_page_) return interstitial_page_->GetView(); if (render_frame_host_) return render_frame_host_->GetView(); return nullptr; }
cwe
CWE-20
C/C++
static int packet_set_ring(struct sock *sk, union tpacket_req_u *req_u, int closing, int tx_ring) { struct pgv *pg_vec = NULL; struct packet_sock *po = pkt_sk(sk); int was_running, order = 0; struct packet_ring_buffer *rb; struct sk_buff_head *rb_queue; __be16 num; int err = -EINVAL; /* Added to avoid minimal...
cwe
CWE-362
C/C++
static void _ewk_frame_smart_del(Evas_Object* ewkFrame) { EWK_FRAME_SD_GET(ewkFrame, smartData); if (smartData) { if (smartData->frame) { WebCore::FrameLoaderClientEfl* flc = _ewk_frame_loader_efl_get(smartData->frame); flc->setWebFrame(0); smartData->frame->loade...
cwe
CWE-399
C/C++
static void umount_tree(struct mount *mnt, enum umount_tree_flags how) { LIST_HEAD(tmp_list); struct mount *p; if (how & UMOUNT_PROPAGATE) propagate_mount_unlock(mnt); /* Gather the mounts to umount */ for (p = mnt; p; p = next_mnt(p, mnt)) { p->mnt.mnt_flags |= MNT_UMOUNT; list_move(&p->mnt_list, &tmp_lis...
cwe
CWE-703
Unknown
package com.salesmanager.shop.admin.controller.shipping; import java.util.HashMap; import java.util.List; import java.util.Locale; import java.util.Map; import javax.inject.Inject; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.commons.lang3.StringUtils...
cwe
CWE-639
Java
const request = require('request') const purest = require('purest')({ request }) const { promisify } = require('util') const Provider = require('../Provider') const { getURLMeta } = require('../../helpers/request') const logger = require('../../logger') const adapter = require('./adapter') const { ProviderApiError, Pr...
cwe
CWE-863
JavaScript
TfLiteStatus DecodeCenterSizeBoxes(TfLiteContext* context, TfLiteNode* node, OpData* op_data) { // Parse input tensor boxencodings const TfLiteTensor* input_box_encodings = GetInput(context, node, kInputTensorBoxEncodings); TF_LITE_ENSURE_EQ(context, input_box_encodings->d...
cwe
CWE-125
C/C++
def read_lines(filename, selector) if selector IO.foreach(filename).select.with_index(1, &selector) else URI.open(filename, &:read) end end
cwe
CWE-78
Ruby
package com.salesmanager.shop.admin.model.catalog; import com.salesmanager.core.model.catalog.product.image.ProductImage; import com.salesmanager.core.model.catalog.product.manufacturer.ManufacturerDescription; import org.springframework.web.multipart.MultipartFile; import javax.validation.Valid; import javax.validat...
cwe
CWE-639
Java
/* * (c) Copyright Ascensio System SIA 2010-2019 * * This program is a free software product. You can redistribute it and/or * modify it under the terms of the GNU Affero General Public License (AGPL) * version 3 as published by the Free Software Foundation. In accordance with * Section 7(a) of the GNU AGPL its ...
cwe
CWE-787
C/C++
/* * Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy,...
cwe
CWE-287
Java
unsigned Utf8Decoder<kBufferSize>::WriteUtf16(uint16_t* data, unsigned length) const { DCHECK(length > 0); if (length > utf16_length_) length = utf16_length_; // memcpy everything in buffer. unsigned buffer_length = last_byte_of_buffer_unused_ ? kBufferSize - ...
cwe
CWE-119
Unknown
/* * 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-400
Java
function Q(Ca,Qa){Ba.innerHTML="";if(0< Ca.length){var Za=document.createElement("table");Za.setAttribute("cellpadding","2");Za.style.boxSizing="border-box";Za.style.tableLayout="fixed";Za.style.width="100%";var cb=document.createElement("tbody");if(null!=Ca&&0<Ca.length)for(var Ja=0;Ja<Ca.length;Ja++)(function(Ua){var...
cwe
CWE-94
JavaScript
package com.zrlog.web.config; import com.hibegin.common.util.FileUtils; import com.hibegin.common.util.IOUtil; import com.hibegin.common.util.StringUtils; import com.jfinal.config.*; import com.jfinal.core.JFinal; import com.jfinal.kit.PathKit; import com.jfinal.plugin.IPlugin; import com.jfinal.plugin.activerecord.Ac...
cwe
CWE-79
Java
name.encodingLength = function (n) { if (n === '.') return 1 return Buffer.byteLength(n) + 2 }
cwe
CWE-909
JavaScript
int process_open(ProcessHandle process, const char *fname) { int rv = process_open_nofail(process, fname); if (rv < 0) { fprintf(stderr, "Error: cannot open /proc/%d/%s: %s\n", process->pid, fname, strerror(errno)); exit(1); } return rv; }
cwe
CWE-269
Unknown
function merge(dst, ...sources) { for (src of sources) { for (let key in src) { let s = src[key], d = dst[key] if (Object(s) == s && Object(d) === d) { dst[key] = merge(d, s) continue } dst[key] = src[key] } } return dst } module.exports = mer...
cwe
CWE-915
JavaScript
void simplestring_addn(simplestring* target, const char* source, int add_len) { if(target && source) { if(!target->str) { simplestring_init_str(target); } if(target->len + add_len + 1 > target->size) { /* newsize is current length + new length */ int newsize = target->len...
cwe
CWE-119
C/C++
public function updatePreferences(Codendi_Request $request) { $request->valid(new Valid_String('cancel')); if (!$request->exist('cancel')) { $job_id = $request->get($this->widget_id . '_job_id'); $sql = "UPDATE plugin_hudson_widget SET job_id=" . $job_id . " WHERE owner_id = ...
cwe
CWE-89
PHP
static char *make_filename_safe(const char *filename TSRMLS_DC) { if (*filename && strncmp(filename, ":memory:", sizeof(":memory:")-1)) { char *fullpath = expand_filepath(filename, NULL TSRMLS_CC); if (!fullpath) { return NULL; } if (PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_...
cwe
CWE-264
C/C++
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors // MIT License. See license.txt // My HTTP Request frappe.provide('frappe.request'); frappe.provide('frappe.request.error_handlers'); frappe.request.url = '/'; frappe.request.ajax_count = 0; frappe.request.waiting_for_ajax = []; frappe.request.logs...
cwe
CWE-79
Python
public function getRecordTitle($id) { if (isset($this->faqRecord['id']) && ($this->faqRecord['id'] == $id)) { return $this->faqRecord['title']; } $question = ''; $query = sprintf( "SELECT thema AS question FROM %sf...
cwe
CWE-79
PHP
import contextlib import logging import os import pathlib import sys from typing import ( Any, Dict, Generator, Mapping, NoReturn, Optional, Sequence, TextIO, Tuple, ) import click import yaml import vault_cli from vault_cli import client, environment, exceptions, settings, ssh, ty...
cwe
CWE-94
Python
/* 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-787
Python
static Image *ReadOneJNGImage(MngInfo *mng_info, const ImageInfo *image_info, ExceptionInfo *exception) { Image *alpha_image, *color_image, *image, *jng_image; ImageInfo *alpha_image_info, *color_image_info; MagickBooleanType logging; int unique_filenames; ssize_t y...
cwe
CWE-772
C/C++
def loadMyPageData(pageIds: St): Action[U] = GetAction { request => import request.dao QUICK; COULD_OPTIMIZE // don't use String.split('') — it sometimes creates a regex. // Review the whole code base. // Use Guava's Splitter instead. // https://guava.dev/releases/20.0/api/docs/com/google/common/base/Sp...
cwe
CWE-613
Scala
raptor_xml_writer_start_element_common(raptor_xml_writer* xml_writer, raptor_xml_element* element, int auto_empty) { raptor_iostream* iostr = xml_writer->iostr; raptor_namespace_stack *nstack = xml_writer->nstack; int depth = xml_writer...
cwe
CWE-787
C/C++
/* Print instructions for the Texas TMS320C[34]X, for GDB and GNU Binutils. Copyright (C) 2002-2019 Free Software Foundation, Inc. Contributed by Michael P. Hayes (m.hayes@elec.canterbury.ac.nz) This file is part of the GNU opcodes library. This library is free software; you can redistribute it and/or m...
cwe
CWE-908
C/C++
package server import ( "github.com/labstack/echo/v4" "github.com/usememos/memos/api" "github.com/usememos/memos/common" ) type response struct { Data interface{} `json:"data"` } func composeResponse(data interface{}) response { return response{ Data: data, } } func (server *Server) DefaultAuthSkipper(c ech...
cwe
CWE-79
Go
function getCsrfToken() { if (csrf) return csrf if (document.querySelector('[data-csrf]')) { csrf = document.querySelector('[data-csrf]').getAttribute('data-csrf') return csrf } if (window.livewireScriptConfig['csrf'] ?? false) { csrf = window.livewireScriptConfig['csrf'] ...
cwe
CWE-352
JavaScript
/* * NET3 Protocol independent device support routines. * * 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) any later version. * ...
cwe
CWE-400
C/C++
int rds_rdma_extra_size(struct rds_rdma_args *args) { struct rds_iovec vec; struct rds_iovec __user *local_vec; int tot_pages = 0; unsigned int nr_pages; unsigned int i; local_vec = (struct rds_iovec __user *)(unsigned long) args->local_vec_addr; /* figure out the number of pages in the vector */ for (i = 0; ...
cwe
CWE-787
C/C++
'use strict'; var htmlEscape = require('./htmlEscape'); var is = require('is'); var keys = require('object-keys'); // generates a string for common HTML tag attributes var attrs = function attrs(a) { if (typeof a.id === 'boolean') { a.id = a.id ? 'id_' + a.name : null; } if (is.array(a.classes) &&...
cwe
CWE-79
JavaScript
module.exports = async function remote() { const origin = await exec('git remote get-url origin'); const nosuffix = origin.replace(/\.git$/, ''); const [ match ] = nosuffix.match(/[\w-]*\/[\w-]+$/) || [ nosuffix ]; const [ name, owner = '' ] = match.split('/').reverse(); return { name, owner }; };
cwe
CWE-78
JavaScript
*vidtv_s302m_encoder_init(struct vidtv_s302m_encoder_init_args args) { u32 priv_sz = sizeof(struct vidtv_s302m_ctx); struct vidtv_s302m_ctx *ctx; struct vidtv_encoder *e; e = kzalloc(sizeof(*e), GFP_KERNEL); if (!e) return NULL; e->id = S302M; if (args.name) e->name = kstrdup(args.name, GFP_KERNEL); e->...
cwe
CWE-476
C/C++
static long perf_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { struct perf_event *event = file->private_data; void (*func)(struct perf_event *); u32 flags = arg; switch (cmd) { case PERF_EVENT_IOC_ENABLE: func = perf_event_enable; break; case PERF_EVENT_IOC_DISABLE: func = perf_event_disa...
cwe
CWE-264
Unknown
const got = require('@/utils/got'); const cache = require('./cache'); module.exports = async (ctx) => { const category = ctx.params.category; const tabIdMapping = { choiceness: '1_110', overseas: '1_108', orignal: '1_109', ps4: '2_5', xboxone: '2_13', pc: '2_1',...
cwe
CWE-74
JavaScript
/* * * Copyright 2018 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-668
C/C++
public function testPinCommentAction() { $client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN); $this->assertAccessIsGranted($client, '/admin/project/1/details'); $form = $client->getCrawler()->filter('form[name=project_comment_form]')->form(); $client->submit($form, [ ...
cwe
CWE-352
PHP
init_copy(mrb_state *mrb, mrb_value dest, mrb_value obj) { switch (mrb_type(obj)) { case MRB_TT_CLASS: case MRB_TT_MODULE: copy_class(mrb, dest, obj); mrb_iv_copy(mrb, dest, obj); mrb_iv_remove(mrb, dest, mrb_intern_lit(mrb, "__classname__")); break; case MRB_TT_OBJECT: ca...
cwe
CWE-824
C/C++
function preprocessRFC2822(s) { // Remove comments and folding whitespace and replace multiple-spaces with a single space return s .replace(/\([^)]*\)|[\n\t]/g, ' ') .replace(/(\s\s+)/g, ' ') .replace(/^\s\s*/, '') .replace(/\s\s*$/, ''); }
cwe
CWE-400
JavaScript
/* * See the NOTICE file distributed with this work for additional * information regarding copyright ownership. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * th...
cwe
CWE-287
Java
def _call_external_zip(base_dir, zip_filename, verbose=False, dry_run=False): # XXX see if we want to keep an external call here if verbose: zipoptions = "-r" else: zipoptions = "-rq" from distutils.errors import DistutilsExecError from distutils.spawn import spawn try: s...
cwe
CWE-78
Python
package com.dextra.injectit.servlets; import java.io.IOException; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import javax.servlet.ServletException; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; i...
cwe
CWE-89
Java
TIFFRGBAImageBegin(TIFFRGBAImage* img, TIFF* tif, int stop, char emsg[1024]) { uint16* sampleinfo; uint16 extrasamples; uint16 planarconfig; uint16 compress; int colorchannels; uint16 *red_orig, *green_orig, *blue_orig; int n_color; /* Initialize to normal values */ img->row_offset = 0; img->col_offset = 0; ...
cwe
CWE-119
Unknown
/* * Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy,...
cwe
CWE-287
Java
void usb_deregister_dev(struct usb_interface *intf, struct usb_class_driver *class_driver) { if (intf->minor == -1) return; dev_dbg(&intf->dev, "removing %d minor\n", intf->minor); down_write(&minor_rwsem); usb_minors[intf->minor] = NULL; up_write(&minor_rwsem); device_destroy(usb_class->class, MKDEV(USB_...
cwe
CWE-362
Unknown
function dol_sanitizeFileName($str, $newstr = '_', $unaccent = 1) { // List of special chars for filenames in windows are defined on page https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file // Char '>' '<' '|' '$' and ';' are special chars for shells. // Char '/' and '\' are file delimiters. $filesy...
cwe
CWE-88
PHP
int ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b) { int result = -1; if (!a || !b || a->type != b->type) return -1; switch (a->type) { case V_ASN1_OBJECT: result = OBJ_cmp(a->value.object, b->value.object); break; case V_ASN1_BOOLEAN: result = a->value.boole...
cwe
CWE-119
Unknown
QPDFWriter::unparseObject(QPDFObjectHandle object, int level, unsigned int flags, size_t stream_length, bool compress) { QPDFObjGen old_og = object.getObjGen(); unsigned int child_flags = flags & ~f_stream; std::string indent; for (int i = 0; i < level; ++i) { indent...
cwe
CWE-787
Unknown
/* * Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy,...
cwe
CWE-287
Java
// SPDX-License-Identifier: GPL-2.0-or-later /* DVB USB compliant Linux driver for the Afatech 9005 * USB1.1 DVB-T receiver. * * Copyright (C) 2007 Luca Olivetti (luca@ventoso.org) * * Thanks to Afatech who kindly provided information. * * see Documentation/media/dvb-drivers/dvb-usb.rst for more information */ ...
cwe
CWE-400
C/C++
static int tcf_add_notify(struct tc_action *a, u32 pid, u32 seq, int event, u16 flags) { struct tcamsg *t; struct nlmsghdr *nlh; struct sk_buff *skb; struct rtattr *x; unsigned char *b; int err = 0; skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL); if (!skb) return -ENOBUFS; b = (unsig...
cwe
CWE-200
Unknown
def get_tournaments_during_month(db, scene, date): y, m, d = date.split('-') ym_date = '{}-{}'.format(y, m) sql = "select url, date from matches where scene='{}' and date like '%{}%' group by url, date order by date".format(scene, ym_date) res = db.exec(sql) urls = [r[0] for r in res] return url...
cwe
CWE-89
Python
'use strict'; const crypto = require('crypto'); const utils = require("../../utils.js"); const g_constants = require("../../constants.js"); const trade = require("../users/trade.js"); const wallet = require("../users/wallet.js"); const orders = require("../users/orders.js"); const market = require("../users/market.js"...
cwe
CWE-89
JavaScript
static Image *ReadPSDImage(const ImageInfo *image_info, ExceptionInfo *exception) { Image *image; MagickBooleanType has_merged_image, skip_layers, status; MagickOffsetType offset; MagickSizeType length; PSDInfo psd_info; register ssize_t i; ssize_t count; uns...
cwe
CWE-120
C/C++
"""Base Tornado handlers for the notebook server.""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import functools import json import logging import os import re import sys import traceback try: # py3 from http.client import responses except ImportError:...
cwe
CWE-79
Python
def download(self, log_files, sort='time', limit=-1, nfl_filter='', output_format='default'): if len(log_files) == 0: raise NotFoundException(_('no log file found')) try: nfl_esc = nfl_filter.replace('(', '\(').replace(')', '\)') # remove the slash th...
cwe
CWE-377
Python
includeFile(FileInfo *nested, CharsString *includedFile, CharacterClass **characterClasses, TranslationTableCharacterAttributes *characterClassAttribute, short opcodeLengths[], TranslationTableOffset *newRuleOffset, TranslationTableRule **newRule, RuleName **ruleNames, TranslationTableHeader **table) { int k...
cwe
CWE-787
Unknown
parserule(struct scanner *s, struct environment *env) { struct rule *r; char *var; struct evalstring *val; bool hascommand = false, hasrspfile = false, hasrspcontent = false; r = mkrule(scanname(s)); scannewline(s); while (scanindent(s)) { var = scanname(s); parselet(s, &val); ruleaddvar(r, var, val); i...
cwe
CWE-284
C/C++
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ /* * lsquic_engine.c - QUIC engine */ #include <assert.h> #include <errno.h> #include <inttypes.h> #include <limits.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/queue.h> #include <time.h> #ifn...
cwe
CWE-476
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 applica...
cwe
CWE-502
Python
static gboolean udscs_server_accept_cb(GSocketService *service, GSocketConnection *socket_conn, GObject *source_object, gpointer user_data) { struct udscs_server *server = user...
cwe
CWE-770
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-369
Python
void CSecurityTLS::checkSession() { const unsigned allowed_errors = GNUTLS_CERT_INVALID | GNUTLS_CERT_SIGNER_NOT_FOUND | GNUTLS_CERT_SIGNER_NOT_CA; unsigned int status; const gnutls_datum_t *cert_list; unsigned int cert_list_size = 0; int err; gnutls_datum_t info; if (anon) return; if ...
cwe
CWE-295
C/C++
"&from="+q;break}q=z.background;"png"!=g&&"pdf"!=g&&"svg"!=g||!p?p||null!=q&&q!=mxConstants.NONE||(q="#ffffff"):q=mxConstants.NONE;p={globalVars:z.getExportVariables()};A&&(p.grid={size:z.gridSize,steps:z.view.gridSteps,color:z.view.gridColor});Graph.translateDiagram&&(p.diagramLanguage=Graph.diagramLanguage);return ne...
cwe
CWE-20
JavaScript
static int pkey_sm2_decrypt(EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen, const unsigned char *in, size_t inlen) { EC_KEY *ec = ctx->pkey->pkey.ec; SM2_PKEY_CTX *dctx = ctx->data; const EVP_MD *md = (dctx->md == NULL) ? EVP_sm3() : dctx->md; ...
cwe
CWE-120
Unknown
/* * The two pass scaling function is based on: * Filtered Image Rescaling * Based on Gems III * - Schumacher general filtered image rescaling * (pp. 414-424) * by Dale Schumacher * * Additional changes by Ray Gardener, Daylon Graphics Ltd. * December 4, 1999 * * Ported to libgd by Pierre Joye. Support f...
cwe
CWE-399
C/C++
/* * GPAC - Multimedia Framework C SDK * * Authors: Jean Le Feuvre, Romain Bouqueau, Cyril Concolato * Copyright (c) Telecom ParisTech 2000-2021 * All rights reserved * * This file is part of GPAC / Media Tools sub-project * * GPAC is free software; you can redistribute it and/or modify * it unde...
cwe
CWE-415
C/C++
void NavigatorImpl::DiscardPendingEntryIfNeeded(int expected_pending_entry_id) { NavigationEntry* pending_entry = controller_->GetPendingEntry(); bool pending_matches_fail_msg = pending_entry && expected_pending_entry_id == pending_entry->GetUniqueID(); if (!pending_matches_fail_msg) return; bo...
cwe
CWE-20
C/C++
/** * OLAT - Online Learning and Training<br> * http://www.olat.org * <p> * Licensed under the Apache License, Version 2.0 (the "License"); <br> * you may not use this file except in compliance with the License.<br> * You may obtain a copy of the License at * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * Unl...
cwe
CWE-91
Java
static bool imap_parser_read_string(struct imap_parser *parser, const unsigned char *data, size_t data_size) { size_t i; /* read until we've found non-escaped ", CR or LF */ for (i = parser->cur_pos; i < data_size; i++) { if (data[i] == '"') { imap_parser_save_arg(parser, data, i); i++; /* skip the...
cwe
CWE-787
Unknown
public function show_screen_options() { global $wp_meta_boxes; if ( is_bool( $this->_show_screen_options ) ) return $this->_show_screen_options; $columns = get_column_headers( $this ); $show_screen = ! empty( $wp_meta_boxes[ $this->id ] ) || $columns || $this->get_option( 'per_page' ); switch ( $this->...
cwe
CWE-352
PHP
/* imzmq3.c * * This input plugin enables rsyslog to read messages from a ZeroMQ * queue. * * Copyright 2012 Talksum, Inc. * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation, eithe...
cwe
CWE-134
C/C++
var userentitiesTable = $('#userentities-table').DataTable({ 'order': [[1, 'asc']], 'columnDefs': [ { 'orderable': false, 'targets': 0 }, { 'searchable': false, "targets": 0 } ] }); $('#userentities-table tbody').removeClass("d-none"); userentitiesTable.columns.adjust().draw(); $("#search").on("keyup", Delay(f...
cwe
CWE-79
JavaScript
int wolfSSH_SFTP_RecvOpen(WOLFSSH* ssh, int reqId, byte* data, word32 maxSz) #ifndef USE_WINDOWS_API { WS_SFTP_FILEATRB atr; WFD fd; word32 sz; char* dir; word32 reason; word32 idx = 0; int m = 0; int ret = WS_SUCCESS; word32 outSz = sizeof(WFD) + UINT32_SZ + WOLFSSH_SFTP_HEADER...
cwe
CWE-190
Unknown
daemon_msg_findallif_req(uint8 ver, struct daemon_slpars *pars, uint32 plen) { char errbuf[PCAP_ERRBUF_SIZE]; // buffer for network errors char errmsgbuf[PCAP_ERRBUF_SIZE]; // buffer for errors to send to the client char sendbuf[RPCAP_NETBUF_SIZE]; // temporary buffer in which data to be sent is buffered int sendb...
cwe
CWE-20
Unknown
function SessionManager(options, serializeUser) { if (typeof options == 'function') { serializeUser = options; options = undefined; } options = options || {}; this._key = options.key || 'passport'; this._serializeUser = serializeUser; } SessionManager.prototype.logIn = function(req, user, cb) { ...
cwe
CWE-384
JavaScript
/* Apache 2.0 - Copyright 2007-2018 - pancake and dso class.c rewrite: Adam Pridgen <dso@rice.edu || adam.pridgen@thecoverofnight.com> */ #include <stdio.h> #include <string.h> #include <stdlib.h> #include <stdarg.h> #include <unistd.h> #include <r_types.h> #include <r_util.h> #include <r_bin.h> #include <math.h> #...
cwe
CWE-119
C/C++
/* Copyright The Helm 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 in writing, software di...
cwe
CWE-200
Go
/** * OLAT - Online Learning and Training<br> * http://www.olat.org * <p> * Licensed under the Apache License, Version 2.0 (the "License"); <br> * you may not use this file except in compliance with the License.<br> * You may obtain a copy of the License at * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * Unl...
cwe
CWE-22
Java
static int init_nss_hash(struct crypto_instance *instance) { PK11SlotInfo* hash_slot = NULL; SECItem hash_param; if (!hash_to_nss[instance->crypto_hash_type]) { return 0; } hash_param.type = siBuffer; hash_param.data = 0; hash_param.len = 0; hash_slot = PK11_GetBestSlot(hash_to_nss[instance->crypto_h...
cwe
CWE-703
C/C++
ipmi_sdr_print_sensor_mc_locator(struct sdr_record_mc_locator *mc) { char desc[17]; if (!mc) return -1; memset(desc, 0, sizeof (desc)); snprintf(desc, (mc->id_code & 0x1f) + 1, "%s", mc->id_string); if (verbose == 0) { if (csv_output) printf("%s,00h,ok,%d.%d\n", mc->id_code ? desc : "", ...
cwe
CWE-120
Unknown
static cchar *getPakVersion(cchar *name, cchar *version) { MprDirEntry *dp; MprList *files; if (!version || smatch(version, "*")) { name = stok(sclone(name), "#", (char**) &version); if (!version) { files = mprGetPathFiles(mprJoinPath(app->paksCacheDir, name), MPR_PA...
cwe
CWE-476
C/C++
static int f_midi_set_alt(struct usb_function *f, unsigned intf, unsigned alt) { struct f_midi *midi = func_to_midi(f); unsigned i; int err; /* we only set alt for MIDIStreaming interface */ if (intf != midi->ms_id) return 0; err = f_midi_start_ep(midi, f, midi->in_ep); if (err) return err; err = f_midi_...
cwe
CWE-415
Unknown
urlParams.pages||1<U.pages.length||Editor.pagesVisible)?"inline-block":"none"};var S=function(){ra.innerHTML="";if(null!=U.currentPage){mxUtils.write(ra,U.currentPage.getName());var ua=null!=U.pages?U.pages.length:1,ya=U.getPageIndex(U.currentPage);ya=null!=ya?ya+1:1;var Na=U.currentPage.getId();ra.setAttribute("title"...
cwe
CWE-94
JavaScript
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-125
C/C++
evdev_device_get_sysname(struct evdev_device *device) { return udev_device_get_sysname(device->udev_device); }
cwe
CWE-134
Unknown
/** * Copyright (c) 2006-2012, JGraph Ltd */ /** * Constructs a new open dialog. */ var OpenDialog = function() { var iframe = document.createElement('iframe'); iframe.style.backgroundColor = 'transparent'; iframe.allowTransparency = 'true'; iframe.style.borderStyle = 'none'; iframe.style.borderWidth = '0px'; ...
cwe
CWE-79
Java
setkey_principal_2_svc(setkey_arg *arg, struct svc_req *rqstp) { static generic_ret ret; char *prime_arg; gss_buffer_desc client_name, service_name; OM_uint32 minor_stat; kadm5_server_handle_t handle; ...
cwe
CWE-772
C/C++
WebGLRenderingContextBase::~WebGLRenderingContextBase() { destruction_in_progress_ = true; DestroyContext(); RestoreEvictedContext(this); }
cwe
CWE-416
C/C++
/* * Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy,...
cwe
CWE-287
Java
if(p||q){var J=[],V=null,U=null,X=null,t=function(fa){W.setAttribute("disabled","disabled");for(var sa=0;sa<J.length;sa++)J[sa].className=sa==fa?"geBtn gePrimaryBtn":"geBtn"};N=!0;z=document.createElement("div");z.style.whiteSpace="nowrap";z.style.height="30px";G.appendChild(z);C=mxUtils.button(mxResources.get("Templat...
cwe
CWE-94
JavaScript
// Copyright 2017 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 "third_party/blink/renderer/platform/graphics/gpu/image_layer_bridge.h" #include "base/memory/read_only_shared_memory_region.h" #include "cc/lay...
cwe
CWE-668
C/C++
plan_a (char const *filename) { char const *s; char const *lim; char const **ptr; char *buffer; lin iline; size_t size = instat.st_size; /* Fail if the file size doesn't fit in a size_t, or if storage isn't available. */ if (! (size == instat.st_size && (buffer = malloc (size ? size : (size_t) ...
cwe
CWE-59
Unknown