code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
static bool r_bin_mdmp_init_directory_entry(struct r_bin_mdmp_obj *obj, struct minidump_directory *entry) {
r_strf_buffer (128);
struct minidump_handle_operation_list handle_operation_list;
struct minidump_memory_list memory_list;
struct minidump_memory64_list memory64_list;
struct minidump_memory_info_list memory... | cwe | CWE-703 | Unknown |
lyxml_parse_mem(struct ly_ctx *ctx, const char *data, int options)
{
FUN_IN;
const char *c = data;
unsigned int len;
struct lyxml_elem *root, *first = NULL, *next;
if (!ctx) {
LOGARG;
return NULL;
}
if (!data) {
/* nothing to parse */
return NULL;
}
re... | cwe | CWE-674 | C/C++ |
void mobi_buffer_move(MOBIBuffer *buf, const int offset, const size_t len) {
size_t aoffset = (size_t) abs(offset);
unsigned char *source = buf->data + buf->offset;
if (offset >= 0) {
if (buf->offset + aoffset + len > buf->maxlen) {
debug_print("%s", "End of buffer\n");
buf->... | cwe | CWE-787 | Unknown |
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/ory/fosite (interfaces: Hasher)
// Package internal is a generated GoMock package.
package internal
import (
context "context"
reflect "reflect"
gomock "github.com/golang/mock/gomock"
)
// MockHasher is a mock of Hasher interface
type MockHasher st... | cwe | CWE-345 | Go |
inline int MatchingDim(const RuntimeShape& shape1, int index1,
const RuntimeShape& shape2, int index2) {
TFLITE_DCHECK_EQ(shape1.Dims(index1), shape2.Dims(index2));
return shape1.Dims(index1);
} | cwe | CWE-125 | C/C++ |
package io.onedev.server.migration;
import java.beans.IntrospectionException;
import java.beans.PropertyDescriptor;
import java.io.IOException;
import java.io.StringReader;
import java.io.StringWriter;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Comparator... | cwe | CWE-502 | Java |
/* 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-682 | Python |
do_replace(struct net *net, const void __user *user, unsigned int len)
{
int ret;
struct ip6t_replace tmp;
struct xt_table_info *newinfo;
void *loc_cpu_entry;
struct ip6t_entry *iter;
if (copy_from_user(&tmp, user, sizeof(tmp)) != 0)
return -EFAULT;
/* overflow check */
if (tmp.num_counters >= INT_MAX / siz... | cwe | CWE-200 | Unknown |
void readFile (int channelCount,
bool bulkRead,
bool relativeCoords,
bool randomChannels,
const std::string & filename)
{
if (relativeCoords)
assert(bulkRead == false);
cout << "reading " << flush;
DeepTiledInputFile file (filename.c_str(... | cwe | CWE-125 | Unknown |
function refreshTags(tags, selected)
{
tagCloud.innerHTML = '';
if (tags.length > 0)
{
var table = document.createElement('table');
table.setAttribute('cellpadding', '2');
table.style.boxSizing = 'border-box';
table.style.tableLayout = 'fixed';
table.style.width = '100%';
var tbod... | cwe | CWE-94 | JavaScript |
/* 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 applicable law or a... | cwe | CWE-20 | Python |
void vlan_setup(struct net_device *dev)
{
ether_setup(dev);
dev->priv_flags |= IFF_802_1Q_VLAN;
dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
dev->tx_queue_len = 0;
dev->netdev_ops = &vlan_netdev_ops;
dev->destructor = free_netdev;
dev->ethtool_ops = &vlan_ethtool_ops;
memset(dev->broadcast, 0, ETH_ALEN);
} | cwe | CWE-703 | Unknown |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | cwe | CWE-20 | Python |
char *url_decode_r(char *to, char *url, size_t size) {
char *s = url, // source
*d = to, // destination
*e = &to[size - 1]; // destination end
while(*s && d < e) {
if(unlikely(*s == '%')) {
if(likely(s[1] && s[2])) {
*d++ = from_hex(s[1... | cwe | CWE-94 | C/C++ |
static int dccp_print_option(netdissect_options *ndo, const u_char *option, u_int hlen)
{
uint8_t optlen, i;
ND_TCHECK(*option);
if (*option >= 32) {
ND_TCHECK(*(option+1));
optlen = *(option +1);
if (optlen < 2) {
if (*option >= 128)
ND_PRINT((ndo, "CCID option %u optlen too short", *option));
... | cwe | CWE-125 | C/C++ |
cert_sign(
struct exten *ep, /* extension field pointer */
struct value *vp /* value pointer */
)
{
X509 *req; /* X509 certificate request */
X509 *cert; /* X509 certificate */
X509_EXTENSION *ext; /* certificate extension */
ASN1_INTEGER *serial; /* serial number */
X509_NAME *subj; /* distinguished (common)... | cwe | CWE-20 | Unknown |
main(int argc, char *argv[])
{
OFCondition cond = EC_Normal;
OFCmdUnsignedInt overridePort = 0;
OFCmdUnsignedInt overrideMaxPDU = 0;
DcmQueryRetrieveOptions options;
#ifdef HAVE_GUSI_H
/* needed for Macintosh */
GUSISetup(GUSIwithSIOUXSockets);
GUSISetup(GUSIwithInternetSockets);
#endif
#ifdef HAVE_WINS... | cwe | CWE-264 | C/C++ |
import { FlowRouter } from 'meteor/ostrio:flow-router-extra'
import './projectAccessRights.html'
import { t, i18nReady } from '../../utils/i18n.js'
import {
validateEmail, getGlobalSetting, showToast,
} from '../../utils/frontend_helpers'
import Projects from '../../api/projects/projects.js'
Template.projectAccessRi... | cwe | CWE-1236 | JavaScript |
protected function GetRefs($refList, $type)
{
if (!$refList)
return;
if (empty($type))
return;
$args = array();
$args[] = '--' . $type;
$args[] = '--dereference';
$ret = $this->exe->Execute($refList->GetProject()->GetPath(), GIT_SHOW_REF, $args);
$lines = explode("\n", $ret);
$refs = array();... | cwe | CWE-78 | PHP |
def publish(request, category_id=None):
if category_id:
get_object_or_404(
Category.objects.visible(),
pk=category_id)
user = request.user
form = TopicForm(
user=user,
data=post_data(request),
initial={'category': category_id})
cform = CommentForm... | cwe | CWE-601 | Python |
var mxClient={VERSION:"19.0.1",IS_IE:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE"),IS_IE11:null!=navigator.userAgent&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_EM:"spellcheck"in document.createElement("textarea")&&8==docum... | cwe | CWE-79 | JavaScript |
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-787 | C/C++ |
(function(){var b=new mxObjectCodec(new ChangeGridColor,["ui"]);b.beforeDecode=function(e,f,c){c.ui=e.ui;return f};mxCodecRegistry.register(b)})();(function(){EditorUi.VERSION="18.0.5";EditorUi.compactUi="atlas"!=uiTheme;Editor.isDarkMode()&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);E... | cwe | CWE-918 | JavaScript |
processInitRequest(struct module_qstate* qstate, struct iter_qstate* iq,
struct iter_env* ie, int id)
{
uint8_t* delname, *dpname=NULL;
size_t delnamelen, dpnamelen=0;
struct dns_msg* msg = NULL;
log_query_info(VERB_DETAIL, "resolving", &qstate->qinfo);
/* check effort */
/* We enforce a maximum number of quer... | cwe | CWE-613 | Unknown |
'use strict';
/**
* Share application.
*/
angular.module('share',
// Dependencies
['ui.router', 'ui.bootstrap', 'restangular', 'ngSanitize', 'ngTouch', 'pascalprecht.translate', 'tmh.dynamicLocale']
)
/**
* Configuring modules.
*/
.config(function($locationProvider, $stateProvider, $httpProvider, Restan... | cwe | CWE-79 | Java |
/**
* Licensed to The Apereo Foundation under one or more contributor license
* agreements. See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
*
* The Apereo Foundation licenses this file to you under the Educational
* Community License, Version 2.0 (the ... | cwe | CWE-863 | Java |
@login_required(redirect_field_name='', login_url='/403')
@require_POST
@require_AJAX
@transaction.atomic
def batch_edit_translations(request):
"""Perform an action on a list of translations.
Available actions are defined in `ACTIONS_FN_MAP`. Arguments to this view
are defined in `models.BatchActionsForm`.... | cwe | CWE-79 | Python |
public function isLocal() {
$localhosts = array('::1', '127.0.0.1', '0.0.0.0');
return (
in_array(server::get('SERVER_ADDR'), $localhosts) ||
server::get('SERVER_NAME') == 'localhost' ||
str::endsWith(server::get('SERVER_NAME'), '.localhost') ||
str::endsWith(server::get('SERVER_NAME'), ... | cwe | CWE-346 | PHP |
int ParseCaffHeaderConfig (FILE *infile, char *infilename, char *fourcc, WavpackContext *wpc, WavpackConfig *config)
{
uint32_t chan_chunk = 0, channel_layout = 0, bcount;
unsigned char *channel_identities = NULL;
unsigned char *channel_reorder = NULL;
int64_t total_samples = 0, infilesize;
CAFFileH... | cwe | CWE-125 | Unknown |
static void huft_free(huft_t *p)
{
huft_t *q;
/* Go through linked list, freeing from the malloced (t[-1]) address. */
while (p) {
q = (--p)->v.t;
free(p);
p = q;
}
} | cwe | CWE-755 | Unknown |
inline static bool jas_safe_size_mul(size_t x, size_t y, size_t *result)
{
/* Check if overflow would occur */
if (x && y > SIZE_MAX / x) {
/* Overflow would occur. */
*result = 0;
return false;
}
*result = x * y;
return true;
} | cwe | CWE-119 | Unknown |
lasso_saml20_login_check_assertion_signature(LassoLogin *login,
LassoSaml2Assertion *assertion)
{
xmlNode *original_node = NULL;
LassoSaml2NameID *Issuer = NULL;
LassoServer *server = NULL;
LassoProfile *profile = NULL;
char *remote_provider_id = NULL;
LassoProvider *remote_provider;
int rc = 0;
lasso_bad_pa... | cwe | CWE-347 | Unknown |
SQLRETURN SQLSetDescFieldW( SQLHDESC descriptor_handle,
SQLSMALLINT rec_number,
SQLSMALLINT field_identifier,
SQLPOINTER value,
SQLINTEGER buffer_length )
{
/*
* not quite sure how the descriptor can be
* allocated to a statement, all the documentation talks
... | cwe | CWE-369 | Unknown |
static int __ptrace_may_access(struct task_struct *task, unsigned int mode)
{
const struct cred *cred = current_cred(), *tcred;
/* May we inspect the given task?
* This check is used both for attaching with ptrace
* and for allowing access to sensitive information in /proc.
*
* ptrace_attach denies several c... | cwe | CWE-264 | C/C++ |
HexOutStream::HexOutStream(OutStream& os, int buflen)
: out_stream(os), offset(0), bufSize(buflen ? buflen : DEFAULT_BUF_LEN)
{
if (bufSize % 2)
bufSize--;
ptr = start = new U8[bufSize];
end = start + bufSize;
} | cwe | CWE-787 | C/C++ |
package com.salesmanager.shop.admin.controller.products;
import com.salesmanager.core.business.services.catalog.category.CategoryService;
import com.salesmanager.core.business.services.catalog.product.ProductService;
import com.salesmanager.core.business.services.catalog.product.image.ProductImageService;
import com.s... | cwe | CWE-639 | Java |
/* ----------------------------------------------------------------------------
* ATMEL Microcontroller Software Support
* ----------------------------------------------------------------------------
* Copyright (c) 2015, Atmel Corporation
*
* All rights reserved.
*
* Redistribution and use in source and... | cwe | CWE-203 | C/C++ |
userauth_pubkey(struct ssh *ssh)
{
Authctxt *authctxt = ssh->authctxt;
struct passwd *pw = authctxt->pw;
struct sshbuf *b;
struct sshkey *key = NULL;
char *pkalg, *userstyle = NULL, *key_s = NULL, *ca_s = NULL;
u_char *pkblob, *sig, have_sig;
size_t blen, slen;
int r, pktype;
int authenticated = 0;
st... | cwe | CWE-200 | C/C++ |
static void *createArrayObject(const redisReadTask *task, size_t elements) {
redisReply *r, *parent;
r = createReplyObject(task->type);
if (r == NULL)
return NULL;
if (elements > 0) {
r->element = hi_calloc(elements,sizeof(redisReply*));
if (r->element == NULL) {
fr... | cwe | CWE-680 | Unknown |
decnet_print(netdissect_options *ndo,
register const u_char *ap, register u_int length,
register u_int caplen)
{
register const union routehdr *rhp;
register int mflags;
int dst, src, hops;
u_int nsplen, pktlen;
const u_char *nspp;
if (length < sizeof(struct shorthdr)) {
ND_PRINT((ndo... | cwe | CWE-125 | C/C++ |
raptor_rdfxml_parse_start(raptor_parser* rdf_parser)
{
raptor_uri *uri = rdf_parser->base_uri;
raptor_rdfxml_parser* rdf_xml_parser;
rdf_xml_parser = (raptor_rdfxml_parser*)rdf_parser->context;
/* base URI required for RDF/XML */
if(!uri)
return 1;
/* Optionally normalize language to lowercase
* h... | cwe | CWE-611 | C/C++ |
void copyBytes(InStream* is, int length) {
while (length > 0) {
int n = check(1, length);
is->readBytes(ptr, n);
ptr += n;
length -= n;
}
} | cwe | CWE-787 | C/C++ |
parse_file (FILE* input_file, char* directory,
char *body_filename, char *body_pref,
int flags)
{
uint32 d;
uint16 key;
Attr *attr = NULL;
File *file = NULL;
int rtf_size = 0, html_size = 0;
MessageBody body;
memset (&body, '\0', sizeof (MessageBody));
/* store the program op... | cwe | CWE-125 | C/C++ |
token_continue(i_ctx_t *i_ctx_p, scanner_state * pstate, bool save)
{
os_ptr op = osp;
int code;
ref token;
/* Note that gs_scan_token may change osp! */
pop(1); /* remove the file or scanner state */
again:
gs_scanner_error_object(i_ctx_p, pstate, &i_ctx_p->er... | cwe | CWE-125 | C/C++ |
int ssl3_get_finished(SSL *s, int a, int b)
{
int al,i,ok;
long n;
unsigned char *p;
/* the mac has already been generated when we received the
* change cipher spec message and is in s->s3->tmp.peer_finish_md
*/
n=s->method->ssl_get_message(s,
a,
b,
SSL3_MT_FINISHED,
64, /* should actually be 36+4 ... | cwe | CWE-310 | Unknown |
getword(f, word, newlinep, filename)
FILE *f;
char *word;
int *newlinep;
char *filename;
{
int c, len, escape;
int quoted, comment;
int value, digit, got, n;
#define isoctal(c) ((c) >= '0' && (c) < '8')
*newlinep = 0;
len = 0;
escape = 0;
comment = 0;
quoted = 0;
/... | cwe | CWE-119 | C/C++ |
/*
* Copyright (C) 2014-2018 Yubico AB - See COPYING
*/
/* Define which PAM interfaces we provide */
#define PAM_SM_AUTH
/* Include PAM headers */
#include <security/pam_appl.h>
#include <security/pam_modules.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <stdlib.h... | cwe | CWE-200 | C/C++ |
SRP_user_pwd *SRP_VBASE_get_by_user(SRP_VBASE *vb, char *username)
{
int i;
SRP_user_pwd *user;
unsigned char digv[SHA_DIGEST_LENGTH];
unsigned char digs[SHA_DIGEST_LENGTH];
EVP_MD_CTX ctxt;
if (vb == NULL)
return NULL;
for (i = 0; i < sk_SRP_user_pwd_num(vb->users_pwd); i++)... | cwe | CWE-399 | Unknown |
'use strict';
const async = require('async');
const validator = require('validator');
const utils = require('../utils');
const meta = require('../meta');
const db = require('../database');
const groups = require('../groups');
const plugins = require('../plugins');
module.exports = function (User) {
User.updateProf... | cwe | CWE-269 | JavaScript |
IMPEG2D_ERROR_CODES_T impeg2d_dec_d_slice(dec_state_t *ps_dec)
{
UWORD32 i;
yuv_buf_t *ps_cur_frm_buf = &ps_dec->s_cur_frm_buf;
stream_t *ps_stream = &ps_dec->s_bit_stream;
UWORD8 *pu1_vld_buf;
WORD16 i2_dc_diff;
UWORD32 u4_frame_width = ps_dec->u2_frame_width;
UWORD32 u4_frm_offset = 0... | cwe | CWE-200 | C/C++ |
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\... | cwe | CWE-22 | C/C++ |
OFCondition DcmSCP::listen()
{
// make sure not to let dcmdata remove trailing blank padding or perform other
// manipulations. We want to see the real data.
dcmEnableAutomaticInputDataCorrection.set( OFFalse );
OFCondition cond = EC_Normal;
// Make sure data dictionary is loaded.
if( !dcmDataDict.isDicti... | cwe | CWE-264 | C/C++ |
static MagickBooleanType WriteJP2Image(const ImageInfo *image_info,Image *image,
ExceptionInfo *exception)
{
const char
*option,
*property;
int
jp2_status;
MagickBooleanType
status;
opj_codec_t
*jp2_codec;
OPJ_COLOR_SPACE
jp2_colorspace;
opj_cparameters_t
parameters;
op... | cwe | CWE-665 | C/C++ |
void MessageService::OpenChannelToNativeApp(
int source_process_id,
int source_routing_id,
int receiver_port_id,
const std::string& source_extension_id,
const std::string& native_app_name,
const std::string& channel_name,
const std::string& connect_message) {
content::RenderProcessHost* so... | cwe | CWE-264 | C/C++ |
def register(request, registration_form=RegistrationForm):
if request.user.is_authenticated:
return redirect(request.GET.get('next', reverse('spirit:user:update')))
form = registration_form(data=post_data(request))
if (is_post(request) and
not request.is_limited() and
form.i... | cwe | CWE-601 | Python |
int ext4_setattr(struct dentry *dentry, struct iattr *attr)
{
struct inode *inode = d_inode(dentry);
int error, rc = 0;
int orphan = 0;
const unsigned int ia_valid = attr->ia_valid;
error = inode_change_ok(inode, attr);
if (error)
return error;
if (is_quota_modification(inode, attr)) {
error = dquot_initia... | cwe | CWE-362 | C/C++ |
/*! simple-get. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
module.exports = simpleGet
const concat = require('simple-concat')
const decompressResponse = require('decompress-response') // excluded from browser build
const http = require('http')
const https = require('https')
const once = requir... | cwe | CWE-200 | JavaScript |
public function setUp() {
$source1 = $this->getMock('RandomLib\Source');
$source1->expects($this->any())
->method('generate')
->will($this->returnCallback(function ($size) {
$r = '';
for ($i = 0; $i < $size; $i++) {
$r .= chr($i... | cwe | CWE-89 | JavaScript |
static Image *ReadTIFFImage(const ImageInfo *image_info,
ExceptionInfo *exception)
{
const char
*option;
float
*chromaticity,
x_position,
y_position,
x_resolution,
y_resolution;
Image
*image;
int
tiff_status;
MagickBooleanType
status;
MagickSizeType
number_pixe... | cwe | CWE-119 | Unknown |
/** @odoo-module **/
import { registry } from "@web/core/registry";
import {
Many2ManyTagsAvatarUserField,
KanbanMany2ManyTagsAvatarUserField,
many2ManyTagsAvatarUserField,
kanbanMany2ManyTagsAvatarUserField,
listMany2ManyTagsAvatarUserField,
} from "@mail/web/fields/many2many_avatar_user_field/man... | cwe | CWE-732 | C/C++ |
$scope.provision = function() {
$scope.isSaving = true;
growl.info($sanitize('The node ' + $scope.node.nodeLabel + ' is being added to requisition ' + $scope.node.foreignSource + '. Please wait...'));
var successMessage = $sanitize('The node ' + $scope.node.nodeLabel + ' has been added to requisition ... | cwe | CWE-79 | JavaScript |
unsigned char *ssl_add_clienthello_tlsext(SSL *s, unsigned char *buf, unsigned char *limit)
{
int extdatalen=0;
unsigned char *orig = buf;
unsigned char *ret = buf;
/* don't add extensions for SSLv3 unless doing secure renegotiation */
if (s->client_version == SSL3_VERSION
&& !s->s3->send_connection_binding... | cwe | CWE-20 | C/C++ |
resolve_op_end (FlatpakTransaction *self,
FlatpakTransactionOperation *op,
const char *checksum,
GFile *sideload_path,
GBytes *metadata_bytes)
{
g_autoptr(GBytes) old_metadata_bytes = NULL;
old_metadata_bytes = load_deployed_metadata (self, op->ref, N... | cwe | CWE-276 | C/C++ |
// SPDX-License-Identifier: BSD-2-Clause
/*
* Copyright (c) 2014, STMicroelectronics International N.V.
*/
#include <assert.h>
#include <compiler.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_a... | cwe | CWE-787 | C/C++ |
void Compute(OpKernelContext* context) override {
// There are two steps when calculating gradient for FractionalMaxPool.
// 1) Walk through the process of calculating fractional pooling given
// pooling region; however, in the process, keep track of where the max
// element comes from. (arg_max)
... | cwe | CWE-908 | Unknown |
(err, data) => {
if (err) {
if (!fs.existsSync(safeFileFullPath)) {
var EnoentError = `Requested metadata for ${metaFileName} not found`
logger.log2('error', EnoentError)
res.status(404).send(EnoentError)
} else {
res.status(500).send(`An error... | cwe | CWE-79 | JavaScript |
void FileSystemManagerImpl::CreateWriter(const GURL& file_path,
CreateWriterCallback callback) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
FileSystemURL url(context_->CrackURL(file_path));
base::Optional<base::File::Error> opt_error = ValidateFileSystemURL(url);
if ... | cwe | CWE-189 | C/C++ |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-119 | C/C++ |
run(code, filename) {
let dirname;
let resolvedFilename;
let script;
if (code instanceof VMScript) {
script = this.options.strict ? code._compileNodeVMStrict() : code._compileNodeVM();
resolvedFilename = pa.resolve(code.filename);
dirname = pa.dirname(resolvedFilename);
} else {
const unresolvedF... | cwe | CWE-1321 | JavaScript |
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | cwe | CWE-617 | Python |
jio_snprintf(char * str, int n, const char * format, ...)
{
va_list args;
int result;
Trc_SC_snprintf_Entry();
va_start(args, format);
#if defined(WIN32) && !defined(WIN32_IBMC)
result = _vsnprintf( str, n, format, args );
#else
result = vsprintf( str, format, args );
#endif
va_end(args);
Trc_SC_snprintf_Exi... | cwe | CWE-119 | C/C++ |
package samlsp
import (
"crypto/rsa"
"errors"
"fmt"
"time"
"github.com/dgrijalva/jwt-go"
"github.com/crewjam/saml"
)
const defaultSessionMaxAge = time.Hour
// JWTSessionCodec implements SessionCoded to encode and decode Sessions from
// the corresponding JWT.
type JWTSessionCodec struct {
SigningMethod jwt.... | cwe | CWE-287 | Go |
static int mem_read(jas_stream_obj_t *obj, char *buf, int cnt)
{
int n;
assert(cnt >= 0);
assert(buf);
JAS_DBGLOG(100, ("mem_read(%p, %p, %d)\n", obj, buf, cnt));
jas_stream_memobj_t *m = (jas_stream_memobj_t *)obj;
n = m->len_ - m->pos_;
cnt = JAS_MIN(n, cnt);
memcpy(buf, &m->buf_[m->pos_], cnt);
m->pos_ += ... | cwe | CWE-190 | Unknown |
/*
* Dragonfly - Runtime dependency management library
* Copyright (c) 2021 Joshua Sing <joshua@hypera.dev>
*
* 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, in... | cwe | CWE-611 | Java |
get_8bit_row(j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
/* This version is for reading 8-bit colormap indexes */
{
bmp_source_ptr source = (bmp_source_ptr)sinfo;
register JSAMPARRAY colormap = source->colormap;
JSAMPARRAY image_ptr;
register int t;
register JSAMPROW inptr, outptr;
register JDIMENSION col... | cwe | CWE-200 | Unknown |
NOEXPORT char *base64(int encode, const char *in, int len) {
BIO *bio, *b64;
char *out;
int n;
b64=BIO_new(BIO_f_base64());
if(!b64)
return NULL;
BIO_set_flags(b64, BIO_FLAGS_BASE64_NO_NL);
bio=BIO_new(BIO_s_mem());
if(!bio) {
str_free(b64);
return NULL;
}
... | cwe | CWE-295 | C/C++ |
public void emptyHeaderNameNotAllowed() {
newEmptyHeaders().add("", "foo");
} | cwe | CWE-74 | Java |
/*******************************************************************************
* This file is part of OpenNMS(R).
*
* Copyright (C) 2002-2014 The OpenNMS Group, Inc.
* OpenNMS(R) is Copyright (C) 1999-2014 The OpenNMS Group, Inc.
*
* OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc.
*
* OpenNMS(... | cwe | CWE-352 | Java |
PREFIX(prologTok)(const ENCODING *enc, const char *ptr, const char *end,
const char **nextTokPtr) {
int tok;
if (ptr >= end)
return XML_TOK_NONE;
if (MINBPC(enc) > 1) {
size_t n = end - ptr;
if (n & (MINBPC(enc) - 1)) {
n &= ~(MINBPC(enc) - 1);
if (n == 0)
return ... | cwe | CWE-116 | C/C++ |
dtls1_process_record(SSL *s)
{
int i,al;
int enc_err;
SSL_SESSION *sess;
SSL3_RECORD *rr;
unsigned int mac_size;
unsigned char md[EVP_MAX_MD_SIZE];
rr= &(s->s3->rrec);
sess = s->session;
/* At this point, s->packet_length == SSL3_RT_HEADER_LNGTH + rr->length,
* and we have that many bytes in s->packet
*/... | cwe | CWE-119 | C/C++ |
int nfc_register_device(struct nfc_dev *dev)
{
int rc;
pr_debug("dev_name=%s\n", dev_name(&dev->dev));
mutex_lock(&nfc_devlist_mutex);
nfc_devlist_generation++;
rc = device_add(&dev->dev);
mutex_unlock(&nfc_devlist_mutex);
if (rc < 0)
return rc;
rc = nfc_llcp_register_device(dev);
if (rc)
pr_err("Could... | cwe | CWE-416 | Unknown |
package hudson.util;
import com.trilead.ssh2.crypto.Base64;
import hudson.model.TaskListener;
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputSt... | cwe | CWE-326 | Java |
static int __poke_user_compat(struct task_struct *child,
addr_t addr, addr_t data)
{
struct compat_user *dummy32 = NULL;
__u32 tmp = (__u32) data;
addr_t offset;
if (addr < (addr_t) &dummy32->regs.acrs) {
struct pt_regs *regs = task_pt_regs(child);
/*
* psw, gprs, acrs and orig_gpr2 are stored on t... | cwe | CWE-269 | Unknown |
int avpriv_dv_produce_packet(DVDemuxContext *c, AVPacket *pkt,
uint8_t* buf, int buf_size)
{
int size, i;
uint8_t *ppcm[4] = {0};
if (buf_size < DV_PROFILE_BYTES ||
!(c->sys = avpriv_dv_frame_profile(c->sys, buf, buf_size)) ||
buf_size < c->sys->frame_size) {
... | cwe | CWE-119 | Unknown |
"#ffffff")),Ca=mxUtils.setStyle(Ca,mxConstants.STYLE_STROKECOLOR,mxUtils.getValue(za,mxConstants.STYLE_STROKECOLOR,"#000000")),Ca=mxUtils.setStyle(Ca,mxConstants.STYLE_GRADIENTCOLOR,mxUtils.getValue(za,mxConstants.STYLE_GRADIENTCOLOR,null)),T.getModel().isVertex(Ia[Ea])&&(Ca=mxUtils.setStyle(Ca,mxConstants.STYLE_FONTCO... | cwe | CWE-20 | JavaScript |
void WebGLRenderingContextBase::DrawingBufferClientRestorePixelPackAlignment() {
if (!ContextGL())
return;
ContextGL()->PixelStorei(GL_PACK_ALIGNMENT, pack_alignment_);
} | cwe | CWE-119 | C/C++ |
pimv1_print(netdissect_options *ndo,
register const u_char *bp, register u_int len)
{
register const u_char *ep;
register u_char type;
ep = (const u_char *)ndo->ndo_snapend;
if (bp >= ep)
return;
ND_TCHECK(bp[1]);
type = bp[1];
ND_PRINT((ndo, " %s", tok2str(pimv1_type_str, "[type %u]", type)));
... | cwe | CWE-125 | C/C++ |
void MainWindow::on_actionUpgrade_triggered()
{
if (Settings.askUpgradeAutmatic()) {
QMessageBox dialog(QMessageBox::Question,
qApp->applicationName(),
tr("Do you want to automatically check for updates in the future?"),
QMessageBox::No |
QMessageBox::Yes,
... | cwe | CWE-295 | C/C++ |
public TList readListBegin() throws TException {
return new TList(readByte(), readI32());
} | cwe | CWE-770 | Java |
static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock,
struct msghdr *msg, size_t size,
int flags)
{
struct sock_iocb *siocb = kiocb_to_siocb(iocb);
struct scm_cookie tmp_scm;
struct sock *sk = sock->sk;
struct unix_sock *u = unix_sk(sk);
struct sockaddr_un *sunaddr = msg->msg_... | cwe | CWE-20 | C/C++ |
flac_buffer_copy (SF_PRIVATE *psf)
{ FLAC_PRIVATE* pflac = (FLAC_PRIVATE*) psf->codec_data ;
const FLAC__Frame *frame = pflac->frame ;
const int32_t* const *buffer = pflac->wbuffer ;
unsigned i = 0, j, offset, channels, len ;
/*
** frame->header.blocksize is variable and we're using a constant blocksize
** of FL... | cwe | CWE-119 | C/C++ |
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
const TfLiteTensor* input = GetInput(context, node, kInput);
const TfLiteTensor* input_state = GetInput(context, node, kInputState);
const TfLiteTensor* gate_weight = GetInput(context, node, kGateWeight);
const TfLiteTensor* gate_bias = GetInput(cont... | cwe | CWE-787 | C/C++ |
int make_btrfs(int fd, u64 blocks[4], u64 num_bytes, u32 nodesize,
u32 leafsize, u32 sectorsize, u32 stripesize)
{
struct btrfs_super_block super;
struct extent_buffer *buf;
struct btrfs_root_item root_item;
struct btrfs_disk_key disk_key;
struct btrfs_extent_ref *extent_ref;
struct btrfs_extent_item *ext... | cwe | CWE-787 | C/C++ |
static int open_url(AVFormatContext *s, AVIOContext **pb, const char *url,
AVDictionary *opts, AVDictionary *opts2, int *is_http)
{
HLSContext *c = s->priv_data;
AVDictionary *tmp = NULL;
const char *proto_name = NULL;
int ret;
av_dict_copy(&tmp, opts, 0);
av_dict_copy(&tmp,... | cwe | CWE-200 | C/C++ |
void PaymentRequest::AreRequestedMethodsSupportedCallback(
bool methods_supported) {
if (methods_supported) {
if (SatisfiesSkipUIConstraints()) {
skipped_payment_request_ui_ = true;
Pay();
}
} else {
journey_logger_.SetNotShown(
JourneyLogger::NOT_SHOWN_REASON_NO_SUPPORTED_PAYMEN... | cwe | CWE-189 | C/C++ |
static Image *ReadVIFFImage(const ImageInfo *image_info,
ExceptionInfo *exception)
{
#define VFF_CM_genericRGB 15
#define VFF_CM_ntscRGB 1
#define VFF_CM_NONE 0
#define VFF_DEP_DECORDER 0x4
#define VFF_DEP_NSORDER 0x8
#define VFF_DES_RAW 0
#define VFF_LOC_IMPLICIT 1
#define VFF_MAPTYP_NONE 0
#define VFF_MAPTY... | cwe | CWE-400 | C/C++ |
static int startApp(QCommandLineParser& p)
{
// Stop daemon and exit?
if (p.isSet("s"))
{
KDEsuClient client;
if (client.ping() == -1)
{
qCCritical(category) << "Daemon not running -- nothing to stop\n";
p.showHelp(1);
}
if (client.stopServer()... | cwe | CWE-94 | Unknown |
OMX_ERRORTYPE SimpleSoftOMXComponent::internalSetParameter(
OMX_INDEXTYPE index, const OMX_PTR params) {
switch (index) {
case OMX_IndexParamPortDefinition:
{
OMX_PARAM_PORTDEFINITIONTYPE *defParams =
(OMX_PARAM_PORTDEFINITIONTYPE *)params;
if (defParams->nPortIn... | cwe | CWE-119 | C/C++ |
visitMixin: function(mixin) {
var name = 'pug_mixins[';
var args = mixin.args || '';
var block = mixin.block;
var attrs = mixin.attrs;
var attrsBlocks = this.attributeBlocks(mixin.attributeBlocks);
var pp = this.pp;
var dynamic = mixin.name[0] === '#';
var key = mixin.name;
if (dynam... | cwe | CWE-74 | JavaScript |
function (done) {
cp.exec(
[gitApp, "tag", "-a", tagName, "-m", message].join(" "),
gitExtra,
done
);
}, | cwe | CWE-78 | JavaScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.