code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
# -*- coding: utf-8 -*-
#
# http://www.privacyidea.org
# (c) cornelius kölbel, privacyidea.org
#
# 2018-01-22 Cornelius Kölbel <cornelius.koelbel@netknights.it>
# Add offline refill
# 2016-12-20 Cornelius Kölbel <cornelius.koelbel@netknights.it>
# Add triggerchallenge endpoint
# 2016-10-23 Corneli... | cwe | CWE-20 | Python |
/*
misc.c : irssi
Copyright (C) 1999 Timo Sirainen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
T... | cwe | CWE-416 | C/C++ |
TfLiteStatus NonMaxSuppressionMultiClass(TfLiteContext* context,
TfLiteNode* node, OpData* op_data) {
// Get the input tensors
const TfLiteTensor* input_box_encodings =
GetInput(context, node, kInputTensorBoxEncodings);
const TfLiteTensor* input_class_predictions =
... | cwe | CWE-125 | C/C++ |
def save(self, data_store, filename):
pgm_model = self.model
if type(data_store) is LocalFileSystem:
data_store.write_pomegranate_model(
model=pgm_model, filename=filename)
if type(data_store) is S3DataStore:
local_filename = "/tmp/kronos.json"
... | cwe | CWE-502 | Python |
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/browser/storage_partition_impl.h"
#include <stddef.h>
#include <stdint.h>
#include <set>
#include <utility>
#include <vector>
#in... | cwe | CWE-415 | C/C++ |
status_t FLACParser::init()
{
mDecoder = FLAC__stream_decoder_new();
if (mDecoder == NULL) {
ALOGE("new failed");
return NO_INIT;
}
FLAC__stream_decoder_set_md5_checking(mDecoder, false);
FLAC__stream_decoder_set_metadata_ignore_all(mDecoder);
FLAC__stream_decoder_set_metadata_respond(
... | cwe | CWE-119 | C/C++ |
PredictorEncodeRow(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
{
TIFFPredictorState *sp = PredictorState(tif);
assert(sp != NULL);
assert(sp->encodepfunc != NULL);
assert(sp->encoderow != NULL);
/* XXX horizontal differencing alters user's data XXX */
(*sp->encodepfunc)(tif, bp, cc);
return (*sp->encoderow)(t... | cwe | CWE-119 | C/C++ |
DeepTiledInputFile::Data::Data (int numThreads):
numXTiles (0),
numYTiles (0),
partNumber (-1),
multiPartBackwardSupport(false),
numThreads(numThreads),
memoryMapped(false),
_streamData(NULL),
_deleteStream(false)
{
//
// We need at least one tileBuffer, but if threading is used,... | cwe | CWE-125 | Unknown |
def fetch_resultSet(self, session, id):
self._openContainer(session)
sid = str(id)
if (self.idNormalizer is not None):
sid = self.idNormalizer.process_string(session, sid)
query = ("SELECT class, data FROM %s WHERE identifier = '%s';" %
(self.table, sid)
... | cwe | CWE-89 | Python |
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | cwe | CWE-190 | Python |
resolve_ops (FlatpakTransaction *self,
GCancellable *cancellable,
GError **error)
{
FlatpakTransactionPrivate *priv = flatpak_transaction_get_instance_private (self);
GList *l;
for (l = priv->ops; l != NULL; l = l->next)
{
FlatpakTransactionOperation *op = l->... | cwe | CWE-269 | C/C++ |
package io.swagger.client.api;
import io.swagger.client.ApiException;
import io.swagger.client.ApiClient;
import io.swagger.client.ApiResponse;
import io.swagger.client.Configuration;
import io.swagger.client.Pair;
import javax.ws.rs.core.GenericType;
import java.io.File;
import io.swagger.client.model.ModelApiRespo... | cwe | CWE-732 | Java |
def create
File.open(resource[:path], "w") { |f| f << expected_content }
end | cwe | CWE-264 | Ruby |
func (voteSet *VoteSet) MakeCommit() *Commit {
if voteSet.signedMsgType != tmproto.PrecommitType {
panic("Cannot MakeCommit() unless VoteSet.Type is PrecommitType")
}
voteSet.mtx.Lock()
defer voteSet.mtx.Unlock()
// Make sure we have a 2/3 majority
if voteSet.maj23 == nil {
panic("Cannot MakeCommit() unless ... | cwe | CWE-347 | Go |
// SPDX-License-Identifier: GPL-2.0-or-later
/*
*
* Copyright (C) Alan Cox GW4PTS (alan@lxorguk.ukuu.org.uk)
* Copyright (C) Jonathan Naylor G4KLX (g4klx@g4klx.demon.co.uk)
* Copyright (C) Darryl Miles G7LED (dlm@g7led.demon.co.uk)
* Copyright (C) Steven Whitehouse GW7RRM (stevew@acm.org)
* Copyright (C) Joerg Re... | cwe | CWE-476 | C/C++ |
ecc_ecdsa_verify (const struct ecc_curve *ecc,
const mp_limb_t *pp, /* Public key */
size_t length, const uint8_t *digest,
const mp_limb_t *rp, const mp_limb_t *sp,
mp_limb_t *scratch)
{
/* Procedure, according to RFC 6090, "KT-I". q denotes the group
order.
1. Check 0 < r, s < q.
2. ... | cwe | CWE-787 | Unknown |
/*
* Copyright (c) 2018-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/
#include <fizz/record/EncryptedRecordLayer.h>
#include <fizz/crypto/aead/IOBufUtil.h>
namespace fizz {... | cwe | CWE-400 | C/C++ |
def remove_acl_permission(session, acl_perm_id)
stdout, stderror, retval = run_cmd(
session, PCS, "acl", "permission", "delete", acl_perm_id.to_s
)
if retval != 0
if stderror.empty?
return "Error removing permission"
else
return stderror.join("\n").strip
end
end
return ""
end | cwe | CWE-384 | Ruby |
archive_read_format_rar_read_data(struct archive_read *a, const void **buff,
size_t *size, int64_t *offset)
{
struct rar *rar = (struct rar *)(a->format->data);
int ret;
if (rar->has_encrypted_entries == ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) {
rar->has_encrypted_entries =... | cwe | CWE-416 | Unknown |
QUtil::hex_decode(std::string const& input)
{
std::string result;
size_t pos = 0;
for (std::string::const_iterator p = input.begin(); p != input.end(); ++p)
{
char ch = *p;
bool skip = false;
if ((*p >= 'A') && (*p <= 'F'))
{
ch -= 'A';
ch += 10;
... | cwe | CWE-787 | Unknown |
function peg$parseinline() {
var s0, s1, s2, s3;
peg$silentFails++;
s0 = peg$currPos;
if (input.charCodeAt(peg$currPos) === 34) {
s1 = peg$c79;
peg$currPos++;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c80); }
}
if (s1 !... | cwe | CWE-1321 | JavaScript |
inline void pad(int bytes) {
while (bytes-- > 0) writeU8(0);
} | cwe | CWE-787 | C/C++ |
/*
* Copyright (C) 2012 The Android Open Source Project
*
* 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 app... | cwe | CWE-200 | Java |
static int _lldp_send(struct lldpd *global,
struct lldpd_hardware *hardware,
u_int8_t c_id_subtype,
char *c_id,
int c_id_len,
u_int8_t p_id_subtype,
char *p_id,
int p_id_len,
int shutdown)
{
struct lldpd_port *port;
struct lldpd_chassis *chassis;
struct lldpd_frame *frame;
int length... | cwe | CWE-617 | Unknown |
package server
import (
"encoding/json"
"net/http"
"os"
"github.com/usememos/memos/api"
"github.com/usememos/memos/common"
metric "github.com/usememos/memos/plugin/metrics"
"github.com/labstack/echo/v4"
)
func (s *Server) registerSystemRoutes(g *echo.Group) {
g.GET("/ping", func(c echo.Context) error {
da... | cwe | CWE-319 | Go |
/* Copyright (C) 2012-2018 Kentoku Shiba
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; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHO... | cwe | CWE-476 | C/C++ |
SPL_METHOD(SplDoublyLinkedList, unserialize)
{
spl_dllist_object *intern = (spl_dllist_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
zval *flags, *elem;
char *buf;
int buf_len;
const unsigned char *p, *s;
php_unserialize_data_t var_hash;
if (zend_parse_parameters(ZEND_NUM_AR... | cwe | CWE-416 | C/C++ |
/**
* deps/ecc/math.js - Elliptic Curve Math
* Original Copyright (c) 2003-2005 Tom Wu.
* Modifications Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
*
* Ported from Tom Wu, which is ported from BouncyCastle
* Modified to reuse existing external NPM modules, restricted to the
* NIST//SECG/X9.62 prim... | cwe | CWE-835 | JavaScript |
package de.presti.ree6.sql;
import com.google.gson.JsonObject;
import de.presti.ree6.bot.BotWorker;
import de.presti.ree6.commands.Category;
import de.presti.ree6.commands.interfaces.Command;
import de.presti.ree6.commands.interfaces.ICommand;
import de.presti.ree6.logger.invite.InviteContainer;
import de.presti.ree6.... | cwe | CWE-863 | Java |
int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
size_t len)
{
struct inet_sock *inet = inet_sk(sk);
struct udp_sock *up = udp_sk(sk);
struct flowi4 *fl4;
int ulen = len;
struct ipcm_cookie ipc;
struct rtable *rt = NULL;
int free = 0;
int connected = 0;
__be32 daddr, faddr, saddr;
__... | cwe | CWE-362 | Unknown |
package com.salesmanager.shop.store.controller.category;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.stream.Collectors;
import javax.... | cwe | CWE-79 | Java |
static void stellaris_enet_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
k->init = stellaris_enet_init;
dc->unrealize = stellaris_enet_unrealize;
dc->props = stellaris_enet_properties;
} | cwe | CWE-119 | Unknown |
def __init__(self, host, port=None, use_ssl=None, ssl_validator=None,
timeout=TIMEOUT_DEFAULT,
continue_timeout=TIMEOUT_ASSUME_CONTINUE,
proxy_hostport=None, **ssl_opts):
"""Create a new HTTPConnection.
Args:
host: The host to which we'll con... | cwe | CWE-327 | Python |
mrb_io_initialize_copy(mrb_state *mrb, mrb_value copy)
{
mrb_value orig;
mrb_value buf;
struct mrb_io *fptr_copy;
struct mrb_io *fptr_orig;
mrb_bool failed = TRUE;
mrb_get_args(mrb, "o", &orig);
fptr_copy = (struct mrb_io *)DATA_PTR(copy);
if (fptr_copy != NULL) {
fptr_finalize(mrb, fptr_copy... | cwe | CWE-416 | C/C++ |
(T.getElementsByTagName("input")[0].setAttribute("disabled","disabled"),mxUtils.setOpacity(T,60));u.appendChild(T)}return u};var q=DiagramFormatPanel.prototype.addOptions;DiagramFormatPanel.prototype.addOptions=function(u){u=q.apply(this,arguments);var E=this.editorUi,J=E.editor.graph;if(J.isEnabled()){var T=E.getCurre... | cwe | CWE-20 | JavaScript |
static int StreamTcpTest10 (void)
{
Packet *p = SCMalloc(SIZE_OF_PACKET);
FAIL_IF(unlikely(p == NULL));
Flow f;
ThreadVars tv;
StreamTcpThread stt;
TCPHdr tcph;
uint8_t payload[4];
memset(p, 0, SIZE_OF_PACKET);
PacketQueue pq;
memset(&pq,0,sizeof(PacketQueue));
memset (&f, 0,... | cwe | CWE-94 | Unknown |
static int send_solid_rect(VncState *vs)
{
size_t bytes;
tight_pack24(vs, vs->tight.tight.buffer, 1, &vs->tight.tight.offset);
bytes = 3;
} else {
bytes = vs->clientds.pf.bytes_per_pixel;
} | cwe | CWE-120 | C/C++ |
static void send_ext_key_event_ack(VncState *vs)
{
vnc_lock_output(vs);
vnc_write_u8(vs, VNC_MSG_SERVER_FRAMEBUFFER_UPDATE);
vnc_write_u8(vs, 0);
vnc_write_u16(vs, 1);
vnc_framebuffer_update(vs, 0, 0,
surface_width(vs->vd->ds),
surface_height(vs-... | cwe | CWE-125 | Unknown |
bool Monitor::ms_verify_authorizer(Connection *con, int peer_type,
int protocol, bufferlist& authorizer_data,
bufferlist& authorizer_reply,
bool& isvalid, CryptoKey& session_key)
{
dout(10) << "ms_verify_authorizer " << con->get_peer_addr()
<< " " << ceph_entity_type_name(peer_type)
<< " ... | cwe | CWE-287 | Unknown |
static void FUNC(intra_pred)(HEVCContext *s, int x0, int y0, int log2_size, int c_idx)
{
#define PU(x) \
((x) >> s->sps->log2_min_pu_size)
#define MVF(x, y) \
(s->ref->tab_mvf[(x) + (y) * min_pu_width])
#define MVF_PU(x, y) \
MVF(PU(x0 + ((x) << hshift)), PU(y0 + ((y) << vshift)))
#define IS_INTRA(x, y) \
... | cwe | CWE-703 | Unknown |
/*
* Copyright (C) Igor Sysoev
* Copyright (C) NGINX, Inc.
*/
#include <njs_main.h>
struct njs_property_next_s {
uint32_t index;
njs_array_t *array;
};
static njs_jump_off_t njs_vmcode_object(njs_vm_t *vm);
static njs_jump_off_t njs_vmcode_array(njs_vm_t *vm, u_char *pc);
static njs_jump_off_t njs... | cwe | CWE-476 | C/C++ |
cf2_hintmap_build( CF2_HintMap hintmap,
CF2_ArrStack hStemHintArray,
CF2_ArrStack vStemHintArray,
CF2_HintMask hintMask,
CF2_Fixed hintOrigin,
FT_Bool initialMap )
{
FT_Byte* maskPtr;
CF2_... | cwe | CWE-119 | C/C++ |
'use strict'
var fs = require('graceful-fs')
var path = require('path')
var chain = require('slide').chain
var iferr = require('iferr')
var rimraf = require('rimraf')
var correctMkdir = require('../../utils/correct-mkdir')
var rmStuff = require('../../unbuild.js').rmStuff
var lifecycle = require('../../utils/lifecycle.... | cwe | CWE-732 | JavaScript |
*/
static void php_wddx_serialize_object(wddx_packet *packet, zval *obj)
{
/* OBJECTS_FIXME */
zval **ent, *fname, **varname;
zval *retval = NULL;
const char *key;
ulong idx;
char tmp_buf[WDDX_BUF_LEN];
HashTable *objhash, *sleephash;
TSRMLS_FETCH();
MAKE_STD_ZVAL(fname);
ZVAL_STRING(fname, "__sleep", 1);
/... | cwe | CWE-476 | C/C++ |
void qemu_chr_fe_set_handlers(CharBackend *b,
IOCanReadHandler *fd_can_read,
IOReadHandler *fd_read,
IOEventHandler *fd_event,
void *opaque,
GMainContext *context)
{
... | cwe | CWE-416 | Unknown |
struct snd_seq_client_port *snd_seq_create_port(struct snd_seq_client *client,
int port)
{
unsigned long flags;
struct snd_seq_client_port *new_port, *p;
int num = -1;
/* sanity check */
if (snd_BUG_ON(!client))
return NULL;
if (client->num_ports >= SNDRV_SEQ_MAX_PORTS) {
pr_warn("ALSA: seq: too ma... | cwe | CWE-416 | C/C++ |
static Image *ReadARTImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
const unsigned char
*pixels;
Image
*image;
QuantumInfo
*quantum_info;
MagickBooleanType
status;
size_t
length;
ssize_t
count,
y;
/*
Open image file.
*/
assert(image_info != (const I... | cwe | CWE-772 | C/C++ |
void derive_boundaryStrength(de265_image* img, bool vertical, int yStart,int yEnd,
int xStart,int xEnd)
{
int xIncr = vertical ? 2 : 1;
int yIncr = vertical ? 1 : 2;
int xOffs = vertical ? 1 : 0;
int yOffs = vertical ? 0 : 1;
int edgeMask = vertical ?
(DEBLOCK_FLAG_VERTI | DEB... | cwe | CWE-703 | Unknown |
void recompute_ideal_colors_2planes(
const image_block& blk,
const error_weight_block& ewb,
const block_size_descriptor& bsd,
const decimation_info& di,
int weight_quant_mode,
const uint8_t* dec_weights_quant_pvalue_plane1,
const uint8_t* dec_weights_quant_pvalue_plane2,
endpoints& ep,
vfloat4& rgbs_vector,
v... | cwe | CWE-787 | 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 |
xsltParseStylesheetAttributeSet(xsltStylesheetPtr style, xmlNodePtr cur) {
const xmlChar *ncname;
const xmlChar *prefix;
xmlChar *value;
xmlNodePtr child;
xsltAttrElemPtr attrItems;
if ((cur == NULL) || (style == NULL) || (cur->type != XML_ELEMENT_NODE))
return;
value = xmlGetNsProp(cu... | cwe | CWE-119 | C/C++ |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.rtds.svc;
import com.rtds.jpa.CaptureType;
import java.util.List;
import javax.enterprise.context.ApplicationScoped;
impor... | cwe | CWE-287 | Java |
sysObjectID_handler(snmp_varbind_t *varbind, uint32_t *oid)
{
OID(sysObjectID_oid, 1, 3, 6, 1, 4, 1, 54352);
snmp_api_set_oid(varbind, oid, sysObjectID_oid);
} | cwe | CWE-125 | C/C++ |
local block_state deflate_huff(s, flush)
deflate_state *s;
int flush;
{
int bflush; /* set if current block must be flushed */
for (;;) {
/* Make sure that we have a literal to write. */
if (s->lookahead == 0) {
fill_window(s);
if (s->lookahead == 0) ... | cwe | CWE-787 | Unknown |
function xml(options) {
options = options || {};
options.type = options.type || DEFAULT_TYPES;
const textParser = bodyParser.text(options);
return function xmlParser(req, res, next) {
// First, run the body through the text parser.
textParser(req, res, function (err) {
if (err) {
... | cwe | CWE-1321 | JavaScript |
static void do_client_file_xfer(VirtioPort *vport,
VDAgentMessage *message_header,
uint8_t *data)
{
uint32_t msg_type, id;
UdscsConnection *conn;
switch (message_header->type) {
case VD_AGENT_FILE_XFER_START: {
VDAgentFileXferStart... | cwe | CWE-200 | C/C++ |
package autonat
import (
"context"
"errors"
"math/rand"
"sync"
"time"
pb "github.com/libp2p/go-libp2p/p2p/host/autonat/pb"
"github.com/libp2p/go-libp2p-core/network"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p-core/peerstore"
"github.com/libp2p/go-msgio/protoio"
ma "github.com/mu... | cwe | CWE-400 | Go |
private int
mget(struct magic_set *ms, const unsigned char *s, struct magic *m,
size_t nbytes, size_t o, unsigned int cont_level, int mode, int text,
int flip, int recursion_level, int *printed_something,
int *need_separator, int *returnval)
{
uint32_t soffset, offset = ms->offset;
uint32_t count = m->str... | cwe | CWE-20 | C/C++ |
/*
* Copyright (c) 2012-2019 Belledonne Communications SARL.
*
* This file is part of belle-sip.
*
* 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 3 of the License, or
* (... | cwe | CWE-444 | C/C++ |
/* Copyright 2016 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 |
prepenv(const struct rule *rule)
{
static const char *safeset[] = {
"DISPLAY", "HOME", "LOGNAME", "MAIL",
"PATH", "TERM", "USER", "USERNAME",
NULL
};
struct env *env;
env = createenv(rule);
/* if we started with blank, fill some defaults then apply rules */
if (!(rule->options & KEEPENV))
fillenv(env, s... | cwe | CWE-459 | C/C++ |
(function () {
if (typeof Prism === 'undefined' || typeof document === 'undefined') {
return;
}
var CLASS_PATTERN = /(?:^|\s)command-line(?:\s|$)/;
var PROMPT_CLASS = 'command-line-prompt';
/** @type {(str: string, prefix: string) => boolean} */
var startsWith = ''.startsWith
? function (s, p) { return s.s... | cwe | CWE-79 | JavaScript |
AP4_AvccAtom::InspectFields(AP4_AtomInspector& inspector)
{
inspector.AddField("Configuration Version", m_ConfigurationVersion);
const char* profile_name = GetProfileName(m_Profile);
if (profile_name) {
inspector.AddField("Profile", profile_name);
} else {
inspector.AddField("Profile", m... | cwe | CWE-703 | C/C++ |
process_secondary_order(STREAM s)
{
/* The length isn't calculated correctly by the server.
* For very compact orders the length becomes negative
* so a signed integer must be used. */
uint16 length;
uint16 flags;
uint8 type;
uint8 *next_order;
in_uint16_le(s, length);
in_uint16_le(s, flags); /* used by bmp... | cwe | CWE-787 | Unknown |
def resolve_orders(root: models.User, info, **kwargs):
from ..order.types import OrderCountableConnection
def _resolve_orders(orders):
requester = get_user_or_app_from_context(info.context)
if not requester.has_perm(OrderPermissions.MANAGE_ORDERS):
orders = list(... | cwe | CWE-862 | Python |
'use strict';
const { clone, cloneDeep } = require('./clone');
const SMALL_ARRAY_SIZE = 10;
function isEmpty(item) {
if (Array.isArray(item) || Buffer.isBuffer(item)) {
return item.length === 0;
} else if (isObject(item)) {
return Object.keys(item).length === 0;
} else {
return true;
}
}
function... | cwe | CWE-915 | JavaScript |
#include "source/common/tcp_proxy/tcp_proxy.h"
#include <cstdint>
#include <memory>
#include <string>
#include "envoy/buffer/buffer.h"
#include "envoy/config/accesslog/v3/accesslog.pb.h"
#include "envoy/event/dispatcher.h"
#include "envoy/event/timer.h"
#include "envoy/extensions/filters/network/tcp_proxy/v3/tcp_prox... | cwe | CWE-416 | C/C++ |
function doToggle()
{
var resolveActionLnk = evt.target;
resolveActionLnk.innerHTML = '';
comment.isResolved = !comment.isResolved;
mxUtils.write(resolveActionLnk, comment.isResolved? mxResources.get('reopen') : mxResources.get('resolve'));
var actionsDisplay = comment.isResolved? 'none' :... | cwe | CWE-94 | JavaScript |
public function beforeFilter() { // TODO REMOVE
parent::beforeFilter();
$this->Security->unlockedActions = array('saveElementSorting', 'populateEventFromTemplate', 'uploadFile', 'deleteTemporaryFile');
} | cwe | CWE-94 | PHP |
static int yam_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
struct yam_port *yp = netdev_priv(dev);
struct yamdrv_ioctl_cfg yi;
struct yamdrv_ioctl_mcs *ym;
int ioctl_cmd;
if (copy_from_user(&ioctl_cmd, ifr->ifr_data, sizeof(int)))
return -EFAULT;
if (yp->magic != YAM_MAGIC)
return -EINVAL;
... | cwe | CWE-399 | Unknown |
wb_id(netdissect_options *ndo,
const struct pkt_id *id, u_int len)
{
int i;
const char *cp;
const struct id_off *io;
char c;
int nid;
ND_PRINT((ndo, " wb-id:"));
if (len < sizeof(*id) || !ND_TTEST(*id))
return (-1);
len -= sizeof(*id);
ND_PRINT((ndo, " %u/%s:%u (max %u/%s:%u) ",
EXTRACT_32BIT... | cwe | CWE-20 | C/C++ |
nfssvc_decode_writeargs(struct svc_rqst *rqstp, __be32 *p,
struct nfsd_writeargs *args)
{
unsigned int len, hdr, dlen;
struct kvec *head = rqstp->rq_arg.head;
int v;
p = decode_fh(p, &args->fh);
if (!p)
return 0;
p++; /* beginoffset */
args->offset = ntohl(*p++); /* offset */
p++; /* totalcount *... | cwe | CWE-119 | C/C++ |
static void copy_asoundrc(void) {
char *src = RUN_ASOUNDRC_FILE ;
char *dest;
if (asprintf(&dest, "%s/.asoundrc", cfg.homedir) == -1)
errExit("asprintf");
if (is_link(dest)) {
fprintf(stderr, "Error: %s is a symbolic link\n", dest);
exit(1);
}
pid_t child = fork();
if (child < 0)
errExit("fork")... | cwe | CWE-269 | C/C++ |
PackLinuxElf64::check_pt_dynamic(Elf64_Phdr const *const phdr)
{
upx_uint64_t t = get_te64(&phdr->p_offset), s = sizeof(Elf64_Dyn) + t;
upx_uint64_t vaddr = get_te64(&phdr->p_vaddr);
upx_uint64_t filesz = get_te64(&phdr->p_filesz), memsz = get_te64(&phdr->p_memsz);
upx_uint64_t align = get_te64(&phdr->p... | cwe | CWE-787 | Unknown |
void FdOutStream::flush()
{
while (sentUpTo < ptr) {
int n = writeWithTimeout((const void*) sentUpTo,
ptr - sentUpTo,
blocking? timeoutms : 0);
// Timeout?
if (n == 0) {
// If non-blocking then we're done here
if (!blocking)
br... | cwe | CWE-122 | C/C++ |
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
TF_LITE_ENSURE_EQ(context, NumInputs(node), 2);
TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1);
const TfLiteTensor* data = GetInput(context, node, kInputDataTensor);
const TfLiteTensor* segment_ids =
GetInput(context, node, kInputSegmentIds... | cwe | CWE-787 | C/C++ |
F.substring(0,11)){var J=F.indexOf(",");0<J&&(F=F.substring(0,J)+";base64,"+F.substring(J+1))}c(F,null,0,0,G,N);v.scrollTop=v.scrollHeight}})});m.setAttribute("id","btnAddImageUrl");m.className="geBtn";d.appendChild(m);this.saveBtnClickHandler=function(F,G,N,J){b.saveLibrary(F,G,N,J)};m=mxUtils.button(mxResources.get("... | cwe | CWE-20 | JavaScript |
FT_Bitmap_Embolden( FT_Library library,
FT_Bitmap* bitmap,
FT_Pos xStrength,
FT_Pos yStrength )
{
FT_Error error;
unsigned char* p;
FT_Int i, x, y, pitch;
FT_Int xstr, ystr;
return FT_... | cwe | CWE-119 | C/C++ |
func ServeData(ctx *context.Context, name string, size int64, reader io.Reader) error {
buf := make([]byte, 1024)
n, err := util.ReadAtMost(reader, buf)
if err != nil {
return err
}
if n >= 0 {
buf = buf[:n]
}
ctx.Resp.Header().Set("Cache-Control", "public,max-age=86400")
if size >= 0 {
ctx.Resp.Header(... | cwe | CWE-79 | Go |
sec_recv(uint8 * rdpver)
{
uint32 sec_flags;
uint16 channel;
STREAM s;
while ((s = mcs_recv(&channel, rdpver)) != NULL)
{
if (rdpver != NULL)
{
if (*rdpver != 3)
{
if (*rdpver & 0x80)
{
in_uint8s(s, 8); /* signature */
sec_decrypt(s->p, s->end - s->p);
}
return s;
}
}
if... | cwe | CWE-787 | Unknown |
extract_archive_thread (GSimpleAsyncResult *result,
GObject *object,
GCancellable *cancellable)
{
ExtractData *extract_data;
LoadData *load_data;
GHashTable *checked_folders;
struct archive *a;
struct archive_entry *entry;
int r;
extr... | cwe | CWE-22 | Unknown |
package filesystem
import (
"bufio"
"io"
"io/ioutil"
"os"
"path"
"path/filepath"
"sort"
"strconv"
"strings"
"sync"
"sync/atomic"
"time"
"emperror.dev/errors"
"github.com/gabriel-vasile/mimetype"
"github.com/karrick/godirwalk"
ignore "github.com/sabhiram/go-gitignore"
"github.com/pterodactyl/wings/co... | cwe | CWE-59 | Go |
package docker
import (
"context"
"crypto/tls"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
"os"
"path/filepath"
"strconv"
"strings"
"sync"
"time"
"github.com/containers/image/v5/docker/reference"
"github.com/containers/image/v5/pkg/docker/config"
"github.com/containers/image/v5/pkg/sy... | cwe | CWE-400 | Go |
PHP_METHOD(Phar, __construct)
{
#if !HAVE_SPL
zend_throw_exception_ex(zend_ce_exception, 0, "Cannot instantiate Phar object without SPL extension");
#else
char *fname, *alias = NULL, *error, *arch = NULL, *entry = NULL, *save_fname;
size_t fname_len, alias_len = 0;
int arch_len, entry_len, is_data;
zend_long flags... | cwe | CWE-20 | Unknown |
public function render()
{
$languageService = $this->getLanguageService();
$options = $this->data['renderData']['fieldControlOptions'];
$title = $options['title'] ?? 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.edit';
$parameterArray = $this->data['parameterAr... | cwe | CWE-200 | PHP |
////////////////////////////////////////////////////////////////////////////
// **** WAVPACK **** //
// Hybrid Lossless Wavefile Compressor //
// Copyright (c) 1998 - 2016 David Bryant. //
// ... | cwe | CWE-125 | C/C++ |
/*
* . .o8 oooo
* .o8 "888 `888
* .o888oo oooo d8b oooo oooo .oooo888 .ooooo. .oooo.o 888 oooo
* 888 `888""8P `888 `888 d88' `888 d88' `88b d88( "8 888 .8P'
* 888 888 888 888 8... | cwe | CWE-269 | JavaScript |
def post(self, request, *args, **kwargs): # doccov: ignore
command = request.POST.get("command")
if command:
dispatcher = getattr(self, "dispatch_%s" % command, None)
if not callable(dispatcher):
raise Problem(_("Unknown command: `%s`.") % command)
di... | cwe | CWE-79 | Python |
package com.salesmanager.shop.admin.controller.shipping;
import com.salesmanager.core.business.services.reference.country.CountryService;
import com.salesmanager.core.business.services.reference.zone.ZoneService;
import com.salesmanager.core.business.services.shipping.ShippingOriginService;
import com.salesmanager.cor... | cwe | CWE-639 | Java |
/*
OmnomIRC COPYRIGHT 2010,2011 Netham45
2012-2014 Sorunome
2015 juju2143
This file contains snippets of code taken from OmnomIRC.
*/
function parseLinks(text,nav)
{
text = text.replace(/(\x01)/g,"");
if (!text || text === null || text === undefined){
... | cwe | CWE-79 | JavaScript |
void auth_policy_create_json(struct policy_lookup_ctx *context,
const char *password, bool include_success)
{
const struct var_expand_table *var_table;
context->json = str_new(context->pool, 64);
unsigned char *ptr;
const struct hash_method *digest = hash_method_lookup(context->set->policy_hash_mech);
i_assert(d... | cwe | CWE-20 | Unknown |
static int do_jit(struct bpf_prog *bpf_prog, int *addrs, u8 *image,
int oldproglen, struct jit_context *ctx, bool jmp_padding)
{
bool tail_call_reachable = bpf_prog->aux->tail_call_reachable;
struct bpf_insn *insn = bpf_prog->insnsi;
bool callee_regs_used[4] = {};
int insn_cnt = bpf_prog->len;
bool tail_call_s... | cwe | CWE-77 | C/C++ |
/*
* Filename routines for HTMLDOC, a HTML document processing program.
*
* Copyright © 2011-2021 by Michael R Sweet.
* Copyright © 1997-2010 by Easy Software Products. All rights reserved.
*
* This program is free software. Distribution and use rights are outlined in
* the file "COPYING".
*/
/*
* Include n... | cwe | CWE-787 | C/C++ |
static VALUE read_memory(VALUE klass, VALUE content)
{
xmlSchemaPtr schema;
xmlSchemaParserCtxtPtr ctx = xmlSchemaNewMemParserCtxt(
(const char *)StringValuePtr(content),
(int)RSTRING_LEN(content)
);
VALUE rb_schema;
VALUE errors = rb_ary_new();
xmlSetStructuredErrorFunc((void *)errors, Nokogiri... | cwe | CWE-611 | C/C++ |
bool PxMDecoder::readData( Mat& img )
{
int color = img.channels() > 1;
uchar* data = img.ptr();
PaletteEntry palette[256];
bool result = false;
const int bit_depth = CV_ELEM_SIZE1(m_type)*8;
const int src_pitch = divUp(m_width*m_bpp*(bit_depth/8), 8);
int nch = CV_MAT_CN(m_type);
int... | cwe | CWE-399 | C/C++ |
/******************************************************************************
* main.c
*
* pdfresurrect - PDF history extraction tool
*
* Copyright (C) 2008-2010, 2012, 2017, 2019 Matt Davis (enferex).
*
* Special thanks to all of the contributors: See AUTHORS.
*
* Special thanks to 757labs (757 crew), the... | cwe | CWE-787 | C/C++ |
package io.swagger.codegen.languages;
import io.swagger.codegen.*;
import io.swagger.codegen.languages.features.BeanValidationFeatures;
import io.swagger.models.Operation;
import java.util.*;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.StringUtils;
public class JavaJerseyServerCode... | cwe | CWE-732 | Java |
void MediaStreamDispatcherHost::DoOpenDevice(
int32_t page_request_id,
const std::string& device_id,
MediaStreamType type,
OpenDeviceCallback callback,
MediaDeviceSaltAndOrigin salt_and_origin) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (!MediaStreamManager::IsOriginAllowed(render_process_id_,... | cwe | CWE-189 | C/C++ |
def add_item(self, item):
""""Add new item."""
if self.connection:
self.cursor.execute('insert into item (name, shoppinglistid) values ("%s", "%s")' % (item[0], item[1]))
self.connection.commit() | cwe | CWE-89 | Python |
read_creator_block (FILE *f,
gint image_ID,
guint total_len,
PSPimage *ia)
{
long data_start;
guchar buf[4];
guint16 keyword;
guint32 length;
gchar *string;
gchar *title = NULL, *artist = NULL,... | cwe | CWE-125 | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.