code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
Status ImmutableExecutorState::BuildControlFlowInfo(const Graph* g,
ControlFlowInfo* cf_info) {
const int num_nodes = g->num_node_ids();
cf_info->frame_names.resize(num_nodes);
std::vector<Node*> parent_nodes;
parent_nodes.resize(num_nodes);
std::vector<bool... | cwe | CWE-476 | Unknown |
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
OpData* op_data = reinterpret_cast<OpData*>(node->user_data);
const int scratch_tensor_index = op_data->scratch_tensor_index;
// Check we have all the inputs and outputs we need.
bool is_layer_norm_lstm = false;
if (node->inputs->size == 24) {
... | cwe | CWE-787 | C/C++ |
static ssize_t valid_zones_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct memory_block *mem = to_memory_block(dev);
unsigned long start_pfn = section_nr_to_pfn(mem->start_section_nr);
unsigned long nr_pages = PAGES_PER_SECTION * sections_per_block;
struct zone *default_zone;
int ni... | cwe | CWE-787 | Unknown |
package certs
import (
"bytes"
"crypto"
"crypto/ecdsa"
"crypto/rand"
"crypto/rsa"
"crypto/sha256"
"crypto/tls"
"crypto/x509"
"crypto/x509/pkix"
"encoding/hex"
"encoding/pem"
"errors"
"io/ioutil"
"net/http"
"strings"
"time"
cache "github.com/pmylund/go-cache"
"github.com/sirupsen/logrus"
)
// Storag... | cwe | CWE-287 | Go |
static MagickBooleanType WritePDFImage(const ImageInfo *image_info,Image *image,
ExceptionInfo *exception)
{
#define CFormat "/Filter [ /%s ]\n"
#define ObjectsPerImage 14
DisableMSCWarning(4310)
static const char
XMPProfile[]=
{
"<?xpacket begin=\"%s\" id=\"W5M0MpCehiHzreSzNTczkc9d\"?>\n"
"<... | cwe | CWE-617 | C/C++ |
static ssize_t fuse_dev_splice_write(struct pipe_inode_info *pipe,
struct file *out, loff_t *ppos,
size_t len, unsigned int flags)
{
unsigned nbuf;
unsigned idx;
struct pipe_buffer *bufs;
struct fuse_copy_state cs;
struct fuse_dev *fud;
size_t rem;
ssize_t ret;
fud = fuse_get_dev(out);
if (!... | cwe | CWE-416 | Unknown |
def get_socket(self):
if self.use_ssl:
cert_path = os.path.join(self.config_path, 'certs', self.host)
if not os.path.exists(cert_path):
is_new = True
s = self.get_simple_socket()
if s is None:
return
# tr... | cwe | CWE-327 | Python |
from __future__ import absolute_import, division, unicode_literals
from six import text_type
import re
from ..constants import voidElements, booleanAttributes, spaceCharacters
from ..constants import rcdataElements, entities, xmlEntities
from .. import utils
from xml.sax.saxutils import escape
spaceCharacters = "".j... | cwe | CWE-79 | Python |
def cluster_status_remote(params, request, session)
if not allowed_for_local_cluster(session, Permissions::READ)
return 403, 'Permission denied'
end
cluster_name = $cluster_name
# If node is not in a cluster, return empty data
if not cluster_name or cluster_name.empty?
overview = {
:cluster_nam... | cwe | CWE-384 | Ruby |
void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc,
int length, int offset, int total_size)
{
struct oz_port *port = hport;
struct urb *urb;
int err = 0;
oz_dbg(ON, "oz_hcd_get_desc_cnf length = %d offs = %d tot_size = %d\n",
length, offset, total_size);
urb = oz_find_urb_by... | cwe | CWE-189 | C/C++ |
package svg
import (
"bytes"
"fmt"
"io"
"strings"
nanoid "github.com/matoous/go-nanoid/v2"
"github.com/tdewolff/parse/v2"
"github.com/tdewolff/parse/v2/xml"
"github.com/imgproxy/imgproxy/v3/imagedata"
)
var feDropShadowName = []byte("feDropShadow")
const feDropShadowTemplate = `
<feMerge result="dsin-%[1]... | cwe | CWE-79 | Go |
rsa_compute_root_tr(const struct rsa_public_key *pub,
const struct rsa_private_key *key,
void *random_ctx, nettle_random_func *random,
mpz_t x, const mpz_t m)
{
int res;
mpz_t t, mb, xb, ri;
/* mpz_powm_sec handles only odd moduli. If p, q or n is even, the
key is invalid and rejected by r... | cwe | CWE-20 | Unknown |
function(q){q&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));c.init()};var l=EditorUi.prototype.createFormat;EditorUi.prototype.createFormat=function(c){var e=l.apply(this,arguments);this.editor.graph.addListener("viewStateChanged",mxUtils.bind(this,function(g){this.editor.graph.isSelectionEmp... | cwe | CWE-20 | JavaScript |
do_core_note(struct magic_set *ms, unsigned char *nbuf, uint32_t type,
int swap, uint32_t namesz, uint32_t descsz,
size_t noff, size_t doff, int *flags, size_t size, int clazz)
{
#ifdef ELFCORE
int os_style = -1;
/*
* Sigh. The 2.0.36 kernel in Debian 2.1, at
* least, doesn't correctly implement name
*... | cwe | CWE-125 | Unknown |
this.complete = function (result) {
if (resultsBuffer.length) {
socket.emit('result', resultsBuffer)
resultsBuffer = []
}
socket.emit('complete', result || {})
if (this.config.clearContext) {
navigateContextTo('about:blank')
} else {
self.updater.updateTestStatus('complete')... | cwe | CWE-601 | JavaScript |
static int hls_slice_header(HEVCContext *s)
{
GetBitContext *gb = &s->HEVClc->gb;
SliceHeader *sh = &s->sh;
int i, ret;
// Coded parameters
sh->first_slice_in_pic_flag = get_bits1(gb);
if ((IS_IDR(s) || IS_BLA(s)) && sh->first_slice_in_pic_flag) {
s->seq_decode = (s->seq_decode + 1) &... | cwe | CWE-476 | Unknown |
e_ews_autodiscover_ws_url (ESource *source,
CamelEwsSettings *settings,
const gchar *email_address,
const gchar *password,
GCancellable *cancellable,
GAsyncReadyCallback callback,
... | cwe | CWE-295 | Unknown |
function html_show_tabs_left() {
global $config, $tabs_left;
if (is_realm_allowed(8)) {
$show_console_tab = true;
} else {
$show_console_tab = false;
}
if (get_selected_theme() == 'classic') {
if ($show_console_tab == true) {
?><a <?php print (is_console_page(get_current_page()) ? " id='maintab-anchor" ... | cwe | CWE-79 | PHP |
/**
* 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 |
static int stellaris_enet_init(SysBusDevice *sbd)
{
DeviceState *dev = DEVICE(sbd);
stellaris_enet_state *s = STELLARIS_ENET(dev);
memory_region_init_io(&s->mmio, OBJECT(s), &stellaris_enet_ops, s,
"stellaris_enet", 0x1000);
sysbus_init_mmio(sbd, &s->mmio);
sysbus_init_irq... | cwe | CWE-119 | Unknown |
onIgnoreTagAttr(tag, name, value) {
const forTag = allowList.attrList[tag];
if (forTag) {
const forAttr = forTag[name];
if (
(forAttr &&
(forAttr.indexOf("*") !== -1 || forAttr.indexOf(value) !== -1)) ||
(name.indexOf("data-") === 0 && forTag["data-*"]) ||
... | cwe | CWE-79 | JavaScript |
xmlSchemaPSimpleTypeErr(xmlSchemaParserCtxtPtr ctxt,
xmlParserErrors error,
xmlSchemaBasicItemPtr ownerItem ATTRIBUTE_UNUSED,
xmlNodePtr node,
xmlSchemaTypePtr type,
const char *expected,
const xmlChar *value,
const char *message,
const xmlChar *str1,
const xmlChar *str2)
{
xmlChar *msg =... | cwe | CWE-134 | Unknown |
long keyctl_set_reqkey_keyring(int reqkey_defl)
{
struct cred *new;
int ret, old_setting;
old_setting = current_cred_xxx(jit_keyring);
if (reqkey_defl == KEY_REQKEY_DEFL_NO_CHANGE)
return old_setting;
new = prepare_creds();
if (!new)
return -ENOMEM;
switch (reqkey_defl) {
case KEY_REQKEY_DEFL_THREAD_KEY... | cwe | CWE-404 | C/C++ |
bool __skb_flow_dissect(const struct sk_buff *skb,
struct flow_dissector *flow_dissector,
void *target_container,
void *data, __be16 proto, int nhoff, int hlen)
{
struct flow_dissector_key_control *key_control;
struct flow_dissector_key_basic *key_basic;
struct flow_dissector_key_addrs *key_addrs;
struct f... | cwe | CWE-20 | C/C++ |
int ntlm_read_message_fields_buffer(wStream* s, NTLM_MESSAGE_FIELDS* fields)
{
if (fields->Len > 0)
{
if ((fields->BufferOffset + fields->Len) > Stream_Length(s))
return -1;
fields->Buffer = (PBYTE) malloc(fields->Len);
if (!fields->Buffer)
return -1;
Stream_SetPosition(s, fields->BufferOffset)... | cwe | CWE-125 | C/C++ |
parseAssociate(unsigned char *buf, unsigned long pduLength,
PRV_ASSOCIATEPDU * assoc)
{
OFCondition cond = EC_Normal;
unsigned char
type;
unsigned long
itemLength;
PRV_PRESENTATIONCONTEXTITEM
* context;
(void) memset(assoc, 0, sizeof(*assoc));
if ((assoc->... | cwe | CWE-401 | C/C++ |
TIFFFlushData1(TIFF* tif)
{
if (tif->tif_rawcc > 0 && tif->tif_flags & TIFF_BUF4WRITE ) {
if (!isFillOrder(tif, tif->tif_dir.td_fillorder) &&
(tif->tif_flags & TIFF_NOBITREV) == 0)
TIFFReverseBits((uint8*)tif->tif_rawdata,
tif->tif_rawcc);
if (!TIFFAppendToStrip(tif,
isTiled(tif) ? tif->tif... | cwe | CWE-787 | C/C++ |
import io
import os
import re
from setuptools import find_packages, setup
with io.open("flask_appbuilder/__init__.py", "rt", encoding="utf8") as f:
version = re.search(r"__version__ = \"(.*?)\"", f.read()).group(1)
def fpath(name):
return os.path.join(os.path.dirname(__file__), name)
def read(fname):
... | cwe | CWE-601 | Python |
...(ctx.input.cookiecutterCompat
? {}
: {
tags: {
// TODO(mtlewis/orkohunter): Document Why we are changing the literals? Not here, but on scaffolder docs. ADR?
variableStart: '${{',
variableEnd: '}}',
},
}),
... | cwe | CWE-22 | JavaScript |
/* 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-122 | C/C++ |
static int jas_icclut8_input(jas_iccattrval_t *attrval, jas_stream_t *in,
int cnt)
{
int i;
int j;
int clutsize;
jas_icclut8_t *lut8 = &attrval->data.lut8;
lut8->clut = 0;
lut8->intabs = 0;
lut8->intabsbuf = 0;
lut8->outtabs = 0;
lut8->outtabsbuf = 0;
if (jas_iccgetuint8(in, &lut8->numinchans) ||
jas_icc... | cwe | CWE-189 | Unknown |
this.window.setLocation=function(q,v){var x=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight;q=Math.max(0,Math.min(q,(window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth)-this.table.clientWidth));v=Math.max(0,Math.min(v,x-this.table.clientHeight-("1"==... | cwe | CWE-20 | JavaScript |
bool HeapAllocator::backingShrink(void* address,
size_t quantizedCurrentSize,
size_t quantizedShrunkSize) {
if (!address || quantizedShrunkSize == quantizedCurrentSize)
return true;
ASSERT(quantizedShrunkSize < quantizedCurrentSize);
Thread... | cwe | CWE-787 | C/C++ |
asn1_get_bit_der (const unsigned char *der, int der_len,
int *ret_len, unsigned char *str, int str_size,
int *bit_len)
{
int len_len = 0, len_byte;
if (der_len <= 0)
return ASN1_GENERIC_ERROR;
len_byte = asn1_get_length_der (der, der_len, &len_len) - 1;
if (len_byte < 0)
return ASN1_DER_ERROR;
... | cwe | CWE-476 | Unknown |
void __init aarp_proto_init(void)
{
aarp_dl = register_snap_client(aarp_snap_id, aarp_rcv);
if (!aarp_dl)
printk(KERN_CRIT "Unable to register AARP with SNAP.\n");
timer_setup(&aarp_timer, aarp_expire_timeout, 0);
aarp_timer.expires = jiffies + sysctl_aarp_expiry_time;
add_timer(&aarp_timer);
register_netdevic... | cwe | CWE-476 | C/C++ |
static RzList *entries(RzBinFile *bf) {
if (!bf) {
return NULL;
}
LuacBinInfo *bin_info_obj = GET_INTERNAL_BIN_INFO_OBJ(bf);
if (!bin_info_obj) {
return NULL;
}
return bin_info_obj->entry_list;
} | cwe | CWE-787 | Unknown |
def reset_users
Log.add_info(request, params.inspect)
count = 0
unless params[:check_user].nil?
params[:check_user].each do |user_id, value|
if value == '1'
begin
Research.destroy_all('user_id=' + user_id.to_s)
count += 1
rescue => evar
... | cwe | CWE-89 | Ruby |
static int calcstepsizes(uint_fast16_t refstepsize, int numrlvls,
uint_fast16_t *stepsizes)
{
int bandno;
int numbands;
uint_fast16_t expn;
uint_fast16_t mant;
expn = JPC_QCX_GETEXPN(refstepsize);
mant = JPC_QCX_GETMANT(refstepsize);
numbands = 3 * numrlvls - 2;
for (bandno = 0; bandno < numbands; ++bandno) {... | cwe | CWE-617 | Unknown |
/*!
Copyright (c) REBUILD <https://getrebuild.com/> and/or its owners. All rights reserved.
rebuild is dual-licensed under commercial and open source licenses (GPLv3).
See LICENSE and COMMERCIAL in the project root for license information.
*/
package com.rebuild.utils;
import cn.devezhao.commons.ObjectUtils;
import ... | cwe | CWE-89 | Java |
/* ADMesh -- process triangulated solid meshes
* Copyright (C) 1995, 1996 Anthony D. Martin <amartin@engr.csulb.edu>
* Copyright (C) 2013, 2014 several contributors, see AUTHORS
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as... | cwe | CWE-129 | C/C++ |
mark_op_resolved (FlatpakTransactionOperation *op,
const char *commit,
GFile *sideload_path,
GBytes *metadata,
GBytes *old_metadata)
{
g_debug ("marking op %s:%s res... | cwe | CWE-269 | C/C++ |
_XimProtoSetICValues(
XIC xic,
XIMArg *arg)
{
Xic ic = (Xic)xic;
Xim im = (Xim)ic->core.im;
XimDefICValues ic_values;
INT16 len;
CARD16 *buf_s;
char *tmp;
CARD32 tmp_buf32[BUFSIZE/4];
char *tmp_buf = (char *)tmp_buf32;
char *buf;
int buf_size;
ch... | cwe | CWE-190 | Unknown |
static VTermState *vterm_state_new(VTerm *vt)
{
VTermState *state = vterm_allocator_malloc(vt, sizeof(VTermState));
state->vt = vt;
state->rows = vt->rows;
state->cols = vt->cols;
state->mouse_col = 0;
state->mouse_row = 0;
state->mouse_buttons = 0;
state->mouse_protocol = MOUSE_X10;
stat... | cwe | CWE-476 | Unknown |
static int dv_extract_audio_info(DVDemuxContext* c, uint8_t* frame)
{
const uint8_t* as_pack;
int freq, stype, smpls, quant, i, ach;
as_pack = dv_extract_pack(frame, dv_audio_source);
if (!as_pack || !c->sys) { /* No audio ? */
c->ach = 0;
return 0;
}
smpls = as_pack[1] & 0... | cwe | CWE-20 | Unknown |
kg_unseal_v1(context, minor_status, ctx, ptr, bodysize, message_buffer,
conf_state, qop_state, toktype)
krb5_context context;
OM_uint32 *minor_status;
krb5_gss_ctx_id_rec *ctx;
unsigned char *ptr;
int bodysize;
gss_buffer_t message_buffer;
int *conf_state;
gss_qop_t *qop_sta... | cwe | CWE-125 | Unknown |
int asn1_ex_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len,
int utype, char *free_cont, const ASN1_ITEM *it)
{
ASN1_VALUE **opval = NULL;
ASN1_STRING *stmp;
ASN1_TYPE *typ = NULL;
int ret = 0;
const ASN1_PRIMITIVE_FUNCS *pf;
ASN1_INTEGER **tint;
pf = it->funcs;
... | cwe | CWE-119 | Unknown |
gdImagePtr gdImageCreateTrueColor (int sx, int sy)
{
int i;
gdImagePtr im;
if (overflow2(sx, sy)) {
return NULL;
}
if (overflow2(sizeof(unsigned char *), sy)) {
return NULL;
}
if (overflow2(sizeof(int) + sizeof(unsigned char), sx * sy)) {
return NULL;
}
// Check for OOM before doing a ... | cwe | CWE-22 | 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-755 | Python |
from django.contrib import admin
import import_export.widgets as widgets
from import_export.admin import ImportExportModelAdmin
from import_export.fields import Field
from import_export.resources import ModelResource
from build.models import Build
from company.models import Company, SupplierPart
from order.models imp... | cwe | CWE-79 | Python |
constructor(autoSingletons, debug) {
this.debugEnabled = (typeof debug === 'boolean' && debug === true);
this.autoInitSingletons = (typeof autoSingletons === 'boolean' && autoSingletons === false);
this.plugins = {};
this.listeners = {};
this.foundBaseUrl = null;
this.dom... | cwe | CWE-1321 | JavaScript |
TfLiteStatus Subgraph::Invoke() {
if (!consistent_) {
ReportError("Invoke called on model that is not consistent.");
return kTfLiteError;
}
TfLiteStatus status = kTfLiteOk;
if (state_ == kStateUninvokable) {
ReportError("Invoke called on model that is not ready.");
return kTfLiteError;
} else... | cwe | CWE-476 | C/C++ |
static int cirrus_bitblt_solidfill(CirrusVGAState *s, int blt_rop)
{
cirrus_fill_t rop_func;
if (blit_is_unsafe(s, true)) {
return 0;
}
rop_func = cirrus_fill[rop_to_index[blt_rop]][s->cirrus_blt_pixelwidth - 1];
rop_func(s, s->vga.vram_ptr + s->cirrus_blt_dstaddr,
s->cirrus_bl... | cwe | CWE-119 | Unknown |
/*
* Copyright 2019-present Facebook, Inc.
*
* 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 Lic... | cwe | CWE-755 | Go |
DECLAREcpFunc(cpSeparate2ContigByRow)
{
tsize_t scanlinesizein = TIFFScanlineSize(in);
tsize_t scanlinesizeout = TIFFScanlineSize(out);
tdata_t inbuf;
tdata_t outbuf;
register uint8 *inp, *outp;
register uint32 n;
uint32 row;
tsample_t s;
inbuf = _TIFFmalloc(scanlinesizein);
outbuf = _TIFFmalloc(scanli... | cwe | CWE-119 | C/C++ |
/*
+----------------------------------------------------------------------+
| HipHop for PHP |
+----------------------------------------------------------------------+
| Copyright (c) 2010-present Facebook, Inc. (http://www.facebook.com) |
+---------... | cwe | CWE-22 | C/C++ |
void * alloc_bottom(size_t size) {
byte * tmp = bottom;
bottom += size;
if (bottom > top) {new_chunk(); tmp = bottom; bottom += size;}
return tmp;
} | cwe | CWE-787 | C/C++ |
static int nfs_readlink_reply(unsigned char *pkt, unsigned len)
{
uint32_t *data;
char *path;
int rlen;
int ret;
ret = rpc_check_reply(pkt, 1);
if (ret)
return ret;
data = (uint32_t *)(pkt + sizeof(struct rpc_reply));
data++;
rlen = ntohl(net_read_uint32(data)); /* new path length */
data++;
... | cwe | CWE-787 | 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 |
"""
Functionality for dealing with dbkeys.
"""
#dbkeys read from disk using builds.txt
from galaxy.util import read_dbnames
from galaxy.util.json import loads
import os.path
class GenomeBuilds( object ):
default_value = "?"
default_name = "unspecified (?)"
def __init__( self, app, data_table_name="__dbke... | cwe | CWE-74 | Python |
static int btrfs_clone(struct inode *src, struct inode *inode,
const u64 off, const u64 olen, const u64 olen_aligned,
const u64 destoff, int no_time_update)
{
struct btrfs_root *root = BTRFS_I(inode)->root;
struct btrfs_path *path = NULL;
struct extent_buffer *leaf;
struct btrfs_trans_handle *tran... | cwe | CWE-200 | Unknown |
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2007 Novell, Inc.
* Copyright (C) 2008 Red Hat, Inc.
*
* 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 Fou... | cwe | CWE-835 | C/C++ |
static Image *ReadPIXImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
Image
*image;
IndexPacket
index;
MagickBooleanType
status;
Quantum
blue,
green,
red;
register IndexPacket
*indexes;
register ssize_t
x;
register PixelPacket
*q;
size_t
bits_p... | cwe | CWE-401 | Unknown |
/*
* . .o8 oooo
* .o8 "888 `888
* .o888oo oooo d8b oooo oooo .oooo888 .ooooo. .oooo.o 888 oooo
* 888 `888""8P `888 `888 d88' `888 d88' `88b d88( "8 888 .8P'
* 888 888 888 888 8... | cwe | CWE-79 | JavaScript |
bool move_huge_pmd(struct vm_area_struct *vma, unsigned long old_addr,
unsigned long new_addr, unsigned long old_end,
pmd_t *old_pmd, pmd_t *new_pmd, bool *need_flush)
{
spinlock_t *old_ptl, *new_ptl;
pmd_t pmd;
struct mm_struct *mm = vma->vm_mm;
bool force_flush = false;
if ((old_addr & ~HPAGE_PMD_MASK) ... | cwe | CWE-459 | Unknown |
$.fn.multiSelect=function(options){
multiSelectId++;
var settings = {
'createCallback':false,
'createText':false,
'title':this.attr('title'),
'checked':[],
'oncheck':false,
'onuncheck':false,
'minWidth': 'default;',
};
$.extend(settings,options);
$.each(this.children(),function(i,option){... | cwe | CWE-79 | JavaScript |
int hfsplus_find_cat(struct super_block *sb, u32 cnid,
struct hfs_find_data *fd)
{
hfsplus_cat_entry tmp;
int err;
u16 type;
hfsplus_cat_build_key(sb, fd->search_key, cnid, NULL);
err = hfs_brec_read(fd, &tmp, sizeof(hfsplus_cat_entry));
if (err)
return err;
type = be16_to_cpu(tmp.type);
if (type != ... | cwe | CWE-119 | Unknown |
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
TF_LITE_ENSURE_EQ(context, NumInputs(node), 2);
TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1);
// Check type and shape of the input tensor
const TfLiteTensor* input = GetInput(context, node, kInputTensor);
TF_LITE_ENSURE(context, NumDimension... | cwe | CWE-787 | C/C++ |
static int selinux_ptrace_traceme(struct task_struct *parent)
{
return avc_has_perm(&selinux_state,
task_sid_subj(parent), task_sid_obj(current),
SECCLASS_PROCESS, PROCESS__PTRACE, NULL);
} | cwe | CWE-416 | Unknown |
int use_env()
{
int indent;
size_t flags = 0;
json_t *json;
json_error_t error;
#ifdef _WIN32
/* On Windows, set stdout and stderr to binary mode to avoid
outputting DOS line terminators */
_setmode(_fileno(stdout), _O_BINARY);
_setmode(_fileno(stderr), _O_BINARY);
#endif
... | cwe | CWE-310 | C/C++ |
static bool __oom_reap_task_mm(struct task_struct *tsk, struct mm_struct *mm)
{
struct mmu_gather tlb;
struct vm_area_struct *vma;
bool ret = true;
/*
* We have to make sure to not race with the victim exit path
* and cause premature new oom victim selection:
* __oom_reap_task_mm exit_mm
* mmget_not_zer... | cwe | CWE-416 | C/C++ |
Pl_LZWDecoder::addToTable(unsigned char next)
{
unsigned int last_size = 0;
unsigned char const* last_data = 0;
unsigned char tmp[1];
if (this->last_code < 256)
{
tmp[0] = this->last_code;
last_data = tmp;
last_size = 1;
}
else if (this->last_code > 257)
{
unsigned int idx = this->l... | cwe | CWE-787 | Unknown |
import { cloneDeep } from "lodash/fp"
import { get } from "svelte/store"
import {
findAllMatchingComponents,
findComponent,
findComponentPath,
getComponentSettings,
} from "./componentUtils"
import { store } from "builderStore"
import {
queries as queriesStores,
tables as tablesStore,
roles as rolesStore,... | cwe | CWE-284 | JavaScript |
function setPopoverHtmlContent($enteredElement, content) {
content =
content ||
$enteredElement.attr("data-html-popover") ||
$enteredElement.attr("data-html-tooltip");
replaceHtmlContent($enteredElement, content);
} | cwe | CWE-79 | JavaScript |
/* Copyright JS Foundation and other contributors, http://js.foundation
*
* 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 r... | cwe | CWE-119 | C/C++ |
xmlDocPtr soap_xmlParseFile(const char *filename TSRMLS_DC)
{
xmlParserCtxtPtr ctxt = NULL;
xmlDocPtr ret;
zend_bool old_allow_url_fopen;
/*
xmlInitParser();
*/
old_allow_url_fopen = PG(allow_url_fopen);
PG(allow_url_fopen) = 1;
ctxt = xmlCreateFileParserCtxt(filename);
PG(allow_url_fopen) = old_allow_... | cwe | CWE-200 | C/C++ |
/*
* mm/rmap.c - physical to virtual reverse mappings
*
* Copyright 2001, Rik van Riel <riel@conectiva.com.br>
* Released under the General Public License (GPL).
*
* Simple, low overhead reverse mapping scheme.
* Please try to keep this thing as modular as possible.
*
* Provides methods for unmapping each kind... | cwe | CWE-416 | C/C++ |
static int mongo_cursor_get_more( mongo_cursor *cursor ) {
int res;
if( cursor->limit > 0 && cursor->seen >= cursor->limit ) {
cursor->err = MONGO_CURSOR_EXHAUSTED;
return MONGO_ERROR;
}
else if( ! cursor->reply ) {
cursor->err = MONGO_CURSOR_INVALID;
return MONGO_ERROR;... | cwe | CWE-190 | Unknown |
(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.3";EditorUi.compactUi="atlas"!=uiTheme;Editor.isDarkMode()&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);E... | cwe | CWE-20 | JavaScript |
/* Copyright (c) 2012-2013, University of Edinburgh.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* li... | cwe | CWE-22 | Java |
"geCommentActionLnk";mxUtils.write(da,P);Y.appendChild(da);mxEvent.addListener(da,"click",function(ha){O(ha,J);ha.preventDefault();mxEvent.consume(ha)});T.appendChild(Y);R&&(Y.style.display="none")}function W(){function P(Y){O.push(R);if(null!=Y.replies)for(var da=0;da<Y.replies.length;da++)R=R.nextSibling,P(Y.replies[... | cwe | CWE-20 | JavaScript |
static MagickBooleanType ProcessMSLScript(const ImageInfo *image_info,
Image **image,ExceptionInfo *exception)
{
char
message[MagickPathExtent];
Image
*msl_image;
int
status;
ssize_t
n;
MSLInfo
msl_info;
xmlSAXHandler
sax_modules;
xmlSAXHandlerPtr
sax_handler;
/*
... | cwe | CWE-772 | C/C++ |
const bootbox = require('bootbox');
const Requisition = require('../model/Requisition');
require('../services/Requisitions');
require('../services/Synchronize');
/**
* @author Alejandro Galue <agalue@opennms.org>
* @copyright 2014 The OpenNMS Group, Inc.
*/
(function() {
'use strict';
angular.module('onms-req... | cwe | CWE-79 | Java |
static Image *ReadWEBPImage(const ImageInfo *image_info,
ExceptionInfo *exception)
{
Image
*image;
int
webp_status;
MagickBooleanType
status;
register unsigned char
*p;
size_t
length;
ssize_t
count,
y;
unsigned char
header[12],
*stream;
WebPDecoderConfig
... | cwe | CWE-120 | C/C++ |
static js_Ast *bitxor(js_State *J, int notin)
{
js_Ast *a = bitand(J, notin);
while (jsP_accept(J, '^'))
a = EXP2(BITXOR, a, bitand(J, notin));
return a;
} | cwe | CWE-674 | Unknown |
var callback2 = function(docList, errorMsg, searchImportCats)
{
i0 = 0;
spinner.stop();
templates = docList;
searchImportCats = searchImportCats || {};
var importListsCount = 0;
for (var cat in searchImportCats)
{
importListsCount += searchImportCats[cat].length;
}
... | cwe | CWE-94 | JavaScript |
void DRW_TableEntry::parseCode(int code, dxfReader *reader){
switch (code) {
case 5:
handle = reader->getHandleString();
break;
case 330:
parentHandle = reader->getHandleString();
break;
case 2:
name = reader->getUtf8String();
break;
case 70:
f... | cwe | CWE-191 | Unknown |
static void close_all_connections(struct Curl_multi *multi)
{
struct connectdata *conn;
conn = Curl_conncache_find_first_connection(&multi->conn_cache);
while(conn) {
SIGPIPE_VARIABLE(pipe_st);
conn->data = multi->closure_handle;
sigpipe_ignore(conn->data, &pipe_st);
/* This will remove the conn... | cwe | CWE-416 | 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-617 | Python |
/*
* 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 |
function genIndex(path, content = '', router, depth) {
const tokens = window.marked.lexer(content);
const slugify = window.Docsify.slugify;
const index = {};
let slug;
tokens.forEach(token => {
if (token.type === 'heading' && token.depth <= depth) {
slug = router.toURL(path, { id: slugify(escapeHtm... | cwe | CWE-79 | JavaScript |
static int tcp_v6_send_synack(const struct sock *sk, struct dst_entry *dst,
struct flowi *fl,
struct request_sock *req,
struct tcp_fastopen_cookie *foc,
bool attach_req)
{
struct inet_request_sock *ireq = inet_rsk(req);
struct ipv6_pinfo *np = inet6_sk(sk);
struct flowi6 *fl6 = &f... | cwe | CWE-416 | Unknown |
/* eslint-disable no-unused-vars */
// eslint-disable-next-line no-undef
const socket = io();
var MouseSelectedText = false;
var MouseSelectedBox = false;
var loaded = false;
var questionPopupToRespond = false;
const Board1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
const Board2 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 11];
const Boa... | cwe | CWE-384 | JavaScript |
TfLiteStatus EvalHybridPerChannel(TfLiteContext* context, TfLiteNode* node,
TfLiteDepthwiseConvParams* params,
OpData* data, const TfLiteTensor* input,
const TfLiteTensor* filter,
cons... | cwe | CWE-125 | C/C++ |
PKL_CommandLength(CMD_Request *r)
{
int type;
type = ntohs(r->command);
if (type < 0 || type >= N_REQUEST_TYPES) {
return 0;
} else {
switch (type) {
case REQ_NULL:
return offsetof(CMD_Request, data);
case REQ_ONLINE:
return offsetof(CMD_Request, data.online.EOR);
... | cwe | CWE-189 | Unknown |
static int md_require_https_maybe(request_rec *r)
{
const md_srv_conf_t *sc;
apr_uri_t uri;
const char *s;
int status;
if (opt_ssl_is_https
&& strncmp(WELL_KNOWN_PREFIX, r->parsed_uri.path, sizeof(WELL_KNOWN_PREFIX)-1)) {
sc = ap_get_module_config(r->server->module_con... | cwe | CWE-476 | Unknown |
void Scanner::lex_code_indented() {
const loc_t &loc = tok_loc();
tok = cur;
code:
#line 3086 "src/parse/lex.cc"
{
unsigned char yych;
if ((lim - cur) < 2) { if (!fill(2)) { error("unexpected end of input"); exit(1); } }
yych = (unsigned char)*cur;
if (yych <= '&') {
if (yych <= '\f') {
if (yych <= 0x... | cwe | CWE-787 | Unknown |
static void disk_seqf_stop(struct seq_file *seqf, void *v)
{
struct class_dev_iter *iter = seqf->private;
/* stop is called even after start failed :-( */
if (iter) {
class_dev_iter_exit(iter);
kfree(iter);
}
} | cwe | CWE-416 | C/C++ |
function e(H,F){F.innerHTML="";H=new Date(H.modifiedDate);var J=b.timeSince(H);null==J&&(J=mxResources.get("lessThanAMinute"));mxUtils.write(F,mxResources.get("timeAgo",
[J],"{1} ago"));F.setAttribute("title",H.toLocaleDateString()+" "+H.toLocaleTimeString())} | cwe | CWE-94 | JavaScript |
static int vnc_update_client(VncState *vs, int has_dirty, bool sync)
{
if (vs->need_update && vs->csock != -1) {
VncDisplay *vd = vs->vd;
VncJob *job;
int y;
int height, width;
int n = 0;
if (vs->output.offset && !vs->audio_cap && !vs->force_update)
/* ke... | cwe | CWE-125 | Unknown |
e_ews_config_utils_open_connection_for (ESource *source,
CamelEwsSettings *ews_settings,
const gchar *connect_url,
EEwsConfigUtilTryCredentialsFunc try_credentials_func,
gpointer user_data,
GCancellable *cancellable,
... | cwe | CWE-295 | Unknown |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.