code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
Status GetMatchingPaths(FileSystem* fs, Env* env, const string& pattern,
std::vector<string>* results) {
results->clear();
if (pattern.empty()) {
return Status::OK();
}
string fixed_prefix = pattern.substr(0, pattern.find_first_of("*?[\\"));
string eval_pattern = pattern;
string... | cwe | CWE-125 | C/C++ |
/************************************************************************
* 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 |
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 |
toggleExtensionState({ extensionId, state }) {
checkAuthentication(this)
const extension = Extensions.findOne({ _id: extensionId })
if (extension) {
Extensions.update({ _id: extension._id }, { $set: { isActive: state } })
return 'notifications.success'
}
return new Meteor.Error('Extensio... | cwe | CWE-285 | JavaScript |
Status AuthorizationManager::getBSONForRole(RoleGraph* graph,
const RoleName& roleName,
mutablebson::Element result) {
if (!graph->roleExists(roleName)) {
return Status(ErrorCodes::RoleNotFound,
mon... | cwe | CWE-863 | Unknown |
private int
mcopy(struct magic_set *ms, union VALUETYPE *p, int type, int indir,
const unsigned char *s, uint32_t offset, size_t nbytes, size_t linecnt)
{
/*
* Note: FILE_SEARCH and FILE_REGEX do not actually copy
* anything, but setup pointers into the source
*/
if (indir == 0) {
switch (type) {
case F... | cwe | CWE-399 | C/C++ |
/**
* Copyright (c) 2006-2017, JGraph Ltd
* Copyright (c) 2006-2017, Gaudenz Alder
*/
TrelloClient = function(editorUi)
{
DrawioClient.call(this, editorUi, 'tauth');
Trello.setKey(this.key);
};
// Extends DrawioClient
mxUtils.extend(TrelloClient, DrawioClient);
TrelloClient.prototype.key = (window.location.hostn... | cwe | CWE-94 | JavaScript |
isdn_net_addphone(isdn_net_ioctl_phone * phone)
{
isdn_net_dev *p = isdn_net_findif(phone->name);
isdn_net_phone *n;
if (p) {
if (!(n = kmalloc(sizeof(isdn_net_phone), GFP_KERNEL)))
return -ENOMEM;
strcpy(n->num, phone->phone);
n->next = p->local->phone[phone->outgoing & 1];
p->local->phone[phone->outgoi... | cwe | CWE-119 | Unknown |
static int send_sub_rect(VncState *vs, int x, int y, int w, int h)
{
uint32_t bg = 0, fg = 0;
int colors;
int ret = 0;
#ifdef CONFIG_VNC_JPEG
bool force_jpeg = false;
bool allow_jpeg = true;
#endif
if (!color_count_palette) {
color_count_palette = g_malloc(sizeof(VncPalette));
v... | cwe | CWE-401 | Unknown |
static av_cold int vqa_decode_init(AVCodecContext *avctx)
{
VqaContext *s = avctx->priv_data;
int i, j, codebook_index, ret;
s->avctx = avctx;
avctx->pix_fmt = AV_PIX_FMT_PAL8;
/* make sure the extradata made it */
if (s->avctx->extradata_size != VQA_HEADER_SIZE) {
av_log(s->avctx, AV_... | cwe | CWE-20 | C/C++ |
void StorageHandler::GetUsageAndQuota(
const String& origin,
std::unique_ptr<GetUsageAndQuotaCallback> callback) {
if (!process_)
return callback->sendFailure(Response::InternalError());
GURL origin_url(origin);
if (!origin_url.is_valid()) {
return callback->sendFailure(
Response::E... | cwe | CWE-20 | C/C++ |
"#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 |
static int cdc_ncm_bind(struct usbnet *dev, struct usb_interface *intf)
{
int ret;
/* MBIM backwards compatible function? */
if (cdc_ncm_select_altsetting(intf) != CDC_NCM_COMM_ALTSETTING_NCM)
return -ENODEV;
/* The NCM data altsetting is fixed, so we hard-coded it.
* Additionally, generic NCM devices are... | cwe | CWE-703 | C/C++ |
RList *r_bin_ne_get_symbols(r_bin_ne_obj_t *bin) {
RBinSymbol *sym;
ut16 off = bin->ne_header->ResidNamTable + bin->header_offset;
RList *symbols = r_list_newf (free);
if (!symbols) {
return NULL;
}
RList *entries = r_bin_ne_get_entrypoints (bin);
bool resident = true, first = true;
while (true) {
ut8 sz = ... | cwe | CWE-476 | C/C++ |
OMX_ERRORTYPE omx_venc::set_config(OMX_IN OMX_HANDLETYPE hComp,
OMX_IN OMX_INDEXTYPE configIndex,
OMX_IN OMX_PTR configData)
{
(void)hComp;
if (configData == NULL) {
DEBUG_PRINT_ERROR("ERROR: param is null");
return OMX_ErrorBadParameter;
}
if (m_state == OMX_StateInvalid) {
... | cwe | CWE-20 | C/C++ |
TfLiteStatus ComparisonPrepareCommon(TfLiteContext* context, TfLiteNode* node,
bool is_string_allowed) {
TF_LITE_ENSURE_EQ(context, NumInputs(node), 2);
TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1);
const TfLiteTensor* input1 = GetInput(context, node, kInputTensor1);
con... | cwe | CWE-125 | C/C++ |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% M M AAA TTTTT L AAA BBBB ... | cwe | CWE-119 | C/C++ |
static void adapter_stop(struct btd_adapter *adapter)
{
/* check pending requests */
reply_pending_requests(adapter);
cancel_passive_scanning(adapter);
remove_discovery_list(adapter);
discovery_cleanup(adapter, 0);
adapter->filtered_discovery = false;
adapter->no_scan_restart_delay = false;
g_free(adapter->... | cwe | CWE-862 | Unknown |
static int cbs_jpeg_split_fragment(CodedBitstreamContext *ctx,
CodedBitstreamFragment *frag,
int header)
{
AVBufferRef *data_ref;
uint8_t *data;
size_t data_size;
int unit, start, end, marker, next_start, next_marker;
int err, i, ... | cwe | CWE-787 | C/C++ |
export default function parseUrl(href, part, parseQuery) {
href = String(href);
var match = href.match(_parse_url_exp)
, map = _parse_url_map
, i, ret = false
;
if (match) {
if (part && part in map) {
ret = match[map[part]] || NIL;
if (part == 'pathnam... | cwe | CWE-20 | JavaScript |
/*
* Copyright (c) 2017, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
#include <pr... | cwe | CWE-416 | C/C++ |
#include "source/common/upstream/health_checker_impl.h"
#include <memory>
#include "envoy/config/core/v3/health_check.pb.h"
#include "envoy/data/core/v3/health_check_event.pb.h"
#include "envoy/server/health_checker_config.h"
#include "envoy/type/v3/http.pb.h"
#include "envoy/type/v3/range.pb.h"
#include "source/com... | cwe | CWE-476 | C/C++ |
def self.get_for_group(group_id, category=nil)
SqlHelper.validate_token([group_id, category])
con = []
con << "(group_id=#{group_id})"
con << "(category='#{category}')" unless category.nil?
settings = Setting.where(con.join(' and ')).to_a
return nil if settings.nil? or settings.empty?
h... | cwe | CWE-89 | Ruby |
label: $('#variableInput').val().replace(/_/g, " ")
};
newChart.series.push(newSeries);
$('#seriesPreview').append('- ' + newSeries.label + str + '<br/>');
newChart.nodes.push(serie);
$('#variableInput').val('');
$('input[name="differentialValue"]').prop('checked', true);... | cwe | CWE-79 | JavaScript |
static int replace_cmd(void) {
char n[MAX_FNAME], envstr[MAX_ENVSTR];
FILE *tmp;
int ch, eof, fd;
int error = 0;
entry *e;
uid_t file_owner;
char **envp;
char *safename;
safename = host_specific_filename("#tmp", "XXXXXXXXXX");
if (!safename || !glue_strings(TempFilename, sizeof TempFilename, SPOOL_DIR,
s... | cwe | CWE-476 | Unknown |
int udf_get_filename(struct super_block *sb, uint8_t *sname, uint8_t *dname,
int flen)
{
struct ustr *filename, *unifilename;
int len = 0;
filename = kmalloc(sizeof(struct ustr), GFP_NOFS);
if (!filename)
return 0;
unifilename = kmalloc(sizeof(struct ustr), GFP_NOFS);
if (!unifilename)
goto out1... | cwe | CWE-17 | C/C++ |
def self.reminders(options={})
days = options[:days] || 7
project = options[:project] ? Project.find(options[:project]) : nil
tracker = options[:tracker] ? Tracker.find(options[:tracker]) : nil
target_version_id = options[:version] ? Version.named(options[:version]).pluck(:id) : nil
if options[:vers... | cwe | CWE-200 | Ruby |
static int cmd_info(void *data, const char *input) {
RCore *core = (RCore *) data;
bool newline = r_config_get_i (core->config, "scr.interactive");
RBinObject *o = r_bin_cur_object (core->bin);
RCoreFile *cf = core->file;
int i, va = core->io->va || core->io->debug;
int mode = 0; //R_CORE_BIN_SIMPLE;
int is_arra... | cwe | CWE-119 | Unknown |
public static function vulnerableExtensions(){
return '/^.*\.('.implode('|',["php","php5","php7","phar","phtml"]).')$/i';
} | cwe | CWE-434 | PHP |
void CairoOutputDev::beginString(GfxState *state, GooString *s)
{
int len = s->getLength();
if (needFontUpdate)
updateFont(state);
if (!currentFont)
return;
glyphs = (cairo_glyph_t *) gmalloc (len * sizeof (cairo_glyph_t));
glyphCount = 0;
} | cwe | CWE-189 | C/C++ |
// Copyright 2013 Unknown
//
// 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 writ... | cwe | CWE-22 | Go |
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software F... | cwe | CWE-120 | C/C++ |
save_config(
struct recvbuf *rbufp,
int restrict_mask
)
{
#ifdef SAVECONFIG
static const char savedconfig_eq[] = "savedconfig=";
char filespec[128];
char filename[128];
char fullpath[512];
char savedconfig[sizeof(savedconfig_eq) + sizeof(filename)];
time_t now;
int fd;
FILE *fptr;
int prc;
size_t reqlen;... | cwe | CWE-254 | C/C++ |
int ossl_rsaz_mod_exp_avx512_x2(BN_ULONG *res1,
const BN_ULONG *base1,
const BN_ULONG *exp1,
const BN_ULONG *m1,
const BN_ULONG *rr1,
BN_ULONG k0_1,
... | cwe | CWE-787 | Unknown |
def make_rs256_token(payload = nil)
payload = { sub: 'abc123' } if payload.nil?
JWT.encode payload, rsa_private_key, 'RS256', kid: jwks_kid
end | cwe | CWE-287 | Ruby |
long mkvparser::UnserializeFloat(IMkvReader* pReader, long long pos,
long long size_, double& result) {
assert(pReader);
assert(pos >= 0);
if ((size_ != 4) && (size_ != 8))
return E_FILE_FORMAT_INVALID;
const long size = static_cast<long>(size_);
unsigned char buf[8];
... | cwe | CWE-20 | C/C++ |
QPDF_Stream::replaceFilterData(QPDFObjectHandle const& filter,
QPDFObjectHandle const& decode_parms,
size_t length)
{
this->stream_dict.replaceOrRemoveKey("/Filter", filter);
this->stream_dict.replaceOrRemoveKey("/DecodeParms", decode_parms);
if (length == 0)
{
QTC::TC("qpdf"... | cwe | CWE-787 | Unknown |
static struct sk_buff **gre_gro_receive(struct sk_buff **head,
struct sk_buff *skb)
{
struct sk_buff **pp = NULL;
struct sk_buff *p;
const struct gre_base_hdr *greh;
unsigned int hlen, grehlen;
unsigned int off;
int flush = 1;
struct packet_offload *ptype;
__be16 type;
off = skb_gro_offset(skb);
hl... | cwe | CWE-400 | C/C++ |
/************************************************************************
* 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 |
ext_get_plugin(const char *name, const char *module, const char *revision)
{
uint16_t u;
assert(name);
assert(module);
for (u = 0; u < ext_plugins_count; u++) {
if (!strcmp(name, ext_plugins[u].name) &&
!strcmp(module, ext_plugins[u].module) &&
(!ext_plugins[u].... | cwe | CWE-252 | C/C++ |
DictionaryValue* ExtensionTabUtil::CreateTabValue(
const WebContents* contents,
TabStripModel* tab_strip,
int tab_index,
const Extension* extension) {
bool has_permission = extension && extension->HasAPIPermissionForTab(
GetTabId(contents), APIPermission::kTab);
return CreateTabValue(conten... | cwe | CWE-264 | C/C++ |
errfinish(int dummy,...)
{
ErrorData *edata = &errordata[errordata_stack_depth];
int elevel;
bool save_ImmediateInterruptOK;
MemoryContext oldcontext;
ErrorContextCallback *econtext;
recursion_depth++;
CHECK_STACK_DEPTH();
elevel = edata->elevel;
/*
* Ensure we can't get interrupted while performing er... | cwe | CWE-89 | Unknown |
var batteriesTable = $('#batteries-table').DataTable({
'order': [[1, 'asc']],
'columnDefs': [
{ 'orderable': false, 'targets': 0 },
{ 'searchable': false, "targets": 0 }
],
});
$('#batteries-table tbody').removeClass("d-none");
batteriesTable.columns.adjust().draw();
$("#search").on("keyup", Delay(function()
{... | cwe | CWE-79 | JavaScript |
/*
* Copyright (c) 1997 - 2008 Kungliga Tekniska Högskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
* Portions Copyright (c) 2009 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided th... | cwe | CWE-320 | C/C++ |
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#define DEBUG_TYPE "typeinference"
#include "hermes/Optimizer/Scalar/TypeInference.h"
#include "hermes/IR/Analysis.h"
#include "... | cwe | CWE-843 | C/C++ |
/*
* JBoss, Home of Professional Open Source.
* Copyright 2017 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* 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 Licen... | cwe | CWE-400 | Java |
folly::Optional<ErrorCode> HTTP2Codec::parseHeadersDecodeFrames(
const folly::Optional<http2::PriorityUpdate>& priority,
const folly::Optional<uint32_t>& promisedStream,
const folly::Optional<ExAttributes>& exAttributes,
std::unique_ptr<HTTPMessage>& msg) {
// decompress headers
Cursor headerCursor(... | cwe | CWE-400 | C/C++ |
/*
* linux/fs/nfs/callback.c
*
* Copyright (C) 2004 Trond Myklebust
*
* NFSv4 callback handling
*/
#include <linux/completion.h>
#include <linux/ip.h>
#include <linux/module.h>
#include <linux/sched/signal.h>
#include <linux/sunrpc/svc.h>
#include <linux/sunrpc/svcsock.h>
#include <linux/nfs_fs.h>
#include <linu... | cwe | CWE-404 | C/C++ |
static int ldb_kv_index_dn_attr(struct ldb_module *module,
struct ldb_kv_private *ldb_kv,
const char *attr,
struct ldb_dn *dn,
struct dn_list *list,
enum key_truncation *truncation)
{
struct ldb_context *ldb;
struct ldb_dn *key;
struct ldb_val val;
int ret;
ldb = ldb_module_get_ctx(module);
... | cwe | CWE-20 | C/C++ |
TfLiteStatus PopulateQuantizedLstmParams8x8_8(
TfLiteContext* context, TfLiteNode* node,
lstm_eval::IntegerLstmParameter* integer_lstm_param) {
// Get all tensors.
const TfLiteTensor* input = GetInput(context, node, kInputTensor);
const TfLiteTensor* input_to_input_weights =
GetOptionalInputTensor(c... | cwe | CWE-787 | Unknown |
int PackLinuxElf32::canUnpack()
{
if (super::canUnpack()) {
return true;
}
if (Elf32_Ehdr::ET_DYN==get_te16(&ehdri.e_type)) {
PackLinuxElf32help1(fi);
}
return false;
} | cwe | CWE-415 | C/C++ |
#include "source/common/conn_pool/conn_pool_base.h"
#include "source/common/common/assert.h"
#include "source/common/network/transport_socket_options_impl.h"
#include "source/common/runtime/runtime_features.h"
#include "source/common/stats/timespan_impl.h"
#include "source/common/upstream/upstream_impl.h"
namespace E... | cwe | CWE-674 | C/C++ |
void jas_matrix_clip(jas_matrix_t *matrix, jas_seqent_t minval, jas_seqent_t maxval)
{
int i;
int j;
jas_seqent_t v;
jas_seqent_t *rowstart;
jas_seqent_t *data;
int rowstep;
rowstep = jas_matrix_rowstep(matrix);
for (i = matrix->numrows_, rowstart = matrix->rows_[0]; i > 0; --i,
rowstart += rowstep) {
dat... | cwe | CWE-20 | 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-120 | Python |
duint32 dwgCompressor::longCompressionOffset(){
duint32 cont = 0;
duint8 ll = bufC[pos++];
while (ll == 0x00){
cont += 0xFF;
ll = bufC[pos++];
}
cont += ll;
return cont;
} | cwe | CWE-191 | Unknown |
error_t mqttSnClientSendUnsubscribe(MqttSnClientContext *context,
const char_t *topicName)
{
error_t error;
systime_t time;
uint16_t topicId;
MqttSnFlags flags;
//Initialize status code
error = NO_ERROR;
//Reset unused flags
flags.all = 0;
//Check whether a predefined topic ID has been ... | cwe | CWE-20 | C/C++ |
static int wdm_post_reset(struct usb_interface *intf)
{
struct wdm_device *desc = wdm_find_device(intf);
int rv;
clear_bit(WDM_RESETTING, &desc->flags);
rv = recover_from_urb_loss(desc);
mutex_unlock(&desc->wlock);
mutex_unlock(&desc->rlock);
return 0;
} | cwe | CWE-119 | Unknown |
'use strict'
const From = require('fastify-reply-from')
const WebSocket = require('ws')
const httpMethods = ['DELETE', 'GET', 'HEAD', 'PATCH', 'POST', 'PUT', 'OPTIONS']
function liftErrorCode (code) {
if (typeof code !== 'number') {
// Sometimes "close" event emits with a non-numeric value
return 1011
} ... | cwe | CWE-20 | JavaScript |
package user
import (
"context"
"encoding/json"
"time"
"golang.org/x/text/language"
"github.com/zitadel/zitadel/internal/crypto"
"github.com/zitadel/zitadel/internal/domain"
"github.com/zitadel/zitadel/internal/errors"
"github.com/zitadel/zitadel/internal/eventstore"
"github.com/zitadel/zitadel/internal/eve... | cwe | CWE-613 | Go |
/*
* Copyright (C) 2016 Southern Storm Software, Pty Ltd.
*
* 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-119 | Java |
int tls1_process_ticket(SSL *s, unsigned char *session_id, int len,
const unsigned char *limit, SSL_SESSION **ret)
{
/* Point after session ID in client hello */
const unsigned char *p = session_id + len;
unsigned short i;
*ret = NULL;
s->tlsext_ticket_expected = 0;
/*
... | cwe | CWE-190 | Unknown |
PackLinuxElf64::invert_pt_dynamic(Elf64_Dyn const *dynp)
{
if (dt_table[Elf64_Dyn::DT_NULL]) {
return; // not 1st time; do not change upx_dt_init
}
Elf64_Dyn const *const dynp0 = dynp;
unsigned ndx = 1+ 0;
if (dynp)
for (; ; ++ndx, ++dynp) {
upx_uint64_t const d_tag = get_te64(&... | cwe | CWE-476 | Unknown |
def node_unstandby(params, request, session)
if params[:name]
code, response = send_request_with_token(
session, params[:name], 'node_unstandby', true, {"node"=>params[:name]}
)
# data={"node"=>params[:name]} for backward compatibility with older versions of pcs/pcsd
else
if not allowed_for_lo... | cwe | CWE-384 | Ruby |
static void cgroup_pressure_release(struct kernfs_open_file *of)
{
struct cgroup_file_ctx *ctx = of->priv;
psi_trigger_replace(&ctx->psi.trigger, NULL);
} | cwe | CWE-416 | Unknown |
query: _.bind(this._queryCirclesAutocomplete, this),
id: function(circle) {
return circle.unique_id;
},
initSelection: function(element, callback) {
var val = $(element).val().trim();
if (val) {
var circleIds = val.split(','),
circles = [];
OCA.Circles.api.listCircles("a... | cwe | CWE-79 | JavaScript |
import axios from 'axios'
import Cookies from 'js-cookie'
import router from '../router'
import store from '../store'
const _axios = axios.create()
_axios.interceptors.request.use(
function (config) {
// Do something before request is sent
if (store.state.auth.isAuthenticated) {
config.headers['Accep... | cwe | CWE-305 | Python |
static Image *ReadSTEGANOImage(const ImageInfo *image_info,
ExceptionInfo *exception)
{
#define GetBit(alpha,i) MagickMin((((size_t) (alpha) >> (size_t) \
(i)) & 0x01),16)
#define SetBit(indexes,i,set) SetPixelIndex(indexes,((set) != 0 ? \
(size_t) GetPixelIndex(indexes) | (one << (size_t) (i)) : (size_t) \
Get... | cwe | CWE-120 | 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-617 | C/C++ |
func readTransfer(msg interface{}, r *bufio.Reader) (err error) {
t := &transferReader{RequestMethod: "GET"}
// Unify input
isResponse := false
switch rr := msg.(type) {
case *Response:
t.Header = rr.Header
t.StatusCode = rr.StatusCode
t.ProtoMajor = rr.ProtoMajor
t.ProtoMinor = rr.ProtoMinor
t.Close = ... | cwe | CWE-444 | Go |
TPMI_RH_ENDORSEMENT_Unmarshal(TPMI_RH_ENDORSEMENT *target, BYTE **buffer, INT32 *size, BOOL allowNull)
{
TPM_RC rc = TPM_RC_SUCCESS;
if (rc == TPM_RC_SUCCESS) {
rc = TPM_HANDLE_Unmarshal(target, buffer, size);
}
if (rc == TPM_RC_SUCCESS) {
switch (*target) {
case TPM_RH_ENDORSEMENT:
break;
... | cwe | CWE-787 | Unknown |
function isCleanHtml(content)
{
var events = 'onmousedown|onmousemove|onmmouseup|onmouseover|onmouseout|onload|onunload|onfocus|onblur|onchange';
events += '|onsubmit|ondblclick|onclick|onkeydown|onkeyup|onkeypress|onmouseenter|onmouseleave|onerror|onselect|onreset|onabort|ondragdrop|onresize|onactivate|onafterprin... | cwe | CWE-79 | JavaScript |
static bool ShouldAutofocus(const HTMLFormControlElement* element) {
if (!element->isConnected())
return false;
if (!element->IsAutofocusable())
return false;
Document& doc = element->GetDocument();
if (doc.IsSandboxed(WebSandboxFlags::kAutomaticFeatures)) {
doc.AddConsoleMessage(ConsoleMess... | cwe | CWE-843 | C/C++ |
void CoordinatorImpl::GetVmRegionsForHeapProfiler(
const std::vector<base::ProcessId>& pids,
GetVmRegionsForHeapProfilerCallback callback) {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
uint64_t dump_guid = ++next_dump_id_;
std::unique_ptr<QueuedVmRegionRequest> request =
std::make_unique<QueuedV... | cwe | CWE-787 | C/C++ |
static void ftrace_syscall_enter(void *data, struct pt_regs *regs, long id)
{
struct trace_array *tr = data;
struct ftrace_event_file *ftrace_file;
struct syscall_trace_enter *entry;
struct syscall_metadata *sys_data;
struct ring_buffer_event *event;
struct ring_buffer *buffer;
unsigned long irq_flags;
int pc;
... | cwe | CWE-476 | Unknown |
buildRawBchOnlyTx(config: configBuildBchSendTx) {
config.bchReceiverAddressArray.forEach(outputAddress => {
if (!bchaddr.isSlpAddress(outputAddress) && !bchaddr.isCashAddress(outputAddress))
throw new Error("Token receiver address not in SlpAddr or CashAddr format.");
});
... | cwe | CWE-20 | JavaScript |
static int rawv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
{
struct ipv6_txoptions opt_space;
DECLARE_SOCKADDR(struct sockaddr_in6 *, sin6, msg->msg_name);
struct in6_addr *daddr, *final_p, final;
struct inet_sock *inet = inet_sk(sk);
struct ipv6_pinfo *np = inet6_sk(sk);
struct raw6_sock *rp = raw... | cwe | CWE-416 | Unknown |
import dayjs from 'dayjs'
import utc from 'dayjs/plugin/utc'
import { FlowRouter } from 'meteor/ostrio:flow-router-extra'
import { saveAs } from 'file-saver'
import { NullXlsx } from '@neovici/nullxlsx'
import './dailytimetable.html'
import './pagination.js'
import './limitpicker.js'
import {
getGlobalSetting,
numb... | cwe | CWE-79 | JavaScript |
package common
import (
"os"
"path/filepath"
"strconv"
"time"
"github.com/sirupsen/logrus"
)
// Default service addresses and URLS of Argo CD internal services
const (
// DefaultRepoServerAddr is the gRPC address of the Argo CD repo server
DefaultRepoServerAddr = "argocd-repo-server:8081"
// DefaultDexServer... | cwe | CWE-863 | Go |
void ImageFetched(const ContentSuggestion::ID& id,
const GURL& url,
const base::string16& title,
const base::string16& text,
base::Time timeout_at,
const gfx::Image& image) {
if (!ShouldNotifyInState(app_status_liste... | cwe | CWE-399 | C/C++ |
PJ_DEF(pj_status_t) pjmedia_rtp_decode_rtp2(
pjmedia_rtp_session *ses,
const void *pkt, int pkt_len,
const pjmedia_rtp_hdr **hdr,
pjmedia_rtp_dec_hdr *dec_hdr,
const void **payload,
unsigned *payloadlen)
{
int offset;
PJ_UNUSED_ARG(ses);
/* Assume RTP ... | cwe | CWE-125 | Unknown |
async def on_send_leave_request(
self, origin: str, content: JsonDict, room_id: str | cwe | CWE-400 | Python |
/**
* Copyright (c) 2006-2021, JGraph Ltd
* Copyright (c) 2006-2021, draw.io AG
*/
// urlParams is null when used for embedding
window.urlParams = window.urlParams || {};
// isLocalStorage controls access to local storage
window.isLocalStorage = window.isLocalStorage || false;
// Disables loading settings in conf... | cwe | CWE-78 | JavaScript |
/** @file mat5.c
* Matlab MAT version 5 file functions
* @ingroup MAT
*/
/*
* Copyright (c) 2005-2019, Christopher C. Hulbert
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redis... | cwe | CWE-190 | C/C++ |
xmlParseElementMixedContentDecl(xmlParserCtxtPtr ctxt, int inputchk) {
xmlElementContentPtr ret = NULL, cur = NULL, n;
const xmlChar *elem = NULL;
GROW;
if (CMP7(CUR_PTR, '#', 'P', 'C', 'D', 'A', 'T', 'A')) {
SKIP(7);
SKIP_BLANKS;
SHRINK;
if (RAW == ')') {
if ((ctxt->validate) && (ctxt->input-... | cwe | CWE-119 | C/C++ |
aa&&(la=pa[ca],null==la&&(la={},pa[ca]=la),ca=la[aa],null==ca&&(ca=[],la[aa]=ca),ca.push(na))}ia=ia.nextSibling}G(ya,fa,wa)}})}function I(ia){v&&(Aa.scrollTop=0,ea.innerHTML="",Ha.spin(ea),U=!1,V=!0,ha.innerHTML=mxUtils.htmlEntities(mxResources.get("recentDiag")),ba=null,v(ua,function(){z(mxResources.get("cannotLoad"))... | cwe | CWE-94 | JavaScript |
/* Copyright 2019 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-681 | Python |
import datetime
import re
import time
import urllib2
from email import encoders
from email.mime.base import MIMEBase
import mailpile.security as security
from mailpile.conn_brokers import Master as ConnBroker
from mailpile.i18n import gettext as _
from mailpile.i18n import ngettext as _n
from mailpile.commands import ... | cwe | CWE-287 | Python |
static int __perf_event_overflow(struct perf_event *event, int nmi,
int throttle, struct perf_sample_data *data,
struct pt_regs *regs)
{
int events = atomic_read(&event->event_limit);
struct hw_perf_event *hwc = &event->hw;
int ret = 0;
/*
* Non-sampling counters might still use the PMI to fold ... | cwe | CWE-400 | C/C++ |
bool TabsCaptureVisibleTabFunction::RunImpl() {
PrefService* service = profile()->GetPrefs();
if (service->GetBoolean(prefs::kDisableScreenshots)) {
error_ = keys::kScreenshotsDisabled;
return false;
}
WebContents* web_contents = NULL;
if (!GetTabToCapture(&web_contents))
return false;
image_f... | cwe | CWE-264 | C/C++ |
void ImageBitmapFactories::ImageBitmapLoader::RejectPromise(
ImageBitmapRejectionReason reason) {
switch (reason) {
case kUndecodableImageBitmapRejectionReason:
resolver_->Reject(
DOMException::Create(DOMExceptionCode::kInvalidStateError,
"The source image could ... | cwe | CWE-787 | C/C++ |
int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
{
struct bonding *bond = netdev_priv(bond_dev);
const struct net_device_ops *slave_ops = slave_dev->netdev_ops;
struct slave *new_slave = NULL;
struct netdev_hw_addr *ha;
struct sockaddr addr;
int link_reporting;
int res = 0;
if (!bond... | cwe | CWE-264 | Unknown |
int fib6_add(struct fib6_node *root, struct rt6_info *rt, struct nl_info *info)
{
struct fib6_node *fn, *pn = NULL;
int err = -ENOMEM;
int allow_create = 1;
int replace_required = 0;
if (info->nlh) {
if (!(info->nlh->nlmsg_flags & NLM_F_CREATE))
allow_create = 0;
if (info->nlh->nlmsg_flags & NLM_F_REPLACE)... | cwe | CWE-264 | C/C++ |
amgtar_backup(
application_argument_t *argument)
{
int dumpin;
char *cmd = NULL;
char *qdisk;
char *incrname;
char line[32768];
amregex_t *rp;
off_t dump_size = -1;
char *type;
char startchr;
int dataf = 1;
int me... | cwe | CWE-264 | Unknown |
showImportFileError(fileName, fileSize, message) {
const $alert = $('.js-import-file-error');
const fileData = fileName + ' (' + this.humanizeSize(fileSize) + ')';
$alert.find('.js-file-data').html(fileData);
$alert.find('.js-error-message').html(message);
$alert.removeClass('d-none');
} | cwe | CWE-79 | JavaScript |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-119 | C/C++ |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-119 | C/C++ |
import $ from "jquery";
import _ from "lodash";
import generated_emoji_codes from "../generated/emoji/emoji_codes.json";
import generated_pygments_data from "../generated/pygments_data.json";
import * as emoji from "../shared/js/emoji";
import * as fenced_code from "../shared/js/fenced_code";
import render_compose fro... | cwe | CWE-79 | JavaScript |
static void io_async_task_func(struct callback_head *cb)
{
struct io_kiocb *req = container_of(cb, struct io_kiocb, task_work);
struct async_poll *apoll = req->apoll;
struct io_ring_ctx *ctx = req->ctx;
trace_io_uring_task_run(req->ctx, req->opcode, req->user_data);
if (io_poll_rewait(req, &apoll->poll)) {
spi... | cwe | CWE-416 | Unknown |
xmlXPtrNewRangePoints(xmlXPathObjectPtr start, xmlXPathObjectPtr end) {
xmlXPathObjectPtr ret;
if (start == NULL)
return(NULL);
if (end == NULL)
return(NULL);
if (start->type != XPATH_POINT)
return(NULL);
if (end->type != XPATH_POINT)
return(NULL);
ret = (xmlXPathObjectPtr) xmlMalloc(sizeo... | cwe | CWE-119 | Unknown |
public function update()
{
$project = $this->getProject();
$tag_id = $this->request->getIntegerParam('tag_id');
$tag = $this->tagModel->getById($tag_id);
$values = $this->request->getValues();
list($valid, $errors) = $this->tagValidator->validateModification($values);
... | cwe | CWE-639 | PHP |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.