code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
xsltGenerateIdFunction(xmlXPathParserContextPtr ctxt, int nargs){ xmlNodePtr cur = NULL; long val; xmlChar str[30]; xmlDocPtr doc; if (nargs == 0) { cur = ctxt->context->node; } else if (nargs == 1) { xmlXPathObjectPtr obj; xmlNodeSetPtr nodelist; int i, ret; if ((ctxt->value =...
cwe
CWE-399
C/C++
fpAcc(TIFF* tif, uint8* cp0, tmsize_t cc) { tmsize_t stride = PredictorState(tif)->stride; uint32 bps = tif->tif_dir.td_bitspersample / 8; tmsize_t wc = cc / bps; tmsize_t count = cc; uint8 *cp = (uint8 *) cp0; uint8 *tmp = (uint8 *)_TIFFmalloc(cc); assert((cc%(bps*stride))==0); if (!tmp) return; ...
cwe
CWE-119
C/C++
char *cJSON_PrintUnformatted( cJSON *item ) { return print_value( item, 0, 0 ); }
cwe
CWE-120
C/C++
static Image *ReadTIFFImage(const ImageInfo *image_info, ExceptionInfo *exception) { #define ThrowTIFFException(severity,message) \ { \ if (tiff_pixels != (unsigned char *) NULL) \ tiff_pixels=(unsigned char *) RelinquishMagickMemory(tiff_pixels); \ if (quantum_info != (QuantumInfo *) NULL) \ quantum_info...
cwe
CWE-770
C/C++
int compute_password_element (pwd_session_t *session, uint16_t grp_num, char const *password, int password_len, char const *id_server, int id_server_len, char const *id_peer, int id_peer_len, uint32_t *token) { BIGNUM *x_candidate = NULL, *rnd = NULL, *cofactor = NULL; HMAC_CTX *ct...
cwe
CWE-284
C/C++
// Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite/handler/oauth2 (interfaces: AccessTokenStorage) // Package internal is a generated GoMock package. package internal import ( context "context" reflect "reflect" gomock "github.com/golang/mock/gomock" fosite "github.com/ory/fosite" ) //...
cwe
CWE-345
Go
public static function getNameWithCase($name, $surname, $title = false, $id = false, $nick = false) { $str = ''; if ($title !== false && $title instanceof Title) { $str .= $title->tshort . ' '; } $str .= mb_strtoupper($name, 'UTF-8') . ' ' . ucwords(mb_strto...
cwe
CWE-79
PHP
size_t OpenMP4Source(char *filename, uint32_t traktype, uint32_t traksubtype) //RAW or within MP4 { mp4object *mp4 = (mp4object *)malloc(sizeof(mp4object)); if (mp4 == NULL) return 0; memset(mp4, 0, sizeof(mp4object)); #ifdef _WINDOWS fopen_s(&mp4->mediafp, filename, "rb"); #else mp4->mediafp = fopen(filename, ...
cwe
CWE-787
Unknown
public function createBranch($name, $checkout = FALSE) { // git branch $name $this->run('branch', $name); if ($checkout) { $this->checkout($name); } return $this; }
cwe
CWE-88
PHP
njs_promise_perform_all_settled_handler(njs_vm_t *vm, njs_iterator_args_t *args, njs_value_t *value, int64_t index) { njs_int_t ret; njs_array_t *array; njs_value_t arguments[2], next; njs_function_t *on_fulfilled, *on_rejected; ...
cwe
CWE-703
Unknown
ps_parser_to_token( PS_Parser parser, T1_Token token ) { FT_Byte* cur; FT_Byte* limit; FT_Int embed; token->type = T1_TOKEN_TYPE_NONE; token->start = NULL; token->limit = NULL; /* first of all, skip leading whitespace */ ps_parser_skip_spaces( parser )...
cwe
CWE-119
Unknown
const char* WinPKIErrorString(void) { static char error_string[64]; DWORD error_code = GetLastError(); if ((error_code >> 16) != 0x8009) return WindowsErrorString(); switch (error_code) { case NTE_BAD_UID: return "Bad UID."; case CRYPT_E_MSG_ERROR: return "An error occurred while performing an operation o...
cwe
CWE-347
C/C++
// Copyright (c) 2012 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 "chrome/browser/chrome_content_browser_client.h" #include <map> #include <set> #include <utility> #include <vector> #include "base/base_swi...
cwe
CWE-787
C/C++
const main = require('./index'); async function task() { const argv = [...process.argv]; const port = process.argv.pop(); const command = process.argv.pop(); switch (command) { case "kill": const result = await main.killAllProcessesOnPort(port); console.log(result.filter(item => !item.success).map(item =>...
cwe
CWE-77
JavaScript
import namedavatar from 'namedavatar' import { QuillDeltaToHtmlConverter } from 'quill-delta-to-html' import './projectchart.html' import Projects, { ProjectStats } from '../../api/projects/projects.js' import projectUsers from '../../api/users/users.js' import { getUserSetting, getUserTimeUnitVerbose } from '../../uti...
cwe
CWE-79
JavaScript
fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env) { int r, num; OnigCodePoint c; OnigEncoding enc = env->enc; const OnigSyntaxType* syn = env->syntax; UChar* prev; UChar* p = *src; PFETCH_READY; start: if (PEND) { tok->type = TK_EOT; return tok->type; } tok->type = TK_ST...
cwe
CWE-125
Unknown
package com.publiccms.views.directive.sys; // Generated 2021-8-2 11:31:34 by com.publiccms.common.generator.SourceGenerator import java.io.IOException; import java.io.StringReader; import java.util.List; import java.util.Map; import java.util.Properties; import org.springframework.beans.factory.annotation.Autowired;...
cwe
CWE-200
Java
static long _syscall( long num, long arg1, long arg2, long arg3, long arg4, long arg5, long arg6) { long ret = -1; oe_errno = 0; /* Handle the software system call. */ switch (num) { #if defined(OE_SYS_creat) case OE_SYS_creat: { const char* p...
cwe
CWE-552
Unknown
/* Copyright 2019 The Vitess 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, soft...
cwe
CWE-703
Go
xmlEncodeSpecialChars(xmlDocPtr doc ATTRIBUTE_UNUSED, const xmlChar *input) { const xmlChar *cur = input; xmlChar *buffer = NULL; xmlChar *out = NULL; int buffer_size = 0; if (input == NULL) return(NULL); /* * allocate an translation buffer. */ buffer_size = 1000; buffer = (xm...
cwe
CWE-189
Unknown
public void fireUndeployEvent(HotDeployEvent hotDeployEvent) { for (HotDeployListener hotDeployListener : _hotDeployListeners) { try { hotDeployListener.invokeUndeploy(hotDeployEvent); } catch (HotDeployException hde) { _log.error(hde, hde); } } _deployedServletContextNames.remove( hotDepl...
cwe
CWE-264
Java
void kvm_lapic_reset(struct kvm_vcpu *vcpu, bool init_event) { struct kvm_lapic *apic = vcpu->arch.apic; int i; if (!init_event) { vcpu->arch.apic_base = APIC_DEFAULT_PHYS_BASE | MSR_IA32_APICBASE_ENABLE; if (kvm_vcpu_is_reset_bsp(vcpu)) vcpu->arch.apic_base |= MSR_IA32_APICBASE_BSP; } if (!api...
cwe
CWE-703
Unknown
/* * Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com> * * This file is part of Open5GS. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or ...
cwe
CWE-404
C/C++
from vyper import ast as vy_ast from vyper.address_space import CALLDATA, DATA, IMMUTABLES, MEMORY, STORAGE from vyper.codegen.ir_node import Encoding, IRnode from vyper.codegen.types import ( DYNAMIC_ARRAY_OVERHEAD, ArrayLike, BaseType, ByteArrayLike, DArrayType, MappingType, SArrayType, ...
cwe
CWE-697
Python
/* * 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-732
Java
static Image *ReadCINImage(const ImageInfo *image_info,ExceptionInfo *exception) { #define MonoColorType 1 #define RGBColorType 3 char property[MagickPathExtent]; CINInfo cin; const unsigned char *pixels; Image *image; MagickBooleanType status; MagickOffsetType offset; Qua...
cwe
CWE-400
C/C++
/* vsprintf with automatic memory allocation. Copyright (C) 1999, 2002-2018 Free Software Foundation, Inc. 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, or (at your op...
cwe
CWE-787
C/C++
static void rtps_util_detect_coherent_set_end_empty_data_case( coherent_set_entity_info *coherent_set_entity_info_object) { coherent_set_entity_info *coherent_set_entry = NULL; coherent_set_entry = (coherent_set_entity_info*) wmem_map_lookup(coherent_set_tracking.entities_using_map, &coherent_set_entity_info_ob...
cwe
CWE-401
Unknown
package de.timroes.axmlrpc; import de.timroes.axmlrpc.serializer.SerializerHandler; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.util.Map; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; ...
cwe
CWE-611
Java
int ZEXPORT deflatePrime (strm, bits, value) z_streamp strm; int bits; int value; { deflate_state *s; int put; if (deflateStateCheck(strm)) return Z_STREAM_ERROR; s = strm->state; if ((Bytef *)(s->d_buf) < s->pending_out + ((Buf_size + 7) >> 3)) return Z_BUF_ERROR; do { ...
cwe
CWE-787
Unknown
static int mb86a20s_read_status(struct dvb_frontend *fe, enum fe_status *status) { struct mb86a20s_state *state = fe->demodulator_priv; int val; *status = 0; val = mb86a20s_readreg(state, 0x0a) & 0xf; if (val < 0) return val; if (val >= 2) *status |= FE_HAS_SIGNAL; if (val >= 4) *status |= FE_HAS_CARRI...
cwe
CWE-119
Unknown
static void InsertRow(Image *image,unsigned char *p,ssize_t y,int bpp, ExceptionInfo *exception) { int bit; Quantum index; register Quantum *q; ssize_t x; switch (bpp) { case 1: /* Convert bitmap scanline. */ { q=QueueAuthenticPixels(image,0,y,image->columns,1,exce...
cwe
CWE-787
C/C++
function J(ha){if(ba!=ha||Q!=ja)y(),ya.scrollTop=0,da.innerHTML="",fa.innerHTML=mxUtils.htmlEntities(mxResources.get("searchResults"))+' "'+mxUtils.htmlEntities(ha)+'"',va=null,Z?F(ha):c&&(ha?(Ea.spin(da),U=!1,V=!0,c(ha,ua,function(){z(mxResources.get("searchFailed")); ua([])},Q?null:u)):H(Q)),ba=ha,ja=Q}
cwe
CWE-94
JavaScript
package io.onedev.server.web.resource; import java.io.BufferedInputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.Arr...
cwe
CWE-79
Java
/*jshint laxbreak:true */ var sizeParser = require('filesize-parser'); var exec = require('child_process').exec, child; module.exports = function(path, opts, cb) { if (!cb) { cb = opts; opts = {}; } var cmd = module.exports.cmd(path, opts); opts.timeout = opts.timeout || 5000; exec(cmd, opts, func...
cwe
CWE-78
JavaScript
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
cwe
CWE-119
C/C++
int vhost_get_vq_desc(struct vhost_virtqueue *vq, struct iovec iov[], unsigned int iov_size, unsigned int *out_num, unsigned int *in_num, struct vhost_log *log, unsigned int *log_num) { struct vring_desc desc; unsigned int i, head, found = 0; u16 last_avail_idx; __virtio16 avail_idx; __virt...
cwe
CWE-120
Unknown
package extractor import ( "archive/tar" "compress/gzip" "fmt" "io" "os" "os/exec" "path/filepath" ) type tgzExtractor struct{} func NewTgz() Extractor { return &tgzExtractor{} } func (e *tgzExtractor) Extract(src, dest string) error { srcType, err := mimeType(src) if err != nil { return err } switch...
cwe
CWE-22
Go
save_config( struct recvbuf *rbufp, int restrict_mask ) { char reply[128]; #ifdef SAVECONFIG char filespec[128]; char filename[128]; char fullpath[512]; const char savedconfig_eq[] = "savedconfig="; char savedconfig[sizeof(savedconfig_eq) + sizeof(filename)]; time_t now; int fd; FILE *fptr; #endif if (RES...
cwe
CWE-22
C/C++
/* * XWD image format * * Copyright (c) 2012 Paul B Mahol * * This file is part of FFmpeg. * * FFmpeg 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 the License, or (a...
cwe
CWE-119
C/C++
struct clock_source *dcn20_clock_source_create( struct dc_context *ctx, struct dc_bios *bios, enum clock_source_id id, const struct dce110_clk_src_regs *regs, bool dp_clk_src) { struct dce110_clk_src *clk_src = kzalloc(sizeof(struct dce110_clk_src), GFP_KERNEL); if (!clk_src) return NULL; if (dcn20_clk_sr...
cwe
CWE-401
Unknown
protected BigDecimal bcdToBigDecimal() { if (usingBytes) { // Converting to a string here is faster than doing BigInteger/BigDecimal arithmetic. BigDecimal result = new BigDecimal(toNumberString()); if (isNegative()) { result = result.negate(); } ...
cwe
CWE-190
Java
QPDF::resolveObjectsInStream(int obj_stream_number) { // Force resolution of object stream QPDFObjectHandle obj_stream = getObjectByID(obj_stream_number, 0); if (! obj_stream.isStream()) { throw QPDFExc(qpdf_e_damaged_pdf, this->m->file->getName(), this->m->last_object_description, this...
cwe
CWE-125
Unknown
@jwt_required def patch(self, user_id): """ Replaces information of corresponding user_id with request body """ query = f"""update users set user_id = %s """ query += f"""where user_id = '{user_id}'""" json_data = request.get_json() parameters = (json_data['user_id'], ) ...
cwe
CWE-89
Python
/** * Freshdesk ticket plugin. Drag tickets into the diagram. Tickets are * updated on file open, page select and via Extras, Update Tickets. * * Drag freshdesk tickets into the diagram. Domain must match deskDomain.freshdesk.com. * * Use #C to configure the client as follows: * * https://www.draw.io/?p=tick...
cwe
CWE-79
JavaScript
public function updateForgottenPassword(array $input) { $condition = [ 'glpi_users.is_active' => 1, 'glpi_users.is_deleted' => 0, [ 'OR' => [ ['glpi_users.begin_date' => null], ['glpi_users.begin_date' => ['<', new QueryExpression('NOW()')]] ...
cwe
CWE-640
PHP
SWTPM_NVRAM_CheckHeader(unsigned char *data, uint32_t length, uint32_t *dataoffset, uint16_t *hdrflags, uint8_t *hdrversion, bool quiet) { blobheader *bh = (blobheader *)data; if (length < sizeof(bh)) { if (!quiet) logprintf(STDERR_FILENO, ...
cwe
CWE-125
C/C++
from typing import Any, Callable, List, Optional from urllib.parse import urlparse from django.conf import settings from django.http import HttpResponse from django.urls import URLPattern, include, path, re_path from django.views.decorators import csrf from django.views.decorators.csrf import csrf_exempt from drf_spec...
cwe
CWE-601
Python
static void l2tp_eth_dev_setup(struct net_device *dev) { ether_setup(dev); dev->netdev_ops = &l2tp_eth_netdev_ops; dev->destructor = free_netdev; }
cwe
CWE-703
Unknown
MagickExport Image *WaveImage(const Image *image,const double amplitude, const double wave_length,ExceptionInfo *exception) { #define WaveImageTag "Wave/Image" CacheView *image_view, *wave_view; float *sine_map; Image *wave_image; MagickBooleanType status; MagickOffsetType prog...
cwe
CWE-369
Unknown
/* ** Copyright (C) 2004-2017 Erik de Castro Lopo <erikd@mega-nerd.com> ** Copyright (C) 2004 Tobias Gehrig <tgehrig@ira.uka.de> ** ** 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 ; ei...
cwe
CWE-125
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
static void n_hdlc_send_frames(struct n_hdlc *n_hdlc, struct tty_struct *tty) { register int actual; unsigned long flags; struct n_hdlc_buf *tbuf; if (debuglevel >= DEBUG_LEVEL_INFO) printk("%s(%d)n_hdlc_send_frames() called\n",__FILE__,__LINE__); check_again: spin_lock_irqsave(&n_hdlc->tx_buf_list.spinlo...
cwe
CWE-362
Unknown
store_word( spellinfo_T *spin, char_u *word, int flags, // extra flags, WF_BANNED int region, // supported region(s) char_u *pfxlist, // list of prefix IDs or NULL int need_affix) // only store word with affix ID { int len = (int)STRLEN(word); int ct = captype(word, word + len); ...
cwe
CWE-125
C/C++
def spree_current_user @spree_current_user ||= Spree.user_class.find_by(id: doorkeeper_token.resource_owner_id) if doorkeeper_token end
cwe
CWE-287
Ruby
TfLiteStatus Subgraph::AllocateTensors() { TFLITE_SCOPED_TAGGED_DEFAULT_PROFILE(profiler_.get(), "AllocateTensors"); if (!consistent_) { ReportError("AllocateTensors() called on inconsistent model."); return kTfLiteError; } // Restore delegation state if applicable. TF_LITE_ENSURE_STATUS(RedoAllDeleg...
cwe
CWE-835
Unknown
#ifndef IGNOREALL /* dcraw.c -- Dave Coffin's raw photo decoder Copyright 1997-2015 by Dave Coffin, dcoffin a cybercom o net This is a command-line ANSI C program to convert raw photos from any digital camera on any computer running any operating system. No license is required to download and use dcraw...
cwe
CWE-787
C/C++
fn write_ignition( mountpoint: &Path, digest_in: &Option<IgnitionHash>, mut config_in: &File, ) -> Result<()> { eprintln!("Writing Ignition config"); // Verify configuration digest, if any. if let Some(ref digest) = digest_in { digest .validate(&mut config_in) .c...
cwe
CWE-276
Rust
SSL_CTX *tls_init_ctx(fr_tls_server_conf_t *conf, int client) { SSL_CTX *ctx; X509_STORE *certstore; int verify_mode = SSL_VERIFY_NONE; int ctx_options = 0; int ctx_tls_versions = 0; int type; /* * SHA256 is in all versions of OpenSSL, but isn't * initialized by default. It's needed for WiMAX * cert...
cwe
CWE-295
Unknown
static int dns_validate_dns_response(unsigned char *resp, unsigned char *bufend, struct dns_resolution *resolution, int max_answer_records) { unsigned char *reader; char *previous_dname, tmpname[DNS_MAX_NAME_SIZE]; int len, flags, offset; int dns_query_record_id; int nb_saved_records; struct dns_query_it...
cwe
CWE-125
Unknown
import hashlib import hmac import logging import time from datetime import timedelta from urllib.parse import urlsplit, urlunsplit from flask import jsonify, redirect, request, url_for, session from flask_login import LoginManager, login_user, logout_user, user_logged_in from redash import models, settings from redash...
cwe
CWE-352
Python
/* Copyright 2017 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-476
C/C++
count_comp_fors(struct compiling *c, const node *n) { int n_fors = 0; int is_async; count_comp_for: is_async = 0; n_fors++; REQ(n, comp_for); if (TYPE(CHILD(n, 0)) == ASYNC) { is_async = 1; } if (NCH(n) == (5 + is_async)) { n = CHILD(n, 4 + is_async); } else { ...
cwe
CWE-125
C/C++
int HexInStream::overrun(int itemSize, int nItems, bool wait) { if (itemSize > bufSize) throw Exception("HexInStream overrun: max itemSize exceeded"); if (end - ptr != 0) memmove(start, ptr, end - ptr); end -= ptr - start; offset += ptr - start; ptr = start; while (end < ptr + itemSize) { int...
cwe
CWE-787
C/C++
package org.loklak.tools; import javax.annotation.Nonnull; import org.loklak.data.DAO; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.security.*; import java.security.spec.InvalidKeySpecException; import java.security.spec.X509EncodedKeySpec; import java.util.Base64; i...
cwe
CWE-22
Java
// Copyright (c) 2018-2021, Sylabs Inc. All rights reserved. // This software is licensed under a 3-clause BSD license. Please consult the // LICENSE.md file distributed with the sources of this project regarding your // rights to use or distribute this software. package client import ( "context" "fmt" "io" "net/...
cwe
CWE-601
Go
void ConnectDialog::on_qaUrl_triggered() { ServerItem *si = static_cast<ServerItem *>(qtwServers->currentItem()); if (! si || si->qsUrl.isEmpty()) return; QDesktopServices::openUrl(QUrl(si->qsUrl)); }
cwe
CWE-59
Unknown
function validatePassword(pwd) { const strongRegex = /^(?=.{14,})(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*\W).*$/g const mediumRegex = /^(?=.{10,})(((?=.*[A-Z])(?=.*[a-z]))|((?=.*[A-Z])(?=.*[0-9]))|((?=.*[a-z])(?=.*[0-9]))).*$/g const enoughRegex = /(?=.{8,}).*/g if (pwd.length === 0) { return { valid: false, ...
cwe
CWE-521
JavaScript
// This file is part of Deark. // Copyright (C) 2016 Jason Summers // See the file COPYING for terms of use. // Macintosh PICT graphics #include <deark-config.h> #include <deark-private.h> #include <deark-fmtutil.h> DE_DECLARE_MODULE(de_module_pict); struct pict_point { i64 y, x; }; struct pict_rect { i64 t, l, b...
cwe
CWE-476
C/C++
void readDataAvailable(size_t len) noexcept override { std::cerr << "readDataAvailable, len " << len << std::endl; currentBuffer.length = len; wcb_->setSocket(socket_); // Write back the same data. socket_->write(wcb_, currentBuffer.buffer, len, writeFlags); buffers.push_back(currentBuffer);...
cwe
CWE-125
Unknown
/* * TCP over IPv6 * Linux INET6 implementation * * Authors: * Pedro Roque <roque@di.fc.ul.pt> * * Based on: * linux/net/ipv4/tcp.c * linux/net/ipv4/tcp_input.c * linux/net/ipv4/tcp_output.c * * Fixes: * Hideaki YOSHIFUJI : sin6_scope_id support * YOSHIFUJI Hideaki @USAGI and: Support IPV6_V6ONLY socket ...
cwe
CWE-19
C/C++
Graph.sanitizeHtml=function(a,c){return DOMPurify.sanitize(a,{ADD_ATTR:["target"],FORBID_TAGS:["form"],ALLOWED_URI_REGEXP:/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i})};Graph.sanitizeSvg=function(a){return DOMPurify.sanitize(a,{IN_PLACE:!0})};
cwe
CWE-20
JavaScript
firstname: l.attr('data-firstname') }); l.append(` <div class="member-details"> ${member_item} ${l.attr('data-name') || `${member_itemtype} (${member_items_id})`} </div> ...
cwe
CWE-79
JavaScript
/** * $Id: mxRack.js,v 1.5 2014/01/21 13:10:37 gaudenz Exp $ * Copyright (c) 2006-2013, JGraph Ltd */ //********************************************************************************************************************************************************** //Rack Numbering //***************************************...
cwe
CWE-79
Java
""" .. module: lemur.common.utils :platform: Unix :copyright: (c) 2018 by Netflix Inc., see AUTHORS for more :license: Apache, see LICENSE for more details. .. moduleauthor:: Kevin Glisson <kglisson@netflix.com> """ import base64 import json import random import re import socket import ssl import string i...
cwe
CWE-330
Python
int mbedtls_x509_crt_verify_with_profile( mbedtls_x509_crt *crt, mbedtls_x509_crt *trust_ca, mbedtls_x509_crl *ca_crl, const mbedtls_x509_crt_profile *profile, const char *cn, uint32_t *flags, int (*f_vrfy)(void *, ...
cwe
CWE-287
Unknown
_evbuffer_expand_fast(struct evbuffer *buf, size_t datlen, int n) { struct evbuffer_chain *chain = buf->last, *tmp, *next; size_t avail; int used; ASSERT_EVBUFFER_LOCKED(buf); EVUTIL_ASSERT(n >= 2); if (chain == NULL || (chain->flags & EVBUFFER_IMMUTABLE)) { /* There is no last chunk, or we can't touch the la...
cwe
CWE-189
Unknown
xmlNextChar(xmlParserCtxtPtr ctxt) { if ((ctxt == NULL) || (ctxt->instate == XML_PARSER_EOF) || (ctxt->input == NULL)) return; if (ctxt->charset == XML_CHAR_ENCODING_UTF8) { if ((*ctxt->input->cur == 0) && (xmlParserInputGrow(ctxt->input, INPUT_CHUNK) <= 0) && (c...
cwe
CWE-125
C/C++
from django.contrib import admin import import_export.widgets as widgets from import_export.admin import ImportExportModelAdmin from import_export.fields import Field from import_export.resources import ModelResource import part.models as models from company.models import SupplierPart from stock.models import StockLo...
cwe
CWE-434
Python
def remove_resource(params, request, session) if not allowed_for_local_cluster(session, Permissions::WRITE) return 403, 'Permission denied' end force = params['force'] no_error_if_not_exists = params.include?('no_error_if_not_exists') errors = "" params.each { |k,v| if k.index("resid-") == 0 r...
cwe
CWE-384
Ruby
package com.salesmanager.core.business.services.common.generic; import java.io.Serializable; import java.util.List; import com.salesmanager.core.business.exception.ServiceException; /** * <p>Service racine pour la gestion des entités.</p> * * @param <T> type d'entité */ public interface SalesManagerEntityServic...
cwe
CWE-79
Java
// Copyright 2012-2020 (c) Peter Širka <petersirka@gmail.com> // // 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, cop...
cwe
CWE-77
JavaScript
function sanitizeShellString(str) { let result = str; result = result.replace(/>/g, ""); result = result.replace(/</g, ""); result = result.replace(/\*/g, ""); result = result.replace(/\?/g, ""); result = result.replace(/\[/g, ""); result = result.replace(/\]/g, ""); result = result.replace(/\|/g, ""); ...
cwe
CWE-78
JavaScript
void BlockCodec::runPull() { AFframecount framesToRead = m_outChunk->frameCount; AFframecount framesRead = 0; assert(framesToRead % m_framesPerPacket == 0); int blockCount = framesToRead / m_framesPerPacket; // Read the compressed data. ssize_t bytesRead = read(m_inChunk->buffer, m_bytesPerPacket * blockCount);...
cwe
CWE-190
C/C++
dispose() { this._disposables.dispose(); }
cwe
CWE-20
JavaScript
/******************************************************************************* * Copyright 2018 The MIT Internet Trust Consortium * * Portions copyright 2011-2013 The MITRE Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the L...
cwe
CWE-1321
Java
static int fsmMkdir(const char *path, mode_t mode) { int rc = mkdir(path, (mode & 07777)); if (_fsm_debug) rpmlog(RPMLOG_DEBUG, " %8s (%s, 0%04o) %s\n", __func__, path, (unsigned)(mode & 07777), (rc < 0 ? strerror(errno) : "")); if (rc < 0) rc = RPMERR_MKDIR_FAILED; return rc; }
cwe
CWE-59
C/C++
/* * 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 ...
cwe
CWE-863
Java
package com.salesmanager.shop.model.catalog.product.attribute; import java.io.Serializable; import com.salesmanager.shop.model.entity.Entity; public class ProductOption extends Entity implements Serializable { /** * */ private static final long serialVersionUID = 1L; private String code; private Stri...
cwe
CWE-79
Java
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ #include <assert.h> #include <inttypes.h> #include <stddef.h> #include <stdint.h> #include <sys/queue.h> #include "lsquic_int_types.h" #include "lsquic_types.h" #include "lsquic_hash.h" #include "lsquic.h" #include "lsquic_conn.h" #include "lsqu...
cwe
CWE-476
C/C++
# # Copyright (C) 2015 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later version. # This program is distributed in the hope that it will be...
cwe
CWE-264
Python
static int parseValuesReturnFilter ( Operation *op, SlapReply *rs, LDAPControl *ctrl ) { BerElement *ber; struct berval fstr = BER_BVNULL; if ( op->o_valuesreturnfilter != SLAP_CONTROL_NONE ) { rs->sr_text = "valuesReturnFilter control specified multiple times"; return LDAP_PROTOCOL_ERROR; } if ( BER_BVIS...
cwe
CWE-125
C/C++
var choresTable = $('#chores-table').DataTable({ 'order': [[1, 'asc']], 'columnDefs': [ { 'orderable': false, 'targets': 0 }, { 'searchable': false, "targets": 0 } ] }); $('#chores-table tbody').removeClass("d-none"); choresTable.columns.adjust().draw(); $("#search").on("keyup", Delay(function() { var value =...
cwe
CWE-79
JavaScript
void pdo_stmt_init(TSRMLS_D) { zend_class_entry ce; INIT_CLASS_ENTRY(ce, "PDOStatement", pdo_dbstmt_functions); pdo_dbstmt_ce = zend_register_internal_class(&ce TSRMLS_CC); pdo_dbstmt_ce->get_iterator = pdo_stmt_iter_get; pdo_dbstmt_ce->create_object = pdo_dbstmt_new; zend_class_implements(pdo_dbstmt_ce TSRMLS_C...
cwe
CWE-476
C/C++
static void vrend_renderer_init_blit_ctx(struct vrend_blitter_ctx *blit_ctx) { struct virgl_gl_ctx_param ctx_params; int i; if (blit_ctx->initialised) { vrend_clicbs->make_current(0, blit_ctx->gl_context); return; } ctx_params.shared = true; ctx_params.major_ver = VREND_GL_VER_MAJOR; c...
cwe
CWE-772
Unknown
package com.salesmanager.shop.model.catalog.product.attribute; import java.util.ArrayList; import java.util.List; import com.salesmanager.shop.model.catalog.product.attribute.api.ReadableProductOptionValueEntity; public class ReadableProductOption extends ProductOption { /** * */ private static final long se...
cwe
CWE-639
Java
api.add = async function(req, res) { const { commentForm, slackNotificationForm } = req.body; const { validationResult } = require('express-validator'); const errors = validationResult(req.body); if (!errors.isEmpty()) { return res.json(ApiResponse.error('コメントを入力してください。')); } const pageI...
cwe
CWE-639
JavaScript
/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* lib/krb5/krb/s4u_creds.c */ /* * Copyright (C) 2009 by the Massachusetts Institute of Technology. * All rights reserved. * * Export of this software from the United States of America may * require a specific license from the United States Governm...
cwe
CWE-617
C/C++
static inline int ip6_ufo_append_data(struct sock *sk, int getfrag(void *from, char *to, int offset, int len, int odd, struct sk_buff *skb), void *from, int length, int hh_len, int fragheaderlen, int transhdrlen, int mtu,unsigned int flags) { struct sk_buff *skb; int err; /* There is support for UDP la...
cwe
CWE-703
Unknown
w3m_exit(int i) { #ifdef USE_MIGEMO init_migemo(); /* close pipe to migemo */ #endif stopDownload(); deleteFiles(); #ifdef USE_SSL free_ssl_ctx(); #endif disconnectFTP(); #ifdef USE_NNTP disconnectNews(); #endif #ifdef __MINGW32_VERSION WSACleanup(); #endif exit(i); }
cwe
CWE-59
Unknown