code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
/* * 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-476
C/C++
WM_SYMBOL midi *WildMidi_OpenBuffer(uint8_t *midibuffer, uint32_t size) { uint8_t mus_hdr[] = { 'M', 'U', 'S', 0x1A }; uint8_t xmi_hdr[] = { 'F', 'O', 'R', 'M' }; midi * ret = NULL; if (!WM_Initialized) { _WM_GLOBAL_ERROR(__FUNCTION__, __LINE__, WM_ERR_NOT_INIT, NULL, 0); return (NULL);...
cwe
CWE-119
C/C++
/* Unix SMB/Netbios implementation. Version 1.9. SMB parameters and setup Copyright (C) Andrew Tridgell 1992-2000 Copyright (C) Luke Kenneth Casson Leighton 1996-2000 Modified by Jeremy Allison 1995. Copyright (C) Andrew Bartlett <abartlet@samba.org> 2002-2003 Modified by Steve French (sfrench@u...
cwe
CWE-119
C/C++
static inline void openOptimized(sqlite3*& db) { sqlite3_open(":memory:", &db); std::string settings; for (const auto& setting : kMemoryDBSettings) { settings += "PRAGMA " + setting.first + "=" + setting.second + "; "; } sqlite3_exec(db, settings.c_str(), nullptr, nullptr, nullptr); // Register functi...
cwe
CWE-77
Unknown
void Logger::addMessage(const QString &message, const Log::MsgType &type) { QWriteLocker locker(&lock); Log::Msg temp = { msgCounter++, QDateTime::currentMSecsSinceEpoch(), type, message }; m_messages.push_back(temp); if (m_messages.size() >= MAX_LOG_MESSAGES) m_messages.pop_front(); emit...
cwe
CWE-79
Unknown
exif_mnote_data_olympus_load (ExifMnoteData *en, const unsigned char *buf, unsigned int buf_size) { ExifMnoteDataOlympus *n = (ExifMnoteDataOlympus *) en; ExifShort c; size_t i, tcount, o, o2, datao = 6, base = 0; if (!n || !buf || !buf_size) { exif_log (en->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifMn...
cwe
CWE-416
Unknown
import base64 import json from io import BytesIO from gettext import gettext as _ import requests from lxml import etree from cookbook.helper.ingredient_parser import IngredientParser from cookbook.helper.recipe_url_import import parse_servings, parse_time, parse_servings_text from cookbook.integration.integration i...
cwe
CWE-918
Python
static VALUE cState_space_before_set(VALUE self, VALUE space_before) { unsigned long len; GET_STATE(self); Check_Type(space_before, T_STRING); len = RSTRING_LEN(space_before); if (len == 0) { if (state->space_before) { ruby_xfree(state->space_before); state->space_bef...
cwe
CWE-787
Unknown
cleanup_pathname(struct archive_write_disk *a) { char *dest, *src; char separator = '\0'; dest = src = a->name; if (*src == '\0') { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Invalid empty pathname"); return (ARCHIVE_FAILED); } #if defined(__CYGWIN__) cleanup_pathname_win(a); #endif /* Skip ...
cwe
CWE-20
Unknown
static int fsl_lpspi_probe(struct platform_device *pdev) { struct device_node *np = pdev->dev.of_node; struct fsl_lpspi_data *fsl_lpspi; struct spi_controller *controller; struct spi_imx_master *lpspi_platform_info = dev_get_platdata(&pdev->dev); struct resource *res; int i, ret, irq; u32 temp; bool is_slave;...
cwe
CWE-401
C/C++
def _remove_javascript_link(self, link): # links like "j a v a s c r i p t:" might be interpreted in IE new = _substitute_whitespace('', link) if _is_javascript_scheme(new): # FIXME: should this be None to delete? return '' return link
cwe
CWE-79
Python
WRITE_JSON_ELEMENT(ObjStart) { /* increase depth, save: before first key-value no comma needed. */ ctx->depth++; ctx->commaNeeded[ctx->depth] = false; return writeChar(ctx, '{'); }
cwe
CWE-787
Unknown
null!=sa[ra]&&(ra=sa[ra]);ra={url:pa.getAttribute("url"),libs:pa.getAttribute("libs"),title:pa.getAttribute("title"),tooltip:pa.getAttribute("name")||pa.getAttribute("url"),preview:pa.getAttribute("preview"),clibs:ra,tags:pa.getAttribute("tags")};wa.push(ra);null!=ya&&(wa=Ba[va],null==wa&&(wa={},Ba[va]=wa),va=wa[ya],nu...
cwe
CWE-20
JavaScript
void preproc_mount_mnt_dir(void) { // mount tmpfs on top of /run/firejail/mnt if (!tmpfs_mounted) { if (arg_debug) printf("Mounting tmpfs on %s directory\n", RUN_MNT_DIR); if (mount("tmpfs", RUN_MNT_DIR, "tmpfs", MS_NOSUID | MS_STRICTATIME, "mode=755,gid=0") < 0) errExit("mounting /run/firejail/mnt"); tm...
cwe
CWE-284
Unknown
package proxyutil import ( "context" "errors" "log" "net/http" "net/http/httputil" "strings" "time" glog "github.com/grafana/grafana/pkg/infra/log" ) // StatusClientClosedRequest A non-standard status code introduced by nginx // for the case when a client closes the connection while nginx is processing // th...
cwe
CWE-200
Go
def _startSSL_pyOpenSSL(self): log.debug("_startSSL_pyOpenSSL called") tcpsock = self._owner # NonBlockingHTTPBOSH instance has no attribute _owner if hasattr(tcpsock, '_owner') and tcpsock._owner._caller.client_cert \ and os.path.exists(tcpsock._owner._caller.client_cert): ...
cwe
CWE-327
Python
sg_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos) { int mxsize, cmd_size, k; int input_size, blocking; unsigned char opcode; Sg_device *sdp; Sg_fd *sfp; Sg_request *srp; struct sg_header old_hdr; sg_io_hdr_t *hp; unsigned char cmnd[SG_MAX_CDB_SIZE]; if ((!(sfp = (Sg_fd *) f...
cwe
CWE-416
C/C++
def get_crm_mon_dom(session) begin stdout, _, retval = run_cmd( session, CRM_MON, '--one-shot', '-r', '--as-xml' ) if retval == 0 return REXML::Document.new(stdout.join("\n")) end rescue $logger.error 'Failed to parse crm_mon.' end return nil end
cwe
CWE-384
Ruby
const bootbox = require('bootbox'); const Requisition = require('../model/Requisition'); require('../services/Requisitions'); require('../services/Synchronize'); /** * @author Alejandro Galue <agalue@opennms.org> * @copyright 2014 The OpenNMS Group, Inc. */ (function() { 'use strict'; angular.module('onms-req...
cwe
CWE-79
Java
/* * 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-863
Java
int main(int argc, const char *argv[]) { struct group *grent; const char *cmd; const char *path; int i; struct passwd *pw; grent = getgrnam(ABUILD_GROUP); if (grent == NULL) errx(1, "%s: Group not found", ABUILD_GROUP); char *name = NULL; pw = getpwuid(getuid()); if (pw) name = pw->pw_name; if (!is_in...
cwe
CWE-668
C/C++
$pfTaskJob->update($input); $tasks_id = $data['plugin_glpiinventory_tasks_id']; } } else { // case 2: if not exist, create a new task + taskjob $this->getFromDB($packages_id); //Add the new task $input = [ 'name' ...
cwe
CWE-89
PHP
xmlParseElementContentDecl(xmlParserCtxtPtr ctxt, const xmlChar *name, xmlElementContentPtr *result) { xmlElementContentPtr tree = NULL; int inputid = ctxt->input->id; int res; *result = NULL; if (RAW != '(') { xmlFatalErrMsgStr(ctxt, XML_ERR_ELEMCONTENT_NOT_STARTED, ...
cwe
CWE-119
C/C++
# This file is part of Shuup. # # Copyright (c) 2012-2021, Shuup Commerce Inc. All rights reserved. # # This source code is licensed under the OSL-3.0 license found in the # LICENSE file in the root directory of this source tree. from __future__ import unicode_literals from collections import OrderedDict from django.c...
cwe
CWE-79
Python
static int date_from_ISO8601 (const char *text, time_t * value) { struct tm tm; int n; int i; char buf[30]; if (strchr (text, '-')) { char *p = (char *) text, *p2 = buf; while (p && *p) { if (*p != '-') { *p2 = *p; p2++; if (p2-buf >= sizeof(buf)) { return -1; } } p++; ...
cwe
CWE-119
C/C++
int main(int argc, char *argv[]) { struct MHD_Daemon *d; int port, opti, optc, cmdok, ret, slog_interval; char *log_file, *slog_file; program_name = argv[0]; setlocale(LC_ALL, ""); #if ENABLE_NLS bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); #endif server_data.www_dir = NULL; #ifdef HAVE_GTOP se...
cwe
CWE-22
C/C++
static inline void native_set_ldt(const void *addr, unsigned int entries) { if (likely(entries == 0)) asm volatile("lldt %w0"::"q" (0)); else { unsigned cpu = smp_processor_id(); ldt_desc ldt; set_tssldt_descriptor(&ldt, (unsigned long)addr, DESC_LDT, entries * sizeof(ldt) - 1); write_gdt_entry(g...
cwe
CWE-119
Unknown
TfLiteStatus StoreAllDecodedSequences( TfLiteContext* context, const std::vector<std::vector<std::vector<int>>>& sequences, TfLiteNode* node, int top_paths) { const int32_t batch_size = sequences.size(); std::vector<int32_t> num_entries(top_paths, 0); // Calculate num_entries per path for (const au...
cwe
CWE-787
C/C++
void jslTokenAsString(int token, char *str, size_t len) { if (token>32 && token<128) { assert(len>=4); str[0] = '\''; str[1] = (char)token; str[2] = '\''; str[3] = 0; return; } switch (token) { case LEX_EOF : strncpy(str, "EOF", len); return; case LEX_ID : strncpy(str, "ID", len); ret...
cwe
CWE-119
C/C++
PJ_DEF(pj_status_t) pjmedia_rtcp_fb_build_rpsi( pjmedia_rtcp_session *session, void *buf, pj_size_t *length, const pjmedia_rtcp_fb_rpsi *rpsi) { pjmedia_rtcp_common *hdr; pj_uint8_t *p; unsigned bitlen, padlen, len; PJ_ASSERT_RETURN(session && buf && length && rpsi,...
cwe
CWE-125
C/C++
static Token *tokenize(char *line) { char c, *p = line; enum pp_token_type type; Token *list = NULL; Token *t, **tail = &list; while (*line) { p = line; if (*p == '%') { p++; if (*p == '+' && !nasm_isdigit(p[1])) { p++; type = ...
cwe
CWE-125
C/C++
static pyc_object *get_complex_object(RzBinPycObj *pyc, RzBuffer *buffer) { pyc_object *ret = NULL; bool error = false; ut32 size = 0; ut32 n1 = 0; ut32 n2 = 0; ret = RZ_NEW0(pyc_object); if (!ret) { return NULL; } if ((pyc->magic_int & 0xffff) <= 62061) { n1 = get_ut8(buffer, &error); } else { n1 = g...
cwe
CWE-787
C/C++
static size_t php_bz2iop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) { struct php_bz2_stream_data_t *self = (struct php_bz2_stream_data_t *) stream->abstract; size_t ret; ret = BZ2_bzread(self->bz_file, buf, count); if (ret == 0) { stream->eof = 1; } return ret; }
cwe
CWE-787
C/C++
SYSCALL_DEFINE6(sendto, int, fd, void __user *, buff, size_t, len, unsigned int, flags, struct sockaddr __user *, addr, int, addr_len) { struct socket *sock; struct sockaddr_storage address; int err; struct msghdr msg; struct iovec iov; int fput_needed; if (len > INT_MAX) len = INT_MAX; sock = sockfd...
cwe
CWE-264
C/C++
PJ_DEF(pj_status_t) pjmedia_rtcp_fb_parse_sli( const void *buf, pj_size_t length, unsigned *sli_cnt, pjmedia_rtcp_fb_sli sli[]) { pjmedia_rtcp_common *hdr = (pjmedia_rtcp_common*) buf; pj_uint8_t *p; unsigned cnt, i; PJ_ASSERT_RETURN(buf && sli_cnt && sli, PJ_EINVAL); PJ_ASSERT_...
cwe
CWE-787
C/C++
private static function thumb($source_path, $thumb_path){ ini_set('memory_limit', '128M'); $source_details = getimagesize($source_path); $source_w = $source_details[0]; $source_h = $source_details[1]; if($source_w > $source_h){ $new_w = self::THUMB_W; $new_h = intval($source_h * $new_w / $source_w); ...
cwe
CWE-252
PHP
/* * Load_stp.cpp * ------------ * Purpose: STP (Soundtracker Pro II) module loader * Notes : A few exotic effects aren't supported. * Multiple sample loops are supported, but only the first 10 can be used as cue points * (with 16xx and 18xx). * Fractional speed values and combined au...
cwe
CWE-125
C/C++
private function getSwimlane() { $swimlane = $this->swimlaneModel->getById($this->request->getIntegerParam('swimlane_id')); if (empty($swimlane)) { throw new PageNotFoundException(); } return $swimlane; }
cwe
CWE-639
PHP
pipe_fopen(gx_io_device * iodev, const char *fname, const char *access, gp_file ** pfile, char *rfname, uint rnamelen, gs_memory_t *mem) { #ifdef GS_NO_FILESYSTEM return 0; #else gs_lib_ctx_t *ctx = mem->gs_lib_ctx; gs_fs_list_t *fs = ctx->core->fs; if (gp_validate_path(mem, fname, access) !...
cwe
CWE-20
Unknown
TfLiteStatus UseDynamicOutputTensors(TfLiteContext* context, TfLiteNode* node) { for (int i = 0; i < NumOutputs(node); ++i) { SetTensorToDynamic(GetOutput(context, node, i)); } return kTfLiteOk; }
cwe
CWE-787
C/C++
/* * Copyright (c) Christos Zoulas 2003. * All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice immediately at th...
cwe
CWE-125
C/C++
ins_compl_next( int allow_get_expansion, int count, // repeat completion this many times; should // be at least 1 int insert_match, // Insert the newly selected match int in_compl_func) // called from complete_check() { int num_matches = -1; int todo = count; int...
cwe
CWE-416
Unknown
/* * Copyright (C) 2006 The Android Open Source Project * * 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 app...
cwe
CWE-269
Java
static cmark_node *try_opening_table_row(cmark_syntax_extension *self, cmark_parser *parser, cmark_node *parent_container, unsigned char *input, int len) { cmark_node *table_row_block; table_ro...
cwe
CWE-190
Unknown
function showAndHideMessage (message) { try { var newMessage = (!message) ? GrunionFB_i18n.savedMessage : message; jQuery('#fb-success').html(newMessage); jQuery('#fb-success').slideDown('fast'); setTimeout(function () { jQuery('#fb-success').slideUp('fast'); }, 2500); } catch(e) { if (debug)...
cwe
CWE-79
JavaScript
/* * Copyright (c) 1997-2008 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of ...
cwe
CWE-295
C/C++
static void btif_dm_upstreams_evt(UINT16 event, char* p_param) { tBTA_DM_SEC *p_data = (tBTA_DM_SEC*)p_param; tBTA_SERVICE_MASK service_mask; uint32_t i; bt_bdaddr_t bd_addr; BTIF_TRACE_EVENT("btif_dm_upstreams_cback ev: %s", dump_dm_event(event)); switch (event) { case BTA_DM_ENABLE_EVT: { ...
cwe
CWE-284
C/C++
const _ = require('lodash'); const path = require('path'); const fs = require('fs'); const Promise = require('bluebird'); module.exports = { options: { alias: 'attachment' }, cascades: [ 'imageSizes' ], imageSizes: { add: { max: { width: 1600, height: 1600 }, full: { ...
cwe
CWE-79
JavaScript
// SPDX-License-Identifier: GPL-2.0 /* * linux/fs/pipe.c * * Copyright (C) 1991, 1992, 1999 Linus Torvalds */ #include <linux/mm.h> #include <linux/file.h> #include <linux/poll.h> #include <linux/slab.h> #include <linux/module.h> #include <linux/init.h> #include <linux/fs.h> #include <linux/log2.h> #include <li...
cwe
CWE-667
Java
__global__ void UnsortedSegmentCustomKernel(const Index input_outer_dim_size, const Index inner_dim_size, const Index output_outer_dim_size, const Index* segment_ids, ...
cwe
CWE-122
C/C++
/****************************************************************************** * * Copyright(c) 2003 - 2011 Intel Corporation. All rights reserved. * * Portions of this file are derived from the ipw3945 project, as well * as portions of the ieee80211 subsystem header files. * * This program is free software; yo...
cwe
CWE-119
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 Br(e){return B.List.isList(e)?e:I()(e)?Object(B.fromJS)(e):Object(B.List)()}
cwe
CWE-451
JavaScript
Error ImageLoaderTGA::decode_tga_rle(const uint8_t *p_compressed_buffer, size_t p_pixel_size, uint8_t *p_uncompressed_buffer, size_t p_output_size) { Error error; Vector<uint8_t> pixels; error = pixels.resize(p_pixel_size); if (error != OK) { return error; } uint8_t *pixels_w = pixels.ptrw(); size_t compres...
cwe
CWE-20
Unknown
parse_charstrings( T1_Face face, T1_Loader loader ) { T1_Parser parser = &loader->parser; PS_Table code_table = &loader->charstrings; PS_Table name_table = &loader->glyph_names; PS_Table swap_table = &loader->swap_table; FT_Memory me...
cwe
CWE-119
C/C++
void rose_start_heartbeat(struct sock *sk) { del_timer(&sk->sk_timer); sk->sk_timer.function = rose_heartbeat_expiry; sk->sk_timer.expires = jiffies + 5 * HZ; add_timer(&sk->sk_timer); }
cwe
CWE-416
Unknown
def add_meta_attr_remote(params, request, session) if not allowed_for_local_cluster(session, Permissions::WRITE) return 403, 'Permission denied' end retval = add_meta_attr( session, params["res_id"], params["key"],params["value"] ) if retval == 0 return [200, "Successfully added meta attribute"] ...
cwe
CWE-384
Ruby
public Optional<URL> getResource(String path) { boolean isDirectory = isDirectory(path); if (!isDirectory) { URL url = classLoader.getResource(prefixPath(path)); return Optional.ofNullable(url); } return Optional.empty(); }
cwe
CWE-22
Java
static void dbEvalSetColumnJSON(DbEvalContext *p, int iCol, Jsi_DString *dStr) { Jsi_Interp *interp = p->jdb->interp; char nbuf[200]; sqlite3_stmt *pStmt = p->pPreStmt->pStmt; switch( sqlite3_column_type(pStmt, iCol) ) { case SQLITE_BLOB: { int bytes = sqlite3_column_bytes(pStmt, iCol); ...
cwe
CWE-120
C/C++
function show_interface_modal(modal_content) { var modal_window = $('#interfaceModal'); var interface_id = modal_content.data('interface-id'); modal_window.data('current-id', interface_id); var identifier = modal_content.find('.interface_identifier').val(); modal_window.find('.modal-body').html(''); mod...
cwe
CWE-79
JavaScript
int tls1_mac(SSL *ssl, unsigned char *md, int send) { SSL3_RECORD *rec; unsigned char *seq; EVP_MD_CTX *hash; size_t md_size; int i; EVP_MD_CTX hmac, *mac_ctx; unsigned char buf[5]; int stream_mac = (send?(ssl->mac_flags & SSL_MAC_FLAG_WRITE_MAC_STREAM):(ssl->mac_flags&SSL_MAC_FLAG_READ_MAC_STREAM)); int t; ...
cwe
CWE-310
Unknown
void AuthenticationFeature::collectOptions(std::shared_ptr<ProgramOptions> options) { options->addOldOption("server.disable-authentication", "server.authentication"); options->addOldOption("server.disable-authentication-unix-sockets", "server.authentication-unix-socke...
cwe
CWE-613
C/C++
sg_start_req(Sg_request *srp, unsigned char *cmd) { int res; struct request *rq; Sg_fd *sfp = srp->parentfp; sg_io_hdr_t *hp = &srp->header; int dxfer_len = (int) hp->dxfer_len; int dxfer_dir = hp->dxfer_direction; unsigned int iov_count = hp->iovec_count; Sg_scatter_hold *req_schp = &srp->data; Sg_scatter_hol...
cwe
CWE-190
C/C++
static Image *ReadSVGImage(const ImageInfo *image_info,ExceptionInfo *exception) { char filename[MaxTextExtent]; FILE *file; Image *image, *next; int status, unique_file; ssize_t n; SVGInfo *svg_info; unsigned char message[MaxTextExtent]; xmlSAXHandler sax_...
cwe
CWE-674
C/C++
static UINT rdpei_recv_pdu(RDPEI_CHANNEL_CALLBACK* callback, wStream* s) { UINT16 eventId; UINT32 pduLength; UINT error; Stream_Read_UINT16(s, eventId); /* eventId (2 bytes) */ Stream_Read_UINT32(s, pduLength); /* pduLength (4 bytes) */ #ifdef WITH_DEBUG_RDPEI WLog_DBG(TAG, "rdpei_recv_pdu: eventId: %" PRIu16 "...
cwe
CWE-125
Unknown
/** * Copyright (c) 2006-2012, JGraph Ltd */ /** * Construcs a new sidebar for the given editor. */ function Sidebar(editorUi, container) { this.editorUi = editorUi; this.container = container; this.palettes = new Object(); this.taglist = new Object(); this.lastCreated = 0; this.showTooltips = true; this.gra...
cwe
CWE-94
JavaScript
vhost_reserve_avail_batch_packed(struct virtio_net *dev, struct vhost_virtqueue *vq, struct rte_mempool *mbuf_pool, struct rte_mbuf **pkts, uint16_t avail_idx, uintptr_t *desc_addrs, uint16_t *ids) { bool wrap = vq->avail_wrap_counter; struct vring_packed_desc *descs = vq->desc_packed; ...
cwe
CWE-665
Unknown
# -*- coding: utf-8 -*- # rdiffweb, A web interface to rdiff-backup repositories # Copyright (C) 2012-2021 rdiffweb contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version ...
cwe
CWE-770
Python
void LibRaw::parse_x3f() { x3f_t *x3f = x3f_new_from_file(libraw_internal_data.internal_data.input); if(!x3f) return; _x3f_data = x3f; x3f_header_t *H = NULL; x3f_directory_section_t *DS = NULL; H = &x3f->header; // Parse RAW size from RAW section x3f_directory_entry_t *DE = x3f_get_raw(x3f); ...
cwe
CWE-787
Unknown
sha1_handle_first_client_response (DBusAuth *auth, const DBusString *data) { /* We haven't sent a challenge yet, we're expecting a desired * username from the client. */ DBusString tmp; DBusString tmp2; dbus_bool_t retval = FALSE; DBusError error = DBUS_ERROR_I...
cwe
CWE-59
C/C++
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ #include <assert.h> #include <stddef.h> #include <string.h> #include <openssl/hkdf.h> #include "lsquic_hkdf.h" /* [draft-ietf-quic-tls-17] Section 5 */ void lsquic_qhkdf_expand (const EVP_MD *md, const unsigned char *secret, unsig...
cwe
CWE-476
C/C++
opj_image_t *pngtoimage(const char *read_idf, opj_cparameters_t * params) { png_structp png = NULL; png_infop info = NULL; double gamma; int bit_depth, interlace_type, compression_type, filter_type; OPJ_UINT32 i; png_uint_32 width, height = 0U; int color_type; FILE *reader = NULL; ...
cwe
CWE-787
C/C++
e: function (str) { return new(tree.Anonymous)(str instanceof tree.JavaScript ? str.evaluated : str); },
cwe
CWE-74
JavaScript
package com.bezman.servlet; import com.bezman.reference.Reference; import com.bezman.json.JSON; import org.apache.commons.lang.StringEscapeUtils; import org.json.simple.JSONObject; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.Requ...
cwe
CWE-89
Java
userauth_hostbased_fromfile(LIBSSH2_SESSION *session, const char *username, size_t username_len, const char *publickey, const char *privatekey, const char *passphrase, const char *hostname, size_t hostname_le...
cwe
CWE-787
Unknown
func HandleError(w http.ResponseWriter, err error) { netErr, ok := err.(net.Error) if ok { if netErr.Timeout() { http.Error(w, "Storage read timeout", http.StatusGatewayTimeout) } else if strings.HasSuffix(err.Error(), "connect: no route to host") || strings.HasSuffix(err.Error(), "connect: connection refus...
cwe
CWE-79
Go
static void Sp_replace_regexp(js_State *J) { js_Regexp *re; const char *source, *s, *r; js_Buffer *sb = NULL; int n, x; Resub m; source = checkstring(J, 0); re = js_toregexp(J, 1); if (js_regexec(re->prog, source, &m, 0)) { js_copy(J, 0); return; } re->last = 0; loop: s = m.sub[0].sp; n = m.sub[0].e...
cwe
CWE-787
Unknown
xmlParseNameAndCompare(xmlParserCtxtPtr ctxt, xmlChar const *other) { register const xmlChar *cmp = other; register const xmlChar *in; const xmlChar *ret; GROW; in = ctxt->input->cur; while (*in != 0 && *in == *cmp) { ++in; ++cmp; ctxt->input->col++; } if (*cmp == 0 && (*in ==...
cwe
CWE-119
C/C++
/* * GPAC - Multimedia Framework C SDK * * Authors: Jean Le Feuvre * Copyright (c) Telecom ParisTech 2000-2022 * All rights reserved * * This file is part of GPAC / common tools sub-project * * GPAC is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser Gen...
cwe
CWE-122
C/C++
#include "first.h" #include "burl.h" #include <string.h> #include "buffer.h" #include "base64.h" static const char hex_chars_uc[] = "0123456789ABCDEF"; /* everything except: ! $ & ' ( ) * + , - . / 0-9 : ; = ? @ A-Z _ a-z ~ */ static const char encoded_chars_http_uri_reqd[] = { /* 0 1 2 3 4 5 6 7 8 9 ...
cwe
CWE-190
C/C++
oal_download_response_cb (SoupSession *soup_session, SoupMessage *soup_message, gpointer user_data) { GSimpleAsyncResult *simple; struct _oal_req_data *data; simple = G_SIMPLE_ASYNC_RESULT (user_data); data = g_simple_async_result_get_op_res_gpointer (simple); ...
cwe
CWE-295
Unknown
_gcry_mpi_powm (gcry_mpi_t res, gcry_mpi_t base, gcry_mpi_t expo, gcry_mpi_t mod) { /* Pointer to the limbs of the arguments, their size and signs. */ mpi_ptr_t rp, ep, mp, bp; mpi_size_t esize, msize, bsize, rsize; int msign, bsign, rsign; /* Flags telling the secure allocation...
cwe
CWE-310
C/C++
IMPEG2D_ERROR_CODES_T impeg2d_dec_slice(dec_state_t *ps_dec) { stream_t *ps_stream; UWORD32 u4_slice_vertical_position; UWORD32 u4_slice_vertical_position_extension; IMPEG2D_ERROR_CODES_T e_error; ps_stream = &ps_dec->s_bit_stream; /*------------------------------------------------------------------...
cwe
CWE-254
C/C++
static GF_Err BM_ParseGlobalQuantizer(GF_BifsDecoder *codec, GF_BitStream *bs, GF_List *com_list) { GF_Node *node; GF_Command *com; GF_CommandField *inf; node = gf_bifs_dec_node(codec, bs, NDT_SFWorldNode); if (!node) return GF_NON_COMPLIANT_BITSTREAM; /*reset global QP*/ if (codec->scenegraph->global_qp) { g...
cwe
CWE-416
C/C++
constructor (p, opt) { opt = opt || {} super(opt) if (typeof p !== 'string') throw new TypeError('path is required') this.path = p // suppress atime, ctime, uid, gid, uname, gname this.portable = !!opt.portable // until node has builtin pwnam functions, this'll have to do this.myui...
cwe
CWE-22
JavaScript
import sshpubkeys from sqlalchemy.exc import IntegrityError from grouper.models.counter import Counter from grouper.models.public_key import PublicKey from grouper.plugin import get_plugin_proxy from grouper.plugin.exceptions import PluginRejectedPublicKey class DuplicateKey(Exception): pass class PublicKeyPar...
cwe
CWE-74
Python
function displayUploadedFiles(jsonstring, filecount, fieldname, show_title, show_comment) { var jsonobj; var i; var display = ''; if (jsonstring == '[]') { $('#'+fieldname+'_uploadedfiles').html(display); return; } if (jsonstring !== '') { jsonobj = eval('(' + jsons...
cwe
CWE-79
JavaScript
DEFINE_TEST(test_write_disk_secure) { #if defined(_WIN32) && !defined(__CYGWIN__) skipping("archive_write_disk security checks not supported on Windows"); #else struct archive *a; struct archive_entry *ae; struct stat st; /* Start with a known umask. */ assertUmask(UMASK); /* Create an archive_write_disk objec...
cwe
CWE-703
Unknown
function highlightTarget( anchor ) { console.debug( "Highlighting target '%s'.", anchor ); $("a[name=" + anchor + "]").each( function() { if ( !$(this).parent().parent().hasClass('target-section') ) { console.debug( "Wrapping the target-section" ); $('div.method-detail').unwrap( 'div.target-section...
cwe
CWE-79
JavaScript
def add_consumption_data_row(self, ts, energy_used, power_used): if power_used > 0: query = ''' INSERT OR IGNORE INTO Consumption ( TimeStamp, EnergyUsed, PowerUsed ) VALUES ...
cwe
CWE-89
Python
func Skip(self Protocol, fieldType Type, maxDepth int) (err error) { if maxDepth <= 0 { return NewProtocolExceptionWithType(DEPTH_LIMIT, errors.New("Depth limit exceeded")) } switch fieldType { case STOP: return case BOOL: _, err = self.ReadBool() return case BYTE: _, err = self.ReadByte() return c...
cwe
CWE-834
Go
uint32_t *GetPayload(size_t handle, uint32_t *lastpayload, uint32_t index) { mp4object *mp4 = (mp4object *)handle; if (mp4 == NULL) return NULL; uint32_t *MP4buffer = NULL; if (index < mp4->indexcount && mp4->mediafp) { MP4buffer = (uint32_t *)realloc((void *)lastpayload, mp4->metasizes[index]); if (MP4buffe...
cwe
CWE-125
C/C++
/*! * \file lr1110-se.c * * \brief LR1110 Secure Element hardware implementation * * \copyright Revised BSD License, see section \ref LICENSE. * * \code * ______ _ * / _____) _ | | * ( (____ _____ ____ _|...
cwe
CWE-120
C/C++
HexOutStream::overrun(int itemSize, int nItems) { if (itemSize > bufSize) throw Exception("HexOutStream overrun: max itemSize exceeded"); writeBuffer(); if (itemSize * nItems > end - ptr) nItems = (end - ptr) / itemSize; return nItems; }
cwe
CWE-787
C/C++
static int encrypt(struct blkcipher_desc *desc, struct scatterlist *dst, struct scatterlist *src, unsigned int nbytes) { struct blkcipher_walk walk; struct crypto_blkcipher *tfm = desc->tfm; struct salsa20_ctx *ctx = crypto_blkcipher_ctx(tfm); int err; blkcipher_walk_init(&walk, dst, src, nbytes); err ...
cwe
CWE-200
Unknown
zimage3(i_ctx_t *i_ctx_p) { os_ptr op = osp; gs_image3_t image; int interleave_type; ref *pDataDict; ref *pMaskDict; image_params ip_data, ip_mask; int ignored; int code, mcode; check_type(*op, t_dictionary); check_dict_read(*op); if ((code = dict_int_param(op, "InterleaveTy...
cwe
CWE-704
Unknown
/* * Internet Printing Protocol functions for CUPS. * * Copyright © 2007-2019 by Apple Inc. * Copyright © 1997-2007 by Easy Software Products, all rights reserved. * * Licensed under Apache License v2.0. See the file "LICENSE" for more * information. */ /* * Include necessary headers... */ #include "cups-p...
cwe
CWE-20
C/C++
rar_read_ahead(struct archive_read *a, size_t min, ssize_t *avail) { struct rar *rar = (struct rar *)(a->format->data); const void *h = __archive_read_ahead(a, min, avail); int ret; if (avail) { if (a->archive.read_data_is_posix_read && *avail > (ssize_t)a->archive.read_data_requested) *avail = a->a...
cwe
CWE-416
Unknown
/* * Copyright 2017-2019 original 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 agre...
cwe
CWE-400
Java
/* * tls.c - TLS/TLS/DTLS dissector * * Copyright (C) 2016-21 - ntop.org * * nDPI 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 3 of the License, or * (at your option) any later...
cwe
CWE-787
C/C++