code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
size_t Archive::ReadHeader50() { RawRead Raw(this); bool Decrypt=Encrypted && CurBlockPos>(int64)SFXSize+SIZEOF_MARKHEAD5; if (Decrypt) { #if defined(RAR_NOCRYPT) return 0; #else byte HeadersInitV[SIZE_INITV]; if (Read(HeadersInitV,SIZE_INITV)!=SIZE_INITV) { UnexpEndArcMsg(); retu...
cwe
CWE-787
C/C++
static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, char *offset_base, size_t IFDlength, size_t displacement, int section_index, int ReadNextIFD, tag_table_type tag_table TSRMLS_DC) { size_t length; int tag, format, components; char *value_ptr, tagname[64], cbuf[32], *outside=NULL; size_t b...
cwe
CWE-119
Unknown
static int callback_static_file_uncompressed (const struct _u_request * request, struct _u_response * response, void * user_data) { size_t length; FILE * f; char * file_requested, * file_path, * url_dup_save; const char * content_type; int ret = U_CALLBACK_CONTINUE; if (user_data != NULL && ((struct _u_com...
cwe
CWE-22
C/C++
PackLinuxElf64::check_pt_dynamic(Elf64_Phdr const *const phdr) { upx_uint64_t t = get_te64(&phdr->p_offset), s = sizeof(Elf64_Dyn) + t; upx_uint64_t filesz = get_te64(&phdr->p_filesz), memsz = get_te64(&phdr->p_memsz); if (s < t || (upx_uint64_t)file_size < s || (7 & t) || (0xf & (filesz | memsz)) // ...
cwe
CWE-415
Unknown
// Homer-App // // Homer-App User interface for WEB AI // // Schemes: http, https // Host: localhost:9080 // BasePath: /api/v3 // Version: 1.1.2 // License: AGPL https://www.gnu.org/licenses/agpl-3.0.en.html // Copyright: QXIP B.V. 2019-2020 // // Consumes: // - application/json // // ...
cwe
CWE-798
Go
function We(e){return null==e?ot():He(e)&&!l(e)?e:ot().withMutations((function(t){var n=r(e);Ve(n.size),n.forEach((function(e,n){return t.set(n,e)}))}))}
cwe
CWE-601
JavaScript
/* -*- C++ -*- * Copyright 2019-2020 LibRaw LLC (info@libraw.org) * LibRaw is free software; you can redistribute it and/or modify it under the terms of the one of two licenses as you choose: 1. GNU LESSER GENERAL PUBLIC LICENSE version 2.1 (See file LICENSE.LGPL provided in LibRaw distribution archive for deta...
cwe
CWE-125
C/C++
def get_title_from_youtube_url(url): try: output = str(subprocess.check_output('youtube-dl --get-title %s --no-warnings' % url, stderr=subprocess.STDOUT, shell=True)).strip() except subprocess.CalledProcessError as ex: output = str(ex.output).strip() ...
cwe
CWE-78
Python
0==this.hiddenTags.length)return!1;u=u.split(" ");if(u.length>this.hiddenTags.length)return!1;for(var E=0;E<u.length;E++)if(0>mxUtils.indexOf(this.hiddenTags,u[E]))return!1;return!0};Graph.prototype.getCellsForTags=function(u,E,J,T){var N=[];if(null!=u){E=null!=E?E:this.model.getDescendants(this.model.getRoot());for(va...
cwe
CWE-20
JavaScript
0,Wa,bb,$a);Na.pageSelector=!1;Na.mathEnabled=!1;ua.checked&&(Na.isCellVisible=function(Xa){return Ha.isCellSelected(Xa)});Wa=p.getCurrentFile();null!=Wa&&(Na.title=Wa.getTitle());var ib=Na.writeHead;Na.writeHead=function(Xa){ib.apply(this,arguments);if(mxClient.IS_GC||mxClient.IS_SF)Xa.writeln('<style type="text/css">...
cwe
CWE-20
JavaScript
TfLiteStatus Relu6Eval(TfLiteContext* context, TfLiteNode* node) { const TfLiteTensor* input = GetInput(context, node, 0); TfLiteTensor* output = GetOutput(context, node, 0); ReluOpData* data = reinterpret_cast<ReluOpData*>(node->user_data); switch (input->type) { case kTfLiteFloat32: { size_t element...
cwe
CWE-787
C/C++
private void updateModule( final ModuleBean module, final boolean external, final boolean repair ) { LEnv.LOGGER.info( ( repair ? "Repairing " : "Updating " ) + module.getName() + "..." ); launcherFrame.setStatus( StatusType.PROGRESS, ( repair ? "Repairing " : "Updating " ) + module.getName() ); if ( module ==...
cwe
CWE-22
Java
func VerifyGet(cfg schema.AuthenticationBackendConfiguration) middlewares.RequestHandler { refreshProfile, refreshProfileInterval := getProfileRefreshSettings(cfg) return func(ctx *middlewares.AutheliaCtx) { ctx.Logger.Tracef("Headers=%s", ctx.Request.Header.String()) targetURL, err := ctx.GetOriginalURL() if...
cwe
CWE-287
Go
void SVGStyleElement::DidNotifySubtreeInsertionsToDocument() { if (StyleElement::ProcessStyleSheet(GetDocument(), *this) == StyleElement::kProcessingFatalError) NotifyLoadedSheetAndAllCriticalSubresources( kErrorOccurredLoadingSubresource); }
cwe
CWE-787
C/C++
*/ static void php_wddx_pop_element(void *user_data, const XML_Char *name) { st_entry *ent1, *ent2; wddx_stack *stack = (wddx_stack *)user_data; HashTable *target_hash; zend_class_entry *pce; zval obj; /* OBJECTS_FIXME */ if (stack->top == 0) { return; } if (!strcmp((char *)name, EL_STRING) || ...
cwe
CWE-476
Unknown
public AbstractEpsgFactory(final Hints userHints) throws FactoryException { super(MAXIMUM_PRIORITY - 20); // The following hints have no effect on this class behaviour, // but tell to the user what this factory do about axis order. hints.put(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolea...
cwe
CWE-20
Java
# (c) 2013-2014, Michael DeHaan <michael.dehaan@gmail.com> # Stephen Fromm <sfromm@gmail.com> # Brian Coca <briancoca+dev@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as publish...
cwe
CWE-74
Python
/*! Copyright (c) REBUILD <https://getrebuild.com/> and/or its owners. All rights reserved. rebuild is dual-licensed under commercial and open source licenses (GPLv3). See LICENSE and COMMERCIAL in the project root for license information. */ package com.rebuild.web.project; import cn.devezhao.commons.CalendarUtils;...
cwe
CWE-89
Java
constructor (comp, options) { options = parseOptions(options) if (comp instanceof Comparator) { if (comp.loose === !!options.loose) { return comp } else { comp = comp.value } } debug('comparator', comp, options) this.options = options this.loose = !!options.lo...
cwe
CWE-1333
JavaScript
/* * L2TPv3 IP encapsulation support for IPv6 * * Copyright (c) 2012 Katalix Systems Ltd * * 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 ...
cwe
CWE-362
C/C++
function buildHTML(results) { var html = []; for (var i=0; i<results.length; i++) { html.push([ '<li class="module-item">', '<p class="module-item-title">', 'File: <a href="', results[i].absolute_url, '?highlight=', $("#id_site_search_2").val(), '">', ...
cwe
CWE-79
JavaScript
"""Tornado handlers for frontend config storage.""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import json import os import io import errno from tornado import web from IPython.utils.py3compat import PY3 from ...base.handlers import IPythonHandler, json_errors...
cwe
CWE-79
Python
static u32 fq_flow_idx(struct fq *fq, struct sk_buff *skb) { u32 hash = skb_get_hash_perturb(skb, fq->perturbation); return reciprocal_scale(hash, fq->flows_cnt); }
cwe
CWE-330
Unknown
static RList* entries(RBinFile* bf) { RList* ret = NULL; RBinAddr* addr = NULL; psxexe_header psxheader; if (!(ret = r_list_new ())) { return NULL; } if (!(addr = R_NEW0 (RBinAddr))) { r_list_free (ret); return NULL; } if (r_buf_fread_at (bf->buf, 0, (ut8*)&psxheader, "8c17i", 1) < sizeof (psxexe_heade...
cwe
CWE-400
C/C++
/* * GPAC - Multimedia Framework C SDK * * Authors: Jean Le Feuvre * Copyright (c) Telecom ParisTech 2005-2012 * All rights reserved * * This file is part of GPAC / command-line client * * GPAC is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General ...
cwe
CWE-119
C/C++
/* ** $Id: lvm.c $ ** Lua virtual machine ** See Copyright Notice in lua.h */ #define lvm_c #define LUA_CORE #include "lprefix.h" #include <float.h> #include <limits.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include "lua.h" #include "ldebug.h" #include "ldo.h" #include "lfunc...
cwe
CWE-125
C/C++
protected function _save($fp, $dir, $name, $stat) { $this->clearcache(); $mime = $stat['mime']; $w = !empty($stat['width']) ? $stat['width'] : 0; $h = !empty($stat['height']) ? $stat['height'] : 0; $id = $this->_joinPath($dir, $name); rewind($fp); $stat = fstat($fp); $size = $stat['size']; ...
cwe
CWE-89
JavaScript
int inet_sk_rebuild_header(struct sock *sk) { struct inet_sock *inet = inet_sk(sk); struct rtable *rt = (struct rtable *)__sk_dst_check(sk, 0); __be32 daddr; int err; /* Route is OK, nothing to do. */ if (rt) return 0; /* Reroute. */ daddr = inet->inet_daddr; if (inet->opt && inet->opt->srr) daddr = inet...
cwe
CWE-362
Unknown
void ServerSecurityFeature::collectOptions(std::shared_ptr<ProgramOptions> options) { options->addOption("--server.harden", "lock down REST APIs that reveal version information or server " "internals for non-admin users", new BooleanParameter(&_hardenedRe...
cwe
CWE-918
C/C++
static OPJ_BOOL opj_pi_next_rlcp(opj_pi_iterator_t * pi) { opj_pi_comp_t *comp = NULL; opj_pi_resolution_t *res = NULL; OPJ_UINT32 index = 0; if (!pi->first) { comp = &pi->comps[pi->compno]; res = &comp->resolutions[pi->resno]; goto LABEL_SKIP; } else { pi->first = 0...
cwe
CWE-125
Unknown
// Code generated by go-swagger; DO NOT EDIT. // This file is part of MinIO Console Server // Copyright (c) 2021 MinIO, Inc. // // 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 ...
cwe
CWE-306
Go
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++
int CephxSessionHandler::_calc_signature(Message *m, uint64_t *psig) { const ceph_msg_header& header = m->get_header(); const ceph_msg_footer& footer = m->get_footer(); // optimized signature calculation // - avoid temporary allocated buffers from encode_encrypt[_enc_bl] // - skip the leading 4 byte wrapper ...
cwe
CWE-284
C/C++
xfs_attr3_leaf_getvalue( struct xfs_buf *bp, struct xfs_da_args *args) { struct xfs_attr_leafblock *leaf; struct xfs_attr3_icleaf_hdr ichdr; struct xfs_attr_leaf_entry *entry; struct xfs_attr_leaf_name_local *name_loc; struct xfs_attr_leaf_name_remote *name_rmt; int valuelen; leaf = bp->b_addr; xfs_attr3_...
cwe
CWE-19
C/C++
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
cwe
CWE-119
C/C++
bool Virtual_column_info::fix_session_expr(THD *thd) { DBUG_ENTER("fix_session_vcol_expr"); if (!(flags & (VCOL_TIME_FUNC|VCOL_SESSION_FUNC))) DBUG_RETURN(0); expr->walk(&Item::cleanup_excluding_fields_processor, 0, 0); DBUG_ASSERT(!expr->fixed); DBUG_RETURN(fix_expr(thd)); }
cwe
CWE-703
Unknown
f.setCellStyles(mxConstants.STYLE_ROTATION,Number(L.value),[e[M]])}}finally{f.getModel().endUpdate()}});O.className="geBtn gePrimaryBtn";mxEvent.addListener(m,"keypress",function(M){13==M.keyCode&&O.click()});n=document.createElement("div");n.style.marginTop="20px";n.style.textAlign="right";b.editor.cancelFirst?(n.appe...
cwe
CWE-94
JavaScript
function PMA_getQueryFromSelected($what, $table, $selected, $views) { $reload = false; $full_query_views = null; $full_query = ''; if ($what == 'drop_tbl') { $full_query_views = ''; } $selected_cnt = count($selected); $i = 0; foreach ($selected as $sval) { switch ...
cwe
CWE-79
PHP
batchInit(batch_t *pBatch, int maxElem) { DEFiRet; pBatch->maxElem = maxElem; CHKmalloc(pBatch->pElem = calloc((size_t)maxElem, sizeof(batch_obj_t))); // TODO: replace calloc by inidividual writes? finalize_it: RETiRet; }
cwe
CWE-772
Unknown
package io.swagger.client.api; import io.swagger.client.ApiException; import io.swagger.client.ApiClient; import io.swagger.client.ApiResponse; import io.swagger.client.Configuration; import io.swagger.client.Pair; import javax.ws.rs.core.GenericType; import io.swagger.client.model.Client; import java.util.ArrayLis...
cwe
CWE-200
Java
bool NavigatorImpl::NavigateToEntry( FrameTreeNode* frame_tree_node, const FrameNavigationEntry& frame_entry, const NavigationEntryImpl& entry, ReloadType reload_type, bool is_same_document_history_load, bool is_history_navigation_in_new_child, bool is_pending_entry, const scoped_refptr<...
cwe
CWE-20
C/C++
'use strict'; /* eslint func-names: off */ require('./polyfills'); const fs = require('fs'); const http = require('http'); const path = require('path'); const url = require('url'); const chokidar = require('chokidar'); const compress = require('compression'); const del = require('del'); const express = require('expre...
cwe
CWE-20
JavaScript
function $e(e,a){var i,t,n=e.__data__;return("string"==(t=typeof(i=a))||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==i:null===i)?n["string"==typeof a?"string":"hash"]:n.map}
cwe
CWE-79
JavaScript
public function checkOverlap() { try { $select = $this->zdb->select(self::TABLE, 'c'); $select->columns( array('date_debut_cotis', 'date_fin_cotis') )->join( array('ct' => PREFIX_DB . ContributionsTypes::TABLE), 'c.' . Contr...
cwe
CWE-89
PHP
void SFS_CompoundExpression(ScriptParser *parser) { if (parser->codec->LastError) return; SFS_Expression(parser); if (! gf_bs_read_int(parser->bs, 1)) return; SFS_AddString(parser, ","); SFS_CompoundExpression(parser); }
cwe
CWE-476
Unknown
static int php_handler(request_rec *r) { php_struct * volatile ctx; void *conf; apr_bucket_brigade * volatile brigade; apr_bucket *bucket; apr_status_t rv; request_rec * volatile parent_req = NULL; TSRMLS_FETCH(); #define PHPAP_INI_OFF php_apache_ini_dtor(r, parent_req TSRMLS_CC); conf = ap_get_module_config(...
cwe
CWE-20
C/C++
/************************************************************************ * This file is part of EspoCRM. * * EspoCRM - Open Source CRM application. * Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko * Website: https://www.espocrm.com * * EspoCRM is free software: you can redistribute i...
cwe
CWE-79
JavaScript
ssize_t AsyncConnection::_process_connection() { ssize_t r = 0; switch(state) { case STATE_WAIT_SEND: { std::lock_guard<std::mutex> l(write_lock); if (!outcoming_bl.length()) { assert(state_after_send); state = state_after_send; state_after_send = STATE_NONE;...
cwe
CWE-287
Unknown
public void existingDocumentTerminalFromUIButAlreadyExisting() throws Exception { // current document = xwiki:Main.WebHome DocumentReference documentReference = new DocumentReference("xwiki", Arrays.asList("Main"), "WebHome"); XWikiDocument document = mock(XWikiDocument.class); when(...
cwe
CWE-862
Java
import { mainPage } from "../../support/page_objects/mainPage"; import { isTestSuiteActive, isXcdb, getProjectString, isPostgres, } from "../../support/page_objects/projectConstants"; export const genTest = (apiType, dbType) => { if (!isTestSuiteActive(apiType, dbType)) return; describe(`${api...
cwe
CWE-400
JavaScript
void PluginInfoMessageFilter::PluginsLoaded( const GetPluginInfo_Params& params, IPC::Message* reply_msg, const std::vector<WebPluginInfo>& plugins) { ChromeViewHostMsg_GetPluginInfo_Output output; scoped_ptr<PluginMetadata> plugin_metadata; if (context_.FindEnabledPlugin(params.render_view_id, params...
cwe
CWE-287
C/C++
AppControllerImpl::~AppControllerImpl() { if (apps::AppServiceProxy::Get(profile_)) app_service_proxy_->AppRegistryCache().RemoveObserver(this); }
cwe
CWE-416
C/C++
func (s *Service) loadCsvFile(fileName string) (*data.Frame, error) { validFileName := regexp.MustCompile(`([\w_]+)\.csv`) if !validFileName.MatchString(fileName) { return nil, fmt.Errorf("invalid csv file name: %q", fileName) } filePath := filepath.Join(s.cfg.StaticRootPath, "testdata", fileName) // Can igno...
cwe
CWE-22
Go
const got = require('@/utils/got'); const parser = require('@/utils/rss-parser'); const cheerio = require('cheerio'); module.exports = async (ctx) => { const region = ctx.params.region === 'en' ? '' : ctx.params.region.toLowerCase() + '.'; const category = ctx.params.category ? ctx.params.category.toLowerCase(...
cwe
CWE-918
JavaScript
cdf_read_property_info(const cdf_stream_t *sst, const cdf_header_t *h, uint32_t offs, cdf_property_info_t **info, size_t *count, size_t *maxcount) { const cdf_section_header_t *shp; cdf_section_header_t sh; const uint8_t *p, *q, *e; int16_t s16; int32_t s32; uint32_t u32; int64_t s64; uint64_t u64; cdf_tim...
cwe
CWE-189
C/C++
static ssize_t phys_index_show(struct device *dev, struct device_attribute *attr, char *buf) { struct memory_block *mem = to_memory_block(dev); unsigned long phys_index; phys_index = mem->start_section_nr / sections_per_block; return sprintf(buf, "%08lx\n", phys_index); }
cwe
CWE-787
Unknown
Utterance::Utterance(Profile* profile, const std::string& text, DictionaryValue* options, Task* completion_task) : profile_(profile), id_(next_utterance_id_++), text_(text), rate_(-1.0), pitch_(-1.0), volume_(-1.0), c...
cwe
CWE-20
C/C++
/* * GPAC - Multimedia Framework C SDK * * Authors: Jean Le Feuvre * Copyright (c) Telecom ParisTech 2000-2021 * All rights reserved * * This file is part of GPAC / MPEG-1/2/4(Part2) video reframer filter * * GPAC is free software; you can redistribute it and/or modify * it under the terms of the...
cwe
CWE-476
C/C++
def command(command) operation = Protocol::Command.new(name, command) result = session.with(consistency: :strong) do |session| session.simple_query(operation) end raise Errors::OperationFailure.new( operation, result ) unless result["ok"] == 1.0 result end
cwe
CWE-20
Ruby
static void handle_s_without_atn(ESPState *s) { int32_t cmdlen; if (s->dma && !s->dma_enabled) { s->dma_cb = handle_s_without_atn; return; } s->pdma_cb = s_without_satn_pdma_cb; cmdlen = get_cmd(s, ESP_CMDFIFO_SZ); if (cmdlen > 0) { s->cmdfifo_cdb_offset = 0; do_...
cwe
CWE-476
Unknown
static pj_status_t avi_get_frame(pjmedia_port *this_port, pjmedia_frame *frame) { struct avi_reader_port *fport = (struct avi_reader_port*)this_port; pj_status_t status = PJ_SUCCESS; pj_ssize_t size_read = 0, size_to_read = 0; pj_assert(fport->base.info.signature == SIGNATURE); /* We ...
cwe
CWE-835
C/C++
static int packet_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, size_t len, int flags) { struct sock *sk = sock->sk; struct sk_buff *skb; int copied, err; struct sockaddr_ll *sll; int vnet_hdr_len = 0; err = -EINVAL; if (flags & ~(MSG_PEEK|MSG_DONTWAIT|MSG_TRUNC|MSG_CMSG_COMPAT|MSG_E...
cwe
CWE-200
C/C++
sasl_handle_login(struct sasl_session *const restrict p, struct user *const u, struct myuser *mu) { bool was_killed = false; // Find the account if necessary if (! mu) { if (! *p->authzeid) { (void) slog(LG_INFO, "%s: session for '%s' without an authzeid (BUG)", MOWGLI_FUNC_NAME, u->...
cwe
CWE-287
C/C++
__init int intel_pmu_init(void) { union cpuid10_edx edx; union cpuid10_eax eax; union cpuid10_ebx ebx; struct event_constraint *c; unsigned int unused; int version; if (!cpu_has(&boot_cpu_data, X86_FEATURE_ARCH_PERFMON)) { switch (boot_cpu_data.x86) { case 0x6: return p6_pmu_init(); case 0xb: return...
cwe
CWE-20
C/C++
void delete_run_files(pid_t pid) { delete_bandwidth_run_file(pid); delete_network_run_file(pid); delete_name_run_file(pid); delete_x11_run_file(pid); delete_profile_run_file(pid); }
cwe
CWE-94
Unknown
void getGadgets() throws Exception { assertEquals(new ArrayList<>(), this.defaultGadgetSource.getGadgets(testSource, macroTransformationContext)); BaseObject gadgetObject1 = mock(BaseObject.class); when(xWikiDocument.getXObjects(gadgetClassReference)).thenReturn(Collections.singletonList(ga...
cwe
CWE-94
Java
do_add_counters(struct net *net, const void __user *user, unsigned int len, int compat) { unsigned int i; struct xt_counters_info tmp; struct xt_counters *paddc; unsigned int num_counters; const char *name; int size; void *ptmp; struct xt_table *t; const struct xt_table_info *private; int ret = 0; struct i...
cwe
CWE-119
Unknown
static void xenvif_fatal_tx_err(struct xenvif *vif) { netdev_err(vif->dev, "fatal error; disabling device\n"); xenvif_carrier_off(vif); }
cwe
CWE-399
Unknown
static int dns_transaction_emit_tcp(DnsTransaction *t) { _cleanup_close_ int fd = -1; _cleanup_(dns_stream_unrefp) DnsStream *s = NULL; union sockaddr_union sa; int r; assert(t); dns_transaction_close_connection(t); switch (t->scope->protocol) { case D...
cwe
CWE-416
Unknown
static int do_add_counters(struct net *net, const void __user *user, unsigned int len, int compat) { unsigned int i; struct xt_counters_info tmp; struct xt_counters *paddc; unsigned int num_counters; const char *name; int size; void *ptmp; struct xt_table *t; const struct xt_table_info *private; int ret...
cwe
CWE-119
Unknown
PHP_FUNCTION(move_uploaded_file) { char *path, *new_path; int path_len, new_path_len; zend_bool successful = 0; #ifndef PHP_WIN32 int oldmask; int ret; #endif if (!SG(rfc1867_uploaded_files)) { RETURN_FALSE; } if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &path, &pat...
cwe
CWE-264
Unknown
static int samldb_user_account_control_change(struct samldb_ctx *ac) { struct ldb_context *ldb = ldb_module_get_ctx(ac->module); uint32_t old_uac; uint32_t new_uac; uint32_t raw_uac; uint32_t old_ufa; uint32_t new_ufa; uint32_t old_uac_computed; uint32_t clear_uac; uint32_t old_atype; uint32_t new_atype; uin...
cwe
CWE-200
Unknown
ins_compl_infercase_gettext( char_u *str, int char_len, int compl_char_len, int min_len, char_u **tofree) { int *wca; // Wide character array. char_u *p; int i, c; int has_lower = FALSE; int was_letter = FALSE; garray_T gap; IObuff[0] = NUL; // Allocate wide character array...
cwe
CWE-122
Unknown
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
cwe
CWE-125
C/C++
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { const TfLiteTensor* input = GetInput(context, node, kInputTensor); TfLiteTensor* output = GetOutput(context, node, kOutputTensor); const int num_elements = NumElements(input); TF_LITE_ENSURE_EQ(context, num_elements, NumElements(output)); switch (i...
cwe
CWE-787
C/C++
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { auto* params = reinterpret_cast<TfLiteLSHProjectionParams*>(node->builtin_data); int32_t* out_buf = GetOutput(context, node, 0)->data.i32; const TfLiteTensor* hash = GetInput(context, node, 0); const TfLiteTensor* input = GetInput(context, nod...
cwe
CWE-125
C/C++
print_help (void) { /* We split the help text this way to ease translation of individual entries. */ static const char *help[] = { "\n", N_("\ Mandatory arguments to long options are mandatory for short options too.\n\n"), N_("\ Startup:\n"), N_("\ -V, --version display the versio...
cwe
CWE-20
Unknown
void WebPreferences::Apply(WebView* web_view) const { WebSettings* settings = web_view->settings(); ApplyFontsFromMap(standard_font_family_map, setStandardFontFamilyWrapper, settings); ApplyFontsFromMap(fixed_font_family_map, setFixedFontFamilyWrapper, settings); ApplyFontsFromMap(serif_font...
cwe
CWE-20
C/C++
package v1 import ( "encoding/json" "net/http" "github.com/KubeOperator/KubeOperator/pkg/controller" "github.com/KubeOperator/KubeOperator/pkg/errorf" "github.com/KubeOperator/KubeOperator/pkg/middleware" "github.com/jinzhu/gorm" "github.com/kataras/iris/v12" "github.com/kataras/iris/v12/context" "github.com...
cwe
CWE-285
Go
inlineTokens(src, tokens = [], inLink = false, inRawBlock = false) { let token, lastToken; // String with links masked to avoid interference with em and strong let maskedSrc = src; let match; let keepPrevChar, prevChar; // Mask out reflinks if (this.tokens.links) { const links = Obje...
cwe
CWE-400
JavaScript
resetPassword(req) { const config = req.config; if (!config) { this.invalidRequest(); } if (!config.publicServerURL) { return this.missingPublicServerURL(); } const { username, token, new_password } = req.body; if ((!username || !token || !new_password) && req.xhr === false) ...
cwe
CWE-285
JavaScript
bool Smb4KMountJob::fillArgs(Smb4KShare *share, QMap<QString, QVariant>& map) { QString mount; QStringList paths; paths << "/bin"; paths << "/sbin"; paths << "/usr/bin"; paths << "/usr/sbin"; paths << "/usr/local/bin"; paths << "/usr/local/sbin"; for (int i = 0; i < paths.size(); ++i) { mount =...
cwe
CWE-20
C/C++
it "drops the collection" do database.should_receive(:command).with(drop: :users) collection.drop end
cwe
CWE-20
Ruby
/************************************************************************ * This file is part of EspoCRM. * * EspoCRM - Open Source CRM application. * Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko * Website: https://www.espocrm.com * * EspoCRM is free software: you can redistribute i...
cwe
CWE-79
JavaScript
def format_object(object, html=true, &block) if block_given? object = yield object end case object.class.name when 'Array' object.map {|o| format_object(o, html)}.join(', ').html_safe when 'Time' format_time(object) when 'Date' format_date(object) when 'Fixnum' ...
cwe
CWE-79
Ruby
lex (void) { unsigned int c, c2; int backslash = 0; charclass ccl; int i; /* Basic plan: We fetch a character. If it's a backslash, we set the backslash flag and go through the loop again. On the plus side, this avoids having a duplicate of the main switch inside the backslash case. On the m...
cwe
CWE-189
Unknown
int wolfSSH_SFTP_RecvRead(WOLFSSH* ssh, int reqId, byte* data, word32 maxSz) #ifndef USE_WINDOWS_API { WFD fd; word32 sz; int ret; word32 idx = 0; word32 ofst[2] = {0, 0}; byte* out; word32 outSz; char* res = NULL; char err[] = "Read File Error"; char eof[] = "Read EOF...
cwe
CWE-190
Unknown
static RSA_PSS_PARAMS *rsa_pss_decode(const X509_ALGOR *alg, X509_ALGOR **pmaskHash) { const unsigned char *p; int plen; RSA_PSS_PARAMS *pss; *pmaskHash = NULL; if (!alg->parameter || alg->parameter->type != V_ASN1_SEQUENCE) return NULL; p = alg->p...
cwe
CWE-476
Unknown
void Compute(OpKernelContext* ctx) override { const Tensor& gradient = ctx->input(0); const Tensor& input = ctx->input(1); Tensor* input_backprop = nullptr; OP_REQUIRES_OK(ctx, ctx->allocate_output(0, input.shape(), &input_backprop)); OP_REQUIRES( ctx, input.IsSameSize(gr...
cwe
CWE-787
Unknown
QInt8() {}
cwe
CWE-908
C/C++
static ssize_t aio_setup_vectored_rw(int type, struct kiocb *kiocb, bool compat) { ssize_t ret; #ifdef CONFIG_COMPAT if (compat) ret = compat_rw_copy_check_uvector(type, (struct compat_iovec __user *)kiocb->ki_buf, kiocb->ki_nbytes, 1, &kiocb->ki_inline_vec, &kiocb->ki_iovec, 1); else #endif ret = r...
cwe
CWE-190
C/C++
void Node::RunForwardTypeInference() { VLOG(4) << "Forward type inference: " << props_->node_def.DebugString(); if (props_->fwd_type_fn == nullptr) { return; } std::vector<Node*> input_nodes(props_->input_types.size(), nullptr); std::vector<int> input_idx(props_->input_types.size(), 0); for (const aut...
cwe
CWE-125
C/C++
def set_sync_options(params, request, session) if not allowed_for_local_cluster(session, Permissions::FULL) return 403, 'Permission denied' end options = [ 'sync_thread_pause', 'sync_thread_resume', 'sync_thread_disable', 'sync_thread_enable', ] if params.keys.count { |key| options.include?(key) ...
cwe
CWE-384
Ruby
/* Copyright (C) 2010 ABRT team 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. This program is distributed in th...
cwe
CWE-59
C/C++
int snd_timer_open(struct snd_timer_instance **ti, char *owner, struct snd_timer_id *tid, unsigned int slave_id) { struct snd_timer *timer; struct snd_timer_instance *timeri = NULL; struct device *card_dev_to_put = NULL; int err; mutex_lock(&register_mutex); if (tid->dev_class == SNDRV_TIMER_CLASS_SLAV...
cwe
CWE-703
C/C++
void HeaderTable::setCapacity(uint32_t capacity) { auto oldCapacity = capacity_; capacity_ = capacity; if (capacity_ <= oldCapacity) { evict(0); } else { auto oldTail = tail(); auto oldLength = table_.size(); uint32_t newLength = (capacity_ >> 5) + 1; table_.resize(newLength); if (size_ ...
cwe
CWE-416
Unknown
void MediaStreamDispatcherHost::DoOpenDevice( int32_t page_request_id, const std::string& device_id, blink::MediaStreamType type, OpenDeviceCallback callback, MediaDeviceSaltAndOrigin salt_and_origin) { DCHECK_CURRENTLY_ON(BrowserThread::IO); if (!MediaStreamManager::IsOriginAllowed(render_proce...
cwe
CWE-119
Unknown
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible 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 3 of the License, or # (at your option) any lat...
cwe
CWE-74
Python
import EventEmitter from "event-emitter"; import {extend, borders, uuid, isNumber, bounds, defer, createBlobUrl, revokeBlobUrl} from "../../utils/core"; import EpubCFI from "../../epubcfi"; import Contents from "../../contents"; import { EVENTS } from "../../utils/constants"; import { Pane, Highlight, Underline } from ...
cwe
CWE-79
JavaScript
static int cqspi_setup_flash(struct cqspi_st *cqspi, struct device_node *np) { struct platform_device *pdev = cqspi->pdev; struct device *dev = &pdev->dev; struct cqspi_flash_pdata *f_pdata; struct spi_nor *nor; struct mtd_info *mtd; unsigned int cs; int i, ret; /* Get flash device data */ for_each_available_...
cwe
CWE-119
Unknown