code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
function authenticationEndpoints(app) {
if (!app) return;
app.get("/auth/auto-onboard", async (_, response) => {
try {
const completeSetup = (await User.count({ role: "admin" })) > 0;
if (completeSetup) {
response.status(200).json({ completed: true });
return;
}
const o... | cwe | CWE-287 | JavaScript |
int ocfs2_set_acl(handle_t *handle,
struct inode *inode,
struct buffer_head *di_bh,
int type,
struct posix_acl *acl,
struct ocfs2_alloc_context *meta_ac,
struct ocfs2_alloc_context *data_ac)
{
int name_index;
void *value = NULL;
size_t size = 0;
int ret;
if (S_ISLNK(inode->i_mode))
retur... | cwe | CWE-862 | Unknown |
static jlong Region_createFromParcel(JNIEnv* env, jobject clazz, jobject parcel)
{
if (parcel == NULL) {
return NULL;
}
android::Parcel* p = android::parcelForJavaObject(env, parcel);
const size_t size = p->readInt32();
const void* regionData = p->readInplace(size);
if (regionData == NULL) {
retur... | cwe | CWE-264 | 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-22 | Java |
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim: set sw=4 sts=4 expandtab: */
/*
rsvg.c: SAX-based renderer for SVG files into a GdkPixbuf.
Copyright (C) 2000 Eazel, Inc.
Copyright (C) 2002 Dom Lachowicz <cinamod@hotmail.com>
This program is free software; you can redi... | cwe | CWE-255 | C/C++ |
# Natural Language Toolkit: Interface to MaltParser
#
# Author: Dan Garrette <dhgarrette@gmail.com>
# Contributor: Liling Tan, Mustufain, osamamukhtar11
#
# Copyright (C) 2001-2021 NLTK Project
# URL: <https://www.nltk.org/>
# For license information, see LICENSE.TXT
import inspect
import os
import subprocess
import s... | cwe | CWE-1333 | Python |
foreach ( $metric_group_members as $index => $metric_name ) {
print "
<A HREF=\"./graph_all_periods.php?mobile=1&" . $g_metrics[$metric_name]['graph'] . "\">
<IMG BORDER=0 ALT=\"$clustername\" SRC=\"./graph.php?" . $g_metrics[$metric_name]['graph'] . "\"></A>";
} | cwe | CWE-79 | PHP |
function renderBreadcrumb()
{
var bcDiv = _$('.odFilesBreadcrumb');
if (bcDiv == null) return;
bcDiv.innerHTML = '';
for (var i = 0; i < breadcrumb.length - 1; i++)
{
var folder = document.createElement('span');
folder.className = 'odBCFolder';
folder.innerHTML = mxUtils.htmlEntities(bread... | cwe | CWE-94 | JavaScript |
NORET_TYPE void do_exit(long code)
{
struct task_struct *tsk = current;
int group_dead;
profile_task_exit(tsk);
WARN_ON(atomic_read(&tsk->fs_excl));
if (unlikely(in_interrupt()))
panic("Aiee, killing interrupt handler!");
if (unlikely(!tsk->pid))
panic("Attempted to kill the idle task!");
tracehook_repor... | cwe | CWE-20 | Unknown |
void PngImg::InitStorage_() {
rowPtrs_.resize(info_.height, nullptr);
data_ = new png_byte[info_.height * info_.rowbytes];
for(size_t i = 0; i < info_.height; ++i) {
rowPtrs_[i] = data_ + i * info_.rowbytes;
}
} | cwe | CWE-190 | C/C++ |
void operator()(OpKernelContext* ctx, const CPUDevice& d, int64 num_batches,
int64 samples_per_batch, int64 num_elements,
typename TTypes<T>::ConstFlat means,
typename TTypes<T>::ConstFlat stddevs,
typename TTypes<T>::ConstFlat minvals,
... | cwe | CWE-703 | Unknown |
static av_cold int vqa_decode_init(AVCodecContext *avctx)
{
VqaContext *s = avctx->priv_data;
int i, j, codebook_index;
s->avctx = avctx;
avctx->pix_fmt = PIX_FMT_PAL8;
/* make sure the extradata made it */
if (s->avctx->extradata_size != VQA_HEADER_SIZE) {
av_log(s->avctx, AV_LOG_ERRO... | cwe | CWE-119 | C/C++ |
import json
from tornado import web
from ...base.handlers import IPythonHandler, json_errors
class NbconvertRootHandler(IPythonHandler):
SUPPORTED_METHODS = ('GET',)
@web.authenticated
@json_errors
def get(self):
try:
from IPython.nbconvert.exporters.export import exporter_map
... | cwe | CWE-79 | Python |
static void cirrus_invalidate_region(CirrusVGAState * s, int off_begin,
int off_pitch, int bytesperline,
int lines)
{
int y;
int off_cur;
int off_cur_end;
for (y = 0; y < lines; y++) {
off_cur = off_begin;
off_cur_end = (off_cur + bytesperline) & s->cirrus_addr_mas... | cwe | CWE-125 | C/C++ |
ssize_t oe_recvfrom(
int sockfd,
void* buf,
size_t len,
int flags,
const struct oe_sockaddr* src_addr,
oe_socklen_t* addrlen)
{
ssize_t ret = -1;
oe_fd_t* sock;
if (!(sock = oe_fdtable_get(sockfd, OE_FD_TYPE_SOCKET)))
OE_RAISE_ERRNO(oe_errno);
ret = sock->ops.socket.rec... | cwe | CWE-552 | Unknown |
function handleMultipart (opts = {}) {
if (!this.isMultipart()) {
throw new InvalidMultipartContentTypeError()
}
this.log.debug('starting multipart parsing')
let values = []
let pendingHandler = null
// only one file / field can be processed at a time
// "null" will close the consum... | cwe | CWE-770 | JavaScript |
bool Item_field::fix_fields(THD *thd, Item **reference)
{
DBUG_ASSERT(fixed == 0);
Field *from_field= (Field *)not_found_field;
bool outer_fixed= false;
SELECT_LEX *select= thd->lex->current_select;
if (select && select->in_tvc)
{
my_error(ER_FIELD_REFERENCE_IN_TVC, MYF(0), full_name());
return(1);... | cwe | CWE-703 | Unknown |
static int pfkey_register(struct sock *sk, struct sk_buff *skb, const struct sadb_msg *hdr, void * const *ext_hdrs)
{
struct pfkey_sock *pfk = pfkey_sk(sk);
struct sk_buff *supp_skb;
if (hdr->sadb_msg_satype > SADB_SATYPE_MAX)
return -EINVAL;
if (hdr->sadb_msg_satype != SADB_SATYPE_UNSPEC) {
if (pfk->register... | cwe | CWE-362 | C/C++ |
# -*- coding: utf-8 -*-
# rdiffweb, A web interface to rdiff-backup repositories
# Copyright (C) 2012-2021 rdiffweb contributors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version ... | cwe | CWE-770 | Python |
function load() {
w3_require_once(W3TC_INC_FUNCTIONS_DIR . '/admin.php');
$this->_page = w3tc_get_current_page();
/**
* Run plugin action
*/
$action = false;
foreach ($_REQUEST as $key => $value) {
if (strpos($key, 'w3tc_') === 0) {
... | cwe | CWE-352 | PHP |
static unsigned int help(struct sk_buff *skb,
enum ip_conntrack_info ctinfo,
unsigned int protoff,
unsigned int matchoff,
unsigned int matchlen,
struct nf_conntrack_expect *exp)
{
char buffer[sizeof("4294967296 65635")];
u_int16_t port;
unsigned int ret;
/* Reply comes from server. */
... | cwe | CWE-119 | C/C++ |
static int decode_frame(AVCodecContext *avctx,
void *data, int *got_frame,
AVPacket *avpkt)
{
AnsiContext *s = avctx->priv_data;
uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
const uint8_t *buf_end = buf+buf_size;
int ret, i, count;... | cwe | CWE-190 | Unknown |
static OPJ_BOOL opj_tcd_code_block_enc_allocate_data(opj_tcd_cblk_enc_t *
p_code_block)
{
OPJ_UINT32 l_data_size;
/* +1 is needed for https://github.com/uclouvain/openjpeg/issues/835 */
/* and actually +2 required for https://github.com/uclouvain/openjpeg/issues/982 */
/* and +7 for https://git... | cwe | CWE-122 | C/C++ |
function EventSource (url, eventSourceInitDict) {
var readyState = EventSource.CONNECTING
Object.defineProperty(this, 'readyState', {
get: function () {
return readyState
}
})
Object.defineProperty(this, 'url', {
get: function () {
return url
}
})
var self = this
self.reconne... | cwe | CWE-212 | JavaScript |
rpmRC rpmReadPackageFile(rpmts ts, FD_t fd, const char * fn, Header * hdrp)
{
char *msg = NULL;
Header h = NULL;
Header sigh = NULL;
hdrblob blob = NULL;
hdrblob sigblob = NULL;
rpmVSFlags vsflags = rpmtsVSFlags(ts) | RPMVSF_NEEDPAYLOAD;
rpmKeyring keyring = rpmtsGetKeyring(ts, 1);
struc... | cwe | CWE-345 | Unknown |
static void vnc_dpy_copy(DisplayState *ds, int src_x, int src_y, int dst_x, int dst_y, int w, int h)
{
VncDisplay *vd = ds->opaque;
VncState *vs, *vn;
uint8_t *src_row;
uint8_t *dst_row;
int i,x,y,pitch,depth,inc,w_lim,s;
int cmp_bytes;
vnc_refresh_server_surface(vd);
QTAILQ_FOREACH_SAF... | cwe | CWE-125 | Unknown |
Utf8DecoderBase::Utf8DecoderBase()
: unbuffered_start_(NULL),
utf16_length_(0),
last_byte_of_buffer_unused_(false) {} | cwe | CWE-119 | Unknown |
/**
* Parse Server Configuration Builder
*
* This module builds the definitions file (src/Options/Definitions.js)
* from the src/Options/index.js options interfaces.
* The Definitions.js module is responsible for the default values as well
* as the mappings for the CLI.
*
* To rebuild the definitions file, run
... | cwe | CWE-74 | JavaScript |
void CreateNgrams(const tstring* data, tstring* output, int num_ngrams,
int ngram_width) const {
for (int ngram_index = 0; ngram_index < num_ngrams; ++ngram_index) {
int pad_width = get_pad_width(ngram_width);
int left_padding = std::max(0, pad_width - ngram_index);
int right_p... | cwe | CWE-703 | Unknown |
// Ogg Vorbis audio decoder - v1.16 - public domain
// http://nothings.org/stb_vorbis/
//
// Original version written by Sean Barrett in 2007.
//
// Originally sponsored by RAD Game Tools. Seeking implementation
// sponsored by Phillip Bennefall, Marc Andersen, Aaron Baker,
// Elias Software, Aras Pranckevicius, and Se... | cwe | CWE-369 | C/C++ |
void* IOBuf::operator new(size_t size) {
size_t fullSize = offsetof(HeapStorage, buf) + size;
auto storage = static_cast<HeapStorage*>(checkedMalloc(fullSize));
new (&storage->prefix) HeapPrefix(kIOBufInUse, fullSize);
if (io_buf_alloc_cb) {
io_buf_alloc_cb(storage, fullSize);
}
return &(storage->buf... | cwe | CWE-787 | Unknown |
var Gogo = (function() {
// create our angular module and tell angular what route(s) it will handle
var pluginName = "gogo";
var simplePlugin = angular.module(pluginName, ['hawtioCore'])
.factory('log', function() {
return Logger.get("Gogo");
}).config(function($routeProvider) {
$routeProvid... | cwe | CWE-352 | Java |
int btrfs_add_link(struct btrfs_trans_handle *trans,
struct inode *parent_inode, struct inode *inode,
const char *name, int name_len, int add_backref, u64 index)
{
int ret = 0;
struct btrfs_key key;
struct btrfs_root *root = BTRFS_I(parent_inode)->root;
u64 ino = btrfs_ino(inode);
u64 parent_ino = btrfs_... | cwe | CWE-310 | Unknown |
function finish () {
if (!that.disconnected && that.will) {
that.broker.publish(that.will, that, function (err) {
if (!err) {
that.broker.persistence.delWill({
id: that.id,
brokerId: that.broker.id
}, nop)
}
})
that.will = null // this fu... | cwe | CWE-863 | JavaScript |
static ssize_t psi_write(struct file *file, const char __user *user_buf,
size_t nbytes, enum psi_res res)
{
char buf[32];
size_t buf_size;
struct seq_file *seq;
struct psi_trigger *new;
if (static_branch_likely(&psi_disabled))
return -EOPNOTSUPP;
if (!nbytes)
return -EINVAL;
buf_size = min(nbytes, siz... | cwe | CWE-416 | Unknown |
config_monitor(
config_tree *ptree
)
{
int_node *pfilegen_token;
const char *filegen_string;
const char *filegen_file;
FILEGEN *filegen;
filegen_node *my_node;
attr_val *my_opts;
int filegen_type;
int filegen_flag;
/* Set the statistics directory */
if (ptree->stats_dir)
stats_config(STATS_STATSDIR, ptre... | cwe | CWE-20 | C/C++ |
// Copyright (c) the JPEG XL Project Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
#include "lib/extras/codec_apng.h"
// Parts of this code are taken from apngdis, which has the following license:
/* APNG Disassembler 2.8
*
*... | cwe | CWE-369 | C/C++ |
/*
* Copyright 2000-2020 Vaadin Ltd.
*
* 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... | cwe | CWE-200 | Java |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
#
#
# Copyright (c) 2008-2015 University of Dundee.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or... | cwe | CWE-200 | Python |
static Var* Pe_r_bin_pe_parse_var(RBinPEObj* pe, PE_DWord* curAddr) {
Var* var = calloc (1, sizeof (*var));
if (!var) {
pe_printf ("Warning: calloc (Var)\n");
return NULL;
}
if ((var->wLength = r_buf_read_le16_at (pe->b, *curAddr)) == UT16_MAX) {
pe_printf ("Warning: read (Var wLength)\n");
free_Var (var);
... | cwe | CWE-400 | C/C++ |
/**
* Copyright (c) 2014-present, The osquery authors
*
* This source code is licensed as defined by the LICENSE file found in the
* root directory of this source tree.
*
* SPDX-License-Identifier: (Apache-2.0 OR GPL-2.0-only)
*/
#include "osquery/sql/sqlite_util.h"
#include "osquery/sql/virtual_table.h"
#incl... | cwe | CWE-77 | C/C++ |
__u32 secure_ipv6_id(const __be32 daddr[4])
{
const struct keydata *keyptr;
__u32 hash[4];
keyptr = get_keyptr();
hash[0] = (__force __u32)daddr[0];
hash[1] = (__force __u32)daddr[1];
hash[2] = (__force __u32)daddr[2];
hash[3] = (__force __u32)daddr[3];
return half_md4_transform(hash, keyptr->secret);
} | cwe | CWE-703 | Unknown |
inline int check(int itemSize, int nItems=1, bool wait=true)
{
if (ptr + itemSize * nItems > end) {
if (ptr + itemSize > end)
return overrun(itemSize, nItems, wait);
nItems = (end - ptr) / itemSize;
}
return nItems;
} | cwe | CWE-122 | C/C++ |
/*
* Copyright 2022 Thoughtworks, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | cwe | CWE-532 | Java |
~ScopedRequest() {
if (requested_) {
owner_->delegate_->StopEnumerateDevices(request_id_);
}
} | cwe | CWE-399 | C/C++ |
Send an email message */
PHP_FUNCTION(imap_mail)
{
char *to=NULL, *message=NULL, *headers=NULL, *subject=NULL, *cc=NULL, *bcc=NULL, *rpath=NULL;
int to_len, message_len, headers_len, subject_len, cc_len, bcc_len, rpath_len, argc = ZEND_NUM_ARGS();
if (zend_parse_parameters(argc TSRMLS_CC, "sss|ssss", &to, &to_len, ... | cwe | CWE-476 | Unknown |
'use strict'
function _process (v, mod) {
var i
var r
if (typeof mod === 'function') {
r = mod(v)
if (r !== undefined) {
v = r
}
} else if (Array.isArray(mod)) {
for (i = 0; i < mod.length; i++) {
r = mod[i](v)
if (r !== undefined) {
v = r
}
}
}
return ... | cwe | CWE-74 | JavaScript |
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
auto* data =
reinterpret_cast<TfLiteAudioMicrofrontendParams*>(node->user_data);
FrontendReset(data->state);
const TfLiteTensor* input = GetInput(context, node, kInputTensor);
TfLiteTensor* output = GetOutput(context, node, kOutputTensor);
... | cwe | CWE-787 | C/C++ |
// ximainfo.cpp : main attributes
/* 03/10/2004 v1.00 - Davide Pizzolato - www.xdp.it
* CxImage version 7.0.2 07/Feb/2011
*/
#include "ximage.h"
#if defined(_LINUX) || defined(__APPLE__)
#ifdef UNICODE
#define _tcsnicmp(a,b,c) wcscasecmp(a,b)
#else
#define _tcsnicmp(a,b,c) strcasecmp(a,b)
... | cwe | CWE-770 | C/C++ |
ProcXkbSetNames(ClientPtr client)
{
DeviceIntPtr dev;
CARD32 *tmp;
Atom bad;
int rc;
REQUEST(xkbSetNamesReq);
REQUEST_AT_LEAST_SIZE(xkbSetNamesReq);
if (!(client->xkbClientFlags & _XkbClientInitialized))
return BadAccess;
CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixManag... | cwe | CWE-119 | Unknown |
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/views/select_file_dialog_extension.h"
#include <map>
#include <memory>
#include <string>
#include <utility>
#include "as... | cwe | CWE-416 | C/C++ |
static bool ldap_push_filter(struct asn1_data *data, struct ldb_parse_tree *tree)
{
int i;
switch (tree->operation) {
case LDB_OP_AND:
case LDB_OP_OR:
asn1_push_tag(data, ASN1_CONTEXT(tree->operation==LDB_OP_AND?0:1));
for (i=0; i<tree->u.list.num_elements; i++) ... | cwe | CWE-399 | C/C++ |
static Image *ReadSCTImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
char
magick[2];
Image
*image;
MagickBooleanType
status;
MagickRealType
height,
width;
Quantum
pixel;
register IndexPacket
*indexes;
register ssize_t
i,
x;
register PixelPacket
... | cwe | CWE-120 | C/C++ |
void ValidateInputTensors(OpKernelContext* ctx, const Tensor& in0,
const Tensor& in1) override {
OP_REQUIRES(
ctx, in0.dims() >= 2,
errors::InvalidArgument("In[0] ndims must be >= 2: ", in0.dims()));
OP_REQUIRES(
ctx, in1.dims() >= 2,
errors::InvalidA... | cwe | CWE-125 | Unknown |
/*
* XDR support for nfsd
*
* Copyright (C) 1995, 1996 Olaf Kirch <okir@monad.swb.de>
*/
#include "vfs.h"
#include "xdr.h"
#include "auth.h"
#define NFSDDBG_FACILITY NFSDDBG_XDR
/*
* Mapping of S_IF* types to NFS file types
*/
static u32 nfs_ftypes[] = {
NFNON, NFCHR, NFCHR, NFBAD,
NFDIR, NFBAD, NFBLK, ... | cwe | CWE-399 | C/C++ |
/* Copyright 2020 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | cwe | CWE-20 | C/C++ |
int LibRaw::ljpeg_start(struct jhead *jh, int info_only)
{
ushort c, tag, len;
int cnt = 0;
uchar data[0x10000];
const uchar *dp;
memset(jh, 0, sizeof *jh);
jh->restart = INT_MAX;
if ((fgetc(ifp), fgetc(ifp)) != 0xd8)
return 0;
do
{
if (feof(ifp))
return 0;
if (cnt++ > 1024)
r... | cwe | CWE-125 | C/C++ |
ipmi_spd_print_fru(struct ipmi_intf * intf, uint8_t id)
{
struct ipmi_rs * rsp;
struct ipmi_rq req;
struct fru_info fru;
uint8_t *spd_data, msg_data[4];
int len, offset;
msg_data[0] = id;
memset(&req, 0, sizeof(req));
req.msg.netfn = IPMI_NETFN_STORAGE;
req.msg.cmd = GET_FRU_INFO;
req.msg.data = msg_data;
... | cwe | CWE-120 | C/C++ |
/*
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-74 | Go |
def _exec_cmd(self, cmd):
"""Executes adb commands in a new shell.
This is specific to executing adb binary because stderr is not a good
indicator of cmd execution status.
Args:
cmds: A string that is the adb command to execute.
Returns:
The output of t... | cwe | CWE-78 | Python |
/* Copyright 2020 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | cwe | CWE-908 | C/C++ |
package com.salesmanager.shop.admin.controller.products;
import com.salesmanager.core.business.services.catalog.product.ProductService;
import com.salesmanager.core.business.utils.ajax.AjaxPageableResponse;
import com.salesmanager.core.business.utils.ajax.AjaxResponse;
import com.salesmanager.core.model.catalog.produc... | cwe | CWE-639 | Java |
read_header_block (PSDimage *img_a,
FILE *f,
GError **error)
{
guint16 version;
gchar sig[4];
gchar buf[6];
if (fread (sig, 4, 1, f) < 1
|| fread (&version, 2, 1, f) < 1
|| fread (buf, 6, 1, f) < 1
|| fread (&img_a->channels, 2, 1, f) < 1
... | cwe | CWE-190 | Unknown |
async function encrypt(oid, cipher_algo, hash_algo, m, Q, fingerprint) {
const { V, Z } = await genPublicEphemeralKey(oid, cipher_algo, hash_algo, Q, fingerprint);
return {
V: new BN(V),
C: aes_kw.wrap(Z, m.toString())
};
} | cwe | CWE-327 | JavaScript |
int TfLiteIntArrayGetSizeInBytes(int size) {
static TfLiteIntArray dummy;
int computed_size = sizeof(dummy) + sizeof(dummy.data[0]) * size;
#if defined(_MSC_VER)
// Context for why this is needed is in http://b/189926408#comment21
computed_size -= sizeof(dummy.data[0]);
#endif
return computed_size;
} | cwe | CWE-190 | C/C++ |
cvt_whole_image( TIFF *in, TIFF *out )
{
uint32* raster; /* retrieve RGBA image */
uint32 width, height; /* image width & height */
uint32 row;
size_t pixel_count;
TIFFGetField(in, TIFFTAG_IMAGEWIDTH, &width);
TIFFGetField(in, TIFFTAG_IMAGELENGTH, &height);
pixel_count = width... | cwe | CWE-119 | Unknown |
function o(){var b,c,d,e;return b=vc,c=vc,58===a.charCodeAt(vc)?(d=na,vc++):(d=X,0===Bc&&g(oa)),d!==X?(e=v(),e!==X?(wc=c,d=pa(e),c=d):(vc=c,c=aa)):(vc=c,c=aa),c===X&&(c=ba),c!==X&&(wc=b,c=qa(c)),b=c} | cwe | CWE-1321 | JavaScript |
/*
Copyright 2015 The Kubernetes 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, ... | cwe | CWE-863 | Go |
static SSL_CTX *init_tls_ctx(EAP_TLS_CONF *conf)
{
SSL_METHOD *meth;
SSL_CTX *ctx;
X509_STORE *certstore;
int verify_mode = SSL_VERIFY_NONE;
int ctx_options = 0;
int type;
/*
* Bug fix
* http://old.nabble.com/Backward-compatibility-of-private-key-files--td27937046.html
*/
OpenSSL_add_all_algorithms();
... | cwe | CWE-295 | Unknown |
xmlBufferAdd(xmlBufferPtr buf, const xmlChar *str, int len) {
unsigned int needSize;
if ((str == NULL) || (buf == NULL)) {
return -1;
}
if (buf->alloc == XML_BUFFER_ALLOC_IMMUTABLE) return -1;
if (len < -1) {
#ifdef DEBUG_BUFFER
xmlGenericError(xmlGenericErrorContext,
"xmlBufferAdd: len ... | cwe | CWE-190 | Unknown |
viewController.getData = function (request, cb) {
async.parallel(
[
function (callback) {
if (global.env === 'development') {
require('../../sass/buildsass').build(callback)
} else {
return callback()
}
},
function (callback) {
async.parallel(
... | cwe | CWE-521 | 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-369 | Python |
(function()
{
Sidebar.prototype.addInfographicPalette = function()
{
var w = 100;
var h = 100;
var s = 'whiteSpace=wrap;html=1;shape=mxgraph.infographic.';
var s2 = mxConstants.STYLE_VERTICAL_LABEL_POSITION + '=bottom;' + mxConstants.STYLE_VERTICAL_ALIGN + '=top;html=1;shape=mxgraph.infographic.';
var s3 = ... | cwe | CWE-284 | Java |
@app.route('/quiz')
def quiz():
varga = request.args.get('varga')
try:
rows =[]
with sql.connect('amara.db') as con:
con.row_factory = sql.Row
cur = con.cursor()
cur.execute("select * from pada inner join mula on pada.sloka_line = mula.sloka_line where pada... | cwe | CWE-89 | Python |
static MagickBooleanType WriteBMPImage(const ImageInfo *image_info,Image *image,
ExceptionInfo *exception)
{
BMPInfo
bmp_info;
BMPSubtype
bmp_subtype;
const char
*option;
const StringInfo
*profile;
MagickBooleanType
have_color_info,
status;
MagickOffsetType
scene;
Memor... | cwe | CWE-190 | Unknown |
void BrowserEventRouter::ExtensionActionExecuted(
Profile* profile,
const ExtensionAction& extension_action,
WebContents* web_contents) {
const char* event_name = NULL;
switch (extension_action.action_type()) {
case Extension::ActionInfo::TYPE_BROWSER:
event_name = "browserAction.onClicked";
... | cwe | CWE-264 | C/C++ |
/*
* wildmidi_lib.c -- Midi Wavetable Processing library
*
* Copyright (C) WildMIDI Developers 2001-2016
*
* This file is part of WildMIDI.
*
* WildMIDI is free software: you can redistribute and/or modify the player
* under the terms of the GNU General Public License and you can redistribute
* and/or modify t... | cwe | CWE-119 | C/C++ |
return { kind: 'redirect', to: `/signin?from=${encodeURIComponent(req!.url!)}` };
}
}; | cwe | CWE-79 | JavaScript |
int dtls1_enc(SSL *s, int send)
{
SSL3_RECORD *rec;
EVP_CIPHER_CTX *ds;
unsigned long l;
int bs,i,j,k,mac_size=0;
const EVP_CIPHER *enc;
if (send)
{
if (EVP_MD_CTX_md(s->write_hash))
{
mac_size=EVP_MD_CTX_size(s->write_hash);
if (mac_size < 0)
return -1;
}
ds=s->enc_write_ctx;
rec= &(s->... | cwe | CWE-310 | Unknown |
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: https://www.espocrm.com
*
* EspoCRM is free software: you can redistribute i... | cwe | CWE-79 | JavaScript |
function handleRequest(req, res) {
// express puts content after first slash into 0 index element
const path = req.params.path + req.params[0];
const attributeIds = sql.getColumn("SELECT attributeId FROM attributes WHERE isDeleted = 0 AND type = 'label' AND name IN ('customRequestHandler', 'customResource... | cwe | CWE-79 | JavaScript |
ldns_rr_new_frm_str_internal(ldns_rr **newrr, const char *str,
uint32_t default_ttl, const ldns_rdf *origin,
ldns_rdf **prev, bool question)
{
ldns_rr *new;
const ldns_rr_descriptor *desc;
ldns_rr_type rr_type;
ldns_buffer *rr_buf = NULL;
ldns_buffer *rd_buf = NULL;
uint32_t ttl_val;
char *owner... | cwe | CWE-125 | C/C++ |
PHP_FUNCTION(bcpowmod)
{
char *left, *right, *modulous;
int left_len, right_len, modulous_len;
bc_num first, second, mod, result;
long scale = BCG(bc_precision);
int scale_int;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss|l", &left, &left_len, &right, &right_len, &modulous, &modulous_len, &scale) ==... | cwe | CWE-20 | Unknown |
int ssl_parse_serverhello_tlsext(SSL *s, unsigned char **p, unsigned char *d,
int n, int *al)
{
unsigned short length;
unsigned short type;
unsigned short size;
unsigned char *data = *p;
int tlsext_servername = 0;
int renegotiate_seen = 0;
# ifndef OPENSSL_NO_NE... | cwe | CWE-190 | Unknown |
Try<JWT, JWTError> JWT::parse(const string& token, const string& secret)
{
const vector<string> components = strings::split(token, ".");
if (components.size() != 3) {
return JWTError(
"Expected 3 components in token, got " + stringify(components.size()),
JWTError::Type::INVALID_TOKEN);
}
T... | cwe | CWE-200 | C/C++ |
package eu.hinsch.spring.boot.actuator.logview;
import freemarker.template.Configuration;
import freemarker.template.TemplateException;
import org.apache.commons.io.IOUtils;
import org.springframework.boot.actuate.endpoint.Endpoint;
import org.springframework.boot.actuate.endpoint.mvc.MvcEndpoint;
import org.springfra... | cwe | CWE-22 | Java |
package com.salesmanager.core.business.services.common.generic;
import java.io.Serializable;
import java.util.List;
import com.salesmanager.core.business.exception.ServiceException;
/**
* <p>Service racine pour la gestion des entités.</p>
*
* @param <T> type d'entité
*/
public interface SalesManagerEntityServic... | cwe | CWE-639 | Java |
def __call__(self, env, start_response):
try:
# Validate the method
method = env["REQUEST_METHOD"].upper()
if method != "POST":
raise HTTPException(405, "Method not allowed (%s)." % method)
# Parse the request
try:
leng... | cwe | CWE-20 | Python |
vlv_copy_down_controls(TALLOC_CTX *mem_ctx, struct ldb_control **controls)
{
struct ldb_control **new_controls;
unsigned int i, j, num_ctrls;
if (controls == NULL) {
return NULL;
}
for (num_ctrls = 0; controls[num_ctrls]; num_ctrls++);
new_controls = talloc_array(mem_ctx, struct ldb_control *, num_ctrls);
i... | cwe | CWE-416 | Unknown |
public function scopeSearch(Builder $query, array $search = [])
{
if (empty($search)) {
return $query;
}
if (!array_intersect(array_keys($search), $this->searchable)) {
return $query;
}
return $query->where($search);
} | cwe | CWE-287 | PHP |
'use strict';
const Mailer = require('./mailer');
const shared = require('./shared');
const SMTPPool = require('./smtp-pool');
const SMTPTransport = require('./smtp-transport');
const SendmailTransport = require('./sendmail-transport');
const StreamTransport = require('./stream-transport');
const JSONTransport = requi... | cwe | CWE-74 | Java |
// Copyright 2014 The Gogs Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package form
import (
"net/url"
"strings"
"github.com/go-macaron/binding"
"github.com/unknwon/com"
"gopkg.in/macaron.v1"
"gogs.io/gogs/internal/conf"... | cwe | CWE-918 | Go |
multi_process_incoming_link(struct multi_context *m, struct multi_instance *instance, const unsigned int mpp_flags)
{
struct gc_arena gc = gc_new();
struct context *c;
struct mroute_addr src, dest;
unsigned int mroute_flags;
struct multi_instance *mi;
bool ret = true;
bool floated = false;
... | cwe | CWE-476 | C/C++ |
static int tty_open(struct inode *inode, struct file *filp)
{
struct tty_struct *tty = NULL;
int noctty, retval;
struct tty_driver *driver;
int index;
dev_t device = inode->i_rdev;
unsigned saved_flags = filp->f_flags;
nonseekable_open(inode, filp);
retry_open:
noctty = filp->f_flags & O_NOCTTY;
index = -1;... | cwe | CWE-703 | C/C++ |
static void handle_PORT(ctrl_t *ctrl, char *str)
{
int a, b, c, d, e, f;
char addr[INET_ADDRSTRLEN];
struct sockaddr_in sin;
if (ctrl->data_sd > 0) {
uev_io_stop(&ctrl->data_watcher);
close(ctrl->data_sd);
ctrl->data_sd = -1;
}
/* Convert PORT command's argument to IP address + port */
sscanf(str, "%d,%d... | cwe | CWE-787 | C/C++ |
/*
* The Python Imaging Library.
* $Id: //modules/pil/libImaging/TiffDecode.c#1 $
*
* LibTiff-based Group3 and Group4 decoder
*
*
* started modding to use non-private tiff functions to port to libtiff 4.x
* eds 3/12/12
*
*/
#include "Imaging.h"
#ifdef HAVE_LIBTIFF
#ifndef uint
#define uint uint32
#endif
#... | cwe | CWE-125 | Python |
void Compute(OpKernelContext* context) override {
const auto& input = context->input(0);
auto flat_in = input.flat<tstring>();
int fixed_length;
const auto& length_input = context->input(1);
OP_REQUIRES(context, TensorShapeUtils::IsScalar(length_input.shape()),
errors::InvalidArgume... | cwe | CWE-665 | C/C++ |
TfLiteStatus ReluPrepare(TfLiteContext* context, TfLiteNode* node) {
ReluOpData* data = reinterpret_cast<ReluOpData*>(node->user_data);
TF_LITE_ENSURE_EQ(context, NumInputs(node), 1);
TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1);
const TfLiteTensor* input = GetInput(context, node, 0);
TfLiteTensor* output ... | cwe | CWE-787 | C/C++ |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may n... | cwe | CWE-668 | Java |
/* jshint unused: false */
// eslint-disable-next-line no-unused-vars
/* global window, $, Backbone, document, d3, ReactDOM, React */
/* global arangoHelper, btoa, atob, _, frontendConfig */
(function () {
'use strict';
let isCurrentCoordinator = false;
window.Router = Backbone.Router.extend({
toUpdate: [],... | cwe | CWE-918 | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.