code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
/*
* Copyright (c) 2004-2021, University of Oslo
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
* list of cond... | cwe | CWE-918 | Java |
import { check } from 'meteor/check';
import Logger from '/imports/startup/server/logger';
import Users from '/imports/api/users';
import userJoin from './userJoin';
const clearOtherSessions = (sessionUserId, current = false) => {
const serverSessions = Meteor.server.sessions;
Object.keys(serverSessions)
.filt... | cwe | CWE-74 | JavaScript |
/* Copyright 2018 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | cwe | CWE-476 | Python |
unique_ptr<IOBuf> IOBuf::create(std::size_t capacity) {
// For smaller-sized buffers, allocate the IOBuf, SharedInfo, and the buffer
// all with a single allocation.
//
// We don't do this for larger buffers since it can be wasteful if the user
// needs to reallocate the buffer but keeps using the same IOBuf ... | cwe | CWE-787 | Unknown |
int options_parse(CONF_TYPE type) {
SERVICE_OPTIONS *section;
options_defaults();
section=&new_service_options;
if(options_file(configuration_file, type, §ion))
return 1;
if(init_section(1, §ion))
return 1;
s_log(LOG_NOTICE, "Configuration successful");
return 0;
} | cwe | CWE-295 | Unknown |
_updateAutoJoinConfirmWarning(category, catPermissions) {
const allowedGroups = catPermissions.allowed_groups;
if (catPermissions.private) {
const warningTranslationKey =
allowedGroups.length < 3 ? "warning_groups" : "warning_multiple_groups";
this.set(
"autoJoinWarning",
I... | cwe | CWE-79 | JavaScript |
def do_setup(self, ctxt):
"""Check that we have all configuration details from the storage."""
LOG.debug(_('enter: do_setup'))
self._context = ctxt
# Validate that the pool exists
ssh_cmd = 'svcinfo lsmdiskgrp -delim ! -nohdr'
out, err = self._run_ssh(ssh_cmd)
s... | cwe | CWE-78 | Python |
static ssize_t _hostsock_readv(
oe_fd_t* desc,
const struct oe_iovec* iov,
int iovcnt)
{
ssize_t ret = -1;
sock_t* sock = _cast_sock(desc);
void* buf = NULL;
size_t buf_size = 0;
if (!sock || (!iov && iovcnt) || iovcnt < 0 || iovcnt > OE_IOV_MAX)
OE_RAISE_ERRNO(OE_EINVAL);
... | cwe | CWE-552 | Unknown |
null);mxEvent.consume(G)})))}if(null!=z)for(B=0;B<z.length;B++){var D=document.createElement("div");D.style.marginTop=null!=t||0<B?"6px":"0px";D.appendChild(this.graph.createLinkForHint(z[B].getAttribute("href"),mxUtils.getTextContent(z[B])));this.linkHint.appendChild(D)}}}catch(G){}};mxEdgeHandler.prototype.updateLink... | cwe | CWE-918 | JavaScript |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import re
# see https://gist.github.com/dperini/729294
URL_REGEX = re.compile(
# protocol identifier
"(?:(?:https?|ftp)://)"
# user:pass authentication
"(?:\S+(?::\S*)?@)?"
"(?:"
# IP address exclus... | cwe | CWE-400 | Python |
/*
* Copyright (C) 2012-2018 Tobias Brunner
* Copyright (C) 2009 Martin Willi
* HSR Hochschule fuer Technik Rapperswil
*
* 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 o... | cwe | CWE-287 | C/C++ |
Oa+="@import url("+Ma+");\n":Ia+='@font-face {\nfont-family: "'+Ca+'";\nsrc: url("'+Ma+'");\n}\n'}Ka.appendChild(Ba.createTextNode(Oa+Ia));xa.getElementsByTagName("defs")[0].appendChild(Ka)}null!=la&&(this.shapeBackgroundColor=Fa,this.shapeForegroundColor=Aa,this.stylesheet=la,this.refresh());return xa};var B=Graph.pro... | cwe | CWE-20 | JavaScript |
main (int argc, char *argv[])
{
int i = 0;
time_t t = 0;
struct sigaction sa;
unsigned long cachesize = 0;
char *x = NULL, char_seed[128];
sa.sa_handler = handle_term;
sigaction (SIGINT, &sa, NULL);
sigaction (SIGTERM, &sa, NULL);
sa.sa_handler = SIG_IGN;
sigaction (SIGPIPE, &s... | cwe | CWE-362 | Unknown |
'use strict';
// @ts-check
// ==================================================================================
// docker.js
// ----------------------------------------------------------------------------------
// Description: System Information - library
// for Node.js
// Copyright: (c) 2014 - 20... | cwe | CWE-78 | JavaScript |
public function getSiteInfo()
{
// check for a site request param
if(empty($this->getSite())){
$this->setName(get_bloginfo('name'));
$this->setDescription(get_bloginfo('description'));
$this->setRestApiUrl(get_rest_url());
$this->setSite(get_bloginfo('... | cwe | CWE-918 | PHP |
public Controller execute(FolderComponent folderComponent, UserRequest ureq, WindowControl wControl, Translator translator) {
VFSContainer currentContainer = folderComponent.getCurrentContainer();
VFSContainer rootContainer = folderComponent.getRootContainer();
if (!VFSManager.exists(currentContainer)) {
stat... | cwe | CWE-23 | Java |
int storeQueryInCache(struct module_qstate* qstate, struct query_info* qinfo,
struct reply_info* msgrep, int is_referral)
{
if (!msgrep)
return 0;
/* authoritative answer can't be stored in cache */
if (msgrep->authoritative) {
PyErr_SetString(PyExc_ValueError,
"Authoritative answer can't be stored");
ret... | cwe | CWE-613 | Unknown |
/*****************************************************************************\
* src/slurmd/slurmd/req.c - slurmd request handling
*****************************************************************************
* Copyright (C) 2002-2007 The Regents of the University of California.
* Copyright (C) 2008-2010 Lawren... | cwe | CWE-284 | C/C++ |
function AddonText_Selection_create() {
var presenter = function() {};
presenter.eventBus = null;
presenter.playerController = null;
presenter.textParser = null;
presenter.selected_elements = null;
presenter.isWorkMode = true;
presenter.markedMathJaxContent = [];
presenter.areAllPhrase... | cwe | CWE-79 | JavaScript |
bool ExtensionTtsPlatformImplChromeOs::IsSpeaking() {
if (chromeos::CrosLibrary::Get()->EnsureLoaded()) {
return chromeos::CrosLibrary::Get()->GetSpeechSynthesisLibrary()->
IsSpeaking();
}
set_error(kCrosLibraryNotLoadedError);
return false;
} | cwe | CWE-20 | C/C++ |
////////////////////////////////////////////////////////////////////////////
// **** WAVPACK **** //
// Hybrid Lossless Wavefile Compressor //
// Copyright (c) 1998 - 2016 David Bryant. //
// ... | cwe | CWE-787 | C/C++ |
rx_cache_find(const struct rx_header *rxh, const struct ip *ip, int sport,
int32_t *opcode)
{
int i;
struct rx_cache_entry *rxent;
uint32_t clip;
uint32_t sip;
UNALIGNED_MEMCPY(&clip, &ip->ip_dst, sizeof(uint32_t));
UNALIGNED_MEMCPY(&sip, &ip->ip_src, sizeof(uint32_t));
/* Start the search where we last... | cwe | CWE-125 | C/C++ |
// node-pdf
var Promise = require("es6-promise").Promise;
var path = require("path");
var fs = require("fs");
var util = require("util");
var exec = require("child_process").exec;
function PDFImage(pdfFilePath, options) {
if (!options) options = {};
this.pdfFilePath = pdfFilePath;
this.setPdfFileBaseName(o... | cwe | CWE-77 | JavaScript |
int mingw_rmdir(const char *pathname)
{
int ret, tries = 0;
wchar_t wpathname[MAX_PATH];
if (xutftowcs_path(wpathname, pathname) < 0)
return -1;
while ((ret = _wrmdir(wpathname)) == -1 && tries < ARRAY_SIZE(delay)) {
if (!is_file_in_use_error(GetLastError()))
errno = err_win_to_posix(GetLastError());
if (... | cwe | CWE-61 | Unknown |
int rsa_rsassa_pkcs1_v15_sign( rsa_context *ctx,
int mode,
int hash_id,
unsigned int hashlen,
const unsigned char *hash,
unsigned char *sig )
{
size_t nb_pad, ol... | cwe | CWE-310 | Unknown |
function fillDiagramsList(diagrams, isTemplate, asList, searchImportCats, internalCall)
{
function setSubmitBtnLbl()
{
toggleButtons(isTemplate);
};
if (!internalCall)
{
diagramsTiles.innerHTML = '';
swapActiveItem();
curDiagList = diagrams;
curSearchImportCats = searchImportCats;
}
... | cwe | CWE-94 | JavaScript |
snmp_ber_decode_null(unsigned char *buf, uint32_t *buff_len)
{
buf++;
(*buff_len)--;
buf++;
(*buff_len)--;
return buf;
} | cwe | CWE-125 | C/C++ |
import typing as t
from functools import update_wrapper
from io import BytesIO
from itertools import chain
from typing import Union
from . import exceptions
from .datastructures import FileStorage
from .datastructures import Headers
from .datastructures import MultiDict
from .http import parse_options_header
from .san... | cwe | CWE-770 | Python |
function updateGraph(xml)
{
spinner.stop();
errorNode.innerHTML = '';
var doc = mxUtils.parseXml(xml);
var node = editorUi.editor.extractGraphModel(doc.documentElement, true);
if (node != null)
{
pageSelect.style.display = 'none';
pageSelect.innerHTML = '';
... | cwe | CWE-94 | JavaScript |
/*
* Copyright © 2015-2018 Aeneas Rekkas <aeneas+oss@aeneas.io>
*
* 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... | cwe | CWE-754 | Go |
package com.salesmanager.shop.admin.model.customer.attribute;
import java.io.Serializable;
import java.util.List;
import com.salesmanager.shop.model.entity.ShopEntity;
public class CustomerOption extends ShopEntity implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
privat... | cwe | CWE-639 | Java |
tt_cmap8_validate( FT_Byte* table,
FT_Validator valid )
{
FT_Byte* p = table + 4;
FT_Byte* is32;
FT_UInt32 length;
FT_UInt32 num_groups;
if ( table + 16 + 8192 > valid->limit )
FT_INVALID_TOO_SHORT;
length = TT_NEXT_ULONG( p );
if ( length > (FT_UI... | cwe | CWE-125 | C/C++ |
VaapiVideoDecodeAccelerator::VaapiVP9Accelerator::VaapiVP9Accelerator(
VaapiVideoDecodeAccelerator* vaapi_dec,
VaapiWrapper* vaapi_wrapper)
: vaapi_wrapper_(vaapi_wrapper), vaapi_dec_(vaapi_dec) {
DCHECK(vaapi_wrapper_);
DCHECK(vaapi_dec_);
} | cwe | CWE-362 | C/C++ |
xid_map_enter(netdissect_options *ndo,
const struct sunrpc_msg *rp, const u_char *bp)
{
const struct ip *ip = NULL;
const struct ip6_hdr *ip6 = NULL;
struct xid_map_entry *xmep;
if (!ND_TTEST(rp->rm_call.cb_vers))
return (0);
switch (IP_V((const struct ip *)bp)) {
case 4:
ip = (const struct ip ... | cwe | CWE-125 | C/C++ |
/*
* Copyright (C) Igor Sysoev
* Copyright (C) NGINX, Inc.
*/
#include <njs_main.h>
njs_function_t *
njs_function_alloc(njs_vm_t *vm, njs_function_lambda_t *lambda,
njs_bool_t async)
{
size_t size;
njs_object_t *proto;
njs_function_t *function;
size = sizeof(njs_function_t) + l... | cwe | CWE-416 | C/C++ |
static inline void AllocatePixelCachePixels(CacheInfo *cache_info)
{
cache_info->mapped=MagickFalse;
cache_info->pixels=(PixelPacket *) MagickAssumeAligned(
AcquireAlignedMemory(1,(size_t) cache_info->length));
if (cache_info->pixels == (PixelPacket *) NULL)
{
cache_info->mapped=MagickTrue;
ca... | cwe | CWE-399 | C/C++ |
reset_pcsc_reader_wrapped (int slot)
{
long err;
reader_table_t slotp;
size_t len;
int i, n;
unsigned char msgbuf[9];
unsigned int dummy_status;
int sw = SW_HOST_CARD_IO_ERROR;
slotp = reader_table + slot;
if (slotp->pcsc.req_fd == -1
|| slotp->pcsc.rsp_fd == -1
|| slotp->pcsc.pid == (pi... | cwe | CWE-20 | Unknown |
/*
* Copyright 2020 ThoughtWorks, 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 agr... | cwe | CWE-668 | Java |
bool ExtensionTtsSpeakFunction::RunImpl() {
std::string text;
EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &text));
DictionaryValue* options = NULL;
if (args_->GetSize() >= 2)
EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(1, &options));
Task* completion_task = NewRunnableMethod(
this, &Extensi... | cwe | CWE-20 | C/C++ |
mxCodecRegistry.register(function(){var a=new mxObjectCodec(new mxCell,["children","edges","overlays","mxTransient"],["parent","source","target"]);a.isCellCodec=function(){return!0};a.isNumericAttribute=function(b,c,d){return"value"!==c.nodeName&&mxObjectCodec.prototype.isNumericAttribute.apply(this,arguments)};a.isExc... | cwe | CWE-94 | JavaScript |
function stringEscape(s) {
function hex(ch) { return ch.charCodeAt(0).toString(16).toUpperCase(); }
return s
.replace(/\\/g, '\\\\')
.replace(/"/g, '\\"')
.replace(/\x08/g, '\\b')
.replace(/\t/g, '\\t')
.replace(/\n/g, '\\n')
... | cwe | CWE-1321 | JavaScript |
static void perf_syscall_exit(void *ignore, struct pt_regs *regs, long ret)
{
struct syscall_metadata *sys_data;
struct syscall_trace_exit *rec;
struct hlist_head *head;
int syscall_nr;
int rctx;
int size;
syscall_nr = trace_get_syscall_nr(current, regs);
if (syscall_nr < 0)
return;
if (!test_bit(syscall_nr... | cwe | CWE-264 | Unknown |
magiccheck(struct magic_set *ms, struct magic *m)
{
uint64_t l = m->value.q;
uint64_t v;
float fl, fv;
double dl, dv;
int matched;
union VALUETYPE *p = &ms->ms_value;
switch (m->type) {
case FILE_BYTE:
v = p->b;
break;
case FILE_SHORT:
case FILE_BESHORT:
case FILE_LESHORT:
v = p->h;
break;
case F... | cwe | CWE-399 | C/C++ |
function g(t,e,i){for(var n in e)i&&(c(e[n])||L(e[n]))?(c(e[n])&&!c(t[n])&&(t[n]={}),L(e[n])&&!L(t[n])&&(t[n]=[]),g(t[n],e[n],i)):void 0!==e[n]&&(t[n]=e[n])} | cwe | CWE-79 | JavaScript |
function configure()
{
deskDomain = 'https://' + config.deskDomain + '.freshdesk.com';
deskApiKey = config.deskApiKey;
deskTypes = config.deskTypes || deskTypes;
deskStatus = config.deskStatus || deskStatus;
deskStatusWidth = {};
// Precomputes text widths for custom ticket status
var div = document.... | cwe | CWE-94 | JavaScript |
static int pkey_gost2018_decrypt(EVP_PKEY_CTX *pctx, unsigned char *key,
size_t *key_len, const unsigned char *in,
size_t in_len)
{
const unsigned char *p = in;
struct gost_pmeth_data *data;
EVP_PKEY *priv;
PSKeyTransport_gost *pst = NULL;
int ret ... | cwe | CWE-787 | Unknown |
////////////////////////////////////////////////////////////////////////////////
/// DISCLAIMER
///
/// Copyright 2014-2021 ArangoDB GmbH, Cologne, Germany
/// Copyright 2004-2014 triAGENS GmbH, Cologne, Germany
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except... | cwe | CWE-918 | C/C++ |
thunar_transfer_job_copy_node (ThunarTransferJob *job,
ThunarTransferNode *node,
GFile *target_file,
GFile *target_parent_file,
GList **target_file_list_retu... | cwe | CWE-134 | C/C++ |
static int
iscsi_if_recv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, uint32_t *group)
{
int err = 0;
u32 portid;
struct iscsi_uevent *ev = nlmsg_data(nlh);
struct iscsi_transport *transport = NULL;
struct iscsi_internal *priv;
struct iscsi_cls_session *session;
struct iscsi_cls_conn *conn;
struct iscsi_endpo... | cwe | CWE-125 | C/C++ |
/* $Id$ */
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
*
* Revised: 2/18/01 BAR -- added syntax for extracting single images from
* multi-image TIFF files.
*
* New syntax is: sourceFileName,image#
*
* image# ranges from 0..<n-1> wher... | cwe | CWE-190 | C/C++ |
xps_parse_color(xps_document *doc, char *base_uri, char *string,
fz_colorspace **csp, float *samples)
{
char *p;
int i, n;
char buf[1024];
char *profile;
*csp = fz_device_rgb(doc->ctx);
samples[0] = 1;
samples[1] = 0;
samples[2] = 0;
samples[3] = 0;
if (string[0] == '#')
{
if (strlen(string) == 9)
{... | cwe | CWE-119 | C/C++ |
static void fwnet_receive_broadcast(struct fw_iso_context *context,
u32 cycle, size_t header_length, void *header, void *data)
{
struct fwnet_device *dev;
struct fw_iso_packet packet;
__be16 *hdr_ptr;
__be32 *buf_ptr;
int retval;
u32 length;
u16 source_node_id;
u32 specifier_id;
u32 ver;
unsigned long offse... | cwe | CWE-119 | Unknown |
void WebURLLoaderImpl::Context::OnReceivedResponse(
const ResourceResponseInfo& info) {
if (!client_)
return;
WebURLResponse response;
response.initialize();
PopulateURLResponse(request_.url(), info, &response);
bool show_raw_listing = (GURL(request_.url()).query() == "raw");
if (info.mime_type =... | cwe | CWE-416 | C/C++ |
function getDefaultShell(env) {
return env.ComSpec;
} | cwe | CWE-200 | JavaScript |
package com.salesmanager.shop.admin.model.catalog;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.validation.Valid;
import com.salesmanager.core.model.catalog.category.CategoryDescription;
/**
* Wrapper to ease admin jstl
* @author carlsamson
*
*/
public class Categor... | cwe | CWE-639 | Java |
function wp_statistics_get_site_title( $url ) {
//Get ody Page
$html = wp_statistics_get_html_page( $url );
if ( $html === false ) {
return false;
}
//Get Page Title
if ( class_exists( 'DOMDocument' ) ) {
$dom = new DOMDocument;
@$dom->loadHTML( $html );
$title = '';
if ( isset( $dom ) and $dom->getEl... | cwe | CWE-79 | PHP |
void QuotaManager::GetAvailableSpace(const AvailableSpaceCallback& callback) {
if (is_incognito_) {
callback.Run(kQuotaStatusOk, kIncognitoDefaultTemporaryQuota);
return;
}
make_scoped_refptr(new AvailableSpaceQueryTask(this, callback))->Start();
} | cwe | CWE-399 | C/C++ |
@register.tag
@basictag(takes_context=True)
def screenshotcommentcounts(context, screenshot):
"""
Returns a JSON array of current comments for a screenshot.
Each entry in the array has a dictionary containing the following keys:
=========== ==================================================
Ke... | cwe | CWE-79 | Python |
void Compute(OpKernelContext* context) override {
// Get the stamp token.
const Tensor* stamp_token_t;
OP_REQUIRES_OK(context, context->input("stamp_token", &stamp_token_t));
int64_t stamp_token = stamp_token_t->scalar<int64>()();
// Get the tree ensemble proto.
const Tensor* tree_ensemble_seri... | cwe | CWE-416 | Unknown |
const Cluster* Segment::FindOrPreloadCluster(long long requested_pos) {
if (requested_pos < 0)
return 0;
Cluster** const ii = m_clusters;
Cluster** i = ii;
const long count = m_clusterCount + m_clusterPreloadCount;
Cluster** const jj = ii + count;
Cluster** j = jj;
while (i < j) {
Cluster** const k = i + ... | cwe | CWE-20 | C/C++ |
static void ip6_rt_update_pmtu(struct dst_entry *dst, struct sock *sk,
struct sk_buff *skb, u32 mtu)
{
struct rt6_info *rt6 = (struct rt6_info *)dst;
dst_confirm(dst);
if (mtu < dst_mtu(dst) && rt6->rt6i_dst.plen == 128) {
struct net *net = dev_net(dst->dev);
rt6->rt6i_flags |= RTF_MODIFIED;
if (mt... | cwe | CWE-17 | C/C++ |
num_stmts(const node *n)
{
int i, l;
node *ch;
switch (TYPE(n)) {
case single_input:
if (TYPE(CHILD(n, 0)) == NEWLINE)
return 0;
else
return num_stmts(CHILD(n, 0));
case file_input:
l = 0;
for (i = 0; i < NCH(n)... | cwe | CWE-125 | C/C++ |
#!/usr/bin/python3
'''
SPDX-License-Identifier: Apache-2.0
Copyright 2017 Massachusetts Institute of Technology.
'''
import asyncio
import http.server
import multiprocessing
import platform
import signal
from http.server import HTTPServer, BaseHTTPRequestHandler
from socketserver import ThreadingMixIn
import threadin... | cwe | CWE-290 | Python |
/* Copyright 2022 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | cwe | CWE-476 | Python |
static void opl3_panning(int dev, int voice, int value)
{
devc->voc[voice].panning = value;
} | cwe | CWE-264 | C/C++ |
call_qftf_func(qf_list_T *qfl, int qf_winid, long start_idx, long end_idx)
{
callback_T *cb = &qftf_cb;
list_T *qftf_list = NULL;
// If 'quickfixtextfunc' is set, then use the user-supplied function to get
// the text to display. Use the local value of 'quickfixtextfunc' if it is
// set.
if (qf... | cwe | CWE-703 | C/C++ |
int git_pkt_parse_line(
git_pkt **head, const char *line, const char **out, size_t bufflen)
{
int ret;
int32_t len;
/* Not even enough for the length */
if (bufflen > 0 && bufflen < PKT_LEN_SIZE)
return GIT_EBUFS;
len = parse_len(line);
if (len < 0) {
/*
* If we fail to parse the length, it might be bec... | cwe | CWE-119 | Unknown |
static void destroy_watch(struct inotify_watch *watch)
{
struct audit_chunk *chunk = container_of(watch, struct audit_chunk, watch);
free_chunk(chunk);
} | cwe | CWE-362 | Unknown |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | cwe | CWE-20 | Python |
/* eslint-disable global-require, no-use-before-define */
'use strict';
/**
* This callback will be called to transform a script to JavaScript.
*
* @callback compileCallback
* @param {string} code - Script code to transform to JavaScript.
* @param {string} filename - Filename of this script.
* @return {string} ... | cwe | CWE-915 | JavaScript |
TfLiteStatus ResizeOutput(TfLiteContext* context, TfLiteNode* node) {
const TfLiteTensor* top_k = GetInput(context, node, kInputTopK);
// INT32 number of top results is supported.
TF_LITE_ENSURE_TYPES_EQ(context, top_k->type, kTfLiteInt32);
// Check that the tensor contains only one value.
TF_LITE_ENSURE_EQ(c... | cwe | CWE-125 | C/C++ |
status_t BnSoundTriggerHwService::onTransact(
uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
{
switch(code) {
case LIST_MODULES: {
CHECK_INTERFACE(ISoundTriggerHwService, data, reply);
unsigned int numModulesReq = data.readInt32();
unsigned int numMo... | cwe | CWE-190 | 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-787 | Python |
/*
* OpenVPN -- An application to securely tunnel IP networks
* over a single TCP/UDP port, with support for SSL/TLS-based
* session authentication and key exchange,
* packet encryption, packet authentication, and
* packet compression.
*
* Copyright (C) 2002-2018... | cwe | CWE-306 | C/C++ |
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */
/*
* lsquic_stream.c -- stream processing
*/
#include <assert.h>
#include <errno.h>
#include <inttypes.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <sys/queue.h>
#include <stddef.h>
#ifdef WIN32
#include <malloc.h>
... | cwe | CWE-476 | C/C++ |
function fastifyMultipart (fastify, options, done) {
const attachFieldsToBody = options.attachFieldsToBody
if (options.addToBody === true) {
if (typeof options.sharedSchemaId === 'string') {
fastify.addSchema({
$id: options.sharedSchemaId,
type: 'object',
properties: {
en... | cwe | CWE-770 | JavaScript |
static void dump_one_vdso_page(struct page *pg, struct page *upg)
{
printk("kpg: %p (c:%d,f:%08lx)", __va(page_to_pfn(pg) << PAGE_SHIFT),
page_count(pg),
pg->flags);
if (upg/* && pg != upg*/) {
printk(" upg: %p (c:%d,f:%08lx)", __va(page_to_pfn(upg)
<< PAGE_SHIFT),
page_count(u... | cwe | CWE-20 | Unknown |
setupConnection(host, port, family = 4) {
const closeExistingServer = () => Promise.resolve(
this.dataSocket ? this.dataSocket.destroy() : undefined);
return closeExistingServer()
.then(() => {
this.dataSocket = new Socket();
this.dataSocket.on('error', (err) => this.server && this.server... | cwe | CWE-918 | JavaScript |
pkinit_eku_authorize(krb5_context context, krb5_certauth_moddata moddata,
const uint8_t *cert, size_t cert_len,
krb5_const_principal princ, const void *opts,
const struct _krb5_db_entry_new *db_entry,
char ***authinds_out)
{
krb5_er... | cwe | CWE-295 | C/C++ |
function naughtyHref(name, href) {
// Browsers ignore character codes of 32 (space) and below in a surprising
// number of situations. Start reading here:
// https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet#Embedded_tab
// eslint-disable-next-line no-control-regex
href = href.replace(/... | cwe | CWE-1333 | JavaScript |
/**
* Copyright (c) 2006-2017, JGraph Ltd
* Copyright (c) 2006-2017, Gaudenz Alder
*/
(function()
{
/**
* Version
*/
EditorUi.VERSION = '@DRAWIO-VERSION@';
/**
* Overrides compact UI setting.
*/
EditorUi.compactUi = uiTheme != 'atlas';
/**
* Overrides default grid color for dark mode
*/
if (Edit... | cwe | CWE-79 | Java |
xmlNodePtr SimpleXMLElement_exportNode(const Object& sxe) {
assert(sxe->instanceof(SimpleXMLElement_classof()));
auto data = Native::data<SimpleXMLElement>(sxe.get());
return php_sxe_get_first_node(data, data->nodep());
} | cwe | CWE-345 | C/C++ |
inline void skip(int bytes) {
while (bytes > 0) {
int n = check(1, bytes);
ptr += n;
bytes -= n;
}
} | cwe | CWE-122 | C/C++ |
protected function apiProcessLeaveMessage($args)
{
// Check captcha
if (Settings::get('enablecaptcha') == '1' && can_show_captcha()) {
$captcha = $args['captcha'];
$original = isset($_SESSION[SESSION_PREFIX . 'mibew_captcha'])
? $_SESSION[SESSION_PREFIX . 'mib... | cwe | CWE-79 | PHP |
// Copyright 2018 The Nakama 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 ... | cwe | CWE-307 | Go |
var I=z.div.querySelector(".geCommentEditTxtArea"),F=z.div.querySelector(".geCommentEditBtns");z.comment.content=I.value;I.parentNode.removeChild(I);F.parentNode.removeChild(F)}catch(H){b.handleError(H)}O.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+'/spin.gif" valign="middle"> '+m... | cwe | CWE-94 | JavaScript |
/* Copyright 2019 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 |
require('../services/Requisitions');
import Util from 'lib/util';
const QuickNode = require('../model/QuickNode');
/**
* @author Alejandro Galue <agalue@opennms.org>
* @copyright 2014 The OpenNMS Group, Inc.
*/
(function() {
'use strict';
const quickAddPanelBasicView = require('../../views/quick-add-panel-basi... | cwe | CWE-79 | Java |
/*
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
*
* This file is part of Open5GS.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
... | cwe | CWE-20 | C/C++ |
is_admin_of_role(Oid member, Oid role)
{
bool result = false;
List *roles_list;
ListCell *l;
/* Fast path for simple case */
if (member == role)
return true;
/* Superusers have every privilege, so are part of every role */
if (superuser_arg(member))
return true;
/*
* Find all the roles that membe... | cwe | CWE-264 | Unknown |
/*
* Copyright (C) Dmitry Volyntsev
* Copyright (C) NGINX, Inc.
*/
#include <njs_main.h>
typedef struct {
njs_vm_t *vm;
njs_mp_t *pool;
njs_uint_t depth;
const u_char *start;
const u_char *end;
} njs_json_parse_c... | cwe | CWE-416 | C/C++ |
mrb_vm_exec(mrb_state *mrb, struct RProc *proc, mrb_code *pc)
{
/* mrb_assert(mrb_proc_cfunc_p(proc)) */
mrb_irep *irep = proc->body.irep;
mrb_value *pool = irep->pool;
mrb_sym *syms = irep->syms;
mrb_code i;
int ai = mrb_gc_arena_save(mrb);
struct mrb_jmpbuf *prev_jmp = mrb->jmp;
struct mrb_jmpbuf c_jm... | cwe | CWE-190 | C/C++ |
'use strict'
const {
InvalidArgumentError,
NotSupportedError
} = require('./errors')
const assert = require('assert')
const util = require('./util')
// tokenRegExp and headerCharRegex have been lifted from
// https://github.com/nodejs/node/blob/main/lib/_http_common.js
/**
* Verifies that the given val is a val... | cwe | CWE-74 | JavaScript |
function lazyLoadCustomEmoji(element: HTMLElement): void {
const img = createElement('img', CLASS_CUSTOM_EMOJI) as HTMLImageElement;
if (element.dataset.emoji) {
img.src = element.dataset.emoji;
element.innerText = '';
element.appendChild(img);
}
} | cwe | CWE-79 | JavaScript |
"""An FTP client class and some helper functions.
Based on RFC 959: File Transfer Protocol (FTP), by J. Postel and J. Reynolds
Example:
>>> from ftplib import FTP
>>> ftp = FTP('ftp.python.org') # connect to host, default port
>>> ftp.login() # default, i.e.: user anonymous, passwd anonymous@
'230 Guest login ok, ac... | cwe | CWE-252 | Java |
import { mainPage } from "../../support/page_objects/mainPage";
import { isTestSuiteActive } from "../../support/page_objects/projectConstants";
export const genTest = (apiType, dbType) => {
if (!isTestSuiteActive(apiType, dbType)) return;
describe(`${apiType.toUpperCase()} api - Table: belongs to, link recor... | cwe | CWE-400 | JavaScript |
/*
* MinIO Cloud Storage, (C) 2015, 2016, 2017, 2018 MinIO, 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 require... | cwe | CWE-918 | Go |
/*
* Copyright (c) 2011-2015 The original author or authors
* ------------------------------------------------------
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Apache License v2.0 which accompanies this distr... | cwe | CWE-287 | Java |
bool LookupMatchInTopDomains(base::StringPiece skeleton) {
DCHECK_NE(skeleton.back(), '.');
auto labels = base::SplitStringPiece(skeleton, ".", base::KEEP_WHITESPACE,
base::SPLIT_WANT_ALL);
if (labels.size() > kNumberOfLabelsToCheck) {
labels.erase(labels.begin(),
... | cwe | CWE-19 | C/C++ |
static unsigned int XBMInteger(Image *image,short int *hex_digits)
{
int
c;
unsigned int
value;
/*
Skip any leading whitespace.
*/
do
{
c=ReadBlobByte(image);
if (c == EOF)
return(0);
} while ((c == ' ') || (c == '\t') || (c == '\n') || (c == '\r'));
/*
Evaluate num... | cwe | CWE-834 | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.