code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
static char *fstrndup(const char *ptr, unsigned long len) { char *result; if (len <= 0) return NULL; result = ALLOC_N(char, len); memccpy(result, ptr, 0, len); return result; }
cwe
CWE-119
C/C++
static const SSL_METHOD *ssl23_get_server_method(int ver) { #ifndef OPENSSL_NO_SSL2 if (ver == SSL2_VERSION) return(SSLv2_server_method()); #endif if (ver == SSL3_VERSION) return(SSLv3_server_method()); else if (ver == TLS1_VERSION) return(TLSv1_server_method()); else if (ver == TLS1_1_VERSION) return(TLSv...
cwe
CWE-310
Unknown
Tine.Addressbook.ContactGridPanel.countryRenderer = function(data) { data = Locale.getTranslationData('CountryList', data); return data; };
cwe
CWE-79
JavaScript
require('../lib/initConf'); require('../lib/setupProxy'); var unzipper = require('unzipper'); var path = require('path'); var archiver = require('archiver'); var cas = require('../lib/add_certs'); var os = require('os'); var fs = require('fs'); var http = require('http'); var express = require('express'); var bodyPars...
cwe
CWE-352
JavaScript
tsize_t t2p_readwrite_pdf_image_tile(T2P* t2p, TIFF* input, TIFF* output, ttile_t tile){ uint16 edge=0; tsize_t written=0; unsigned char* buffer=NULL; tsize_t bufferoffset=0; unsigned char* samplebuffer=NULL; tsize_t samplebufferoffset=0; tsize_t read=0; uint16 i=0; ttile_t tilecount=0; /* tsize_t tilesize=0...
cwe
CWE-119
Unknown
bool ImageResource::IsAccessAllowed( const SecurityOrigin* security_origin, ImageResourceInfo::DoesCurrentFrameHaveSingleSecurityOrigin does_current_frame_has_single_security_origin) const { if (GetCORSStatus() == CORSStatus::kServiceWorkerOpaque) return false; if (does_current_frame_has_s...
cwe
CWE-200
C/C++
var sanitize_html = function (html, allow_css) { /** * sanitize HTML * if allow_css is true (default: false), CSS is sanitized as well. * otherwise, CSS elements and attributes are simply removed. */ var html4 = caja.html4; if (allow_css) { // all...
cwe
CWE-79
JavaScript
TfLiteStatus CheckLstmTensorDimensionsAndTypes( TfLiteContext* context, TfLiteNode* node, int n_input, int n_output, int n_cell, int input_to_input_weights_tensor, int input_to_forget_weights_tensor, int input_to_cell_weights_tensor, int input_to_output_weights_tensor, int recurrent_to_input_weights_ten...
cwe
CWE-787
C/C++
$formatted = wfMessage( 'datadump-table-column-failed' )->text(); } else { $formatted = wfMessage( 'datadump-table-column-queued' )->text(); } break; case 'dumps_size': $formatted = htmlspecialchars( $this->getLanguage()->formatSize( isset( $row->dumps_size ) ? $row->dumps_size : 0 ) ); ...
cwe
CWE-352
PHP
/* * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. */ /* * Licensed to Elasticsearch under one or more contributor * license agreements. See the NOTICE file distribute...
cwe
CWE-200
Java
/* * GPAC - Multimedia Framework C SDK * * Authors: Romain Bouqueau, Jean Le Feuvre * Copyright (c) Telecom ParisTech 2018-2021 * All rights reserved * * This file is part of GPAC / AV1 IVF/OBU/annexB reframer filter * * GPAC is free software; you can redistribute it and/or modify * it under the ...
cwe
CWE-476
C/C++
public KeyPair generateKeyPair() { if (!initialised) { DSAParametersGenerator pGen = new DSAParametersGenerator(); pGen.init(strength, certainty, random); param = new DSAKeyGenerationParameters(random, pGen.generateParameters()); engine.init(param); ...
cwe
CWE-310
Java
ord := func(n int) string { switch { case n%100 >= 11 && n%100 <= 13: return "th" case n%10 == 1: return "st" case n%10 == 2: return "nd" case n%10 == 3: return "rd" } return "th" }
cwe
CWE-681
Go
OME.WellBirdsEye = function(opts) { var $tree_details = $("#tree_details"); var $well_details = $("#well_details"); var $well_birds_eye = $("#well_birds_eye"); function selectionChanged() { var imageIds = []; $('.ui-selected', $well_birds_eye).each(function(ws){...
cwe
CWE-79
JavaScript
function c(B,G,M,H,F,J,R,W,O){try{if(b.spinner.stop(),null==G||"image/"==G.substring(0,6))if(null==B&&null!=R||null==z[B]){var V=function(){P.innerHTML="";P.style.cursor="pointer";P.style.whiteSpace="nowrap";P.style.textOverflow="ellipsis";mxUtils.write(P,null!=T.title&&0<T.title.length?T.title:mxResources.get("untitle...
cwe
CWE-94
JavaScript
static int ovl_rename2(struct inode *olddir, struct dentry *old, struct inode *newdir, struct dentry *new, unsigned int flags) { int err; enum ovl_path_type old_type; enum ovl_path_type new_type; struct dentry *old_upperdir; struct dentry *new_upperdir; struct dentry *olddentry; struct dentry *...
cwe
CWE-20
C/C++
def readOptInt(json: JsValue, fieldName: String, altName: String = "", min: Opt[i32] = None, max: Opt[i32] = None): Option[Int] = { readOptLong(json, fieldName).orElse(readOptLong(json, altName)) map { valueAsLong => val maxVal = max getOrElse Int.MaxValue val minVal = min getOrElse Int.MinVal...
cwe
CWE-613
Scala
check_lnums(int do_curwin) { win_T *wp; tabpage_T *tp; FOR_ALL_TAB_WINDOWS(tp, wp) if ((do_curwin || wp != curwin) && wp->w_buffer == curbuf) { // save the original cursor position and topline wp->w_save_cursor.w_cursor_save = wp->w_cursor; wp->w_save_cursor.w_topline_save = wp->w_topline;...
cwe
CWE-787
Unknown
static int pad_pkcs2(bn_t m, int *p_len, int m_len, int k_len, int operation) { uint8_t pad, h1[RLC_MD_LEN], h2[RLC_MD_LEN]; /* MSVC does not allow dynamic stack arrays */ uint8_t *mask = RLC_ALLOCA(uint8_t, k_len); int result = RLC_OK; bn_t t; bn_null(t); RLC_TRY { bn_new(t); switch ...
cwe
CWE-327
C/C++
public function getName($translated = true) { if ($translated === true) { return _T($this->name); } else { return $this->name; } }
cwe
CWE-79
PHP
#!/usr/bin/env python # # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. from typing import Optional, Tuple from onefuzztypes.events import EventInstanceConfigUpdated from onefuzztypes.models import InstanceConfig as BASE_CONFIG from pydantic import Field from .azure.creds import get_instance...
cwe
CWE-346
Python
@contextmanager def run_interactive_shell_command(command, **kwargs): """ Runs a command in shell and provides stdout, stderr and stdin streams. This function creates a context manager that sets up the process, returns to caller, closes streams and waits for process to exit on leaving. The process...
cwe
CWE-78
Python
def _do_get_well_known(self, server_name): """Actually fetch and parse a .well-known, without checking the cache :param server_name: Name of the server, from the requested url :type server_name: bytes :returns a tuple of (result, cache period), where result is one of: - the...
cwe
CWE-770
Python
function Qa(e,t){var n=Xe(e.doc,t),r=Qt(n);return r!=n&&(t=tt(r)),Ya(!0,e,n,t,-1)}
cwe
CWE-79
JavaScript
header_put_le_8byte (SF_PRIVATE *psf, sf_count_t x) { if (psf->headindex < SIGNED_SIZEOF (psf->header) - 8) { psf->header [psf->headindex++] = x ; psf->header [psf->headindex++] = (x >> 8) ; psf->header [psf->headindex++] = (x >> 16) ; psf->header [psf->headindex++] = (x >> 24) ; psf->header [psf->headindex++]...
cwe
CWE-787
Unknown
#include "extensions/filters/http/rbac/rbac_filter.h" #include "envoy/stats/scope.h" #include "common/http/utility.h" #include "extensions/filters/http/well_known_names.h" #include "absl/strings/str_join.h" namespace Envoy { namespace Extensions { namespace HttpFilters { namespace RBACFilter { struct RcDetailsVal...
cwe
CWE-400
C/C++
link : fm.i18n('link') }; this.tpl = { main : '<div class="ui-helper-clearfix elfinder-info-title"><span class="elfinder-cwd-icon {class} ui-corner-all"/>{title}</div><table class="elfinder-info-tb">{content}</table>', itemTitle : '<strong>{name}</strong><span class="elfinder-info-kind">{kind}</spa...
cwe
CWE-89
JavaScript
radix__hugetlb_get_unmapped_area(struct file *file, unsigned long addr, unsigned long len, unsigned long pgoff, unsigned long flags) { struct mm_struct *mm = current->mm; struct vm_area_struct *vma; struct hstate *h = hstate_file(file); struct vm_unmapped_area_info info; if (unlikely(addr > mm->context.ad...
cwe
CWE-119
Unknown
#!/usr/bin/python -u # # p7zr library # # Copyright (c) 2019-2021 Hiroshi Miura <miurahr@linux.com> # Copyright (c) 2004-2015 by Joachim Bauch, mail@joachim-bauch.de # 7-Zip Copyright (C) 1999-2010 Igor Pavlov # LZMA SDK Copyright (C) 1999-2010 Igor Pavlov # # This library is free software; you can redistribute it and/...
cwe
CWE-22
Python
public function column_title( $post ) { global $mode; if ( $this->hierarchical_display ) { if ( 0 === $this->current_level && (int) $post->post_parent > 0 ) { // Sent level 0 by accident, by default, or because we don't know the actual level. $find_main_page = (int) $post->post_parent; while ( $find...
cwe
CWE-79
PHP
static int ext4_ext_grow_indepth(handle_t *handle, struct inode *inode, unsigned int flags) { struct ext4_extent_header *neh; struct buffer_head *bh; ext4_fsblk_t newblock, goal = 0; struct ext4_super_block *es = EXT4_SB(inode->i_sb)->s_es; int err = 0; /* Try to prepend new index to old one */ if (ext_dep...
cwe
CWE-200
Unknown
/** * Return an instance of Listing. * * @constructor * @param {Object} options - instance options */ var Listing = function(options) { this.initialize(options); }; Listing.prototype = { constructor: Listing, listing_defaults: { sortable_selector: '.sortable', with_searchform: true, ...
cwe
CWE-79
Python
static int ext4_valid_extent_idx(struct inode *inode, struct ext4_extent_idx *ext_idx) { ext4_fsblk_t block = ext4_idx_pblock(ext_idx); return ext4_data_block_valid(EXT4_SB(inode->i_sb), block, 1); }
cwe
CWE-703
Unknown
public function delete($id) { $this->CRUD->delete($id); $responsePayload = $this->CRUD->getResponsePayload(); if (!empty($responsePayload)) { return $responsePayload; } $this->set('metaGroup', 'Trust Circles'); }
cwe
CWE-863
PHP
public RFC5649Wrap() { super(new RFC5649WrapEngine(new AESFastEngine())); }
cwe
CWE-310
Java
ObfuscatedPasswd::ObfuscatedPasswd(const PlainPasswd& plainPwd) : CharArray(8), length(8) { int l = strlen(plainPwd.buf), i; for (i=0; i<8; i++) buf[i] = i<l ? plainPwd.buf[i] : 0; deskey(d3desObfuscationKey, EN0); des((rdr::U8*)buf, (rdr::U8*)buf); }
cwe
CWE-122
C/C++
TIFFReadRawTile1(TIFF* tif, uint32 tile, void* buf, tmsize_t size, const char* module) { TIFFDirectory *td = &tif->tif_dir; if (!_TIFFFillStriles( tif )) return ((tmsize_t)(-1)); assert((tif->tif_flags&TIFF_NOREADRAW)==0); if (!isMapped(tif)) { tmsize_t cc; if (!SeekOK(tif, td->td_stripoffset[tile...
cwe
CWE-189
Unknown
check_mountpoint(const char *progname, char *mountpoint) { int err; struct stat statbuf; /* does mountpoint exist and is it a directory? */ err = stat(mountpoint, &statbuf); if (err) { fprintf(stderr, "%s: failed to stat %s: %s\n", progname, mountpoint, strerror(errno)); return EX_USAGE; } if (!S_ISDIR...
cwe
CWE-59
Unknown
int FdOutStream::overrun(int itemSize, int nItems) { if (itemSize > bufSize) throw Exception("FdOutStream overrun: max itemSize exceeded"); // First try to get rid of the data we have flush(); // Still not enough space? if (itemSize > end - ptr) { // Can we shuffle things around? // (don't do th...
cwe
CWE-122
C/C++
function get_allowed_files_extensions_for_upload($fileTypes = 'images', $returnAsArray = false) { $are_allowed = ''; switch ($fileTypes) { case 'img': case 'image': case 'images': $are_allowed .= ',png,gif,jpg,jpeg,tiff,bmp,svg,webp,ico'; ...
cwe
CWE-79
PHP
void Compute(OpKernelContext* ctx) override { auto x = ctx->input(0); auto i = ctx->input(1); auto v = ctx->input(2); OP_REQUIRES(ctx, TensorShapeUtils::IsVector(i.shape()), errors::InvalidArgument("i must be a vector. ", i.shape().DebugString()))...
cwe
CWE-369
Unknown
public function Load($tree) { if (!$tree) return; $contents = array(); $treePath = $tree->GetPath(); $args = array(); $args[] = '--full-name'; if ($this->exe->CanShowSizeInTree()) $args[] = '-l'; $args[] = '-t'; $args[] = $tree->GetHash(); $lines = explode("\n", $this->exe->Execute($tree-...
cwe
CWE-78
PHP
channel_forward_listen(LIBSSH2_SESSION * session, const char *host, int port, int *bound_port, int queue_maxsize) { unsigned char *s; static const unsigned char reply_codes[3] = { SSH_MSG_REQUEST_SUCCESS, SSH_MSG_REQUEST_FAILURE, 0 }; int rc; if(!host) host = "0.0...
cwe
CWE-787
Unknown
package schema import ( "strings" "github.com/answerdev/answer/internal/base/reason" "github.com/answerdev/answer/internal/base/validator" "github.com/answerdev/answer/pkg/converter" "github.com/segmentfault/pacman/errors" ) // SearchTagLikeReq get tag list all request type SearchTagLikeReq struct { // tag Ta...
cwe
CWE-79
Go
static LUA_FUNCTION(openssl_x509_check_ip_asc) { X509 * cert = CHECK_OBJECT(1, X509, "openssl.x509"); if (lua_isstring(L, 2)) { const char *ip_asc = lua_tostring(L, 2); lua_pushboolean(L, X509_check_ip_asc(cert, ip_asc, 0)); } else { lua_pushboolean(L, 0); } return 1; }
cwe
CWE-295
C/C++
public static SSLSocketFactory getSslSocketFactory(Properties info) throws PSQLException { String classname = PGProperty.SSL_FACTORY.get(info); if (classname == null || "org.postgresql.ssl.jdbc4.LibPQFactory".equals(classname) || "org.postgresql.ssl.LibPQFactory".equals(classname)) { retur...
cwe
CWE-665
Java
pci_set_cfgdata32(struct pci_vdev *dev, int offset, uint32_t val) { assert(offset <= (PCI_REGMAX - 3) && (offset & 3) == 0); *(uint32_t *)(dev->cfgdata + offset) = val; }
cwe
CWE-617
C/C++
# -*- 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-284
Python
#!/usr/bin/env python # # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import azure.functions as func # This endpoint handles the signalr negotation # As we do not differentiate from clients at this time, we pass the Functions runtime # provided connection straight to the client # # For more...
cwe
CWE-346
Python
int_x509_param_set_hosts(X509_VERIFY_PARAM_ID *id, int mode, const char *name, size_t namelen) { char *copy; /* * Refuse names with embedded NUL bytes. * XXX: Do we need to push an error onto the error stack? */ if (name && memchr(name, '\0', namelen)) return 0; if (mode == SET_HOST && id->hosts...
cwe
CWE-295
Unknown
$.extend( $.fn, { // https://jqueryvalidation.org/validate/ validate: function( options ) { // If nothing is selected, return nothing; can't chain anyway if ( !this.length ) { if ( options && options.debug && window.console ) { console.warn( "Nothing selected, can't validate, returning nothing." ); } ...
cwe
CWE-400
JavaScript
function(A,z,L,M,n){q.apply(this,arguments);m()};t.resizeCell=function(){mxGraph.prototype.resizeCell.apply(this,arguments);m()};t.connectionHandler.addListener(mxEvent.CONNECT,function(){m()})}var v=mxUtils.button(mxResources.get("close"),function(){b.confirm(mxResources.get("areYouSure"),function(){null!=u.parentNode...
cwe
CWE-20
JavaScript
int parse_config(char *filename, bridge_t **bridges) { dictionary *ubridge_config = NULL; const char *value; const char *bridge_name; int i, nsec; if ((ubridge_config = iniparser_load(filename)) == NULL) { return FALSE; } nsec = iniparser_getnsec(ubridge_config); for (i = 0; i <...
cwe
CWE-200
Unknown
SYSCALL_DEFINE4(ptrace, long, request, long, pid, unsigned long, addr, unsigned long, data) { struct task_struct *child; long ret; if (request == PTRACE_TRACEME) { ret = ptrace_traceme(); if (!ret) arch_ptrace_attach(current); goto out; } child = ptrace_get_task_struct(pid); if (IS_ERR(child)) { re...
cwe
CWE-362
C/C++
/********************************************************************\ * BitlBee -- An IRC to other IM-networks gateway * * * * Copyright 2010 Wilmer van der Gaast <wilmer@gaast.net> * \***********************************...
cwe
CWE-476
C/C++
static int tc_ctl_tfilter(struct sk_buff *skb, struct nlmsghdr *n) { struct net *net = sock_net(skb->sk); struct nlattr *tca[TCA_MAX + 1]; spinlock_t *root_lock; struct tcmsg *t; u32 protocol; u32 prio; u32 nprio; u32 parent; struct net_device *dev; struct Qdisc *q; struct tcf_proto **back, **chain; struct...
cwe
CWE-264
Unknown
'use strict'; var util = require('util'), path = require('path'), shell = require('shelljs'), debug = require('debug')('dns-sync'); //source - http://stackoverflow.com/questions/106179/regular-expression-to-match-dns-hostname-or-ip-address var ValidHostnameRegex = new RegExp("^(([a-zA-Z0-9]|[a-zA-Z0-9][a-...
cwe
CWE-94
JavaScript
function checkProp(value, schema, path,i){ var l; path += path ? typeof i == 'number' ? '[' + i + ']' : typeof i == 'undefined' ? '' : '.' + i : i; function addError(message){ errors.push({property:path,message:message}); } if((typeof schema != 'object' || schema instanceof Array) && (path || typeof sche...
cwe
CWE-1321
JavaScript
function f(t){if(t instanceof Error||t.status>=400)return s.updateLoadingStatus("failed"),r.newThrownErr(o()(new Error((t.message||t.statusText)+" "+e),{source:"fetch"})),void(!t.status&&t instanceof Error&&function(){try{var t;if("URL"in m.a?t=new i.a(e):(t=document.createElement("a")).href=e,"https:"!==t.protocol&&"h...
cwe
CWE-200
JavaScript
def self.get_taxon_concept_id(hierarchy_entry_id) he = self.find_by_sql("select taxon_concept_id from hierarchy_entries where id=#{hierarchy_entry_id};") if he.count > 0 return he.first.taxon_concept_id else return 0 end end
cwe
CWE-89
Ruby
Status TransposeShapeFn(InferenceContext* c) { ShapeHandle input = c->input(0); ShapeHandle perm_shape = c->input(1); const Tensor* perm = c->input_tensor(1); DimensionHandle perm_elems = c->NumElements(perm_shape); // If we don't have rank information on the input or value information on // perm we can't r...
cwe
CWE-787
C/C++
function XMLRPCaddNode($nodeName, $parentNode){ require_once(".ht-inc/privileges.php"); global $user; if(in_array("nodeAdmin", $user['privileges'])){ if(!$parentNode){ $topNodes = getChildNodes(); $keys = array_keys($topNodes); $parentNode = array_shift($keys); ...
cwe
CWE-20
PHP
static void php_snmp_internal(INTERNAL_FUNCTION_PARAMETERS, int st, struct snmp_session *session, struct objid_query *objid_query) { struct snmp_session *ss; struct snmp_pdu *pdu=NULL, *response; struct ...
cwe
CWE-416
C/C++
'use strict' const Router = require('express').Router const formidable = require('formidable') const path = require('path') const fs = require('fs') const os = require('os') const rimraf = require('rimraf') const isSvg = require('is-svg') const config = require('../../config') const logger = require('../../logger') c...
cwe
CWE-434
JavaScript
void DevToolsWindow::InspectedContentsClosing() { web_contents_->GetRenderViewHost()->ClosePage(); }
cwe
CWE-264
Unknown
/* * * * Copyright (c) 2016. David Sowerby * * * * 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 la...
cwe
CWE-89
Java
QPDF::calculateHPageOffset( std::map<int, QPDFXRefEntry> const& xref, std::map<int, qpdf_offset_t> const& lengths, std::map<int, int> const& obj_renumber) { // Page Offset Hint Table // We are purposely leaving some values set to their initial zero // values. std::vector<QPDFObjectHandle> ...
cwe
CWE-787
Unknown
func testThatLegalHoldStatusIsEnabled_AfterAcceptingRequest() { // GIVEN let selfUser = ZMUser.selfUser(in: uiMOC) createSelfClient(onMOC: uiMOC) let conversation = createConversation(in: uiMOC) conversation.addParticipantAndUpdateConversationState(user: selfUser, role: nil) ...
cwe
CWE-345
Swift
static int dgram_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, size_t len, int noblock, int flags, int *addr_len) { size_t copied = 0; int err = -EOPNOTSUPP; struct sk_buff *skb; struct sockaddr_ieee802154 *saddr; saddr = (struct sockaddr_ieee802154 *)msg->msg_name; skb = skb_recv_datagra...
cwe
CWE-200
C/C++
/* * GPAC - Multimedia Framework C SDK * * Authors: Jean Le Feuvre * Copyright (c) Telecom ParisTech 2000-2020 * All rights reserved * * This file is part of GPAC / ISO Media File Format sub-project * * GPAC is free software; you can redistribute it and/or modify * it under the terms of the GNU L...
cwe
CWE-476
C/C++
ex_put(exarg_T *eap) { // ":0put" works like ":1put!". if (eap->line2 == 0) { eap->line2 = 1; eap->forceit = TRUE; } curwin->w_cursor.lnum = eap->line2; do_put(eap->regname, NULL, eap->forceit ? BACKWARD : FORWARD, 1L, PUT_LINE|PUT_CURSLINE); }
cwe
CWE-122
Unknown
/* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2016 The PHP Group | +---------...
cwe
CWE-189
C/C++
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % CCC U U TTTTT ...
cwe
CWE-787
C/C++
int rsa_pkcs1_sign( rsa_context *ctx, int (*f_rng)(void *, unsigned char *, size_t), void *p_rng, int mode, int hash_id, unsigned int hashlen, const unsigned char *hash, unsigned c...
cwe
CWE-310
Unknown
OMX_ERRORTYPE SoftAMRNBEncoder::internalSetParameter( OMX_INDEXTYPE index, const OMX_PTR params) { switch (index) { case OMX_IndexParamStandardComponentRole: { const OMX_PARAM_COMPONENTROLETYPE *roleParams = (const OMX_PARAM_COMPONENTROLETYPE *)params; if (strncm...
cwe
CWE-119
C/C++
public function getFileContent($file, $identifier) { $resource = sprintf('hg cat -r %s %s', ProcessExecutor::escape($identifier), ProcessExecutor::escape($file)); $this->process->execute($resource, $content, $this->repoDir); if (!trim($content)) { return null; } ...
cwe
CWE-88
PHP
void Splash::scaleMaskYdXu(SplashImageMaskSource src, void *srcData, int srcWidth, int srcHeight, int scaledWidth, int scaledHeight, SplashBitmap *dest) { Guchar *lineBuf; Guint *pixBuf; Guint pix; Guchar *destPtr; int yp, yq, xp, xq, yt, y, yStep, xt, x, xStep, d; int i, j; yp = s...
cwe
CWE-119
C/C++
GraphViewer.processElements = function(classname) { mxUtils.forEach(GraphViewer.getElementsByClassName(classname || 'mxgraph'), function(div) { try { div.innerHTML = ''; GraphViewer.createViewerForElement(div); } catch (e) { div.innerHTML = e.message; if (window.console != null) { con...
cwe
CWE-94
JavaScript
Int32 BZ2_decompress ( DState* s ) { UChar uc; Int32 retVal; Int32 minLen, maxLen; bz_stream* strm = s->strm; /* stuff that needs to be saved/restored */ Int32 i; Int32 j; Int32 t; Int32 alphaSize; Int32 nGroups; Int32 nSelectors; Int32 EOB; Int32 groupNo; ...
cwe
CWE-787
C/C++
static bool generic_new(struct nf_conn *ct, const struct sk_buff *skb, unsigned int dataoff, unsigned int *timeouts) { return true; }
cwe
CWE-20
C/C++
// ximage.cpp : main implementation file /* 07/08/2001 v1.00 - Davide Pizzolato - www.xdp.it * CxImage version 7.0.2 07/Feb/2011 */ #include "ximage.h" #ifndef min #define min(a,b) (((a)<(b))?(a):(b)) #endif #ifndef max #define max(a,b) (((a)>(b))?(a):(b)) #endif //////////////////////////////////////////////////...
cwe
CWE-787
C/C++
virtual void seekg (Int64 pos) { if( pos < 0 ) { THROW (IEX_NAMESPACE::InputExc, "internal error: seek to " << pos << " requested"); } current = base + pos; if( current < base || current > end) { THROW (IEX_NAMESPACE::InputExc, "Out of range se...
cwe
CWE-787
Unknown
def send_local_configs_to_nodes( session, nodes, force=false, clear_local_permissions=false ) configs = Cfgsync::get_configs_local(true) if clear_local_permissions pcs_config = PCSConfig.new(configs[Cfgsync::PcsdSettings.name].text()) pcs_config.permissions_local = Permissions::PermissionsSet.new([]) ...
cwe
CWE-384
Ruby
ethertype_print(netdissect_options *ndo, u_short ether_type, const u_char *p, u_int length, u_int caplen, const struct lladdr_info *src, const struct lladdr_info *dst) { switch (ether_type) { case ETHERTYPE_IP: ip_print(ndo, p, length); return (1); case ET...
cwe
CWE-125
Unknown
exif_data_load_data_content (ExifData *data, ExifIfd ifd, const unsigned char *d, unsigned int ds, unsigned int offset, unsigned int recursion_depth) { ExifLong o, thumbnail_offset = 0, thumbnail_length = 0; ExifShort n; ExifEntry *entry; unsigned int i; ExifTag tag; if (!data || !data->priv) ...
cwe
CWE-400
C/C++
/* radare - LGPL - Copyright 2011-2016 - pancake */ #include <r_cons.h> #include <r_types.h> #include <r_util.h> #include <r_lib.h> #include <r_bin.h> #include "dex/dex.h" #define r_hash_adler32 __adler32 #include "../../hash/adler32.c" extern struct r_bin_dbginfo_t r_bin_dbginfo_dex; #define DEBUG_PRINTF 0 #if DEB...
cwe
CWE-476
C/C++
std::string RestAuthHandler::generateJwt(std::string const& username, std::string const& password) { AuthenticationFeature* af = AuthenticationFeature::instance(); TRI_ASSERT(af != nullptr); return fuerte::jwt::generateUserToken(af->tokenCache().jwtSecret(), username, _val...
cwe
CWE-613
C/C++
public RechnungCostEditTablePanel(final String id) { super(id); feedbackPanel = new FeedbackPanel("feedback"); ajaxComponents.register(feedbackPanel); add(feedbackPanel); this.form = new Form<AbstractRechnungsPositionDO>("form"); add(form); rows = new RepeatingView("rows"); form.add(ro...
cwe
CWE-352
Java
function OA_runMPE() { $objResponse = new xajaxResponse(); $objResponse->addAssign("run-mpe", "innerHTML", "<img src='run-mpe.php' />"); return $objResponse; }
cwe
CWE-352
PHP
function URLEscape( $string ) { $string = preg_replace_callback( // Match both decimal & hex code (although hex codes can contain a-f letters). // Should be enough as the alphabet hex codes only have numbers. "/(&#x?[0-9]+;?)/i", function( $match ) { if ( mb_substr( $match[1], -1 ) !== ';' ) { // Fix...
cwe
CWE-79
PHP
FT_Stream_EnterFrame( FT_Stream stream, FT_ULong count ) { FT_Error error = FT_Err_Ok; FT_ULong read_bytes; /* check for nested frame access */ FT_ASSERT( stream && stream->cursor == 0 ); if ( stream->read ) { /* allocate the frame in memory */ FT_Me...
cwe
CWE-20
C/C++
static int v2_init_io(struct quota_handle *h) { struct v2_disk_dqinfo ddqinfo; h->qh_info.u.v2_mdqi.dqi_qtree.dqi_entry_size = sizeof(struct v2r1_disk_dqblk); h->qh_info.u.v2_mdqi.dqi_qtree.dqi_ops = &v2r1_fmt_ops; /* Read information about quotafile */ if (h->e2fs_read(&h->qh_qf, V2_DQINFOOFF, &ddqinfo, s...
cwe
CWE-787
Unknown
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) { TF_LITE_ENSURE_EQ(context, NumInputs(node), 2); TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1); const TfLiteTensor* input = GetInput(context, node, kInputTensor); const TfLiteTensor* axis = GetInput(context, node, kAxisTensor); TF_LITE_ENSURE_...
cwe
CWE-787
C/C++
int php_wddx_deserialize_ex(char *value, int vallen, zval *return_value) { wddx_stack stack; XML_Parser parser; st_entry *ent; int retval; wddx_stack_init(&stack); parser = XML_ParserCreate("UTF-8"); XML_SetUserData(parser, &stack); XML_SetElementHandler(parser, php_wddx_push_element, php_wddx_pop_element); ...
cwe
CWE-476
C/C++
jas_image_t *jp2_decode(jas_stream_t *in, const char *optstr) { jp2_box_t *box; int found; jas_image_t *image; jp2_dec_t *dec; bool samedtype; int dtype; unsigned int i; jp2_cmap_t *cmapd; jp2_pclr_t *pclrd; jp2_cdef_t *cdefd; unsigned int channo; int newcmptno; int_fast32_t *lutents; #if 0 jp2_cdefchan_t...
cwe
CWE-476
Unknown
resolve_superior_type(const char *name, const char *mod_name, const struct lys_module *module, const struct lys_node *parent, struct lys_tpdf **ret) { int i, j; struct lys_tpdf *tpdf, *match; int tpdf_size; if (!mod_name) { /* no prefix, try built-in types */ for (...
cwe
CWE-674
C/C++
# -*- coding: utf-8 -*- # This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web) # Copyright (C) 2018-2019 OzzieIsaacs, cervinko, jkrehm, bodybybuddha, ok11, # andy29485, idalin, Kyosfonica, wuqi, Kennyl, lemmsh, # falgh1, grunjol, csitk...
cwe
CWE-284
JavaScript
static inline void ModulateHCLp(const double percent_hue, const double percent_chroma,const double percent_luma,double *red, double *green,double *blue) { double hue, luma, chroma; /* Increase or decrease color luma, chroma, or hue. */ ConvertRGBToHCLp(*red,*green,*blue,&hue,&chroma,&luma);...
cwe
CWE-835
Unknown
writepid (const char* pidfile, pid_t pid) { FILE* f; if ((f = fopen(pidfile, "w")) == NULL ) { log_err("cannot open pidfile %s: %s", pidfile, strerror(errno)); return; } if(fprintf(f, "%lu\n", (unsigned long)pid) < 0) { log_err("cannot write to pidfile %s: %s", pidfile, strerror(errno)); } fclose(...
cwe
CWE-59
C/C++
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
cwe
CWE-190
Python