code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
/* * Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at * http://www.eclipse.org/legal/epl-2.0. * * This Source Code may also be made available...
cwe
CWE-22
Java
static int ssl_ctx_make_profiles(const char *profiles_string,STACK_OF(SRTP_PROTECTION_PROFILE) **out) { STACK_OF(SRTP_PROTECTION_PROFILE) *profiles; char *col; char *ptr=(char *)profiles_string; SRTP_PROTECTION_PROFILE *p; if(!(profiles=sk_SRTP_PROTECTION_PROFILE_new_null())) { SSLerr(SSL_F_SSL_CTX_MAK...
cwe
CWE-20
Unknown
#include <algorithm> #include "ContentLine.h" #include "analyzer/protocol/tcp/TCP.h" #include "events.bif.h" using namespace analyzer::tcp; ContentLine_Analyzer::ContentLine_Analyzer(Connection* conn, bool orig) : TCP_SupportAnalyzer("CONTENTLINE", conn, orig) { InitState(); } ContentLine_Analyzer::ContentLine_...
cwe
CWE-787
C/C++
static void fuse_readahead(struct readahead_control *rac) { struct inode *inode = rac->mapping->host; struct fuse_conn *fc = get_fuse_conn(inode); unsigned int i, max_pages, nr_pages = 0; if (is_bad_inode(inode)) return; max_pages = min_t(unsigned int, fc->max_pages, fc->max_read / PAGE_SIZE); for (;;) { ...
cwe
CWE-459
Unknown
static int format8BIM(Image *ifile, Image *ofile) { char temp[MagickPathExtent]; unsigned int foundOSType; int ID, resCount, i, c; ssize_t count; unsigned char *PString, *str; resCount=0; foundOSType=0; /* found the OSType */ (void) foundOSType; c=ReadBlobByte(...
cwe
CWE-193
C/C++
pvscsi_ring_pop_req_descr(PVSCSIRingInfo *mgr) { uint32_t ready_ptr = RS_GET_FIELD(mgr, reqProdIdx); if (ready_ptr != mgr->consumed_ptr) { uint32_t next_ready_ptr = mgr->consumed_ptr++ & mgr->txr_len_mask; uint32_t next_ready_page = return mgr->req_ring_pages_pa[next_...
cwe
CWE-399
Unknown
function setImportFile(fileText) { $('.import_text').html(fileText); }
cwe
CWE-79
JavaScript
static int jpc_siz_getparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *in) { jpc_siz_t *siz = &ms->parms.siz; unsigned int i; uint_fast8_t tmp; siz->comps = 0; /* Eliminate compiler warning about unused variables. */ cstate = 0; if (jpc_getuint16(in, &siz->caps) || jpc_getuint32(in, &siz->width) |...
cwe
CWE-190
Unknown
cJSON *cJSON_DetachItemFromArray( cJSON *array, int which ) { cJSON *c = array->child; while ( c && which > 0 ) { c = c->next; --which; } if ( ! c ) return 0; if ( c->prev ) c->prev->next = c->next; if ( c->next ) c->next->prev = c->prev; if ( c == array->child ) array->child = c->next; c->prev = c->n...
cwe
CWE-120
C/C++
static int ivr_read_header(AVFormatContext *s) { unsigned tag, type, len, tlen, value; int i, j, n, count, nb_streams = 0, ret; uint8_t key[256], val[256]; AVIOContext *pb = s->pb; AVStream *st; int64_t pos, offset, temp; pos = avio_tell(pb); tag = avio_rl32(pb); if (tag == MKTAG('....
cwe
CWE-834
Unknown
function clone(array $override_input = [], bool $history = true) { global $DB, $CFG_GLPI; if ($DB->isSlave()) { return false; } $new_item = new static(); $input = $this->fields; foreach ($override_input as $key => $value) { $input[$key] = $value; } $inp...
cwe
CWE-89
PHP
package bitfield // NOTE: Don't bother replacing the divisions/modulo with shifts/ands, go is smart. import ( "math/bits" ) // NewBitfield creates a new fixed-sized Bitfield (allocated up-front). // // Panics if size is not a multiple of 8. func NewBitfield(size int) Bitfield { if size%8 != 0 { panic("Bitfield s...
cwe
CWE-754
Go
void BlobURLRequestJob::DidGetFileItemLength(size_t index, int64 result) { if (error_) return; if (result == net::ERR_UPLOAD_FILE_CHANGED) { NotifyFailure(net::ERR_FILE_NOT_FOUND); return; } else if (result < 0) { NotifyFailure(result); return; } DCHECK_LT(index, blob_data_->items().size...
cwe
CWE-190
C/C++
def index respond_to do |format| format.json do dir = params[:dir] dir = 'desc' unless SORT_DIRECTIONS.include?(dir.try(:upcase)) @occurrences = @bug.occurrences.order("occurred_at #{dir}").limit(50) last = params[:last].present? ? @bug.occurrences.find_by_number(params[:last...
cwe
CWE-94
Ruby
static ssize_t read_and_process_frames(struct audio_stream_in *stream, void* buffer, ssize_t frames_num) { struct stream_in *in = (struct stream_in *)stream; ssize_t frames_wr = 0; /* Number of frames actually read */ size_t bytes_per_sample = audio_bytes_per_sample(stream->common.get_format(&stream->common...
cwe
CWE-125
C/C++
void PrintPreviewUI::GetPrintPreviewDataForIndex( int index, scoped_refptr<base::RefCountedBytes>* data) { print_preview_data_service()->GetDataEntry(preview_ui_addr_str_, index, data); }
cwe
CWE-200
C/C++
char *get_56_lenc_string(char **buffer, size_t *max_bytes_available, size_t *string_length) { static char empty_string[1]= { '\0' }; char *begin= *buffer; if (*max_bytes_available == 0) return NULL; /* If the length encoded string has the length 0 ...
cwe
CWE-190
Unknown
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
cwe
CWE-754
C/C++
// Copyright 2017 The Gogs Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. package repo import ( "bytes" "compress/gzip" "fmt" "net/http" "os" "os/exec" "path" "path/filepath" "strconv" "strings" "time" "gopkg.in/macaro...
cwe
CWE-22
Go
TPM_ECC_CURVE_Unmarshal(TPM_ECC_CURVE *target, BYTE **buffer, INT32 *size) { TPM_RC rc = TPM_RC_SUCCESS; if (rc == TPM_RC_SUCCESS) { rc = UINT16_Unmarshal(target, buffer, size); } if (rc == TPM_RC_SUCCESS) { switch (*target) { case TPM_ECC_NONE: case TPM_ECC_NIST_P192: case TPM_ECC_NIST_P224...
cwe
CWE-787
Unknown
send_request (ctrl_t ctrl, const char *request, const char *hostportstr, const char *httphost, unsigned int httpflags, gpg_error_t (*post_cb)(void *, http_t), void *post_cb_value, estream_t *r_fp, unsigned int *r_http_status) { gpg_error_t err; http_session_t session = NULL...
cwe
CWE-352
Unknown
void loadServerConfigFromString(char *config) { char *err = NULL; int linenum = 0, totlines, i; int slaveof_linenum = 0; sds *lines; lines = sdssplitlen(config,strlen(config),"\n",1,&totlines); for (i = 0; i < totlines; i++) { sds *argv; int argc; linenum = i+1; ...
cwe
CWE-787
Unknown
"url("+mxWindow.prototype.normalizeImage+")";aa.style.backgroundPosition="top center";aa.style.backgroundRepeat="no-repeat";aa.setAttribute("title","Minimize");var va=!1,ja=mxUtils.bind(this,function(){N.innerHTML="";if(!va){var da=function(ia,ma,qa){ia=D("",ia.funct,null,ma,ia,qa);ia.style.width="40px";ia.style.opacit...
cwe
CWE-20
JavaScript
// Copyright 2016 The OPA Authors. All rights reserved. // Use of this source code is governed by an Apache2 // license that can be found in the LICENSE file. package ast import ( "fmt" "io" "sort" "strconv" "strings" "github.com/open-policy-agent/opa/ast/location" "github.com/open-policy-agent/opa/internal/...
cwe
CWE-20
Go
BGD_DECLARE(void) gdImageFillToBorder (gdImagePtr im, int x, int y, int border, int color) { int lastBorder; /* Seek left */ int leftLimit, rightLimit; int i; int restoreAlphaBleding; if (border < 0) { /* Refuse to fill to a non-solid border */ return; } leftLimit = (-1); restoreAlphaBleding = im->alpha...
cwe
CWE-787
Unknown
yank_copy_line(struct block_def *bd, long y_idx, int exclude_trailing_space) { char_u *pnew; if (exclude_trailing_space) bd->endspaces = 0; if ((pnew = alloc(bd->startspaces + bd->endspaces + bd->textlen + 1)) == NULL) return FAIL; y_current->y_array[y_idx] = pnew; vim_memset(pnew, ...
cwe
CWE-787
C/C++
int main(int argc, char* argv[]) { char* name = argv[0]; bool applyColorCorrection = false; #if USE(QCMSLIB) if (argc >= 2 && strcmp(argv[1], "--color-correct") == 0) applyColorCorrection = (--argc, ++argv, true); if (argc < 2) { fprintf(stderr, "Usage: %s [--color-correct] file [ite...
cwe
CWE-200
C/C++
protected function get_remote_contents(&$url, $timeout = 30, $redirect_max = 5, $ua = 'Mozilla/5.0', $fp = null) { if (preg_match('~^(?:ht|f)tps?://[-_.!\~*\'()a-z0-9;/?:\@&=+\$,%#\*\[\]]+~i', $url)) { $info = parse_url($url); $host = trim(strtolower($info['host']), '.'); ...
cwe
CWE-918
PHP
function ame_author_edit( post_id, posttype ) { var ame_sack = new sack( ajaxurl ); ame_sack.execute = 1; ame_sack.method = 'POST'; ame_sack.setVar( "action", "ame_author_edit" ); ame_sack.setVar( "post_id", post_id ); ame_sack.setVar( "col_no", jQuery('.widefat thead tr th').length ); ame_sack.setVar( "posttype...
cwe
CWE-352
JavaScript
// Copyright 2009,2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // FreeBSD system calls. // This file is compiled as ordinary Go code, // but it is also input to mksyscall, // which parses the //sys lines and generates ...
cwe
CWE-287
Go
Response PageHandler::SetDownloadBehavior(const std::string& behavior, Maybe<std::string> download_path) { WebContentsImpl* web_contents = GetWebContents(); if (!web_contents) return Response::InternalError(); if (behavior == Page::SetDownloadBehavior::BehaviorEn...
cwe
CWE-269
C/C++
__read_extent_tree_block(const char *function, unsigned int line, struct inode *inode, ext4_fsblk_t pblk, int depth, int flags) { struct buffer_head *bh; int err; gfp_t gfp_flags = __GFP_MOVABLE | GFP_NOFS; if (flags & EXT4_EX_NOFAIL) gfp_flags |= __GFP_NOFAIL; bh = sb_getblk_gfp(inode->i_sb, pb...
cwe
CWE-703
Unknown
static void virtqueue_map_desc(unsigned int *p_num_sg, hwaddr *addr, struct iovec *iov, unsigned int max_num_sg, bool is_write, hwaddr pa, size_t sz) { unsigned num_sg = *p_num_sg; assert(num_sg <= max_num_sg); while (sz) { hwaddr l...
cwe
CWE-120
C/C++
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
cwe
CWE-787
C/C++
_zip_read_eocd64(zip_source_t *src, zip_buffer_t *buffer, zip_uint64_t buf_offset, unsigned int flags, zip_error_t *error) { zip_cdir_t *cd; zip_uint64_t offset; zip_uint8_t eocd[EOCD64LEN]; zip_uint64_t eocd_offset; zip_uint64_t size, nentry, i, eocdloc_offset; bool free_buffer; zip_uint32_...
cwe
CWE-119
C/C++
/** * OpenOLAT - Online Learning and Training</a><br> * <a href="http://www.openolat.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 the * <a href="http://www.apache...
cwe
CWE-91
Java
#!/usr/bin/python # # Copyright (c) 2010 Red Hat, Inc. # # Authors: James Bowes <jbowes@redhat.com> # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS...
cwe
CWE-264
Python
'use strict' /** * Module dependencies */ var events = require('events') var Store = require('./store') var eos = require('end-of-stream') var mqttPacket = require('mqtt-packet') var Writable = require('readable-stream').Writable var inherits = require('inherits') var reInterval = require('reinterval') var validatio...
cwe
CWE-399
JavaScript
QUInt16() {}
cwe
CWE-908
C/C++
static int unzzip_cat (int argc, char ** argv, int extract) { int done; int argn; ZZIP_MEM_DISK* disk; if (argc == 1) { printf (__FILE__" version "ZZIP_PACKAGE" "ZZIP_VERSION"\n"); return EXIT_OK; /* better provide an archive argument */ } disk = zzip_mem_disk_open (argv[1]); if (! d...
cwe
CWE-772
Unknown
/* Copyright 2016 The Kubernetes 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, ...
cwe
CWE-863
Go
protected void traceLdapEnv(Properties env) { if (trace) { Properties tmp = new Properties(); tmp.putAll(env); String credentials = tmp.getProperty(Context.SECURITY_CREDENTIALS); String bindCredential = tmp.getProperty(BIND_CREDENTIAL); if (credentials != null...
cwe
CWE-200
Java
static s32 gf_hevc_read_vps_bs_internal(GF_BitStream *bs, HEVCState *hevc, Bool stop_at_vps_ext) { u8 vps_sub_layer_ordering_info_present_flag, vps_extension_flag; u32 i, j; s32 vps_id; HEVC_VPS *vps; u8 layer_id_included_flag[MAX_LHVC_LAYERS][64]; //nalu header already parsed vps_id = gf_bs_read_int_log(bs, 4,...
cwe
CWE-190
C/C++
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) { auto* params = reinterpret_cast<TfLiteAudioSpectrogramParams*>(node->user_data); TF_LITE_ENSURE_EQ(context, NumInputs(node), 1); TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1); const TfLiteTensor* input = GetInput(context, node, kInputTen...
cwe
CWE-125
C/C++
# # The OpenDiamond Platform for Interactive Search # # Copyright (c) 2009-2018 Carnegie Mellon University # All rights reserved. # # This software is distributed under the terms of the Eclipse Public # License, Version 1.0 which can be found in the file named LICENSE. # ANY USE, REPRODUCTION OR DISTRIBUTION OF T...
cwe
CWE-22
Python
#ifndef JSI_LITE_ONLY #ifndef JSI_AMALGAMATION #include "jsiInt.h" #else char *strptime(const char *buf, const char *fmt, struct tm *tm); #endif #include <errno.h> #include <sys/stat.h> #include <sys/time.h> #include <signal.h> #include <limits.h> #ifndef __WIN32 #include <sys/wait.h> #endif static Jsi_RC consoleInput...
cwe
CWE-190
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-190
Python
function searchAll() { scheduler.clear("search"); // clear previous search maxJobs = 1; // clear previous max var searchStr = $("#textfilter input").attr("value").trim() || ''; if (searchStr === '') { $("div#search-results").hide(); $("#search > span.close-results").hide(); $("#...
cwe
CWE-79
JavaScript
static void do_under_overlay_for_page( QPDF& pdf, Options& o, UnderOverlay& uo, std::map<int, std::vector<int> >& pagenos, size_t page_idx, std::map<int, QPDFObjectHandle>& fo, std::vector<QPDFPageObjectHelper>& pages, QPDFPageObjectHelper& dest_page, bool before) { int pageno = ...
cwe
CWE-787
Unknown
PHPAPI char *php_escape_shell_arg(char *str) { int x, y = 0, l = strlen(str); char *cmd; size_t estimate = (4 * l) + 3; TSRMLS_FETCH(); cmd = safe_emalloc(4, l, 3); /* worst case */ #ifdef PHP_WIN32 cmd[y++] = '"'; #else cmd[y++] = '\''; #endif for (x = 0; x < l; x++) { int mb_len = php_mblen(str + x, (l ...
cwe
CWE-78
C/C++
QPDF::removePage(QPDFObjectHandle page) { int pos = findPage(page); // also ensures flat /Pages QTC::TC("qpdf", "QPDF remove page", (pos == 0) ? 0 : // remove at beginning (pos == static_cast<int>( this->m->all_pages.size() - 1)) ? 1 : // end ...
cwe
CWE-787
Unknown
/* * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) 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 * * Unles...
cwe
CWE-306
Java
/* * Copyright 2016 Red Hat, Inc. and/or its affiliates * and other contributors as indicated by the @author tags. * * 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.apach...
cwe
CWE-863
Java
/* * Copyright (C) 2015 bspkrs * * 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, * modify, merge, publish, distri...
cwe
CWE-22
Java
find_ex_command( exarg_T *eap, int *full UNUSED, int (*lookup)(char_u *, size_t, int cmd, cctx_T *) UNUSED, cctx_T *cctx UNUSED) { int len; char_u *p; int i; #ifndef FEAT_EVAL int vim9 = FALSE; #else int vim9 = in_vim9script(); /* * Recognize a Vim9 script function/method call and ...
cwe
CWE-125
C/C++
cwd: _pwd().toString(), env: process.env, maxBuffer: DEFAULT_MAXBUFFER_SIZE, encoding: 'utf8', }, opts); if (fs.existsSync(paramsFile)) common.unlinkSync(paramsFile); if (fs.existsSync(stderrFile)) common.unlinkSync(stderrFile); if (fs.existsSync(stdoutFile)) common.unlinkSync(stdoutFile); opts....
cwe
CWE-78
JavaScript
ip6_print(netdissect_options *ndo, const u_char *bp, u_int length) { register const struct ip6_hdr *ip6; register int advance; u_int len; const u_char *ipend; register const u_char *cp; register u_int payload_len; int nh; int fragmented = 0; u_int flow; ip6 = (const struct ip6_hdr *)bp; ND_TCHECK(*ip6); i...
cwe
CWE-125
C/C++
/** shave - Shave is a javascript plugin that truncates multi-line text within a html element based on set max height @version v2.5.2 @link https://github.com/dollarshaveclub/shave#readme @author Jeff Wainwright <yowainwright@gmail.com> (jeffry.in) @license MIT **/ (function (global, factory) { typeof expor...
cwe
CWE-79
JavaScript
static jas_image_cmpt_t *jas_image_cmpt_create(int_fast32_t tlx, int_fast32_t tly, int_fast32_t hstep, int_fast32_t vstep, int_fast32_t width, int_fast32_t height, uint_fast16_t depth, bool sgnd, uint_fast32_t inmem) { jas_image_cmpt_t *cmpt; size_t size; cmpt = 0; if (width < 0 || height < 0 || hstep <= 0 |...
cwe
CWE-190
Unknown
public static function loadFromPath($path) { $instance = new self(); $instance->name = basename($path); $instance->path = $path; return $instance; }
cwe
CWE-79
PHP
package server import ( "context" "fmt" "os" "path/filepath" "strconv" "strings" "github.com/containers/storage/pkg/idtools" "github.com/containers/storage/pkg/mount" "github.com/containers/storage/pkg/stringid" "github.com/cri-o/cri-o/internal/factory/container" "github.com/cri-o/cri-o/internal/lib/sandbo...
cwe
CWE-732
Go
void Compute(OpKernelContext* const context) override { // node_id_range const Tensor* node_id_range_t; OP_REQUIRES_OK(context, context->input("node_id_range", &node_id_range_t)); const auto node_id_range = node_id_range_t->vec<int32>(); OP_REQUIRES( context, node_id_range_t->dims() == 1, ...
cwe
CWE-476
C/C++
char *rfbProcessFileTransferReadBuffer(rfbClientPtr cl, uint32_t length) { char *buffer=NULL; int n=0; FILEXFER_ALLOWED_OR_CLOSE_AND_RETURN("", cl, NULL); /* We later alloc length+1, which might wrap around on 32-bit systems if length equals 0XFFFFFFFF, i.e. SIZE_MAX for 32-bit systems...
cwe
CWE-787
C/C++
static void shm_destroy(struct ipc_namespace *ns, struct shmid_kernel *shp) { ns->shm_tot -= (shp->shm_segsz + PAGE_SIZE - 1) >> PAGE_SHIFT; shm_rmid(ns, shp); shm_unlock(shp); if (!is_file_hugepages(shp->shm_file)) shmem_lock(shp->shm_file, 0, shp->mlock_user); else if (shp->mlock_user) user_shm_unlock(file_i...
cwe
CWE-362
C/C++
int treeRead(struct READER *reader, struct DATAOBJECT *data) { int i, j, err, olen, elements, size, x, y, z, b, e, dy, dz, sx, sy, sz, dzy, szy; char *input, *output; uint8_t node_type, node_level; uint16_t entries_used; uint32_t size_of_chunk; uint32_t filter_mask; uint64_t address_of_left_sibling, address_...
cwe
CWE-20
C/C++
static netdev_tx_t mcba_usb_start_xmit(struct sk_buff *skb, struct net_device *netdev) { struct mcba_priv *priv = netdev_priv(netdev); struct can_frame *cf = (struct can_frame *)skb->data; struct mcba_usb_ctx *ctx = NULL; struct net_device_stats *stats = &priv->netdev->stats; u16 sid; int err; struct ...
cwe
CWE-415
C/C++
// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2005-2014 Brocade Communications Systems, Inc. * Copyright (c) 2014- QLogic Corporation. * All rights reserved * www.qlogic.com * * Linux driver for QLogic BR-series Fibre Channel Host Bus Adapter. */ /* * bfa_attr.c Linux driver configuration interf...
cwe
CWE-400
C/C++
write_vector_int(BitWriter& w, int nitems, std::vector<T>& vec, int bits, int_type T::*field) { // nitems times, write bits bits from the given field of the ith // vector to the given bit writer. for (int i = 0; i < nitems; ++i) { w.writeBits(vec.at(i).*field, bits); } // The PDF spec says ...
cwe
CWE-787
Unknown
static VALUE from_document(VALUE klass, VALUE document) { xmlDocPtr doc; xmlSchemaParserCtxtPtr ctx; xmlSchemaPtr schema; VALUE errors; VALUE rb_schema; Data_Get_Struct(document, xmlDoc, doc); /* In case someone passes us a node. ugh. */ doc = doc->doc; if (has_blank_nodes_p(DOC_NODE_CACHE(doc))) {...
cwe
CWE-611
C/C++
/* * Copyright (c) 2008-2017 Nicira, Inc. * * 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...
cwe
CWE-125
C/C++
function dockerContainerInspect(containerID, payload) { containerID = containerID || ''; return new Promise((resolve) => { process.nextTick(() => { if (containerID) { if (!_docker_socket) { _docker_socket = new DockerSocket(); } _docker_socket.getInspect(containerID.tri...
cwe
CWE-78
JavaScript
/* =========================================================================== Copyright (C) 1999-2005 Id Software, Inc. This file is part of Quake III Arena source code. Quake III Arena source code is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as publish...
cwe
CWE-269
C/C++
static apr_status_t parse_chunk_size(http_ctx_t *ctx, const char *buffer, apr_size_t len, int linelimit) { apr_size_t i = 0; while (i < len) { char c = buffer[i]; ap_xlate_proto_from_ascii(&c, 1); /* handle CRLF after the chunk */ if (ctx->state == BODY_CHUNK_END) { ...
cwe
CWE-17
C/C++
char *cJSON_Print( cJSON *item ) { return print_value( item, 0, 1 ); }
cwe
CWE-120
C/C++
static void __io_req_task_work_add(struct io_kiocb *req, struct io_uring_task *tctx, struct io_wq_work_list *list) { struct io_ring_ctx *ctx = req->ctx; struct io_wq_work_node *node; unsigned long flags; bool running; io_drop_inflight_file(req); spin_lock_irqsave(&tctx->task_lock, flags); wq_list...
cwe
CWE-416
Unknown
this.update);this.refresh()};Format.prototype.clear=function(){this.container.innerHTML="";if(null!=this.panels)for(var a=0;a<this.panels.length;a++)this.panels[a].destroy();this.panels=[]};Format.prototype.refresh=function(){null!=this.pendingRefresh&&(window.clearTimeout(this.pendingRefresh),this.pendingRefresh=null)...
cwe
CWE-94
JavaScript
CacheManager::start(const Comm::ConnectionPointer &client, HttpRequest *request, StoreEntry *entry, const AccessLogEntry::Pointer &ale) { debugs(16, 3, "CacheManager::Start: '" << entry->url() << "'" ); Mgr::Command::Pointer cmd = ParseUrl(entry->url()); if (!cmd) { const auto err = new ErrorState(...
cwe
CWE-401
Unknown
package com.salesmanager.core.business.utils; import java.math.BigDecimal; import java.text.NumberFormat; import java.util.ArrayList; import java.util.Currency; import java.util.Date; import java.util.List; import java.util.Locale; import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; ...
cwe
CWE-639
Java
hfs_cat_traverse(HFS_INFO * hfs, TSK_HFS_BTREE_CB a_cb, void *ptr) { TSK_FS_INFO *fs = &(hfs->fs_info); uint32_t cur_node; /* node id of the current node */ char *node; uint16_t nodesize; uint8_t is_done = 0; tsk_error_reset(); nodesize = tsk_getu16(fs->endian, hfs->catalog_h...
cwe
CWE-284
Unknown
String StringUtil::Implode(const Variant& items, const String& delim, const bool checkIsContainer /* = true */) { if (checkIsContainer && !isContainer(items)) { throw_param_is_not_container(); } int size = getContainerSize(items); if (size == 0) return empty_string(); req::vect...
cwe
CWE-190
Unknown
package com.salesmanager.shop.admin.controller.shipping; import java.text.DecimalFormat; import java.util.HashMap; import java.util.Locale; import java.util.Map; import javax.inject.Inject; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.slf4j.Logger; import or...
cwe
CWE-79
Java
/* Copyright (c) 2013-2014. The YARA Authors. 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, this list of conditions and the fo...
cwe
CWE-125
C/C++
(function (tree) { tree.Quoted = function (str, content, escaped, index, currentFileInfo) { this.escaped = escaped; this.value = content || ''; this.quote = str.charAt(0); this.index = index; this.currentFileInfo = currentFileInfo; }; tree.Quoted.prototype = { type: "Quoted", genCSS: functi...
cwe
CWE-74
Java
public function save_change_password() { global $user; $isuser = ($this->params['uid'] == $user->id) ? 1 : 0; if (!$user->isAdmin() && !$isuser) { flash('error', gt('You do not have permissions to change this users password.')); expHistory::back(); } if...
cwe
CWE-89
PHP
function renderResults(results, currDir) { return _.map(results, function(result, index) { let template = resultTemplate({ index, fileId: _.camelCase(result.filePath), filePath: result.filePath.replace(currDir, ''), color: renderColor(result.errorCount, result.warningCount), summary: renderSummary(res...
cwe
CWE-79
JavaScript
set_richacl(struct archive *a, int fd, const char *name, struct archive_acl *abstract_acl, __LA_MODE_T mode, int ae_requested_type, const char *tname) { int ae_type, ae_permset, ae_tag, ae_id; uid_t ae_uid; gid_t ae_gid; const char *ae_name; int entries; int i; int ret; int e = 0; struct ...
cwe
CWE-59
Unknown
import sqlite3 import re import timeit import sys import os pathlist = os.path.realpath(__file__).split(os.path.sep) RTXindex = pathlist.index("RTX") sys.path.append(os.path.sep.join([*pathlist[:(RTXindex + 1)], 'code'])) from RTXConfiguration import RTXConfiguration RTXConfig = RTXConfiguration() autocomplete_filepa...
cwe
CWE-89
Python
// imagew-main.c // Part of ImageWorsener, Copyright (c) 2011 by Jason Summers. // For more information, see the readme.txt file. #include "imagew-config.h" #include <stdlib.h> #include <string.h> #include <math.h> #include "imagew-internals.h" // Given a color type having an alpha channel, returns the index of th...
cwe
CWE-119
C/C++
"url("+Editor.plusImage+")",aa.setAttribute("title",mxResources.get("insert")),aa.style.width="24px",va=!0)}));ja();F.addListener("darkModeChanged",ja);F.addListener("sketchModeChanged",ja)}else F.editor.addListener("statusChanged",mxUtils.bind(this,function(){F.setStatusText(F.editor.getStatus())}));if(null!=E){var Ba...
cwe
CWE-20
JavaScript
/* * Copyright (c) 2018-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ #include <fizz/record/EncryptedRecordLayer.h> #include <fizz/crypto/aead/IOBufUtil.h> namespace fizz {...
cwe
CWE-770
C/C++
_inplace_src_spans (void *abstract_renderer, int y, int h, const cairo_half_open_span_t *spans, unsigned num_spans) { cairo_image_span_renderer_t *r = abstract_renderer; uint8_t *m; int x0; if (num_spans == 0) return CAIRO_STATUS_SUCCESS; x0 = spans[0].x; m = r->_buf; do { in...
cwe
CWE-787
Unknown
/* 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
void Compute(OpKernelContext* ctx) override { const Tensor& in0 = ctx->input(0); const Tensor& in1 = ctx->input(1); ValidateInputTensors(ctx, in0, in1); MatMulBCast bcast(in0.shape().dim_sizes(), in1.shape().dim_sizes()); OP_REQUIRES( ctx, bcast.IsValid(), errors::InvalidArgument( ...
cwe
CWE-125
Unknown
static int xen_evtchn_cpu_prepare(unsigned int cpu) { int ret = 0; if (evtchn_ops->percpu_init) ret = evtchn_ops->percpu_init(cpu); return ret; }
cwe
CWE-703
Unknown
/////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2004, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the f...
cwe
CWE-476
C/C++
static int airspy_probe(struct usb_interface *intf, const struct usb_device_id *id) { struct airspy *s; int ret; u8 u8tmp, buf[BUF_SIZE]; s = kzalloc(sizeof(struct airspy), GFP_KERNEL); if (s == NULL) { dev_err(&intf->dev, "Could not allocate memory for state\n"); return -ENOMEM; } mutex_init(&s->v4l2_lo...
cwe
CWE-119
C/C++
'use strict'; /*! * Module dependencies. */ const EventEmitter = require('events').EventEmitter; const Kareem = require('kareem'); const MongooseError = require('./error/mongooseError'); const SchemaType = require('./schematype'); const SchemaTypeOptions = require('./options/SchemaTypeOptions'); const VirtualOption...
cwe
CWE-1321
JavaScript
if (typeof content === 'string') { return renderHTML(content); }
cwe
CWE-79
JavaScript
function addEntryHandler(cat, entry, subCat) { mxEvent.addListener(entry, 'click', function() { if (currentEntry != entry) { currentEntry.style.backgroundColor = ''; currentEntry = entry; currentEntry.style.backgroundColor = leftHighlight; div.scrollTop = 0; div.innerHTML ...
cwe
CWE-94
JavaScript
parse(payload) { const type = payload[0]; switch (this._step) { case 1: if (this._protocol._server) { // Server if (type !== MESSAGE.KEXDH_INIT) { return doFatalError( this._protocol, `Received packet ${type} instead of ...
cwe
CWE-354
JavaScript