code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
/*
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator p... | cwe | CWE-732 | Java |
void AuthenticationFeature::collectOptions(std::shared_ptr<ProgramOptions> options) {
options->addOldOption("server.disable-authentication",
"server.authentication");
options->addOldOption("server.disable-authentication-unix-sockets",
"server.authentication-unix-socke... | cwe | CWE-613 | C/C++ |
#include "extensions/filters/http/jwt_authn/verifier.h"
#include "envoy/extensions/filters/http/jwt_authn/v3/config.pb.h"
#include "jwt_verify_lib/check_audience.h"
using envoy::extensions::filters::http::jwt_authn::v3::JwtProvider;
using envoy::extensions::filters::http::jwt_authn::v3::JwtRequirement;
using envoy::... | cwe | CWE-287 | C/C++ |
/*
* Unsquash a squashfs filesystem. This is a highly compressed read only
* filesystem.
*
* Copyright (c) 2021
* Phillip Lougher <phillip@squashfs.org.uk>
*
* 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... | cwe | CWE-59 | C/C++ |
protected function getBodyTagAttributes()
{
$formEngineParameters = [];
$parameters = parent::getBodyTagAttributes();
$formEngineParameters['fieldChangeFunc'] = $this->parameters['fieldChangeFunc'];
$formEngineParameters['fieldChangeFuncHash'] = GeneralUtility::hmac(serialize($this-... | cwe | CWE-502 | PHP |
pthread_mutex_unlock(pthread_mutex_t *mutex)
{
LeaveCriticalSection(mutex);
return 0;
} | cwe | CWE-125 | C/C++ |
function MAX_adRenderImageBeacon($logUrl, $beaconId = 'beacon', $userAgent = null)
{
if (!isset($userAgent) && isset($_SERVER['HTTP_USER_AGENT'])) {
$userAgent = $_SERVER['HTTP_USER_AGENT'];
}
$beaconId .= '_{random}';
// Add beacon image for logging
if (isset($userAgent) && preg_match("#Moz... | cwe | CWE-79 | PHP |
main(
int argc,
char ** argv)
{
#ifdef GNUTAR
int i;
char *e;
char *dbf;
char *cmdline;
GPtrArray *array = g_ptr_array_new();
gchar **strings;
char **new_argv;
char **env;
#endif
if (argc > 1 && argv[1] && g_str_equal(argv[1], "--version")) {
printf("runtar-%s\n", VERSION)... | cwe | CWE-77 | 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 |
TPM2B_NAME_Marshal(TPM2B_NAME *source, BYTE **buffer, INT32 *size)
{
UINT16 written = 0;
written += TPM2B_Marshal(&source->b, buffer, size);
return written;
} | cwe | CWE-787 | Unknown |
static int bgp_capability_msg_parse(struct peer *peer, uint8_t *pnt,
bgp_size_t length)
{
uint8_t *end;
struct capability_mp_data mpc;
struct capability_header *hdr;
uint8_t action;
iana_afi_t pkt_afi;
afi_t afi;
iana_safi_t pkt_safi;
safi_t safi;
end = pnt + length;
while (pnt < end) {
/* We need... | cwe | CWE-125 | C/C++ |
check_compat_entry_size_and_hooks(struct compat_ipt_entry *e,
struct xt_table_info *newinfo,
unsigned int *size,
const unsigned char *base,
const unsigned char *limit,
const unsigned int *hook_entries,
const unsigned int *underflows,
const char *name)
{
struct xt_entry_match *... | cwe | CWE-119 | C/C++ |
function RemoveXSSchars(&$val)
{
static $patterns = NULL;
static $replacements = NULL;
$val_before = $val;
$found = true;
if ( $patterns == NULL ) {
$patterns = array();
$replacements = array();
// remove all non-printable characters. CR(0a) and LF(0b) and TAB(9) are
// allowed this prevents so... | cwe | CWE-79 | PHP |
/* 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 |
eog_image_save_error_message_area_new (const gchar *caption,
const GError *error)
{
GtkWidget *message_area;
gchar *error_message = NULL;
gchar *message_details = NULL;
gchar *pango_escaped_caption = NULL;
g_return_val_if_fail (caption != NULL, NULL);
g_return_val_if_fail (error != NULL, NULL);
/* ... | cwe | CWE-787 | Unknown |
commonio_sort (struct commonio_db *db, int (*cmp) (const void *, const void *))
{
struct commonio_entry **entries, *ptr;
size_t n = 0, i;
#if KEEP_NIS_AT_END
struct commonio_entry *nis = NULL;
#endif
for (ptr = db->head;
(NULL != ptr)
#if KEEP_NIS_AT_END
&& (NULL != ptr->line)
&& ( ('+' != p... | cwe | CWE-787 | C/C++ |
void tipc_mon_rcv(struct net *net, void *data, u16 dlen, u32 addr,
struct tipc_mon_state *state, int bearer_id)
{
struct tipc_monitor *mon = tipc_monitor(net, bearer_id);
struct tipc_mon_domain *arrv_dom = data;
struct tipc_mon_domain dom_bef;
struct tipc_mon_domain *dom;
struct tipc_peer *peer;
u16 new_membe... | cwe | CWE-787 | Unknown |
int lxc_attach(const char* name, const char* lxcpath, lxc_attach_exec_t exec_function, void* exec_payload, lxc_attach_options_t* options, pid_t* attached_process)
{
int ret, status;
pid_t init_pid, pid, attached_pid, expected;
struct lxc_proc_context_info *init_ctx;
char* cwd;
char* new_cwd;
int ipc_sockets[2];
... | cwe | CWE-284 | Unknown |
static enum AVPixelFormat h263_get_format(AVCodecContext *avctx)
{
/* MPEG-4 Studio Profile only, not supported by hardware */
if (avctx->bits_per_raw_sample > 8) {
av_assert1(avctx->profile == FF_PROFILE_MPEG4_SIMPLE_STUDIO);
return avctx->pix_fmt;
}
if (avctx->codec->id == AV_CODEC_ID... | cwe | CWE-617 | Unknown |
0>M?(H=M*V.width,M=0):1<M&&(H=(M-1)*V.width,M=1);0>F?(S=F*V.height,F=0):1<F&&(S=(F-1)*V.height,F=1);return{x:M,y:F,dx:parseInt(H),dy:parseInt(S)}}function k(){if(1==p.getSelectionCount()){var F=p.getSelectionCell();F=g(F);D.value=100*F.x;P.value=100*F.y;G.value=F.dx;K.value=F.dy;C.style.visibility=""}else C.style.visib... | cwe | CWE-20 | JavaScript |
public function store($zdb)
{
$data = array(
'short_label' => $this->short,
'long_label' => $this->long
);
try {
if ($this->id !== null && $this->id > 0) {
$update = $zdb->update(self::TABLE);
$update->set($data)->where... | cwe | CWE-79 | PHP |
def as_json(options = {})
hash = super
hash["secret"] = plaintext_secret if hash.key?("secret")
hash
end | cwe | CWE-862 | Ruby |
int ff_mpeg4_decode_picture_header(Mpeg4DecContext *ctx, GetBitContext *gb)
{
MpegEncContext *s = &ctx->m;
unsigned startcode, v;
int ret;
int vol = 0;
/* search next start code */
align_get_bits(gb);
if (!s->studio_profile && s->avctx->bits_per_raw_sample != 8)
s->avctx->bits_per_... | cwe | CWE-476 | Unknown |
png_create_write_struct_2(png_const_charp user_png_ver, png_voidp error_ptr,
png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr,
png_malloc_ptr malloc_fn, png_free_ptr free_fn)
{
#endif /* PNG_USER_MEM_SUPPORTED */
#ifdef PNG_SETJMP_SUPPORTED
volatile
#endif
png_structp png_ptr;
#ifdef PNG_SET... | cwe | CWE-120 | C/C++ |
long mkvparser::UnserializeString(IMkvReader* pReader, long long pos,
long long size_, char*& str) {
delete[] str;
str = NULL;
if (size_ >= LONG_MAX) // we need (size+1) chars
return E_FILE_FORMAT_INVALID;
const long size = static_cast<long>(size_);
str = new (s... | cwe | CWE-20 | C/C++ |
ethertype_print(netdissect_options *ndo,
u_short ether_type, const u_char *p,
u_int length, u_int caplen,
const struct lladdr_info *src, const struct lladdr_info *dst)
{
switch (ether_type) {
case ETHERTYPE_IP:
ip_print(ndo, p, length);
return (1);
case ET... | cwe | CWE-787 | Unknown |
/* 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-476 | Python |
static void ftrace_syscall_enter(void *data, struct pt_regs *regs, long id)
{
struct trace_array *tr = data;
struct ftrace_event_file *ftrace_file;
struct syscall_trace_enter *entry;
struct syscall_metadata *sys_data;
struct ring_buffer_event *event;
struct ring_buffer *buffer;
unsigned long irq_flags;
int pc;
... | cwe | CWE-264 | Unknown |
const BlockEntry* Cluster::GetEntry(const CuePoint& cp,
const CuePoint::TrackPosition& tp) const {
assert(m_pSegment);
#if 0
LoadBlockEntries();
if (m_entries == NULL)
return NULL;
const long long count = m_entries_count;
if (count <= 0)
return NUL... | cwe | CWE-20 | C/C++ |
static int kvaser_usb_leaf_flush_queue(struct kvaser_usb_net_priv *priv)
{
struct kvaser_cmd *cmd;
int rc;
cmd = kmalloc(sizeof(*cmd), GFP_KERNEL);
if (!cmd)
return -ENOMEM;
cmd->id = CMD_FLUSH_QUEUE;
cmd->len = CMD_HEADER_LEN + sizeof(struct kvaser_cmd_flush_queue);
cmd->u.flush_queue.channel = priv->channe... | cwe | CWE-200 | Unknown |
public static void square(int[] x, int[] zz)
{
long x_0 = x[0] & M;
long zz_1;
int c = 0, w;
{
int i = 7, j = 16;
do
{
long xVal = (x[i--] & M);
long p = xVal * xVal;
zz[--j] = (c << 31) | (int)(p >>... | cwe | CWE-19 | Java |
// SPDX-License-Identifier: BSD-2-Clause
/*
* Copyright (c) 2014, STMicroelectronics International N.V.
*/
#include <assert.h>
#include <crypto/crypto.h>
#include <kernel/tee_ta_manager.h>
#include <mm/tee_mmu.h>
#include <string_ext.h>
#include <string.h>
#include <sys/queue.h>
#include <tee_api_types.h>
#include <... | cwe | CWE-190 | C/C++ |
function parseBuffer(buffer) {
const _entries = []
let cursor = 0
while (cursor < buffer.length) {
const space = buffer.indexOf(32, cursor)
if (space === -1) {
throw new InternalError(
`GitTree: Error parsing buffer at byte location ${cursor}: Could not find the next space character.`
... | cwe | CWE-22 | JavaScript |
EFI_STATUS verify_image(void *data, unsigned int datasize,
EFI_LOADED_IMAGE *li,
PE_COFF_LOADER_IMAGE_CONTEXT *context)
{
EFI_STATUS efi_status;
UINT8 sha1hash[SHA1_DIGEST_SIZE];
UINT8 sha256hash[SHA256_DIGEST_SIZE];
/*
* The binary header contains relevant context and section pointers
*/
efi_status = r... | cwe | CWE-787 | 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-476 | Python |
/*
* Description: network buf manager
* History: yang@haipo.me, 2016/03/16, create
*/
# include <errno.h>
# include <string.h>
# include "nw_buf.h"
# define NW_BUF_POOL_INIT_SIZE 64
# define NW_CACHE_INIT_SIZE 64
size_t nw_buf_size(nw_buf *buf)
{
return buf->wpos - buf->rpos;
}
size_t nw_buf_avail(nw_... | cwe | CWE-190 | C/C++ |
int install_thread_keyring_to_cred(struct cred *new)
{
struct key *keyring;
keyring = keyring_alloc("_tid", new->uid, new->gid, new,
KEY_POS_ALL | KEY_USR_VIEW,
KEY_ALLOC_QUOTA_OVERRUN,
NULL, NULL);
if (IS_ERR(keyring))
return PTR_ERR(keyring);
new->thread_keyring = keyring;
return 0;
} | cwe | CWE-404 | C/C++ |
// SPDX-FileCopyrightText: 2023 froggie <legal@frogg.ie>
//
// SPDX-License-Identifier: OSL-3.0
package api
import (
"net/http"
"time"
"github.com/effectindex/tripreporter/models"
"github.com/effectindex/tripreporter/types"
"github.com/gorilla/mux"
)
func SetupAccountEndpoints(v1 *mux.Router) {
a1 := v1.Metho... | cwe | CWE-287 | Go |
static void settings_changed(struct btd_adapter *adapter, uint32_t settings)
{
uint32_t changed_mask;
changed_mask = adapter->current_settings ^ settings;
adapter->current_settings = settings;
adapter->pending_settings &= ~changed_mask;
DBG("Changed settings: 0x%08x", changed_mask);
DBG("Pending settings: 0x%0... | cwe | CWE-863 | C/C++ |
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
const TfLiteTensor* value = GetInput(context, node, kValueTensor);
TfLiteTensor* output = GetOutput(context, node, kOutputTensor);
if (IsDynamicTensor(output)) {
const TfLiteTensor* dims = GetInput(context, node, kDimsTensor);
TF_LITE_ENSURE_... | cwe | CWE-125 | C/C++ |
/*****************************************************************
|
| AP4 - hdlr Atoms
|
| Copyright 2002-2008 Axiomatic Systems, LLC
|
|
| This file is part of Bento4/AP4 (MP4 Atom Processing Library).
|
| Unless you have obtained Bento4 under a difference license,
| this version of Bento4 is Bento4|G... | cwe | CWE-476 | C/C++ |
chpass_principal3_2_svc(chpass3_arg *arg, struct svc_req *rqstp)
{
static generic_ret ret;
char *prime_arg;
gss_buffer_desc client_name,
service_name;
OM_uint32 minor_stat;
kadm5_server_handle_t handle;
... | cwe | CWE-772 | C/C++ |
package org.jenkinsci.plugins;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.acegisecurity.Authentication;
import org.acegisecurity.AuthenticationException;
import org.acegisecurity.AuthenticationManager;
import org.acegisecurity.BadCredentialsException;
impor... | cwe | CWE-613 | Java |
async function write (cache, data, opts = {}) {
const { algorithms, size, integrity } = opts
if (algorithms && algorithms.length > 1) {
throw new Error('opts.algorithms only supports a single algorithm for now')
}
if (typeof size === 'number' && data.length !== size) {
throw sizeError(size, data.length... | cwe | CWE-200 | JavaScript |
int qcow2_snapshot_load_tmp(BlockDriverState *bs,
const char *snapshot_id,
const char *name,
Error **errp)
{
int i, snapshot_index;
BDRVQcowState *s = bs->opaque;
QCowSnapshot *sn;
uint64_t *new_l1_table;
int new_l1_... | cwe | CWE-190 | Unknown |
static inline struct htx_blk *htx_add_header(struct htx *htx, const struct ist name,
const struct ist value)
{
struct htx_blk *blk;
/* FIXME: check name.len (< 256B) and value.len (< 1MB) */
blk = htx_add_blk(htx, HTX_BLK_HDR, name.len + value.len);
if (!blk)
return NULL;
blk->info += (value.len << 8... | cwe | CWE-190 | C/C++ |
error_t tcpCheckSeqNum(Socket *socket, TcpHeader *segment, size_t length)
{
//Acceptability test for an incoming segment
bool_t acceptable = FALSE;
//Case where both segment length and receive window are zero
if(!length && !socket->rcvWnd)
{
//Make sure that SEG.SEQ = RCV.NXT
if(segment->seq... | cwe | CWE-20 | C/C++ |
def on_permitted_domain(team: Team, request: HttpRequest) -> bool:
permitted_domains = ["127.0.0.1", "localhost"]
for url in team.app_urls:
hostname = parse_domain(url)
if hostname:
permitted_domains.append(hostname)
origin = parse_domain(request.headers.get("Origin"))
refe... | cwe | CWE-601 | Python |
/*
* Kernel-based Virtual Machine driver for Linux
*
* This module enables machines with Intel VT-x extensions to run virtual
* machines without emulation or binary translation.
*
* Copyright (C) 2006 Qumranet, Inc.
* Copyright 2010 Red Hat, Inc. and/or its affiliates.
*
* Authors:
* Avi Kivity <avi@qumra... | cwe | CWE-264 | C/C++ |
/* XML RPC Library
*
* (C) 2005 Trystan Scott Lee
* Contact trystan@nomadirc.net
*
* Please read COPYING and README for further details.
*
* Based on the original code from Denora
*
*
*/
#include <mowgli.h>
#include "atheme.h"
#include "xmlrpclib.h"
static int xmlrpc_error_code;
typedef struct XMLRPCCmd_ X... | cwe | CWE-119 | C/C++ |
/* pb_decode.c -- decode a protobuf using minimal resources
*
* 2011 Petteri Aimonen <jpa@kapsi.fi>
*/
/* Use the GCC warn_unused_result attribute to check that all return values
* are propagated correctly. On other compilers and gcc before 3.4.0 just
* ignore the annotation.
*/
#if !defined(__GNUC__) || ( __GNU... | cwe | CWE-763 | Python |
/*
* Copyright (C) 2004-2018 ZNC, see the NOTICE file for details.
*
* 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 requi... | cwe | CWE-20 | C/C++ |
character === '>' ? `${leading}\u00ad>` : matched | cwe | CWE-1333 | JavaScript |
bool operator()(const OpKernelContext* context,
typename TTypes<float, 4>::ConstTensor grads,
typename TTypes<float, 2>::ConstTensor boxes,
typename TTypes<int32, 1>::ConstTensor box_index,
typename TTypes<T, 4>::Tensor grads_image,
... | cwe | CWE-197 | Unknown |
/*
* Copyright 2013 the original author or 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 applicabl... | cwe | CWE-74 | Java |
static BlockAIOCB *iscsi_aio_ioctl(BlockDriverState *bs,
unsigned long int req, void *buf,
BlockCompletionFunc *cb, void *opaque)
{
IscsiLun *iscsilun = bs->opaque;
struct iscsi_context *iscsi = iscsilun->iscsi;
struct iscsi_data data;
IscsiAIOCB *acb;
acb = qemu_aio_get(&iscsi_aioc... | cwe | CWE-119 | Unknown |
/*
* Description: network buf manager
* History: yang@haipo.me, 2016/03/16, create
*/
# include <errno.h>
# include <string.h>
# include "nw_buf.h"
# define NW_BUF_POOL_INIT_SIZE 64
# define NW_CACHE_INIT_SIZE 64
size_t nw_buf_size(nw_buf *buf)
{
return buf->wpos - buf->rpos;
}
size_t nw_buf_avail(nw_... | cwe | CWE-190 | C/C++ |
function j(t){h("emit readable"),t.emit("readable"),A(t)} | cwe | CWE-200 | JavaScript |
static Image *ReadTIFFImage(const ImageInfo *image_info,
ExceptionInfo *exception)
{
#define MaxPixelChannels 32
#define ThrowTIFFException(severity,message) \
{ \
if (pixel_info != (MemoryInfo *) NULL) \
pixel_info=RelinquishVirtualMemory(pixel_info); \
if (quantum_info != (QuantumInfo *) NULL) \
quantu... | cwe | CWE-787 | C/C++ |
/**
* @file 历史记录
* @author life
*
*/
define('history', [], function() {
var tpl = ['<div class="modal fade history-modal" tabindex="-1" role="dialog" aria-hidden="true">',
'<div class="modal-dialog modal-lg ">',
'<div class="modal-content">',
'<div class="modal... | cwe | CWE-707 | JavaScript |
u64 secure_dccp_sequence_number(__be32 saddr, __be32 daddr,
__be16 sport, __be16 dport)
{
u64 seq;
__u32 hash[4];
struct keydata *keyptr = get_keyptr();
hash[0] = (__force u32)saddr;
hash[1] = (__force u32)daddr;
hash[2] = ((__force u16)sport << 16) + (__force u16)dport;
hash[3] = keyptr->secret[11];
seq ... | cwe | CWE-703 | Unknown |
int rose_rx_call_request(struct sk_buff *skb, struct net_device *dev, struct rose_neigh *neigh, unsigned int lci)
{
struct sock *sk;
struct sock *make;
struct rose_sock *make_rose;
struct rose_facilities_struct facilities;
int n, len;
skb->sk = NULL; /* Initially we don't know who it's for */
/*
* skb->data... | cwe | CWE-20 | Unknown |
static struct usb_function *gprinter_alloc(struct usb_function_instance *fi)
{
struct printer_dev *dev;
struct f_printer_opts *opts;
opts = container_of(fi, struct f_printer_opts, func_inst);
mutex_lock(&opts->lock);
if (opts->minor >= minors) {
mutex_unlock(&opts->lock);
return ERR_PTR(-ENOENT);
}
dev = ... | cwe | CWE-416 | Unknown |
static const ut8 *parse_die(const ut8 *buf, const ut8 *buf_end, RzBinDwarfDebugInfo *info, RzBinDwarfAbbrevDecl *abbrev,
RzBinDwarfCompUnitHdr *hdr, RzBinDwarfDie *die, const ut8 *debug_str, size_t debug_str_len, bool big_endian) {
size_t i;
const char *comp_dir = NULL;
ut64 line_info_offset = UT64_MAX;
for (i = 0... | cwe | CWE-787 | C/C++ |
this.menus.tagsWindow=null);null!=this.menus.findWindow&&(this.menus.findWindow.window.setVisible(!1),this.menus.findWindow.window.destroy(),this.menus.findWindow=null);null!=this.menus.findReplaceWindow&&(this.menus.findReplaceWindow.window.setVisible(!1),this.menus.findReplaceWindow.window.destroy(),this.menus.findRe... | cwe | CWE-20 | JavaScript |
def get_folders_order
Log.add_info(request, params.inspect)
@folder_id = params[:id]
if @folder_id == '0'
@folders = MailFolder.get_account_roots_for(@login_user)
else
mail_folder = MailFolder.find(@folder_id)
if mail_folder.user_id == @login_user.id
@folders = MailFolder.get... | cwe | CWE-89 | Ruby |
package validator
import (
"errors"
"fmt"
"reflect"
"strings"
"github.com/answerdev/answer/internal/base/reason"
"github.com/answerdev/answer/internal/base/translator"
"github.com/go-playground/locales"
german "github.com/go-playground/locales/de"
english "github.com/go-playground/locales/en"
spanish "githu... | cwe | CWE-79 | Go |
/*
* Copyright (c) 2007 The University of Aberdeen, Scotland, UK
* Copyright (c) 2005-7 The University of Waikato, Hamilton, New Zealand.
* Copyright (c) 2005-7 Ian McDonald <ian.mcdonald@jandi.co.nz>
*
* An implementation of the DCCP protocol
*
* This code has been developed by the University of Waikato ... | cwe | CWE-200 | C/C++ |
GC_generic_malloc_ignore_off_page(size_t lb, int k)
{
void *result;
size_t lg;
size_t lb_rounded;
word n_blocks;
GC_bool init;
DCL_LOCK_STATE;
if (SMALL_OBJ(lb))
return GC_generic_malloc(lb, k);
GC_ASSERT(k < MAXOBJKINDS);
lg = ROUNDED_UP_GRANULES(lb);
lb_rounded = GRANU... | cwe | CWE-119 | Unknown |
/*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* th... | cwe | CWE-79 | Java |
PS_READ_FUNC(mm)
{
PS_MM_DATA;
ps_sd *sd;
int ret = FAILURE;
mm_lock(data->mm, MM_LOCK_RD);
sd = ps_sd_lookup(data, key, 0);
if (sd) {
*vallen = sd->datalen;
*val = emalloc(sd->datalen + 1);
memcpy(*val, sd->data, sd->datalen);
(*val)[sd->datalen] = '\0';
ret = SUCCESS;
}
mm_unlock(data->mm);
ret... | cwe | CWE-264 | Unknown |
error::Error GLES2DecoderImpl::HandleReadPixels(
uint32 immediate_data_size, const gles2::ReadPixels& c) {
GLint x = c.x;
GLint y = c.y;
GLsizei width = c.width;
GLsizei height = c.height;
GLenum format = c.format;
GLenum type = c.type;
if (width < 0 || height < 0) {
SetGLError(GL_INVALID_VALUE, "... | cwe | CWE-189 | C/C++ |
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
const auto* params = reinterpret_cast<TfLiteBidirectionalSequenceRNNParams*>(
node->builtin_data);
// Check we have all the inputs and outputs we need.
TF_LITE_ENSURE_EQ(context, node->inputs->size, 12);
TF_LITE_ENSURE_EQ(context, node->out... | cwe | CWE-125 | C/C++ |
static int sc_pkcs15emu_gemsafeGPK_init(sc_pkcs15_card_t *p15card)
{
const cdata certs[] = {
{"User certificate",0, "","1", 0},
{NULL, 0, NULL, NULL, 0}
};
const pindata pins[] = {
{ "01", "pin", "3F000200", 0x00,
SC_PKCS15_PIN_TYPE_ASCII_NUMERIC,
8, 4, 8, SC_PKCS15_PIN_FLAG_NEEDS_PADDING |
SC_PKC... | cwe | CWE-787 | C/C++ |
int __sys_recvmmsg(int fd, struct mmsghdr __user *mmsg, unsigned int vlen,
unsigned int flags, struct timespec *timeout)
{
int fput_needed, err, datagrams;
struct socket *sock;
struct mmsghdr __user *entry;
struct compat_mmsghdr __user *compat_entry;
struct msghdr msg_sys;
struct timespec end_time;
if (tim... | cwe | CWE-19 | C/C++ |
static void launch(OpKernelContext* context,
const TensorShape& tensor_in_shape,
const Tensor& out_backprop,
const std::array<int64, 3>& window,
const std::array<int64, 3>& stride,
const std::array<int64, 3>& output... | cwe | CWE-787 | C/C++ |
/**
* FreeRDP: A Remote Desktop Protocol Implementation
* Remote Desktop Gateway (RDG)
*
* Copyright 2015 Denis Vincent <dvincent@devolutions.net>
*
* 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... | cwe | CWE-125 | C/C++ |
/* 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-131 | Python |
void Compute(OpKernelContext* context) override {
// Input tensor is of the following dimensions:
// [ batch, in_rows, in_cols, in_depth ]
const Tensor& input = context->input(0);
// Input filter is of the following dimensions:
// [ filter_rows, filter_cols, in_depth, out_depth]
const Tensor& f... | cwe | CWE-476 | Unknown |
static void setPathFromConvexPoints(SkPath* path, size_t numPoints, const FloatPoint* points)
{
path->incReserve(numPoints);
path->moveTo(WebCoreFloatToSkScalar(points[0].x()),
WebCoreFloatToSkScalar(points[0].y()));
for (size_t i = 1; i < numPoints; ++i) {
path->lineTo(WebCoreFloa... | cwe | CWE-665 | C/C++ |
static js_Ast *equality(js_State *J, int notin)
{
js_Ast *a = relational(J, notin);
loop:
if (jsP_accept(J, TK_EQ)) { a = EXP2(EQ, a, relational(J, notin)); goto loop; }
if (jsP_accept(J, TK_NE)) { a = EXP2(NE, a, relational(J, notin)); goto loop; }
if (jsP_accept(J, TK_STRICTEQ)) { a = EXP2(STRICTEQ, a, relational... | cwe | CWE-674 | Unknown |
/**
* <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 |
import imghdr
import json
import re
from io import BytesIO
from zipfile import ZipFile
import requests
from django.utils.translation import gettext as _
from cookbook.helper.image_processing import get_filetype
from cookbook.helper.ingredient_parser import IngredientParser
from cookbook.integration.integration import... | cwe | CWE-918 | Python |
static void fanout_release(struct sock *sk)
{
struct packet_sock *po = pkt_sk(sk);
struct packet_fanout *f;
f = po->fanout;
if (!f)
return;
mutex_lock(&fanout_mutex);
po->fanout = NULL;
if (atomic_dec_and_test(&f->sk_ref)) {
list_del(&f->list);
dev_remove_pack(&f->prot_hook);
fanout_release_data(f);
... | cwe | CWE-416 | C/C++ |
long vorbis_book_decodev_add(codebook *book,ogg_int32_t *a,
oggpack_buffer *b,int n,int point){
if(book->used_entries>0){
ogg_int32_t *v = book->dec_buf;//(ogg_int32_t *)alloca(sizeof(*v)*book->dim);
int i,j;
if (!v) return -1;
for(i=0;i<n;){
if(decode_map(book,b,v,point))return ... | cwe | CWE-200 | C/C++ |
void qemu_spice_create_host_primary(SimpleSpiceDisplay *ssd)
{
QXLDevSurfaceCreate surface;
memset(&surface, 0, sizeof(surface));
dprint(1, "%s/%d: %dx%d\n", __func__, ssd->qxl.id,
surface_width(ssd->ds), surface_height(ssd->ds));
surface.format = SPICE_SURFACE_FMT_32_xRGB;
... | cwe | CWE-200 | C/C++ |
rdpsnd_process_ping(STREAM in)
{
uint16 tick;
STREAM out;
in_uint16_le(in, tick);
DEBUG_SOUND(("RDPSND: RDPSND_PING(tick: 0x%04x)\n", (unsigned) tick));
out = rdpsnd_init_packet(RDPSND_PING | 0x2300, 4);
out_uint16_le(out, tick);
out_uint16_le(out, 0);
s_mark_end(out);
rdpsnd_send(out);
DEBUG_SOUND(("RDPS... | cwe | CWE-787 | Unknown |
function matchGrammar(text, tokenList, grammar, startNode, startPos, rematch) {
for (var token in grammar) {
if (!grammar.hasOwnProperty(token) || !grammar[token]) {
continue;
}
var patterns = grammar[token];
patterns = Array.isArray(patterns) ? patterns : [patterns];
for (var j = 0; j < patterns.length... | cwe | CWE-400 | JavaScript |
ews_client_autodiscover_response_cb (SoupSession *session, SoupMessage *msg, gpointer user_data)
{
GError *error;
AutodiscoverData *data = user_data;
gboolean op_res;
guint status;
gint idx;
gsize size;
xmlDoc *doc;
xmlNode *node;
status = msg->status_code;
if (status == SOUP_STATUS_CANCELLED)
... | cwe | CWE-310 | Unknown |
status_t MPEG4Source::fragmentedRead(
MediaBuffer **out, const ReadOptions *options) {
ALOGV("MPEG4Source::fragmentedRead");
CHECK(mStarted);
*out = NULL;
int64_t targetSampleTimeUs = -1;
int64_t seekTimeUs;
ReadOptions::SeekMode mode;
if (options && options->getSeekTo(&seekTimeUs, &mode)) {
int nu... | cwe | CWE-119 | C/C++ |
void jpc_qmfb_split_colres(jpc_fix_t *a, int numrows, int numcols,
int stride, int parity)
{
int bufsize = JPC_CEILDIVPOW2(numrows, 1);
jpc_fix_t splitbuf[QMFB_SPLITBUFSIZE * JPC_QMFB_COLGRPSIZE];
jpc_fix_t *buf = splitbuf;
jpc_fix_t *srcptr;
jpc_fix_t *dstptr;
register jpc_fix_t *srcptr2;
register jpc_fix_t ... | cwe | CWE-119 | C/C++ |
bntseq_t *bns_restore(const char *prefix)
{
char ann_filename[1024], amb_filename[1024], pac_filename[1024], alt_filename[1024];
FILE *fp;
bntseq_t *bns;
strcat(strcpy(ann_filename, prefix), ".ann");
strcat(strcpy(amb_filename, prefix), ".amb");
strcat(strcpy(pac_filename, prefix), ".pac");
bns = bns_restore_c... | cwe | CWE-787 | C/C++ |
TfLiteStatus Relu1Eval(TfLiteContext* context, TfLiteNode* node) {
const TfLiteTensor* input = GetInput(context, node, 0);
TfLiteTensor* output = GetOutput(context, node, 0);
const ReluOpData* data = reinterpret_cast<ReluOpData*>(node->user_data);
switch (input->type) {
case kTfLiteFloat32: {
optimize... | cwe | CWE-125 | 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-125 | Python |
tight_detect_smooth_image24(VncState *vs, int w, int h)
{
int off;
int x, y, d, dx;
unsigned int c;
unsigned int stats[256];
int pixels = 0;
int pix, left[3];
unsigned int errors;
unsigned char *buf = vs->tight.tight.buffer;
/*
* If client is big-endian, color samples begin fro... | cwe | CWE-401 | Unknown |
static int chmd_read_headers(struct mspack_system *sys, struct mspack_file *fh,
struct mschmd_header *chm, int entire)
{
unsigned int section, name_len, x, errors, num_chunks;
unsigned char buf[0x54], *chunk = NULL, *name, *p, *end;
struct mschmd_file *fi, *link = NULL;
off_t offset, length;
int num_e... | cwe | CWE-476 | C/C++ |
UWORD32 ihevcd_cabac_decode_bypass_bins_egk(cab_ctxt_t *ps_cabac,
bitstrm_t *ps_bitstrm,
WORD32 k)
{
UWORD32 u4_sym;
WORD32 numones;
WORD32 bin;
/* Sanity checks */
ASSERT((k >= 0));
numones = k;
bin = 1;
u4_sym = 0;
while(bin)
{
... | cwe | CWE-119 | C/C++ |
logger_get_mask_expanded (struct t_gui_buffer *buffer, const char *mask)
{
char *mask2, *mask_decoded, *mask_decoded2, *mask_decoded3, *mask_decoded4;
char *mask_decoded5;
const char *dir_separator;
int length;
time_t seconds;
struct tm *date_tmp;
mask2 = NULL;
mask_decoded = NUL... | cwe | CWE-119 | C/C++ |
/**
* @copyright 2017 Commenthol
* @license MIT
*/
'use strict'
const vm = require('vm')
const { createContext, allow } = require('./common')
/**
* reuse saferEval context
* @class
* @example
* const {SaferEval} = require('safer-eval')
* const safer = new SaferEval()
* let res1 = safer.runInContext('new Date('1970-0... | cwe | CWE-94 | JavaScript |
get_princs_2_svc(gprincs_arg *arg, struct svc_req *rqstp)
{
static gprincs_ret ret;
char *prime_arg;
gss_buffer_desc client_name,
service_name;
OM_uint32 minor_stat;
kadm5_server_handle_t handle;
cons... | cwe | CWE-772 | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.