code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)} | cwe | CWE-284 | JavaScript |
exports.getPadRaw = function(padId, callback){
async.waterfall([
function(cb){
// Get the Pad available content keys
db.findKeys("pad:"+padId+"*", null, function(err,records){
if(!err){
cb(err, records);
}
})
},
function(records, cb){
var data = {};
async.forEachSeries(... | cwe | CWE-200 | JavaScript |
/* 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-476 | Python |
TEST_F(OAuth2Test, OAuthTestFullFlowPostWithParameters) {
// First construct the initial request to the oauth filter with URI parameters.
Http::TestRequestHeaderMapImpl first_request_headers{
{Http::Headers::get().Path.get(), "/test?name=admin&level=trace"},
{Http::Headers::get().Host.get(), "traffic.ex... | cwe | CWE-416 | Unknown |
/*
* file: InputStreamHelper.java
* author: Jon Iles
* copyright: (c) Packwood Software 2016
* date: 06/06/2016
*/
/*
* This library 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 Foundat... | cwe | CWE-22 | Java |
function upgradeWebSocket(request, options = {}) {
const upgrade = request.headers.get("upgrade");
const upgradeHasWebSocketOption = upgrade !== null &&
ArrayPrototypeSome(
StringPrototypeSplit(upgrade, /\s*,\s*/),
(option) => StringPrototypeToLowerCase(option) === "websocket",
);
if (!upgrade... | cwe | CWE-1333 | JavaScript |
/*
* 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 |
size_t mptsas_config_manufacturing_1(MPTSASState *s, uint8_t **data, int address)
{
/* VPD - all zeros */
return MPTSAS_CONFIG_PACK(1, MPI_CONFIG_PAGETYPE_MANUFACTURING, 0x00,
"s256");
} | cwe | CWE-20 | C/C++ |
static int cbtls_verify(int ok, X509_STORE_CTX *ctx)
{
char subject[1024]; /* Used for the subject name */
char issuer[1024]; /* Used for the issuer name */
char common_name[1024];
char cn_str[1024];
char buf[64];
EAP_HANDLER *handler = NULL;
X509 *client_cert;
X509 *issuer_cert;
SSL *ssl;
int err, depth, loo... | cwe | CWE-119 | C/C++ |
static void dtls1_clear_queues(SSL *s)
{
pitem *item = NULL;
hm_fragment *frag = NULL;
DTLS1_RECORD_DATA *rdata;
while( (item = pqueue_pop(s->d1->unprocessed_rcds.q)) != NULL)
{
rdata = (DTLS1_RECORD_DATA *) item->data;
if (rdata->rbuf.buf)
{
OPENSSL_free(rdata->rbuf.buf);
}
... | cwe | CWE-119 | C/C++ |
void LanLinkProvider::newConnection()
{
qCDebug(KDECONNECT_CORE) << "LanLinkProvider newConnection";
while (m_server->hasPendingConnections()) {
QSslSocket* socket = m_server->nextPendingConnection();
configureSocket(socket);
//This socket is still managed by us (and child of the QTcpSe... | cwe | CWE-703 | Unknown |
PackLinuxElf32::invert_pt_dynamic(Elf32_Dyn const *dynp)
{
if (dt_table[Elf32_Dyn::DT_NULL]) {
return; // not 1st time; do not change upx_dt_init
}
Elf32_Dyn const *const dynp0 = dynp;
unsigned ndx = 1+ 0;
if (dynp)
for (; ; ++ndx, ++dynp) {
unsigned const d_tag = get_te32(&dynp... | cwe | CWE-190 | C/C++ |
static int sc_pkcs15emu_sc_hsm_init (sc_pkcs15_card_t * p15card)
{
sc_card_t *card = p15card->card;
sc_hsm_private_data_t *priv = (sc_hsm_private_data_t *) card->drv_data;
sc_file_t *file = NULL;
sc_path_t path;
u8 filelist[MAX_EXT_APDU_LENGTH];
int filelistlength;
int r, i;
sc_cvc_t devcert;
struct sc_app_inf... | cwe | CWE-119 | Unknown |
/*
* Copyright 2004-present Facebook, 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 a... | cwe | CWE-755 | C/C++ |
package com.datformers.servlet;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import com.datformers.database.OracleDBWrapper;
import com.datformers.utils.DatabaseUtil;
public class AddAppUser {
String query = "";
OracleDBWrapper wrapper;
pub... | cwe | CWE-89 | Java |
def defaultSiteIdAndHostname = {
val hostname = defaultSiteHostname getOrElse throwForbidden(
"EsE5UYK2", o"""No site hostname configured (config value: $DefaultSiteHostnameConfValName)""")
if (defaultSiteId != FirstSiteId) {
val site = systemDao.getSiteById(defaultSiteId).getOrDie(
... | cwe | CWE-74 | Scala |
/**
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at the
* <a href="http://www.apache... | cwe | CWE-91 | Java |
// Copyright 2015 The Brave Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file provides Brave specific functionality that overrides the
// functionality in Chrome. It is not a copy.
#include "chrome/renderer/content_setting... | cwe | CWE-20 | C/C++ |
g_socket_client_connect_async (GSocketClient *client,
GSocketConnectable *connectable,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
GSocketClientAsyncConnectData *data;
g_return_if_fail (G_IS_SOCKET_CLIENT (client)... | cwe | CWE-754 | Unknown |
def try_compile_and_link(compiler, source = '', flags = []):
ensure_tmp_dir_exists()
with tempfile.NamedTemporaryFile() as sfile:
ofile = tempfile.mktemp()
try:
sfile.file.write(bytes(source, 'utf-8'))
sfile.file.flush()
# We can't write to /dev/null, since in... | cwe | CWE-377 | Python |
NOEXPORT char *pgsql_server(CLI *c, SERVICE_OPTIONS *opt, const PHASE phase) {
uint8_t buffer[8], ssl_ok[1]={'S'};
(void)opt; /* squash the unused parameter warning */
if(phase!=PROTOCOL_EARLY)
return NULL;
memset(buffer, 0, sizeof buffer);
s_read(c, c->local_rfd.fd, buffer, sizeof buffer);... | cwe | CWE-295 | Unknown |
static void nbt_name_socket_recv(struct nbt_name_socket *nbtsock)
{
TALLOC_CTX *tmp_ctx = talloc_new(nbtsock);
NTSTATUS status;
enum ndr_err_code ndr_err;
struct socket_address *src;
DATA_BLOB blob;
size_t nread, dsize;
struct nbt_name_packet *packet;
struct nbt_name_request *req;
status = socket_pending(nbts... | cwe | CWE-834 | Unknown |
def get_json(self, uri):
"""Make a GET request to an endpoint returning JSON and parse result
:param uri: The URI to make a GET request to.
:type uri: unicode
:return: A deferred containing JSON parsed into a Python object.
:rtype: twisted.internet.defer.Deferred[dict[any, any]... | cwe | CWE-400 | Python |
/*
* PKCS15 emulation layer for EstEID card.
*
* Copyright (C) 2004, Martin Paljak <martin@martinpaljak.net>
* Copyright (C) 2004, Bud P. Bruegger <bud@comune.grosseto.it>
* Copyright (C) 2004, Antonino Iacono <ant_iacono@tin.it>
* Copyright (C) 2003, Olaf Kirch <okir@suse.de>
*
* This library is free software;... | cwe | CWE-119 | C/C++ |
create_response(const char *nurl, const char *method, unsigned int *rp_code)
{
char *page, *fpath;
struct MHD_Response *resp = NULL;
if (!strncmp(nurl, URL_BASE_API_1_1, strlen(URL_BASE_API_1_1))) {
resp = create_response_api(nurl, method, rp_code);
} else {
... | cwe | CWE-22 | Unknown |
static int decode_nal_unit(HEVCContext *s, const uint8_t *nal, int length)
{
HEVCLocalContext *lc = &s->HEVClc;
GetBitContext *gb = &lc->gb;
int ctb_addr_ts, ret;
ret = init_get_bits8(gb, nal, length);
if (ret < 0)
return ret;
ret = hls_nal_unit(s);
if (ret < 0) {
av_log... | cwe | CWE-703 | Unknown |
_redrawLabel(y, text, orientation, className, characterHeight) {
// reuse redundant label
const label = DOMutil.getDOMElement('div', this.DOMelements.labels, this.dom.frame); //this.dom.redundant.labels.shift();
label.className = className;
label.innerHTML = text;
if (orientation === 'left') {
... | cwe | CWE-79 | JavaScript |
psutil_net_if_addrs(PyObject* self, PyObject* args) {
struct ifaddrs *ifaddr, *ifa;
int family;
PyObject *py_retlist = PyList_New(0);
PyObject *py_tuple = NULL;
PyObject *py_address = NULL;
PyObject *py_netmask = NULL;
PyObject *py_broadcast = NULL;
PyObject *py_ptp = NULL;
if (py_... | cwe | CWE-415 | C/C++ |
struct sock *sk_clone_lock(const struct sock *sk, const gfp_t priority)
{
struct sock *newsk;
bool is_charged = true;
newsk = sk_prot_alloc(sk->sk_prot, priority, sk->sk_family);
if (newsk != NULL) {
struct sk_filter *filter;
sock_copy(newsk, sk);
/* SANITY */
if (likely(newsk->sk_net_refcnt))
get_net... | cwe | CWE-704 | C/C++ |
GC_API void * GC_CALL GC_generic_malloc(size_t lb, int k)
{
void * result;
DCL_LOCK_STATE;
if (EXPECT(GC_have_errors, FALSE))
GC_print_all_errors();
GC_INVOKE_FINALIZERS();
if (SMALL_OBJ(lb)) {
LOCK();
result = GC_generic_malloc_inner((word)lb, k);
UNLOCK();
} else... | cwe | CWE-189 | C/C++ |
public function updateExtraField($key, $trigger = null, $userused = null)
{
global $conf, $langs, $user;
if (!empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) {
return 0;
}
if (empty($userused)) {
$userused = $user;
}
$error = 0;
if (!empty($this->array_options) && isset($this->array_options["o... | cwe | CWE-94 | PHP |
void UninstallExtension(ExtensionService* service, const std::string& id) {
if (service && service->GetInstalledExtension(id)) {
service->UninstallExtension(id,
extensions::UNINSTALL_REASON_SYNC,
base::Bind(&base::DoNothing),
... | cwe | CWE-416 | C/C++ |
package saml
import (
"encoding/xml"
"time"
"github.com/beevik/etree"
)
// HTTPPostBinding is the official URN for the HTTP-POST binding (transport)
const HTTPPostBinding = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
// HTTPRedirectBinding is the official URN for the HTTP-Redirect binding (transport)
const ... | cwe | CWE-287 | Go |
private static function thumb($source_path, $thumb_path){
ini_set('memory_limit', '128M');
$source_details = getimagesize($source_path);
$source_w = $source_details[0];
$source_h = $source_details[1];
if($source_w > $source_h){
$new_w = self::THUMB_W;
$new_h = intval($source_h * $new_w / $source_w);
... | cwe | CWE-20 | PHP |
function doSearch(searchStr)
{
if (lastSearchStr == searchStr && isGetAll == lastGetAll) return;
deselectTempCat();
tempDlgContent.scrollTop = 0;
diagramsTiles.innerHTML = '';
diagramsListTitle.innerHTML = mxUtils.htmlEntities(mxResources.get('searchResults')) +
' "' + mxUtils.htmlEntities(sear... | cwe | CWE-94 | JavaScript |
package admin
import (
"bytes"
"context"
"fmt"
"io/ioutil"
"os"
"reflect"
"sort"
"strconv"
"strings"
"text/tabwriter"
healthutil "github.com/argoproj/gitops-engine/pkg/health"
"github.com/ghodss/yaml"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
corev1 "k8s.io/api/core/v1"
v1 "k8s.io/apim... | cwe | CWE-863 | Go |
# -*- coding: utf-8 -*-
from django.shortcuts import render, redirect, get_object_or_404
from django.contrib.auth import get_user_model
from django.contrib import messages
from django.utils.translation import gettext as _
from djconfig import config
from ...core.utils.views import is_post, post_data
from ...core.uti... | cwe | CWE-601 | Python |
hermesBuiltinApply(void *, Runtime *runtime, NativeArgs args) {
GCScopeMarkerRAII marker{runtime};
Handle<Callable> fn = args.dyncastArg<Callable>(0);
if (LLVM_UNLIKELY(!fn)) {
return runtime->raiseTypeErrorForValue(
args.getArgHandle(0), " is not a function");
}
Handle<JSArray> argArray = args.... | cwe | CWE-787 | C/C++ |
bool DebuggerAttachFunction::RunAsync() {
std::unique_ptr<Attach::Params> params(Attach::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params.get());
CopyDebuggee(&debuggee_, params->target);
if (!InitAgentHost())
return false;
if (!DevToolsAgentHost::IsSupportedProtocolVersion(
params-... | cwe | CWE-20 | C/C++ |
def restrict_user_fields?(user)
user.trust_level == TrustLevel[0] && anonymous?
end | cwe | CWE-863 | Ruby |
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
TF_LITE_ENSURE_EQ(context, NumInputs(node), 2);
TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1);
const TfLiteTensor* dims = GetInput(context, node, kDimsTensor);
const TfLiteTensor* value = GetInput(context, node, kValueTensor);
// Make sure t... | cwe | CWE-125 | C/C++ |
void ftoa_bounded_extra(JsVarFloat val,char *str, size_t len, int radix, int fractionalDigits) {
const JsVarFloat stopAtError = 0.0000001;
if (isnan(val)) strncpy(str,"NaN",len);
else if (!isfinite(val)) {
if (val<0) strncpy(str,"-Infinity",len);
else strncpy(str,"Infinity",len);
} else {
if (val<0)... | cwe | CWE-787 | Unknown |
# -*- 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-770 | Python |
int devmem_is_allowed(unsigned long pagenr)
{
if (pagenr < 256)
return 1;
if (iomem_is_exclusive(pagenr << PAGE_SHIFT))
return 0;
if (!page_is_ram(pagenr))
return 1;
return 0;
} | cwe | CWE-732 | Unknown |
scrollback_get_filename (session *sess)
{
char *net, *chan, *buf, *ret = NULL;
net = server_get_network (sess->server, FALSE);
if (!net)
return NULL;
buf = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "scrollback" G_DIR_SEPARATOR_S "%s" G_DIR_SEPARATOR_S "%s.txt", get_xdir (), net, "");
mkdir_p (buf);
g_free (buf)... | cwe | CWE-22 | C/C++ |
function decode (str) {
var out = {}
var p = out
var section = null
// section |key = value
var re = /^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i
var lines = str.split(/[\r\n]+/g)
lines.forEach(function (line, _, __) {
if (!line || line.match(/^\s*[;#]/)) return
var match = line.match(re... | cwe | CWE-1321 | JavaScript |
static int codeCompare(
Parse *pParse, /* The parsing (and code generating) context */
Expr *pLeft, /* The left operand */
Expr *pRight, /* The right operand */
int opcode, /* The comparison opcode */
int in1, int in2, /* Register holding operands */
int dest, /* Jump here if true.... | cwe | CWE-755 | C/C++ |
def self.find_taxon(id)
self.find_by_sql("select string as taxon_concept,
(select count(*) from hierarchy_entries as h2 where h2.parent_id=h1.id) as siblings_count,
h1.taxon_concept_id
from hierarchy_entries h1
... | cwe | CWE-89 | Ruby |
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
{
AVFilterContext *ctx = inlink->dst;
FieldOrderContext *s = ctx->priv;
AVFilterLink *outlink = ctx->outputs[0];
int h, plane, line_step, line_size, line;
uint8_t *data;
if (!frame->interlaced_frame ||
frame-... | cwe | CWE-119 | C/C++ |
int main(int argc,char *argv[])
{
int error= 0, ho_error;
int first_command;
my_bool can_handle_passwords;
MYSQL mysql;
char **commands, **save_argv;
MY_INIT(argv[0]);
mysql_init(&mysql);
my_getopt_use_args_separator= TRUE;
if (load_defaults("my",load_default_groups,&argc,&argv))
exit(1);
my_ge... | cwe | CWE-284 | 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-369 | Python |
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (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.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS... | cwe | CWE-79 | Java |
"""Reading/writing Beancount files."""
from __future__ import annotations
import datetime
import re
import threading
from codecs import decode
from codecs import encode
from hashlib import sha256
from operator import attrgetter
from typing import Generator
from typing import TYPE_CHECKING
from beancount.core.data imp... | cwe | CWE-79 | Python |
async render() {
const $ = cheerio.load(this.input, {
decodeEntities: true
})
if ($.root().children().length < 1) {
return ''
}
// --------------------------------
// STEP: PRE
// --------------------------------
for (let child of _.reject(this.children, ['step', 'post']))... | cwe | CWE-79 | JavaScript |
int llhttp__after_headers_complete(llhttp_t* parser, const char* p,
const char* endp) {
int hasBody;
hasBody = parser->flags & F_CHUNKED || parser->content_length > 0;
if (parser->upgrade && (parser->method == HTTP_CONNECT ||
(parser->flags & F_SKIPBOD... | cwe | CWE-444 | Unknown |
MagickExport Image *WaveImage(const Image *image,const double amplitude,
const double wave_length,const PixelInterpolateMethod method,
ExceptionInfo *exception)
{
#define WaveImageTag "Wave/Image"
CacheView
*canvas_image_view,
*wave_view;
float
*sine_map;
Image
*canvas_image,
*wave_ima... | cwe | CWE-369 | C/C++ |
/*
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2000-2022
* 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-617 | C/C++ |
static void sasl_already(IRC_SERVER_REC *server, const char *data, const char *from)
{
if (server->sasl_timeout != 0) {
g_source_remove(server->sasl_timeout);
server->sasl_timeout = 0;
}
server->sasl_success = TRUE;
signal_emit("server sasl success", 1, server);
/* We're already authenticated, do nothing */... | cwe | CWE-416 | Unknown |
/*
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy,... | cwe | CWE-287 | Java |
SYSCALL_DEFINE5(mremap, unsigned long, addr, unsigned long, old_len,
unsigned long, new_len, unsigned long, flags,
unsigned long, new_addr)
{
struct mm_struct *mm = current->mm;
struct vm_area_struct *vma;
unsigned long ret = -EINVAL;
unsigned long charged = 0;
bool locked = false;
bool downgraded = false;
s... | cwe | CWE-787 | Unknown |
cid_parse_font_matrix( CID_Face face,
CID_Parser* parser )
{
CID_FaceDict dict;
FT_Face root = (FT_Face)&face->root;
FT_Fixed temp[6];
FT_Fixed temp_scale;
if ( parser->num_dict >= 0 && parser->num_dict < face->cid.num_dicts )
{
FT_Matri... | cwe | CWE-20 | Unknown |
ScanLineInputFile::ScanLineInputFile
(const Header &header,
OPENEXR_IMF_INTERNAL_NAMESPACE::IStream *is,
int numThreads)
:
_data (new Data (numThreads)),
_streamData (new InputStreamMutex())
{
_streamData->is = is;
_data->memoryMapped = is->isMemoryMapped();
initialize(header);
... | cwe | CWE-125 | Unknown |
func runUsingChrootExecMain() {
args := os.Args[1:]
var options runUsingChrootExecSubprocOptions
var err error
runtime.LockOSThread()
// Set logging.
if level := os.Getenv("LOGLEVEL"); level != "" {
if ll, err := strconv.Atoi(level); err == nil {
logrus.SetLevel(logrus.Level(ll))
}
os.Unsetenv("LOGLEVE... | cwe | CWE-200 | Go |
def update_user(username, chat_id, last_update):
conn = sqlite3.connect(os.path.abspath(os.path.dirname(__file__)) + "\\users\\" + username + '.db')
conn2 = sqlite3.connect(os.path.abspath(os.path.dirname(__file__)) + '\\cf.db')
settings = sqlite3.connect(os.path.abspath(os.path.dirname(__file__)) + "\\sett... | cwe | CWE-89 | Python |
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */
#include <assert.h>
#include <ctype.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include "lsquic.h"
#include "lsquic_headers.h"
#include "lsquic_http1x_if.h"
#include "lshpack.h"
#define LSQUIC_LOGGER_MODULE LSQLM_HTTP1X
#def... | cwe | CWE-476 | C/C++ |
void PrintingMessageFilter::OnUpdatePrintSettings(
int document_cookie, const DictionaryValue& job_settings,
IPC::Message* reply_msg) {
scoped_refptr<printing::PrinterQuery> printer_query;
print_job_manager_->PopPrinterQuery(document_cookie, &printer_query);
if (printer_query.get()) {
CancelableTas... | cwe | CWE-416 | C/C++ |
async function getStreamingFile(req, res) {
try {
const filePath = path.join(gladys.config.tempFolder, req.params.folder, req.params.file);
const filestream = fs.createReadStream(filePath);
filestream.on('error', (err) => {
res.status(404).end();
});
filestream.pipe(res);
}... | cwe | CWE-22 | JavaScript |
/*
* ssh.c
*
* Copyright (C) 2009-2011 by ipoque GmbH
* Copyright (C) 2011-20 - ntop.org
*
* This file is part of nDPI, an open source deep packet inspection
* library based on the OpenDPI and PACE technology by ipoque GmbH
*
* nDPI is free software: you can redistribute it and/or modify
* it under the terms ... | cwe | CWE-190 | C/C++ |
void operator()(OpKernelContext* ctx, const CPUDevice& d, int64 num_batches,
int64 samples_per_batch, int64 num_elements,
const BCastList<4>& bcast,
typename TTypes<T>::ConstFlat means,
typename TTypes<T>::ConstFlat stddevs,
typen... | cwe | CWE-197 | C/C++ |
def match?(name, ip)
ip? ? pattern.include?(IPAddr.new(ip)) : matchname?(name)
end | cwe | CWE-287 | Ruby |
static int asn1_template_noexp_d2i(ASN1_VALUE **val,
const unsigned char **in, long len,
const ASN1_TEMPLATE *tt, char opt,
ASN1_TLC *ctx)
{
int flags, aclass;
int ret;
ASN1_VALUE *tval;
const unsign... | cwe | CWE-787 | Unknown |
define([
'exports',
'../errors/RequestError',
'../errors/CancelError',
'../Deferred',
'../io-query',
'../_base/array',
'../_base/lang',
'../promise/Promise',
'../has'
], function(exports, RequestError, CancelError, Deferred, ioQuery, array, lang, Promise, has){
function isArrayBuffer(value) {
return has('n... | cwe | CWE-74 | Java |
function apiWorkspaceEndpoints(app) {
if (!app) return;
app.post("/v1/workspace/new", [validApiKey], async (request, response) => {
/*
#swagger.tags = ['Workspaces']
#swagger.description = 'Create a new workspace'
#swagger.requestBody = {
description: 'JSON object containing new display na... | cwe | CWE-305 | JavaScript |
static void ptrace_link(struct task_struct *child, struct task_struct *new_parent)
{
rcu_read_lock();
__ptrace_link(child, new_parent, __task_cred(new_parent));
rcu_read_unlock();
} | cwe | CWE-264 | C/C++ |
send_ldap_result_ext(
Slapi_PBlock *pb,
int err,
char *matched,
char *text,
int nentries,
struct berval **urls,
BerElement *ber)
{
Slapi_Operation *operation;
passwdPolicy *pwpolicy = NULL;
Connection *conn = NULL;
Slapi_DN *sdn = NULL;
const char *dn = NULL;
ber_tag_... | cwe | CWE-203 | Unknown |
void WebUIExtension::Send(gin::Arguments* args) {
blink::WebLocalFrame* frame;
RenderFrame* render_frame;
if (!ShouldRespondToRequest(&frame, &render_frame))
return;
std::string message;
if (!args->GetNext(&message)) {
args->ThrowError();
return;
}
if (base::EndsWith(message, "RequiringGestu... | cwe | CWE-416 | C/C++ |
public function offset($offset)
{
$this->ar_offset = $offset;
return $this;
} | cwe | CWE-89 | PHP |
TfLiteStatus SigmoidEval(TfLiteContext* context, TfLiteNode* node) {
OpData* data = reinterpret_cast<OpData*>(node->user_data);
const TfLiteTensor* input = GetInput(context, node, 0);
TfLiteTensor* output = GetOutput(context, node, 0);
switch (input->type) {
case kTfLiteFloat32: {
if (kernel_type == ... | cwe | CWE-125 | C/C++ |
var updateSerpPreview = function () {
var metaPanel = this.layout.getComponent("metaDataPanel");
var title = metaPanel.getComponent("title").getValue();
var description = metaPanel.getComponent("description").getValue();
var truncate = function( text, n ... | cwe | CWE-79 | JavaScript |
int rsa_rsaes_pkcs1_v15_encrypt( rsa_context *ctx,
int (*f_rng)(void *, unsigned char *, size_t),
void *p_rng,
int mode, size_t ilen,
const unsigned char *input,
... | cwe | CWE-310 | Unknown |
static int tvaudio_get_ctrl(struct CHIPSTATE *chip,
struct v4l2_control *ctrl)
{
struct CHIPDESC *desc = chip->desc;
switch (ctrl->id) {
case V4L2_CID_AUDIO_MUTE:
ctrl->value=chip->muted;
return 0;
case V4L2_CID_AUDIO_VOLUME:
if (!(desc->flags & CHIP_HAS_VOLUME))
break;
ctrl->value = max(chip->le... | cwe | CWE-399 | Unknown |
/*
* Symmetric key cipher operations.
*
* Generic encrypt/decrypt wrapper for ciphers, handles operations across
* multiple page boundaries by using temporary blocks. In user context,
* the kernel is given a chance to schedule us once per page.
*
* Copyright (c) 2015 Herbert Xu <herbert@gondor.apana.org.au>
*
... | cwe | CWE-476 | C/C++ |
static struct dir *squashfs_opendir(unsigned int block_start, unsigned int offset,
struct inode **i)
{
squashfs_dir_header_2 dirh;
char buffer[sizeof(squashfs_dir_entry_2) + SQUASHFS_NAME_LEN + 1]
__attribute__((aligned));
squashfs_dir_entry_2 *dire = (squashfs_dir_entry_2 *) buffer;
long long start;
int bytes ... | cwe | CWE-22 | Unknown |
l2tp_framing_cap_print(netdissect_options *ndo, const u_char *dat)
{
const uint32_t *ptr = (const uint32_t *)dat;
if (EXTRACT_32BITS(ptr) & L2TP_FRAMING_CAP_ASYNC_MASK) {
ND_PRINT((ndo, "A"));
}
if (EXTRACT_32BITS(ptr) & L2TP_FRAMING_CAP_SYNC_MASK) {
ND_PRINT((ndo, "S"));
}
} | cwe | CWE-125 | 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-824 | Python |
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
const TfLiteTensor* output = GetOutput(context, node, kOutputTensor);
if (output->type == kTfLiteFloat32) {
EvalAddN<float>(context, node);
} else if (output->type == kTfLiteInt32) {
EvalAddN<int32_t>(context, node);
} else {
context->Rep... | cwe | CWE-787 | C/C++ |
from django.contrib import admin
from import_export.admin import ImportExportModelAdmin
from import_export.fields import Field
from import_export.resources import ModelResource
import import_export.widgets as widgets
from build.models import Build, BuildItem
import part.models
class BuildResource(ModelResource):
... | cwe | CWE-79 | Python |
/**
* Copyright (c) 2006-2017, JGraph Ltd
* Copyright (c) 2006-2017, Gaudenz Alder
*/
(function()
{
if (typeof html4 !== 'undefined')
{
/**
* Enables paste from Lucidchart
*/
html4.ATTRIBS['span::data-lucid-content'] = 0;
html4.ATTRIBS['span::data-lucid-type'] = 0;
/**
* Enables custom fonts in... | cwe | CWE-79 | JavaScript |
package com.salesmanager.shop.model.catalog.product.product.definition;
import com.salesmanager.shop.model.entity.Entity;
/**
* Applies to product version 2 management
* @author carlsamson
*
*/
public class ProductDefinition extends Entity {
/**
*
*/
private static final long serialVersionUID = 1L;
priva... | cwe | CWE-79 | Java |
# (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 |
parse_netscreen_hex_dump(FILE_T fh, int pkt_len, const char *cap_int,
const char *cap_dst, struct wtap_pkthdr *phdr, Buffer* buf,
int *err, gchar **err_info)
{
guint8 *pd;
gchar line[NETSCREEN_LINE_LENGTH];
gchar *p;
int n, i = 0, offset = 0;
gchar dststr[13];
/* Make sure we have enough room for the pac... | cwe | CWE-20 | C/C++ |
private static function getTemplateParmValues( $text, $template ) {
$matches = [];
$noMatches = preg_match_all( '/\{\{\s*' . preg_quote( $template, '/' ) . '\s*[|}]/i', $text, $matches, PREG_OFFSET_CAPTURE );
if ( $noMatches <= 0 ) {
return '';
}
$textLen = strlen( $text );
$tval = []; // the result... | cwe | CWE-400 | PHP |
/*!
* socket.io-node
* Copyright(c) 2011 LearnBoost <dev@learnboost.com>
* MIT Licensed
*/
/**
* Module dependencies.
*/
var fs = require('fs')
, url = require('url')
, tty = require('tty')
, util = require('./util')
, store = require('./store')
, client = require('socket.io-client')
, transports = ... | cwe | CWE-330 | JavaScript |
iperf_json_printf(const char *format, ...)
{
cJSON* o;
va_list argp;
const char *cp;
char name[100];
char* np;
cJSON* j;
o = cJSON_CreateObject();
if (o == NULL)
return NULL;
va_start(argp, format);
np = name;
for (cp = format; *cp != '\0'; ++cp) {
switch (*cp) {
... | cwe | CWE-120 | Unknown |
static int rawv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
{
struct ipv6_txoptions opt_space;
DECLARE_SOCKADDR(struct sockaddr_in6 *, sin6, msg->msg_name);
struct in6_addr *daddr, *final_p, final;
struct inet_sock *inet = inet_sk(sk);
struct ipv6_pinfo *np = inet6_sk(sk);
struct raw6_sock *rp = raw... | cwe | CWE-284 | Unknown |
/*
* Copyright (C) 2000-2002 Constantin Kaplinsky. All Rights Reserved.
* Copyright (C) 2000 Tridia Corporation. All Rights Reserved.
* Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU Gene... | cwe | CWE-770 | C/C++ |
void Compute(OpKernelContext* ctx) override {
const Tensor& input = ctx->input(0);
const Tensor& input_min_tensor = ctx->input(1);
const Tensor& input_max_tensor = ctx->input(2);
int num_slices = 1;
if (axis_ > -1) {
num_slices = input.dim_size(axis_);
}
Tensor* output = nullptr;
... | cwe | CWE-20 | C/C++ |
/* 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-476 | C/C++ |
gdImagePtr gdImageScaleTwoPass(const gdImagePtr src, const unsigned int src_width, const unsigned int src_height, const unsigned int new_width, const unsigned int new_height)
{
gdImagePtr tmp_im;
gdImagePtr dst;
/* Convert to truecolor if it isn't; this code requires it. */
if (!src->trueColor) {
gdImagePaletteT... | cwe | CWE-399 | C/C++ |
bgp_nlri_parse_vpnv4 (struct peer *peer, struct attr *attr,
struct bgp_nlri *packet)
{
u_char *pnt;
u_char *lim;
struct prefix p;
int psize;
int prefixlen;
u_int16_t type;
struct rd_as rd_as;
struct rd_ip rd_ip;
struct prefix_rd prd;
u_char *tagpnt;
/* Check peer status. */
if (peer->s... | cwe | CWE-119 | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.