code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
function setupGlobalExceptionHandler() {
if (!globalExceptionHandler) {
globalExceptionHandler = function test (msg, url, linenumber)
{
var errorId = randomString(20);
var userAgent = padutils.escapeHtml(navigator.userAgent);
if ($("#editorloadingbox").attr("display") != "none"){
//s... | cwe | CWE-79 | JavaScript |
ExtensionFunction::ResponseAction UsbFindDevicesFunction::Run() {
scoped_ptr<extensions::core_api::usb::FindDevices::Params> parameters =
FindDevices::Params::Create(*args_);
EXTENSION_FUNCTION_VALIDATE(parameters.get());
vendor_id_ = parameters->options.vendor_id;
product_id_ = parameters->options.pr... | cwe | CWE-399 | C/C++ |
static void TIFFGetProperties(TIFF *tiff,Image *image,ExceptionInfo *exception)
{
char
message[MagickPathExtent],
*text;
uint32
count,
length,
type;
unsigned long
*tietz;
if (TIFFGetField(tiff,TIFFTAG_ARTIST,&text) == 1)
(void) SetImageProperty(image,"tiff:artist",text,exception)... | cwe | CWE-476 | C/C++ |
int __init early_fixup_exception(unsigned long *ip)
{
const struct exception_table_entry *fixup;
unsigned long new_ip;
fixup = search_exception_tables(*ip);
if (fixup) {
new_ip = ex_fixup_addr(fixup);
if (fixup->fixup - fixup->insn >= 0x7ffffff0 - 4) {
/* uaccess handling not supported during early boot */... | cwe | CWE-264 | 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 |
void Unpack::Unpack5(bool Solid)
{
FileExtracted=true;
if (!Suspended)
{
UnpInitData(Solid);
if (!UnpReadBuf())
return;
// Check TablesRead5 to be sure that we read tables at least once
// regardless of current block header TablePresent flag.
// So we can safefly use these tables below... | cwe | CWE-787 | C/C++ |
const bootbox = require('bootbox');
require('../services/Requisitions');
/**
* @author Alejandro Galue <agalue@opennms.org>
* @copyright 2014 The OpenNMS Group, Inc.
*/
(function() {
'use strict';
const policyView = require('../../views/policy.html');
const moveView = require('../../views/move.html');
cons... | cwe | CWE-352 | Java |
// SPDX-License-Identifier: GPL-2.0-only
/*
* The NFC Controller Interface is the communication protocol between an
* NFC Controller (NFCC) and a Device Host (DH).
*
* Copyright (C) 2011 Texas Instruments, Inc.
*
* Written by Ilan Elias <ilane@ti.com>
*
* Acknowledgements:
* This file is based on hci_eve... | cwe | CWE-416 | C/C++ |
/*
* Server-side XDR for NFSv4
*
* Copyright (c) 2002 The Regents of the University of Michigan.
* All rights reserved.
*
* Kendrick Smith <kmsmith@umich.edu>
* Andy Adamson <andros@umich.edu>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provide... | cwe | CWE-787 | C/C++ |
status WAVEFile::parseFormat(const Tag &id, uint32_t size)
{
Track *track = getTrack();
uint16_t formatTag;
readU16(&formatTag);
uint16_t channelCount;
readU16(&channelCount);
uint32_t sampleRate;
readU32(&sampleRate);
uint32_t averageBytesPerSecond;
readU32(&averageBytesPerSecond);
uint16_t blockAlign;
rea... | cwe | CWE-20 | C/C++ |
h2v1_merged_upsample_565_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION in_row_group_ctr,
JSAMPARRAY output_buf)
{
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
register int y, cred, cgreen, cblue;
int cb, cr;
... | cwe | CWE-476 | Unknown |
TfLiteStatus PopulateQuantizedLstmParams8x8_16(
TfLiteContext* context, TfLiteNode* node,
lstm_eval::IntegerLstmParameter* integer_lstm_param) {
// Calculate quantized clip for projection and cell.
const auto* params =
static_cast<TfLiteUnidirectionalSequenceLSTMParams*>(node->builtin_data);
const f... | cwe | CWE-908 | Unknown |
/*
* Silicon Graphics Movie demuxer
* Copyright (c) 2012 Peter Ross
*
* This file is part of FFmpeg.
*
* FFmpeg 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 the Licen... | cwe | CWE-834 | C/C++ |
static MYSQL *db_connect(char *host, char *database,
char *user, char *passwd)
{
MYSQL *mysql;
if (verbose)
fprintf(stdout, "Connecting to %s\n", host ? host : "localhost");
if (!(mysql= mysql_init(NULL)))
return 0;
if (opt_compress)
mysql_options(mysql,MYSQL_OPT_COMPRESS,Nu... | cwe | CWE-295 | Unknown |
function q(){G.innerHTML="";for(var M=0;M<C.length;M++){var H=document.createElement("option");mxUtils.write(H,C[M].displayName);H.value=M;G.appendChild(H);H=document.createElement("option");H.innerHTML=" ";
mxUtils.write(H,"<"+C[M].email+">");H.setAttribute("disabled","disabled");G.appendChild(H)}H=do... | cwe | CWE-94 | JavaScript |
struct dump_dir *dd_create_skeleton(const char *dir, uid_t uid, mode_t mode, int flags)
{
/* a little trick to copy read bits from file mode to exec bit of dir mode*/
mode_t dir_mode = mode | ((mode & 0444) >> 2);
struct dump_dir *dd = dd_init();
dd->mode = mode;
/* Unlike dd_opendir, can't use re... | cwe | CWE-20 | Unknown |
var send = function(files, paths){
var size = 0,
fcnt = 1,
sfiles = [],
c = 0,
total = cnt,
maxFileSize,
totalSize = 0,
chunked = [],
chunkID = +new Date(),
BYTES_PER_CHUNK = Math.min((fm.uplMaxSize? fm.uplMaxSize : 2097152) - 8190, fm.options.uploadMaxChunkSize), // uplMaxSize m... | cwe | CWE-89 | JavaScript |
dump_threads(void)
{
FILE *fp;
char time_buf[26];
element e;
vrrp_t *vrrp;
char *file_name;
file_name = make_file_name("/tmp/thread_dump.dat",
"vrrp",
#if HAVE_DECL_CLONE_NEWNET
global_data->network_namespace,
#else
NULL,
#endif
global_data->instance_name);
fp = fopen(file_name, "a");
FREE(... | cwe | CWE-61 | Unknown |
inline typename V::VectorType FBUnserializer<V>::unserializeList() {
p_ += CODE_SIZE;
// the list size is written so we can reserve it in the vector
// in future. Skip past it for now.
unserializeInt64();
typename V::VectorType ret = V::createVector();
size_t code = nextCode();
while (code != FB_SERIAL... | cwe | CWE-674 | C/C++ |
/*
* 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 |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | cwe | CWE-94 | Python |
static inline LineContribType * _gdContributionsAlloc(unsigned int line_length, unsigned int windows_size)
{
unsigned int u = 0;
LineContribType *res;
int overflow_error = 0;
res = (LineContribType *) gdMalloc(sizeof(LineContribType));
if (!res) {
return NULL;
}
res->WindowSize = windows_size;
res->LineLengt... | cwe | CWE-119 | C/C++ |
/*
* Copyright (c) 2014-2019 Hong Xu <hong AT topbug DOT net>
* Copyright (c) 2018 Sven Strickroth <email AT cs-ware DOT de>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistri... | cwe | CWE-787 | C/C++ |
int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p,
unsigned char *limit, int *al)
{
unsigned short type;
unsigned short size;
unsigned short len;
unsigned char *data = *p;
int renegotiate_seen = 0;
int sigalg_seen = 0;
s->servername_done = 0;
s-... | cwe | CWE-399 | Unknown |
mxEvent.consume(ua))},Za=U.actions.get("zoomIn"),cb=U.actions.get("zoomOut"),Ja=U.actions.get("resetView");Q=U.actions.get("fullscreen");var Ua=U.actions.get("undo"),$a=U.actions.get("redo"),z=X("",Ua.funct,null,mxResources.get("undo")+" ("+Ua.shortcut+")",Ua,Editor.undoImage),L=X("",$a.funct,null,mxResources.get("redo... | cwe | CWE-94 | JavaScript |
static int jas_iccattrtab_resize(jas_iccattrtab_t *tab, int maxents)
{
jas_iccattr_t *newattrs;
assert(maxents >= tab->numattrs);
newattrs = tab->attrs ? jas_realloc(tab->attrs, maxents *
sizeof(jas_iccattr_t)) : jas_malloc(maxents * sizeof(jas_iccattr_t));
if (!newattrs)
return -1;
tab->attrs = newattrs;
ta... | cwe | CWE-189 | Unknown |
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Linux system calls.
// This file is compiled as ordinary Go code,
// but it is also input to mksyscall,
// which parses the //sys lines and generates system ... | cwe | CWE-287 | Go |
static int fuse_setattr(struct dentry *entry, struct iattr *attr)
{
struct inode *inode = d_inode(entry);
struct fuse_conn *fc = get_fuse_conn(inode);
struct file *file = (attr->ia_valid & ATTR_FILE) ? attr->ia_file : NULL;
int ret;
if (!fuse_allow_current_process(get_fuse_conn(inode)))
return -EACCES;
if (at... | cwe | CWE-459 | Unknown |
~SessionRestoreImpl() {
STLDeleteElements(&windows_);
CHECK(profiles_getting_restored);
CHECK(profiles_getting_restored->find(profile_) !=
profiles_getting_restored->end());
profiles_getting_restored->erase(profile_);
if (profiles_getting_restored->empty()) {
delete profiles_getti... | cwe | CWE-119 | C/C++ |
static inline int copy_regset_from_user(struct task_struct *target,
const struct user_regset_view *view,
unsigned int setno,
unsigned int offset, unsigned int size,
const void __user *data)
{
const struct user_regset *regset = &view->regsets[setno];
if (!access_ok(VERIFY_READ, data, size))
retu... | cwe | CWE-476 | Unknown |
static int ___sys_recvmsg(struct socket *sock, struct msghdr __user *msg,
struct msghdr *msg_sys, unsigned int flags, int nosec)
{
struct compat_msghdr __user *msg_compat =
(struct compat_msghdr __user *)msg;
struct iovec iovstack[UIO_FASTIOV];
struct iovec *iov = iovstack;
unsigned long cmsg_ptr;
int err... | cwe | CWE-269 | Unknown |
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */
/*
* lsquic_parse_Q050.c -- Parsing functions specific to GQUIC Q050
*/
#include <assert.h>
#include <errno.h>
#include <inttypes.h>
#include <string.h>
#include <sys/queue.h>
#ifndef WIN32
#include <sys/types.h>
#else
#include <vc_compat.h>
#... | cwe | CWE-476 | C/C++ |
static void cil_reset_classperms_set(struct cil_classperms_set *cp_set)
{
cil_reset_classpermission(cp_set->set);
} | cwe | CWE-416 | Unknown |
pimv2_addr_print(netdissect_options *ndo,
const u_char *bp, enum pimv2_addrtype at, int silent)
{
int af;
int len, hdrlen;
ND_TCHECK(bp[0]);
if (pimv2_addr_len == 0) {
ND_TCHECK(bp[1]);
switch (bp[0]) {
case 1:
af = AF_INET;
len = sizeof(struct in_addr);
break;
case 2:
af = AF... | cwe | CWE-125 | C/C++ |
function d(I,F,H,R){function W(){F.removeChild(U);F.removeChild(X);V.style.display="block";J.style.display="block"}z={div:F,comment:I,saveCallback:H,deleteOnCancel:R};var J=F.querySelector(".geCommentTxt"),V=F.querySelector(".geCommentActionsList"),U=document.createElement("textarea");U.className=
"geCommentEditTxtArea... | cwe | CWE-94 | JavaScript |
#!/usr/bin/env python
# coding: utf-8
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
# -----------------------------------------------------------------------------
# Minimal Python version sanity check (from IPython/Jupyterhub)
# -----------------------------------... | cwe | CWE-639 | Python |
/*
* 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-22 | Java |
/*
* 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 |
CryptRsaDecrypt(
TPM2B *dOut, // OUT: the decrypted data
TPM2B *cIn, // IN: the data to decrypt
OBJECT *key, // IN: the key to use for decryption
TPMT_RSA_DECRYPT *scheme, // IN: the padding scheme
const TPM2B *label ... | cwe | CWE-787 | Unknown |
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
auto* params = reinterpret_cast<TfLiteRNNParams*>(node->builtin_data);
auto* op_data = reinterpret_cast<OpData*>(node->user_data);
const TfLiteTensor* input = GetInput(context, node, kInputTensor);
const TfLiteTensor* input_weights = GetInput(context... | cwe | CWE-787 | C/C++ |
def self.publication_months
result = select("published_at").where("published_at is not NULL").where(type: "Article")
result.map { |it| [it.publication_month] }.uniq
end
# Finds one article which was posted on a certain date and matches the
# supplied dashed-title params is a Hash
def self.requested_art... | cwe | CWE-863 | Ruby |
load_vector_vector(BitStream& bit_stream,
int nitems1, std::vector<T>& vec1, int T::*nitems2,
int bits_wanted, std::vector<int> T::*vec2)
{
// nitems1 times, read nitems2 (from the ith element of vec1) items
// into the vec2 vector field of the ith item of vec1.
for (int i1 = 0; i1 < nitems1; ++i1... | cwe | CWE-787 | Unknown |
PHP_FUNCTION(bcpow)
{
char *left, *right;
int left_len, right_len;
long scale_param = 0;
bc_num first, second, result;
int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS();
if (zend_parse_parameters(argc TSRMLS_CC, "ss|l", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
return;
}
if (arg... | cwe | CWE-20 | Unknown |
/*
Copyright The Helm Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
di... | cwe | CWE-200 | Go |
this.defaultFilename,!0);q.getHash=function(){return k};this.fileLoaded(q);"csv"==c.format&&this.importCsv(v,mxUtils.bind(this,function(M){this.editor.undoManager.clear();this.editor.setModified(!1);this.editor.setStatus("")}));if(null!=c.update){var x=null!=c.interval?parseInt(c.interval):6E4,A=null,z=mxUtils.bind(thi... | cwe | CWE-20 | JavaScript |
int ssl3_accept(SSL *s)
{
BUF_MEM *buf;
unsigned long alg_k,Time=(unsigned long)time(NULL);
void (*cb)(const SSL *ssl,int type,int val)=NULL;
int ret= -1;
int new_state,state,skip=0;
RAND_add(&Time,sizeof(Time),0);
ERR_clear_error();
clear_sys_error();
if (s->info_callback != NULL)
cb=s->info_callback;
e... | cwe | CWE-310 | Unknown |
static int jas_icctxtdesc_input(jas_iccattrval_t *attrval, jas_stream_t *in,
int cnt)
{
int n;
int c;
jas_icctxtdesc_t *txtdesc = &attrval->data.txtdesc;
txtdesc->ascdata = 0;
txtdesc->ucdata = 0;
if (jas_iccgetuint32(in, &txtdesc->asclen))
goto error;
if (!(txtdesc->ascdata = jas_malloc(txtdesc->asclen)))
... | cwe | CWE-189 | Unknown |
/** @file common.c
*
* @brief common tools functions
*
* @example common.c
* Common functions for tools
*
* Copyright (c) 2016 Bartek Fabiszewski
* http://www.fabiszewski.net
*
* Licensed under LGPL, either version 3, or any later.
* See <http://www.gnu.org/licenses/>
*/
#include <stdlib.h>
#include <ctype... | cwe | CWE-476 | C/C++ |
static pngquant_error rwpng_read_image24_libpng(FILE *infile, png24_image *mainprog_ptr, int verbose)
{
png_structp png_ptr = NULL;
png_infop info_ptr = NULL;
png_size_t rowbytes;
int color_type, bit_depth;
png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, mainprog_ptr,
r... | cwe | CWE-190 | C/C++ |
function generate(target, hierarchies, forceOverride) {
var current = target;
hierarchies.forEach(function (info) {
var descriptor = normalizeDescriptor(info);
var value = descriptor.value, type = descriptor.type, create = descriptor.create, override = descriptor.override, created = descript... | cwe | CWE-1321 | JavaScript |
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
/* GdkPixbuf library - animated gif support
*
* Copyright (C) 1999 The Free Software Foundation
*
* Authors: Jonathan Blandford <jrb@redhat.com>
* Havoc Pennington <hp@redhat.com>
*
* This library is free software; you can red... | cwe | CWE-191 | C/C++ |
bool MDSDaemon::ms_verify_authorizer(Connection *con, int peer_type,
int protocol, bufferlist& authorizer_data, bufferlist& authorizer_reply,
bool& is_valid, CryptoKey& session_key)
{
Mutex::Locker l(mds_lock);
if (stopping) {
return false;
}
if (beacon.get_want_state() == CEPH_MDS_STATE... | cwe | CWE-287 | Unknown |
/* $Id$ */
/*
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; eit... | cwe | CWE-120 | C/C++ |
package api
import (
"fmt"
)
// Role is the type of a role.
type Role string
const (
// Host is the HOST role.
Host Role = "HOST"
// Admin is the ADMIN role.
Admin Role = "ADMIN"
// NormalUser is the USER role.
NormalUser Role = "USER"
)
func (e Role) String() string {
switch e {
case Host:
return "HOST"... | cwe | CWE-284 | Go |
const bootbox = require('bootbox');
require('../services/Requisitions');
/**
* @author Alejandro Galue <agalue@opennms.org>
* @copyright 2014 The OpenNMS Group, Inc.
*/
(function() {
'use strict';
const policyView = require('../../views/policy.html');
const moveView = require('../../views/move.html');
cons... | cwe | CWE-79 | Java |
/*
* Copyright (C) 2020 HAW Hamburg
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup sys_uri_parser
* @{
*
* @file
* @brief A minimal, non-destructive URI parse... | cwe | CWE-120 | C/C++ |
package proxyutil
import (
"context"
"errors"
"log"
"net/http"
"net/http/httputil"
"strings"
"time"
glog "github.com/grafana/grafana/pkg/infra/log"
)
// StatusClientClosedRequest A non-standard status code introduced by nginx
// for the case when a client closes the connection while nginx is processing
// th... | cwe | CWE-522 | Go |
intuit_diff_type (bool need_header, mode_t *p_file_type)
{
file_offset this_line = 0;
file_offset first_command_line = -1;
char first_ed_command_letter = 0;
lin fcl_line = 0; /* Pacify 'gcc -W'. */
bool this_is_a_command = false;
bool stars_this_line = false;
bool extended_headers = false;
... | cwe | CWE-476 | 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 |
#include <gio/gio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <pwd.h>
#include <grp.h>
#include "libabrt.h"
#include "abrt-polkit.h"
#include "abrt_glib.h"
#include <libreport/dump_dir.h>
#include "problem_api.h"
static GMainLoop *loop;
static guint g_timeout_source;
/* default, settable with -t: */
static ... | cwe | CWE-22 | C/C++ |
'use strict';
var required = require('requires-port')
, qs = require('querystringify')
, CRHTLF = /[\n\r\t]/g
, slashes = /^[A-Za-z][A-Za-z0-9+-.]*:\/\//
, protocolre = /^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i
, windowsDriveLetter = /^[a-zA-Z]:/
, whitespace = /^[ \f\n\r\t\v\u00a0\u1680\u2000-\u2... | cwe | CWE-639 | JavaScript |
async def get_resolved_ref(self):
if hasattr(self, 'resolved_ref'):
return self.resolved_ref
try:
# Check if the reference is a valid SHA hash
self.sha1_validate(self.unresolved_ref)
except ValueError:
# The ref is a head/tag and we resolve it usi... | cwe | CWE-78 | Python |
dns_transmit_get (struct dns_transmit *d, const iopause_fd *x,
const struct taia *when)
{
char udpbuf[4097];
int r = 0, fd = 0;
unsigned char ch = 0;
fd = d->s1 - 1;
errno = error_io;
if (!x->revents)
{
if (taia_less (when, &d->deadline))
... | cwe | CWE-362 | Unknown |
psf_binheader_readf (SF_PRIVATE *psf, char const *format, ...)
{ va_list argptr ;
sf_count_t *countptr, countdata ;
unsigned char *ucptr, sixteen_bytes [16] ;
unsigned int *intptr, intdata ;
unsigned short *shortptr ;
char *charptr ;
float *floatptr ;
double *doubleptr ;
char c ;
int byte_count ... | cwe | CWE-119 | C/C++ |
void isis_notif_area_mismatch(const struct isis_circuit *circuit,
const char *raw_pdu, size_t raw_pdu_len)
{
const char *xpath = "/frr-isisd:area-mismatch";
struct list *arguments = yang_data_list_new();
char xpath_arg[XPATH_MAXLEN];
struct yang_data *data;
struct isis_area *area = circuit->area;
notif_... | cwe | CWE-787 | Unknown |
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/ory/fosite (interfaces: AuthorizeResponder)
// Package internal is a generated GoMock package.
package internal
import (
http "net/http"
url "net/url"
reflect "reflect"
gomock "github.com/golang/mock/gomock"
)
// MockAuthorizeResponder is a mock o... | cwe | CWE-345 | Go |
xfs_attr3_leaf_clearflag(
struct xfs_da_args *args)
{
struct xfs_attr_leafblock *leaf;
struct xfs_attr_leaf_entry *entry;
struct xfs_attr_leaf_name_remote *name_rmt;
struct xfs_buf *bp;
int error;
#ifdef DEBUG
struct xfs_attr3_icleaf_hdr ichdr;
xfs_attr_leaf_name_local_t *name_loc;
int namelen;
char *name;... | cwe | CWE-19 | C/C++ |
/* -*- C++ -*-
* File: libraw_cxx.cpp
* Copyright 2008-2017 LibRaw LLC (info@libraw.org)
* Created: Sat Mar 8 , 2008
*
* LibRaw C++ interface (implementation)
LibRaw is free software; you can redistribute it and/or modify
it under the terms of the one of two licenses as you choose:
1. GNU LESSER GENERAL PUBLIC ... | cwe | CWE-787 | C/C++ |
PredictorDecodeTile(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
{
TIFFPredictorState *sp = PredictorState(tif);
assert(sp != NULL);
assert(sp->decodetile != NULL);
if ((*sp->decodetile)(tif, op0, occ0, s)) {
tmsize_t rowsize = sp->rowsize;
assert(rowsize > 0);
assert((occ0%rowsize)==0);
assert(sp->dec... | cwe | CWE-119 | 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-476 | Python |
void MediaStreamDispatcherHost::DoGenerateStream(
int32_t page_request_id,
const StreamControls& controls,
bool user_gesture,
GenerateStreamCallback callback,
MediaDeviceSaltAndOrigin salt_and_origin) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (!MediaStreamManager::IsOriginAllowed(render_proce... | cwe | CWE-189 | C/C++ |
do_ed_script (char const *inname, char const *outname,
bool *outname_needs_removal, FILE *ofp)
{
static char const editor_program[] = EDITOR_PROGRAM;
file_offset beginning_of_this_line;
size_t chars_read;
FILE *tmpfp = 0;
char const *tmpname;
int tmpfd;
pid_t pid;
if (! dry_run ... | cwe | CWE-78 | Unknown |
static ssize_t node_read_meminfo(struct device *dev,
struct device_attribute *attr, char *buf)
{
int n;
int nid = dev->id;
struct pglist_data *pgdat = NODE_DATA(nid);
struct sysinfo i;
unsigned long sreclaimable, sunreclaimable;
si_meminfo_node(&i, nid);
sreclaimable = node_page_state_pages(pgdat, NR_SLAB_RE... | cwe | CWE-787 | Unknown |
hugetlbfs_fill_super(struct super_block *sb, void *data, int silent)
{
struct inode * inode;
struct dentry * root;
int ret;
struct hugetlbfs_config config;
struct hugetlbfs_sb_info *sbinfo;
save_mount_options(sb, data);
config.nr_blocks = -1; /* No limit on size by default */
config.nr_inodes = -1; /* No limi... | cwe | CWE-399 | C/C++ |
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/ory/fosite/handler/openid (interfaces: OpenIDConnectTokenStrategy)
// Package internal is a generated GoMock package.
package internal
import (
context "context"
reflect "reflect"
gomock "github.com/golang/mock/gomock"
fosite "github.com/ory/fosit... | cwe | CWE-345 | Go |
EbmlElement * EbmlElement::FindNextElement(IOCallback & DataStream, const EbmlSemanticContext & Context, int & UpperLevel,
uint64 MaxDataSize, bool AllowDummyElt, unsigned int MaxLowerLevel)
{
int PossibleID_Length = 0;
binary PossibleIdNSize[16];
int PossibleSizeLength;... | cwe | CWE-125 | C/C++ |
void Magick::Image::read(MagickCore::Image *image,
MagickCore::ExceptionInfo *exceptionInfo)
{
// Ensure that multiple image frames were not read.
if (image != (MagickCore::Image *) NULL &&
image->next != (MagickCore::Image *) NULL)
{
MagickCore::Image
*next;
// Destroy any extra im... | cwe | CWE-416 | 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-20 | Python |
pax_decode_header (struct tar_sparse_file *file)
{
if (file->stat_info->sparse_major > 0)
{
uintmax_t u;
char nbuf[UINTMAX_STRSIZE_BOUND];
union block *blk;
char *p;
size_t i;
off_t start;
#define COPY_BUF(b,buf,src) do \
{ ... | cwe | CWE-476 | Unknown |
int tipc_nl_publ_dump(struct sk_buff *skb, struct netlink_callback *cb)
{
int err;
u32 tsk_portid = cb->args[0];
u32 last_publ = cb->args[1];
u32 done = cb->args[2];
struct net *net = sock_net(skb->sk);
struct tipc_sock *tsk;
if (!tsk_portid) {
struct nlattr **attrs;
struct nlattr *sock[TIPC_NLA_SOCK_MAX + ... | cwe | CWE-703 | C/C++ |
static void ip6gre_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
u8 type, u8 code, int offset, __be32 info)
{
const struct ipv6hdr *ipv6h = (const struct ipv6hdr *)skb->data;
__be16 *p = (__be16 *)(skb->data + offset);
int grehlen = offset + 4;
struct ip6_tnl *t;
__be16 flags;
flags = p[0];
if (flags&(... | cwe | CWE-125 | C/C++ |
void PacketReader::getLabelFromContent(const vector<uint8_t>& content, uint16_t& frompos, string& ret, int recurs)
{
if(recurs > 100) // the forward reference-check below should make this test 100% obsolete
throw MOADNSException("Loop");
int pos = frompos;
// it is tempting to call reserve on ret, but it tu... | cwe | CWE-399 | C/C++ |
N.message?N.message:mxResources.get("disconnected")));mxEvent.consume(E)}));G.setAttribute("title",F);B.style.paddingRight="4px";B.appendChild(G)}}}};var q=App.prototype.updateButtonContainer;App.prototype.updateButtonContainer=function(){q.apply(this,arguments);if(null!=this.shareButton){var B=this.shareButton;B.style... | cwe | CWE-20 | JavaScript |
package data_loader
import (
"crypto/tls"
"encoding/json"
"github.com/TykTechnologies/tyk-identity-broker/tap"
"github.com/sirupsen/logrus"
"gopkg.in/mgo.v2"
"net"
"time"
)
var mongoPrefix = "mongo"
var ProfilesCollectionName = "profilesCollection"
// MongoLoaderConf is the configuration struct for a MongoLoa... | cwe | CWE-287 | Go |
async ls (specs) {
const cachePath = path.join(this.npm.cache, '_cacache')
const cacheKeys = Object.keys(await cacache.ls(cachePath))
if (specs.length > 0) {
// get results for each package spec specified
const results = new Set()
for (const spec of specs) {
const keySet = await se... | cwe | CWE-200 | JavaScript |
int ip6_mroute_setsockopt(struct sock *sk, int optname, char __user *optval, unsigned int optlen)
{
int ret, parent = 0;
struct mif6ctl vif;
struct mf6cctl mfc;
mifi_t mifi;
struct net *net = sock_net(sk);
struct mr6_table *mrt;
mrt = ip6mr_get_table(net, raw6_sk(sk)->ip6mr_table ? : RT6_TABLE_DFLT);
if (!mrt)... | cwe | CWE-20 | Unknown |
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
auto* params = reinterpret_cast<TfLiteDivParams*>(node->builtin_data);
OpData* data = reinterpret_cast<OpData*>(node->user_data);
const TfLiteTensor* input1;
TF_LITE_ENSURE_OK(context,
GetInputSafe(context, node, kInputTensor1, &... | cwe | CWE-369 | C/C++ |
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 RList* entries(RBinFile* bf) {
RList* ret = NULL;
RBinAddr* addr = NULL;
psxexe_header psxheader;
if (!(ret = r_list_new ())) {
return NULL;
}
if (!(addr = R_NEW0 (RBinAddr))) {
r_list_free (ret);
return NULL;
}
if (r_buf_fread_at (bf->buf, 0, (ut8*)&psxheader, "8c17i", 1) < sizeof (psxexe_heade... | cwe | CWE-400 | C/C++ |
var tasksTable = $('#tasks-table').DataTable({
'order': [[2, 'desc']],
'columnDefs': [
{ 'orderable': false, 'targets': 0 },
{ 'searchable': false, "targets": 0 },
{ 'visible': false, 'targets': 3 }
],
'rowGroup': {
dataSrc: 3
}
});
$('#tasks-table tbody').removeClass("d-none");
tasksTable.columns.adjust(... | cwe | CWE-79 | JavaScript |
static int input_default_setkeycode(struct input_dev *dev,
const struct input_keymap_entry *ke,
unsigned int *old_keycode)
{
unsigned int index;
int error;
int i;
if (!dev->keycodesize)
return -EINVAL;
if (ke->flags & INPUT_KEYMAP_BY_INDEX) {
index = ke->index;
} else {
error = input_scanc... | cwe | CWE-703 | Unknown |
static int xmlInitializeDict(void) {
if (xmlDictInitialized)
return(1);
if ((xmlDictMutex = xmlNewRMutex()) == NULL)
return(0);
xmlDictInitialized = 1;
return(1);
} | cwe | CWE-399 | Unknown |
XdmcpGenerateKey (XdmAuthKeyPtr key)
{
#ifndef HAVE_ARC4RANDOM_BUF
long lowbits, highbits;
srandom ((int)getpid() ^ time((Time_t *)0));
highbits = random ();
highbits = random ();
getbits (lowbits, key->data);
getbits (highbits, key->data + 4);
#else
arc4random_buf(key->data, 8);... | cwe | CWE-331 | C/C++ |
#!/usr/bin/env python
#
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
from typing import Optional, Tuple
from onefuzztypes.events import EventInstanceConfigUpdated
from onefuzztypes.models import InstanceConfig as BASE_CONFIG
from pydantic import Field
from .azure.creds import get_instance... | cwe | CWE-285 | Python |
def build_query(path, details)
query = @pattern.dup
query.gsub!(/\:prefix(\/)?/, path.prefix.empty? ? "" : "#{path.prefix}\\1") # prefix can be empty...
query.gsub!(/\:action/, path.partial? ? "_#{path.name}" : path.name)
details.each do |ext, variants|
query.gsub!(/\:#{ext}/, "{#{varia... | cwe | CWE-20 | Ruby |
static int uvc_parse_format(struct uvc_device *dev,
struct uvc_streaming *streaming, struct uvc_format *format,
__u32 **intervals, unsigned char *buffer, int buflen)
{
struct usb_interface *intf = streaming->intf;
struct usb_host_interface *alts = intf->cur_altsetting;
struct uvc_format_desc *fmtdesc;
struct uvc_... | cwe | CWE-120 | Unknown |
function processOptions(isPreview) {
isPreview = isPreview ? isPreview : false;
// Process preview first so it always loads before the browser hits its
// maximum number of connections to a server as can happen with cubic
// panoramas
if (isPreview && 'preview' in config) {
var p = config.p... | cwe | CWE-79 | JavaScript |
Http::FilterTrailersStatus Context::onRequestTrailers() {
if (!wasm_->onRequestTrailers_) {
return Http::FilterTrailersStatus::Continue;
}
if (wasm_->onRequestTrailers_(this, id_).u64_ == 0) {
return Http::FilterTrailersStatus::Continue;
}
return Http::FilterTrailersStatus::StopIteration;
} | cwe | CWE-476 | C/C++ |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-119 | C/C++ |
function fillFolderFiles(driveId, folderId, siteId, folderName, searchTxt)
{
if (requestInProgress) return;
_$('.odCatsList').style.display = 'block';
_$('.odFilesSec').style.display = 'block';
// _$('#signOutLnk').style.display = '';
if (prevDiv != null)
{
prevDiv.innerHTML = '';
... | cwe | CWE-94 | JavaScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.