code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
function createObjectIterator(obj) {
var okeys = keys(obj);
var i = -1;
var len = okeys.length;
return function next() {
var key = okeys[++i];
return i < len ? {value: obj[key], key: key} : null;
};
} | cwe | CWE-1321 | JavaScript |
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */
/*
* LSQUIC Logger implementation.
*/
#include <assert.h>
#include <errno.h>
#include <inttypes.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifndef WIN32
#include <sys/time.h>
#endif
#include <time.h>
#de... | cwe | CWE-476 | C/C++ |
public function checkLdapLogin(){
$username = 'admin';
$password = '123456';
$ldap_open = D("Options")->get("ldap_open" ) ;
$ldap_form = D("Options")->get("ldap_form" ) ;
$ldap_form = json_decode($ldap_form,1);
if (!$ldap_open) {
r... | cwe | CWE-338 | PHP |
void skip(Protocol_& prot, TType arg_type) {
switch (arg_type) {
case TType::T_BOOL: {
bool boolv;
prot.readBool(boolv);
return;
}
case TType::T_BYTE: {
int8_t bytev;
prot.readByte(bytev);
return;
}
case TType::T_I16: {
int16_t i16;
prot.readI16(i16)... | cwe | CWE-755 | Python |
static int qcow2_open(BlockDriverState *bs, QDict *options, int flags,
Error **errp)
{
BDRVQcowState *s = bs->opaque;
int len, i, ret = 0;
QCowHeader header;
QemuOpts *opts;
Error *local_err = NULL;
uint64_t ext_end;
uint64_t l1_vm_state_index;
const char *opt_overl... | cwe | CWE-20 | Unknown |
exports.create = function create(members) {
// create new class using php-style syntax (sort of)
if (!members) members = {};
// setup constructor
var constructor = null;
// inherit from parent class
if (members.__parent) {
if (members.__construct) {
// explicit constructor passed in
constructor = memb... | cwe | CWE-78 | JavaScript |
int dtls1_accept(SSL *s)
{
BUF_MEM *buf;
unsigned long Time=(unsigned long)time(NULL);
void (*cb)(const SSL *ssl,int type,int val)=NULL;
unsigned long alg_k;
int ret= -1;
int new_state,state,skip=0;
int listen;
#ifndef OPENSSL_NO_SCTP
unsigned char sctpauthkey[64];
char labelbuffer[sizeof(DTLS1_SCTP_AUTH_LABE... | cwe | CWE-310 | Unknown |
OMX_ERRORTYPE omx_video::free_buffer(OMX_IN OMX_HANDLETYPE hComp,
OMX_IN OMX_U32 port,
OMX_IN OMX_BUFFERHEADERTYPE* buffer)
{
(void)hComp;
OMX_ERRORTYPE eRet = OMX_ErrorNone;
unsigned int nPortIndex;
DEBUG_PRINT_LOW("In for encoder free_buffer");
if (m_state == OMX_... | cwe | CWE-119 | C/C++ |
/* $Id$ */
/*
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
*
* 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; eit... | cwe | CWE-120 | C/C++ |
amstar_estimate(
application_argument_t *argument)
{
GPtrArray *argv_ptr;
char *cmd = NULL;
int nullfd;
int pipefd;
FILE *dumpout = NULL;
off_t size = -1;
char line[32768];
char *errmsg = NULL;
char *qerrmsg;
char *q... | cwe | CWE-77 | Unknown |
static int snd_hrtimer_stop(struct snd_timer *t)
{
struct snd_hrtimer *stime = t->private_data;
atomic_set(&stime->running, 0);
return 0;
} | cwe | CWE-20 | C/C++ |
// Don't wait for the whole page to be loaded.
// (include script at the bottom of the page.)
var Pagination = new function() {
this.init = function(processHash, document_containers, setHash) {
// For each pagination node
var containers = new Array();
// Create new containers Array after each i... | cwe | CWE-79 | JavaScript |
daemon_AuthUserPwd(char *username, char *password, char *errbuf)
{
#ifdef _WIN32
/*
* Warning: the user which launches the process must have the
* SE_TCB_NAME right.
* This corresponds to have the "Act as part of the Operating System"
* turned on (administrative tools, local security settings, local
* polici... | cwe | CWE-476 | C/C++ |
struct sock *inet_csk_clone_lock(const struct sock *sk,
const struct request_sock *req,
const gfp_t priority)
{
struct sock *newsk = sk_clone_lock(sk, priority);
if (newsk) {
struct inet_connection_sock *newicsk = inet_csk(newsk);
newsk->sk_state = TCP_SYN_RECV;
newicsk->icsk_bind_hash = NULL;
in... | cwe | CWE-415 | C/C++ |
int wc_SignatureGenerate(
enum wc_HashType hash_type, enum wc_SignatureType sig_type,
const byte* data, word32 data_len,
byte* sig, word32 *sig_len,
const void* key, word32 key_len, WC_RNG* rng)
{
int ret;
word32 hash_len, hash_enc_len;
#ifdef WOLFSSL_SMALL_STACK
byte *hash_data;
#else
b... | cwe | CWE-347 | Unknown |
static int fsmVerify(const char *path, rpmfi fi)
{
int rc;
int saveerrno = errno;
struct stat dsb;
mode_t mode = rpmfiFMode(fi);
rc = fsmStat(path, 1, &dsb);
if (rc)
return rc;
if (S_ISREG(mode)) {
/* HP-UX (and other os'es) don't permit unlink on busy files. */
char *rmpath = rstrsc... | cwe | CWE-59 | C/C++ |
ECDSA_PrivateKey::create_signature_op(RandomNumberGenerator& /*rng*/,
const std::string& params,
const std::string& provider) const
{
#if defined(BOTAN_HAS_BEARSSL)
if(provider == "bearssl" || provider.empty())
{
try
... | cwe | CWE-200 | C/C++ |
void intel_guc_ads_reset(struct intel_guc *guc)
{
if (!guc->ads_vma)
return;
__guc_ads_init(guc);
} | cwe | CWE-190 | Unknown |
static int vmxnet3_post_load(void *opaque, int version_id)
{
VMXNET3State *s = opaque;
PCIDevice *d = PCI_DEVICE(s);
vmxnet_tx_pkt_init(&s->tx_pkt, s->max_tx_frags, s->peer_has_vhdr);
vmxnet_rx_pkt_init(&s->rx_pkt, s->peer_has_vhdr);
if (s->msix_used) {
if (!vmxnet3_use_msix_vectors(s, VM... | cwe | CWE-20 | C/C++ |
void HTMLMediaElement::NoneSupported(const String& message) {
BLINK_MEDIA_LOG << "NoneSupported(" << (void*)this << ", message='" << message
<< "')";
StopPeriodicTimers();
load_state_ = kWaitingForSource;
current_source_node_ = nullptr;
error_ = MediaError::Create(MediaError::kMedia... | cwe | CWE-200 | C/C++ |
// SPDX-License-Identifier: GPL-3.0-or-later
#include "web_api_v1.h"
static struct {
const char *name;
uint32_t hash;
RRDR_OPTIONS value;
} api_v1_data_options[] = {
{ "nonzero" , 0 , RRDR_OPTION_NONZERO}
, {"flip" , 0 , RRDR_OPTION_REVERSED}
, {"reversed"... | cwe | CWE-116 | C/C++ |
static int rsa_builtin_keygen(RSA *rsa, int bits, BIGNUM *e_value,
BN_GENCB *cb)
{
BIGNUM *r0 = NULL, *r1 = NULL, *r2 = NULL, *r3 = NULL, *tmp;
BIGNUM local_r0, local_d, local_p;
BIGNUM *pr0, *d, *p;
int bitsp, bitsq, ok = -1, n = 0;
BN_CTX *ctx = NULL;
unsigned lon... | cwe | CWE-327 | Unknown |
main_get_appheader (xd3_stream *stream, main_file *ifile,
main_file *output, main_file *sfile)
{
uint8_t *apphead;
usize_t appheadsz;
int ret;
/* The user may disable the application header. Once the appheader
* is set, this disables setting it again. */
if (! option_use_appheader) { return; }
r... | cwe | CWE-119 | Unknown |
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2018, Linaro Ltd */
#include <linux/miscdevice.h>
#include <linux/module.h>
#include <linux/poll.h>
#include <linux/skbuff.h>
#include <linux/uaccess.h>
#include "qrtr.h"
struct qrtr_tun {
struct qrtr_endpoint ep;
struct sk_buff_head queue;
wait_queue_head_t r... | cwe | CWE-401 | C/C++ |
int cfg80211_mgd_wext_giwessid(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *data, char *ssid)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
/* call only for station! */
if (WARN_ON(wdev->iftype != NL80211_IFTYPE_STATION))
return -EINVAL;
data->flags = 0;
wdev_... | cwe | CWE-120 | Unknown |
throwError: function(error, start, end) {
end = end || this.index;
var colStr = (isDefined(start)
? 's ' + start + '-' + this.index + ' [' + this.text.substring(start, end) + ']'
: ' ' + end);
throw $parseMinErr('lexerr', 'Lexer Error: {0} at column{1} in expression [{2}].',
... | cwe | CWE-74 | JavaScript |
_bdf_parse_glyphs( char* line,
unsigned long linelen,
unsigned long lineno,
void* call_data,
void* client_data )
{
int c, mask_index;
char* s;
unsigned char* bp;... | cwe | CWE-119 | Unknown |
export function cleanObject(obj: any): any {
return Object.entries(obj).reduce(
(obj, [key, value]) =>
value === undefined
? obj
: {
...obj,
[key]: value
},
{}
);
} | cwe | CWE-1321 | JavaScript |
"keydown",mxUtils.bind(this,function(N){mxEvent.isConsumed(N)||((mxEvent.isControlDown(N)||mxClient.IS_MAC&&mxEvent.isMetaDown(N))&&13==N.keyCode?(I.click(),mxEvent.consume(N)):27==N.keyCode&&(u.click(),mxEvent.consume(N)))}));I.focus();I.className="geCommentEditBtn gePrimaryBtn";ta.appendChild(I);U.insertBefore(ta,R);... | cwe | CWE-94 | JavaScript |
func (p *CompactProtocol) ReadString() (value string, err error) {
length, e := p.readVarint32()
if e != nil {
return "", NewProtocolException(e)
}
if length < 0 {
return "", invalidDataLength
}
if uint64(length) > p.trans.RemainingBytes() {
return "", invalidDataLength
}
if length == 0 {
return "", ni... | cwe | CWE-770 | Go |
render()
{
const rows = [];
if (this.props.story)
{
const hasBackgrounds = this.props.story.backgrounds.length > 0;
const classesHeaderPicture = cs(
"article-header-picture",
{
"radius-all": !hasBackgrounds,
... | cwe | CWE-200 | JavaScript |
static int snd_seq_device_dev_free(struct snd_device *device)
{
struct snd_seq_device *dev = device->device_data;
put_device(&dev->dev);
return 0;
} | cwe | CWE-416 | C/C++ |
status_t OMXNodeInstance::fillBuffer(OMX::buffer_id buffer, int fenceFd) {
Mutex::Autolock autoLock(mLock);
OMX_BUFFERHEADERTYPE *header = findBufferHeader(buffer);
header->nFilledLen = 0;
header->nOffset = 0;
header->nFlags = 0;
status_t res = storeFenceInMeta_l(header, fenceFd, kPortIndexO... | cwe | CWE-119 | C/C++ |
struct inode *ext4_iget(struct super_block *sb, unsigned long ino)
{
struct ext4_iloc iloc;
struct ext4_inode *raw_inode;
struct ext4_inode_info *ei;
struct inode *inode;
journal_t *journal = EXT4_SB(sb)->s_journal;
long ret;
loff_t size;
int block;
uid_t i_uid;
gid_t i_gid;
projid_t i_projid;
inode = iget... | cwe | CWE-416 | Unknown |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.website.website_generator import WebsiteGenerator
from frappe.website.render import clear_cache
from frappe.utils import today, cin... | cwe | CWE-79 | Python |
bool ConstantFolding::MulConvPushDown(GraphDef* optimized_graph, NodeDef* node,
const GraphProperties& properties) {
// Push down multiplication on ConvND.
// * ConvND
// / \ / \
// ... | cwe | CWE-476 | C/C++ |
webSocketsHasDataInBuffer(rfbClientPtr cl)
{
ws_ctx_t *wsctx = (ws_ctx_t *)cl->wsctx;
if (wsctx && wsctx->readbuflen)
return TRUE;
return (cl->sslctx && rfbssl_pending(cl) > 0);
} | cwe | CWE-787 | Unknown |
int ParseCertRelative(DecodedCert* cert, int type, int verify, void* cm)
{
int ret = 0;
int checkPathLen = 0;
int decrementMaxPathLen = 0;
word32 confirmOID = 0;
#if defined(WOLFSSL_RENESAS_TSIP)
int idx = 0;
#endif
byte* tsip_encRsaKeyIdx;
#ifdef WOLFSSL_CERT_REQ
int len = 0... | cwe | CWE-345 | Unknown |
public function crossOriginRedirectProvider()
{
return [
['http://example.com?a=b', 'http://test.com/', false],
['https://example.com?a=b', 'https://test.com/', false],
['http://example.com?a=b', 'https://test.com/', false],
['https://example.com?a=b', 'http:/... | cwe | CWE-200 | PHP |
module.exports = async ({ reporter, getBrowser, htmlUrl, strategy, timeout, req, imageExecution, options }) => {
const optionsToUse = Object.assign({}, options)
const browser = await getBrowser()
function pageLog (level, message) {
const maxLogEntrySize = 1000
let newMsg = message
if (newMsg.length... | cwe | CWE-200 | JavaScript |
bool SoftVPX::outputBuffers(bool flushDecoder, bool display, bool eos, bool *portWillReset) {
List<BufferInfo *> &outQueue = getPortQueue(1);
BufferInfo *outInfo = NULL;
OMX_BUFFERHEADERTYPE *outHeader = NULL;
vpx_codec_iter_t iter = NULL;
if (flushDecoder && mFrameParallelMode) {
if (vpx_codec_decode((vpx_co... | cwe | CWE-119 | C/C++ |
def set_auth_users
Log.add_info(request, params.inspect)
@folder = Folder.find(params[:id])
if Folder.check_user_auth(@folder.id, @login_user, 'w', true)
read_users = []
write_users = []
users_auth = params[:users_auth]
unless users_auth.nil?
users_auth.each do |auth_param... | cwe | CWE-89 | Ruby |
package edu.stanford.nlp.semgraph.semgrex.ssurgeon;
import java.io.*;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.text.DateFormat;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.OutputKeys;
impor... | cwe | CWE-611 | Java |
void MediaStreamManager::OpenDevice(int render_process_id,
int render_frame_id,
int page_request_id,
const std::string& device_id,
MediaStreamType type,
... | cwe | CWE-189 | C/C++ |
void MediaElementAudioSourceHandler::SetFormat(size_t number_of_channels,
float source_sample_rate) {
if (number_of_channels != source_number_of_channels_ ||
source_sample_rate != source_sample_rate_) {
if (!number_of_channels ||
number_of_channels ... | cwe | CWE-20 | C/C++ |
bool AdminRequestHandler::handleDumpStaticStringsRequest(
const std::string& /*cmd*/, const std::string& filename) {
auto const& list = lookupDefinedStaticStrings();
std::ofstream out(filename.c_str());
SCOPE_EXIT { out.close(); };
for (auto item : list) {
out << formatStaticString(item);
if (RuntimeO... | cwe | CWE-22 | C/C++ |
function esc(value) {
if (typeof value !== 'string') return value;
let last=ESCAPE.lastIndex=0, tmp=0, out='';
while (ESCAPE.test(value)) {
tmp = ESCAPE.lastIndex - 1;
out += value.substring(last, tmp) + CHARS[value[tmp]];
last = tmp + 1;
}
return out + value.substring(last);
} | cwe | CWE-79 | JavaScript |
/* Copyright 2020 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-131 | Python |
libxlLoggerCloseFile(libxlLogger *logger, int id)
{
g_autofree char *domidstr = NULL;
domidstr = g_strdup_printf("%d", id);
ignore_value(virHashRemoveEntry(logger->files, domidstr));
} | cwe | CWE-667 | Unknown |
DECLAREreadFunc(readContigTilesIntoBuffer)
{
int status = 1;
tsize_t tilesize = TIFFTileSize(in);
tdata_t tilebuf;
uint32 imagew = TIFFScanlineSize(in);
uint32 tilew = TIFFTileRowSize(in);
int iskew = imagew - tilew;
uint8* bufp = (uint8*) buf;
uint32 tw, tl;
uint32 row;
(void) spp;
tilebuf = _TIFFmalloc(t... | cwe | CWE-787 | Unknown |
static void vnc_dpy_update(DisplayState *ds, int x, int y, int w, int h)
{
int i;
VncDisplay *vd = ds->opaque;
struct VncSurface *s = &vd->guest;
h += y;
two 16-pixel blocks but we only mark the first as dirty
*/
w += (x % 16);
x -= (x % 16);
w += (x % 16);
x -= (x %... | cwe | CWE-125 | C/C++ |
static int check_line_charstring(void)
{
char *p = line;
while (isspace(*p))
p++;
return (*p == '/' || (p[0] == 'd' && p[1] == 'u' && p[2] == 'p'));
} | cwe | CWE-119 | C/C++ |
ba,ja,ia){function ma(La,Ta){null==Ja?(Ga=La,Ga=/^https?:\/\//.test(Ga)&&!b.editor.isCorsEnabledForUrl(Ga)?PROXY_URL+"?url="+encodeURIComponent(Ga):TEMPLATE_PATH+"/"+Ga,mxUtils.get(Ga,mxUtils.bind(this,function(Ua){200<=Ua.getStatus()&&299>=Ua.getStatus()&&(Ja=Ua.getText());Ta(Ja,Ga)}))):Ta(Ja,Ga)}function qa(La,Ta,Ua)... | cwe | CWE-20 | JavaScript |
#include "source/extensions/transport_sockets/tls/cert_validator/default_validator.h"
#include <array>
#include <deque>
#include <functional>
#include <string>
#include <vector>
#include "envoy/network/transport_socket.h"
#include "envoy/ssl/context.h"
#include "envoy/ssl/context_config.h"
#include "envoy/ssl/private... | cwe | CWE-295 | C/C++ |
int Reverb_setParameter (ReverbContext *pContext, void *pParam, void *pValue){
int status = 0;
int16_t level;
int16_t ratio;
uint32_t time;
t_reverb_settings *pProperties;
int32_t *pParamTemp = (int32_t *)pParam;
int32_t param = *pParamTemp++;
if (pContext->preset) {
if (param != REVERB_PARAM_P... | cwe | CWE-200 | C/C++ |
long keyctl_update_key(key_serial_t id,
const void __user *_payload,
size_t plen)
{
key_ref_t key_ref;
void *payload;
long ret;
ret = -EINVAL;
if (plen > PAGE_SIZE)
goto error;
/* pull the payload in if one was supplied */
payload = NULL;
if (_payload) {
ret = -ENOMEM;
payload = kmallo... | cwe | CWE-476 | C/C++ |
updateState: function(rfb, state, oldstate) {
var msg;
document.documentElement.classList.remove("noVNC_connecting");
document.documentElement.classList.remove("noVNC_connected");
document.documentElement.classList.remove("noVNC_disconnecting");
switch (stat... | cwe | CWE-79 | JavaScript |
static void handle_satn(ESPState *s)
{
int32_t cmdlen;
if (s->dma && !s->dma_enabled) {
s->dma_cb = handle_satn;
return;
}
s->pdma_cb = satn_pdma_cb;
cmdlen = get_cmd(s, ESP_CMDFIFO_SZ);
if (cmdlen > 0) {
s->cmdfifo_cdb_offset = 1;
do_cmd(s);
} else if (cmdle... | cwe | CWE-476 | Unknown |
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-415 | Unknown |
mxClient.IS_FF||5<=document.documentMode?n.select():document.execCommand("selectAll",!1,null)):K.focus()};EditorUi.prototype.showRemoteExportDialog=function(c,e,g,k,m){var q=document.createElement("div");q.style.whiteSpace="nowrap";var v=document.createElement("h3");mxUtils.write(v,mxResources.get("image"));v.style.css... | cwe | CWE-20 | JavaScript |
/**
* File: WebP IO
*
* Read and write WebP images.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif /* HAVE_CONFIG_H */
#ifdef HAVE_LIBWEBP
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include "gd.h"
#include "gd_errors.h"
#include "gdhelpers.h"
#include "webp/decode.h"
#inclu... | cwe | CWE-190 | C/C++ |
status_t Parcel::readUtf8FromUtf16(std::string* str) const {
size_t utf16Size = 0;
const char16_t* src = readString16Inplace(&utf16Size);
if (!src) {
return UNEXPECTED_NULL;
}
if (utf16Size == 0u) {
str->clear();
return NO_ERROR;
}
ssize_t utf8Size = utf16_to_utf8_length(src, utf16Siz... | cwe | CWE-119 | C/C++ |
void Compute(OpKernelContext* context) override {
const Tensor& rhs = context->input(1);
// We always return the input ref.
context->forward_ref_input_to_ref_output(0, 0);
// We can't always know how this value will be used downstream, so make
// conservative assumptions in specifying constraints ... | cwe | CWE-908 | C/C++ |
/*
* Copyright (C) 2005-2020 ManyDesigns srl. All rights reserved.
* http://www.manydesigns.com/
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 3 of
* the License, or (a... | cwe | CWE-347 | Java |
/*
* Copyright (C) 2004, 2005, 2006 Joe Walnes.
* Copyright (C) 2006, 2007, 2008, 2009, 2011, 2018, 2021 XStream Committers.
* All rights reserved.
*
* The software in this package is published under the terms of the BSD
* style license a copy of which has been included with this distribution in
* the LICENSE.tx... | cwe | CWE-400 | Java |
- (id <WOActionResults>) viewAction
{
WOResponse *result;
NSDictionary *data;
NSCalendarDate *eventStartDate, *eventEndDate;
NSTimeZone *timeZone;
SOGoUserDefaults *ud;
SOGoCalendarComponent *co;
NSString *created_by;
BOOL resetAlarm;
unsigned int snoozeAlarm;
[self event];
result = [self respo... | cwe | CWE-79 | JavaScript |
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */
/* Various HTTP-related functions. */
#include <stddef.h>
#include <stdlib.h>
#ifdef WIN32
#include <vc_compat.h>
#endif
#include "ls-sfparser.h"
#include "lsquic.h"
#include "lsquic_hq.h"
struct parse_pfv_ctx
{
enum ppc_flags ... | cwe | CWE-476 | C/C++ |
function s(e,i){var s=i===o?a&&a.array:e&&e.array,u=i>n?0:n-i,c=r-i;return c>g&&(c=g),function(){if(u===c)return It;var e=t?--c:u++;return s&&s[e]}} | cwe | CWE-601 | JavaScript |
static int tc_ctl_tclass(struct sk_buff *skb, struct nlmsghdr *n)
{
struct net *net = sock_net(skb->sk);
struct tcmsg *tcm = nlmsg_data(n);
struct nlattr *tca[TCA_MAX + 1];
struct net_device *dev;
struct Qdisc *q = NULL;
const struct Qdisc_class_ops *cops;
unsigned long cl = 0;
unsigned long new_cl;
u32 portid... | cwe | CWE-264 | 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 | Python |
@Override
public void extract(String archive, String destinationDirectory) throws ArchiveExtractionException {
final File archiveFile = new File(archive);
try (FileInputStream fis = new FileInputStream(archiveFile)) {
if ("msi".equals(FileUtils.getExtension(archiveFile.getAbsolutePath()... | cwe | CWE-22 | Java |
get_cred_handler(Service * /*service*/, int /*i*/, Stream *stream) {
char * name = NULL;
int rtnVal = FALSE;
bool found_cred=false;
CredentialWrapper * cred = NULL;
char * owner = NULL;
const char * user = NULL;
void * data = NULL;
ReliSock * socket = (ReliSock*)stream;
if (!socket->triedAuthenticat... | cwe | CWE-134 | C/C++ |
/* 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-617 | Python |
void Compute(OpKernelContext* ctx) override {
const Tensor* x_tensor = nullptr;
OP_REQUIRES_OK(ctx, ctx->input("x", &x_tensor));
const Tensor* cs_prev_tensor = nullptr;
OP_REQUIRES_OK(ctx, ctx->input("cs_prev", &cs_prev_tensor));
const Tensor* h_prev_tensor = nullptr;
OP_REQUIRES_OK(ctx, ctx->... | cwe | CWE-703 | C/C++ |
/*
* linux/fs/pipe.c
*
* Copyright (C) 1991, 1992, 1999 Linus Torvalds
*/
#include <linux/mm.h>
#include <linux/file.h>
#include <linux/poll.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/fs.h>
#include <linux/log2.h>
#include <linux/mount.h>
#include <linux/magic.h... | cwe | CWE-399 | C/C++ |
// Copyright (C) Extensible Service Proxy 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 re... | cwe | CWE-290 | C/C++ |
/**
*
* Static file server with compression Ulfius callback
*
* Copyright 2020-2022 Nicolas Mora <mail@babelouest.org>
*
* Version 20220425
*
* The MIT License (MIT)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "So... | cwe | CWE-22 | C/C++ |
: htmlspecialchars($host['User'])) . '</label></td>' . "\n"
. '<td>' . htmlspecialchars($host['Host']) . '</td>' . "\n";
$html_output .= '<td>';
$password_column = 'Password';
$check_plugin_query = "SELECT * FROM `mysql`.`user` WHERE "
. "`User` = '... | cwe | CWE-79 | PHP |
ccp_run_aes_gcm_cmd(struct ccp_cmd_queue *cmd_q, struct ccp_cmd *cmd)
{
struct ccp_aes_engine *aes = &cmd->u.aes;
struct ccp_dm_workarea key, ctx, final_wa, tag;
struct ccp_data src, dst;
struct ccp_data aad;
struct ccp_op op;
unsigned int dm_offset;
unsigned int authsize;
unsigned int jobid;
unsigned int ilen... | cwe | CWE-401 | C/C++ |
def _get_vdisk_fc_mappings(self, vdisk_name):
"""Return FlashCopy mappings that this vdisk is associated with."""
ssh_cmd = 'svcinfo lsvdiskfcmappings -nohdr %s' % vdisk_name
out, err = self._run_ssh(ssh_cmd)
mapping_ids = []
if (len(out.strip())):
lines = out.strip... | cwe | CWE-78 | Python |
$rst[$key] = self::parseAndTrim($st, $unescape);
}
return $rst;
}
$str = str_replace("<br>"," ",$str);
$str = str_replace("</br>"," ",$str);
$str = str_replace("<br/>"," ",$str);
$str = str_replace("<br />"," ",$str);
$str = str_replace("\r\n"," "... | cwe | CWE-89 | PHP |
/*
* Copyright 2000-2020 Vaadin Ltd.
*
* 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... | cwe | CWE-668 | Java |
void CFontFileType1::Parse()
{
// Сначала проверим, если это pfb файл, тогда избавимся от всех его маркеров.
Reset();
while( m_nPos < m_nLen && ( ' ' == m_sFile[m_nPos] || '\t' == m_sFile[m_nPos] || '\r' == m_sFile[m_nPos] || '\n' == m_sFile[m_nPos] ) )
++m_nPos;
bool b... | cwe | CWE-787 | C/C++ |
static int tcos_decipher(sc_card_t *card, const u8 * crgram, size_t crgram_len, u8 * out, size_t outlen)
{
sc_context_t *ctx;
sc_apdu_t apdu;
u8 rbuf[SC_MAX_APDU_BUFFER_SIZE];
u8 sbuf[SC_MAX_APDU_BUFFER_SIZE];
tcos_data *data;
int tcos3, r;
assert(card != NULL && crgram != NULL && out != NULL);
ctx = card->ctx... | cwe | CWE-787 | C/C++ |
connection_struct *make_connection_snum(struct smbd_server_connection *sconn,
int snum, user_struct *vuser,
DATA_BLOB password,
const char *pdev,
NTSTATUS *pstatus)
{
connection_struct *conn;
struct smb_filename *smb_fname_cpath = NULL;
fstring dev;
int ret;
char addr[INET6_ADDRSTRLEN];
bool o... | cwe | CWE-22 | Unknown |
xfs_attr3_leaf_flipflags(
struct xfs_da_args *args)
{
struct xfs_attr_leafblock *leaf1;
struct xfs_attr_leafblock *leaf2;
struct xfs_attr_leaf_entry *entry1;
struct xfs_attr_leaf_entry *entry2;
struct xfs_attr_leaf_name_remote *name_rmt;
struct xfs_buf *bp1;
struct xfs_buf *bp2;
int error;
#ifdef DEBUG
stru... | cwe | CWE-19 | 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++ |
DECLAREcpFunc(cpDecodedStrips)
{
tsize_t stripsize = TIFFStripSize(in);
tdata_t buf = _TIFFmalloc(stripsize);
(void) imagewidth; (void) spp;
if (buf) {
tstrip_t s, ns = TIFFNumberOfStrips(in);
uint32 row = 0;
_TIFFmemset(buf, 0, stripsize);
for (s = 0; s < ns; s++) {
tsize_t cc = (row + rowsperstrip > ... | cwe | CWE-191 | C/C++ |
static void setProperty(SchemaFactory schemaFactory, String propertyName) throws SAXException {
try {
schemaFactory.setProperty(propertyName, "");
} catch (SAXException e) {
if (Boolean.getBoolean(SYSTEM_PROPERTY_IGNORE_XXE_PROTECTION_FAILURES)) {
LOGGER.warning("... | cwe | CWE-611 | Java |
void ModuleSQL::init()
{
Dispatcher = new DispatcherThread(this);
ServerInstance->Threads.Start(Dispatcher);
} | cwe | CWE-476 | Unknown |
spnego_gss_get_mic_iov(OM_uint32 *minor_status, gss_ctx_id_t context_handle,
gss_qop_t qop_req, gss_iov_buffer_desc *iov,
int iov_count)
{
return gss_get_mic_iov(minor_status, context_handle, qop_req, iov,
iov_count);
} | cwe | CWE-763 | C/C++ |
package com.salesmanager.core.business.services.catalog.product;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;
import javax.inject.Inject;
import o... | cwe | CWE-639 | Java |
sg_common_write(Sg_fd * sfp, Sg_request * srp,
unsigned char *cmnd, int timeout, int blocking)
{
int k, at_head;
Sg_device *sdp = sfp->parentdp;
sg_io_hdr_t *hp = &srp->header;
srp->data.cmd_opcode = cmnd[0]; /* hold opcode of command */
hp->status = 0;
hp->masked_status = 0;
hp->msg_status = 0;
hp->info = 0... | cwe | CWE-415 | C/C++ |
coolkey_find_attribute(sc_card_t *card, sc_cardctl_coolkey_attribute_t *attribute)
{
u8 object_record_type;
CK_ATTRIBUTE_TYPE attr_type = attribute->attribute_type;
const u8 *obj = attribute->object->data;
const u8 *attr = NULL;
size_t buf_len = attribute->object->length;
coolkey_object_header_t *object_head;
in... | cwe | CWE-125 | C/C++ |
q(x)}),mxUtils.bind(this,function(){this.spinner.stop();this.openLocalFile(c,e,k)}));else{if("image/png"==g.type.substring(0,9))c=this.extractGraphModelFromPng(c);else if("application/pdf"==g.type){var v=Editor.extractGraphModelFromPdf(c);null!=v&&(m=null,k=!0,c=v)}this.spinner.stop();this.openLocalFile(c,e,k,m,null!=m... | cwe | CWE-20 | JavaScript |
Mat_VarReadNextInfo4(mat_t *mat)
{
int M,O,data_type,class_type;
mat_int32_t tmp;
long nBytes;
size_t readresult;
matvar_t *matvar = NULL;
union {
mat_uint32_t u;
mat_uint8_t c[4];
} endian;
if ( mat == NULL || mat->fp == NULL )
return NULL;
el... | cwe | CWE-703 | C/C++ |
_pixops_scale_real (guchar *dest_buf,
int render_x0,
int render_y0,
int render_x1,
int render_y1,
int dest_rowstride,
int dest_channels,
gboolean dest_has_alpha,
const guchar *src_buf,
i... | cwe | CWE-119 | Unknown |
const cheerio = require('cheerio');
const got = require('@/utils/got');
module.exports = async (ctx) => {
const url = `http://${ctx.params.column}.bio1000.com/${ctx.params.id}`;
const res = await got.get(url);
const $ = cheerio.load(res.data);
const list = $('.excerpt-1').get();
const out = await ... | cwe | CWE-918 | JavaScript |
int dtls1_accept(SSL *s)
{
BUF_MEM *buf;
unsigned long Time = (unsigned long)time(NULL);
void (*cb) (const SSL *ssl, int type, int val) = NULL;
unsigned long alg_k;
int ret = -1;
int new_state, state, skip = 0;
int listen;
#ifndef OPENSSL_NO_SCTP
unsigned char sctpauthkey[64];
char l... | cwe | CWE-399 | Unknown |
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
OpData* op_data = reinterpret_cast<OpData*>(node->user_data);
OpContext op_context(context, node);
if (IsConstantTensor(op_context.input) && op_data->float_input_initialized) {
return kTfLiteOk;
}
// Dequantize the input
TfLiteTensor* dequan... | cwe | CWE-787 | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.