code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
function getRecentDocs(getAll)
{
if (recentDocsCallback)
{
tempDlgContent.scrollTop = 0;
diagramsTiles.innerHTML = '';
spinner.spin(diagramsTiles);
cancelPendingCall = false;
callInitiated = true;
diagramsListTitle.innerHTML = mxUtils.htmlEntities(mxResources.get('recentDiag'));
lastSearchStr ... | cwe | CWE-94 | JavaScript |
static void vmx_refresh_apicv_exec_ctrl(struct kvm_vcpu *vcpu)
{
struct vcpu_vmx *vmx = to_vmx(vcpu);
vmcs_write32(PIN_BASED_VM_EXEC_CONTROL, vmx_pin_based_exec_ctrl(vmx));
} | cwe | CWE-264 | C/C++ |
processDescription (event, router, conf, sessionManager, SessionValidator) {
var argsURLFragment = event ? (event.args ? event.args[0] : "") : "",
urlParams = URIUtils.parseQueryString(argsURLFragment),
gotoURL = urlParams.goto;
SessionValidator.stop();
... | cwe | CWE-601 | JavaScript |
int ZlibInStream::overrun(int itemSize, int nItems, bool wait)
{
if (itemSize > bufSize)
throw Exception("ZlibInStream overrun: max itemSize exceeded");
if (end - ptr != 0)
memmove(start, ptr, end - ptr);
offset += ptr - start;
end -= ptr - start;
ptr = start;
while (end - ptr < itemSize) {
i... | cwe | CWE-122 | C/C++ |
static int get_refcount(BlockDriverState *bs, int64_t cluster_index)
{
BDRVQcowState *s = bs->opaque;
int refcount_table_index, block_index;
int64_t refcount_block_offset;
int ret;
uint16_t *refcount_block;
uint16_t refcount;
refcount_table_index = cluster_index >> (s->cluster_bits - R... | cwe | CWE-190 | C/C++ |
void posixtimer_rearm(struct siginfo *info)
{
struct k_itimer *timr;
unsigned long flags;
timr = lock_timer(info->si_tid, &flags);
if (!timr)
return;
if (timr->it_requeue_pending == info->si_sys_private) {
timr->kclock->timer_rearm(timr);
timr->it_active = 1;
timr->it_overrun_last = timr->it_overrun;
... | cwe | CWE-190 | Unknown |
export function parse(formula: string): [a: number, b: number] {
formula = formula.trim().toLowerCase();
if (formula === "even") {
return [2, 0];
} else if (formula === "odd") {
return [2, 1];
}
const parsed = formula.match(RE_NTH_ELEMENT);
if (!parsed) {
throw new Err... | cwe | CWE-1333 | JavaScript |
void *MACH0_(mach0_free)(struct MACH0_(obj_t) *mo) {
if (!mo) {
return NULL;
}
size_t i;
if (mo->symbols) {
for (i = 0; !mo->symbols[i].last; i++) {
free (mo->symbols[i].name);
}
free (mo->symbols);
}
free (mo->segs);
free (mo->sects);
free (mo->symtab);
free (mo->symstr);
free (mo->indirectsyms);... | cwe | CWE-122 | C/C++ |
libxlDomainDeathThread(void *opaque)
{
struct libxlEventHandlerThreadInfo *death_info = opaque;
virDomainObj *vm = death_info->vm;
libxl_event *ev = death_info->event;
libxlDriverPrivate *driver = death_info->driver;
virObjectEvent *dom_event = NULL;
g_autoptr(libxlDriverConfig) cfg = libxlDrive... | cwe | CWE-667 | Unknown |
static struct rds_connection *__rds_conn_create(struct net *net,
__be32 laddr, __be32 faddr,
struct rds_transport *trans, gfp_t gfp,
int is_outgoing)
{
struct rds_connection *conn, *parent = NULL;
struct hlist_head *head = rds_conn_bucket(laddr, faddr);
struct rds_transport *loop_trans;
... | cwe | CWE-703 | C/C++ |
SiteInstance* parent_site_instance() const {
return parent_site_instance_.get();
} | cwe | CWE-362 | C/C++ |
void Compute(OpKernelContext* const context) override {
core::RefCountPtr<BoostedTreesEnsembleResource> resource;
// Get the resource.
OP_REQUIRES_OK(context, LookupResource(context, HandleFromInput(context, 0),
&resource));
// Get the inputs.
OpInputList ... | cwe | CWE-197 | C/C++ |
void DeviceTokenFetcher::SetState(FetcherState state) {
state_ = state;
if (state_ != STATE_TEMPORARY_ERROR)
effective_token_fetch_error_delay_ms_ = kTokenFetchErrorDelayMilliseconds;
base::Time delayed_work_at;
switch (state_) {
case STATE_INACTIVE:
notifier_->Inform(CloudPolicySubsystem::... | cwe | CWE-416 | C/C++ |
function clean_input_value($value) {
if (is_string($value)) {
return descript($value);
}
if (is_array($value)) {
return array_map('descript', $value);
}
return '';
} | cwe | CWE-352 | PHP |
static BIGNUM *srp_Calc_k(BIGNUM *N, BIGNUM *g)
{
/* k = SHA1(N | PAD(g)) -- tls-srp draft 8 */
unsigned char digest[SHA_DIGEST_LENGTH];
unsigned char *tmp;
EVP_MD_CTX ctxt;
int longg ;
int longN = BN_num_bytes(N);
if ((tmp = OPENSSL_malloc(longN)) == NULL)
return NULL;
... | cwe | CWE-119 | C/C++ |
function phpAds_SessionStart()
{
global $session;
if (empty($_COOKIE['sessionID'])) {
$session = array();
$_COOKIE['sessionID'] = md5(uniqid('phpads', 1));
phpAds_SessionSetAdminCookie('sessionID', $_COOKIE['sessionID']);
}
return $_COOKIE['sessionID'];
} | cwe | CWE-384 | PHP |
/*
* Filename routines for HTMLDOC, a HTML document processing program.
*
* Copyright © 2011-2021 by Michael R Sweet.
* Copyright © 1997-2010 by Easy Software Products. All rights reserved.
*
* This program is free software. Distribution and use rights are outlined in
* the file "COPYING".
*/
/*
* Include n... | cwe | CWE-415 | C/C++ |
KioskNextHomeInterfaceBrokerImpl::KioskNextHomeInterfaceBrokerImpl(
content::BrowserContext* context)
: connector_(content::BrowserContext::GetConnectorFor(context)->Clone()),
app_controller_(std::make_unique<AppControllerImpl>(
Profile::FromBrowserContext(context))) {} | cwe | CWE-416 | C/C++ |
/*
* Copyright 2016 Red Hat, Inc. and/or its affiliates
* and other 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 License at
*
* http://www.apach... | cwe | CWE-287 | Java |
epass2003_sm_unwrap_apdu(struct sc_card *card, struct sc_apdu *sm, struct sc_apdu *plain)
{
int r;
size_t len = 0;
epass2003_exdata *exdata = NULL;
if (!card->drv_data)
return SC_ERROR_INVALID_ARGUMENTS;
exdata = (epass2003_exdata *)card->drv_data;
LOG_FUNC_CALLED(card->ctx);
r = sc_check_sw(card, sm->sw1... | cwe | CWE-119 | Unknown |
'use strict'
import './polyfills'
import naturalSort from 'javascript-natural-sort'
import jsonrepair from 'jsonrepair'
import jsonlint from './assets/jsonlint/jsonlint'
import jsonMap from 'json-source-map'
import { translate } from './i18n'
const MAX_ITEMS_FIELDS_COLLECTION = 10000
const YEAR_2000 = 946684800000
/... | cwe | CWE-697 | JavaScript |
bool MemFile::seek(int64_t offset, int whence /* = SEEK_SET */) {
assertx(m_len != -1);
if (whence == SEEK_CUR) {
if (offset > 0 && offset < bufferedLen()) {
setReadPosition(getReadPosition() + offset);
setPosition(getPosition() + offset);
return true;
}
offset += getPosition();
wh... | cwe | CWE-787 | C/C++ |
def authorized?(request)
origin_host = request.get_header("HTTP_HOST")&.slice(VALID_ORIGIN_HOST, 1) || ""
forwarded_host = request.x_forwarded_host&.slice(VALID_FORWARDED_HOST, 1) || ""
@permissions.allows?(origin_host) && (forwarded_host.blank? || @permissions.allows?(forwarded_host))
en... | cwe | CWE-601 | Ruby |
func SanitizePath(path string) string {
return strings.TrimLeft(path, "./")
} | cwe | CWE-22 | Go |
/*
* This library is part of OpenCms -
* the Open Source Content Management System
*
* Copyright (c) Alkacon Software GmbH & Co. KG (http://www.alkacon.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 th... | cwe | CWE-79 | Java |
int gnutls_pcert_import_x509 (gnutls_pcert_st* pcert,
gnutls_x509_crt_t crt, unsigned int flags)
{
int ret;
size_t sz;
memset(pcert, 0, sizeof(*pcert));
pcert->type = GNUTLS_CRT_X509;
pcert->cert.data = NULL;
sz = 0;
ret = gnutls_x509_crt_export(crt, GNUTLS_X509_FMT_DER, NULL, &sz);
if (ret < 0 && ret !... | cwe | CWE-399 | Unknown |
void BindSkiaToInProcessGL() {
static bool host_StubGL_installed = false;
if (!host_StubGL_installed) {
GrGLBinding binding;
switch (gfx::GetGLImplementation()) {
case gfx::kGLImplementationNone:
NOTREACHED();
return;
case gfx::kGLImplementationDesktopGL:
binding = kDeskt... | cwe | CWE-190 | C/C++ |
/*
* Unsquash a squashfs filesystem. This is a highly compressed read only
* filesystem.
*
* Copyright (c) 2009, 2010, 2013, 2019, 2021
* Phillip Lougher <phillip@squashfs.org.uk>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* ... | cwe | CWE-59 | C/C++ |
public function logout()
{
// Initialize the current auth session before trying to remove it
if (is_null($this->user) && !$this->check()) {
return;
}
if ($this->isImpersonator()) {
$this->user = $this->getImpersonator();
$this->stopImpersonate();
... | cwe | CWE-613 | PHP |
/*
* Univention Directory Notifier
*
* Copyright 2004-2019 Univention GmbH
*
* http://www.univention.de/
*
* All rights reserved.
*
* The source code of this program is made available
* under the terms of the GNU Affero General Public License version 3
* (GNU AGPL V3) as published by the Free Software Founda... | cwe | CWE-200 | C/C++ |
/* $Id$ */
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and
* its documentation for any purpose is hereby granted without fee, provided
* that (i) the above copyright notices and this permission n... | cwe | CWE-125 | 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-521 | Python |
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import absolute_import
from typing import List, TYPE_CHECKING
from zulint.custom_rules import RuleList
if TYPE_CHECKING:
from zulint.custom_rules import Rule
# Rule help:
# By default, a rule applies to all files within the extension ... | cwe | CWE-287 | Python |
def set_permissions_remote(params, request, session)
if not allowed_for_local_cluster(session, Permissions::GRANT)
return 403, 'Permission denied'
end
begin
data = JSON.parse(params['json_data'])
rescue JSON::ParserError
return 400, JSON.generate({'status' => 'bad_json'})
end
user_set = {}
p... | cwe | CWE-384 | Ruby |
int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
const ASN1_ITEM *it,
int tag, int aclass, char opt, ASN1_TLC *ctx)
{
int rv;
rv = asn1_item_embed_d2i(pval, in, len, it, tag, aclass, opt, ctx);
if (rv <= 0)
ASN1_item_ex_free(pval, ... | cwe | CWE-400 | Unknown |
static inline LineContribType * _gdContributionsAlloc(unsigned int line_length, unsigned int windows_size)
{
unsigned int u = 0;
LineContribType *res;
int overflow_error = 0;
res = (LineContribType *) gdMalloc(sizeof(LineContribType));
if (!res) {
return NULL;
}
res->WindowSize = windows_size;
res->LineLengt... | cwe | CWE-191 | C/C++ |
SQLRETURN SQLSetDescFieldW( SQLHDESC descriptor_handle,
SQLSMALLINT rec_number,
SQLSMALLINT field_identifier,
SQLPOINTER value,
SQLINTEGER buffer_length )
{
/*
* not quite sure how the descriptor can be
* allocated to a statement, all the documentation talks
... | cwe | CWE-119 | Unknown |
static inline int l2cap_config_req(struct l2cap_conn *conn, struct l2cap_cmd_hdr *cmd, u16 cmd_len, u8 *data)
{
struct l2cap_conf_req *req = (struct l2cap_conf_req *) data;
u16 dcid, flags;
u8 rsp[64];
struct sock *sk;
int len;
dcid = __le16_to_cpu(req->dcid);
flags = __le16_to_cpu(req->flags);
BT_DBG("dcid ... | cwe | CWE-119 | Unknown |
struct clock_source *dce110_clock_source_create(
struct dc_context *ctx,
struct dc_bios *bios,
enum clock_source_id id,
const struct dce110_clk_src_regs *regs,
bool dp_clk_src)
{
struct dce110_clk_src *clk_src =
kzalloc(sizeof(struct dce110_clk_src), GFP_KERNEL);
if (!clk_src)
return NULL;
if (dce110_clk_... | cwe | CWE-401 | Unknown |
import gettext
import sys
import logging
_ = lambda x: gettext.ldgettext("rhsm", x)
from subscription_manager import ga_loader
ga_loader.init_ga()
from subscription_manager.ga import Gtk as ga_Gtk
from subscription_manager.ga import gtk_compat
gtk_compat.threads_init()
import rhsm
# enable logging for firstboot
... | cwe | CWE-264 | Python |
jpc_ms_t *jpc_getms(jas_stream_t *in, jpc_cstate_t *cstate)
{
jpc_ms_t *ms;
jpc_mstabent_t *mstabent;
jas_stream_t *tmpstream;
if (!(ms = jpc_ms_create(0))) {
return 0;
}
/* Get the marker type. */
if (jpc_getuint16(in, &ms->id) || ms->id < JPC_MS_MIN ||
ms->id > JPC_MS_MAX) {
jpc_ms_destroy(ms);
retu... | cwe | CWE-20 | C/C++ |
tiffsep_print_page(gx_device_printer * pdev, gp_file * file)
{
tiffsep_device * const tfdev = (tiffsep_device *)pdev;
int num_std_colorants = tfdev->devn_params.num_std_colorant_names;
int num_order = tfdev->devn_params.num_separation_order_names;
int num_spot = tfdev->devn_params.separations.num_separa... | cwe | CWE-476 | Unknown |
void Compute(OpKernelContext* ctx) override {
const Tensor& gradient = ctx->input(0);
const Tensor& input = ctx->input(1);
Tensor* input_backprop = nullptr;
OP_REQUIRES_OK(ctx,
ctx->allocate_output(0, input.shape(), &input_backprop));
OP_REQUIRES(
ctx, axis_ >= -1,
... | cwe | CWE-703 | C/C++ |
/*
* Copyright 2021 Red Hat, Inc. and/or its affiliates
* and other 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 License at
*
* http://www... | cwe | CWE-862 | Java |
#
# Copyright (c) 2012 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a copy of... | cwe | CWE-264 | Python |
function rootQuery($db, $query) {
@ini_set('track_errors', 1); // @ - may be disabled
$file = @file_get_contents("$this->_url/?database=$db", false, stream_context_create(array('http' => array(
'method' => 'POST',
'content' => $this->isQuerySelectLike($query) ? "$query FORMAT JSONCompact" : $query,
'h... | cwe | CWE-918 | PHP |
#ifndef WIN32
#include "UserTerminalRouter.hpp"
#include "ETerminal.pb.h"
namespace et {
UserTerminalRouter::UserTerminalRouter(
shared_ptr<PipeSocketHandler> _socketHandler,
const SocketEndpoint &_routerEndpoint)
: socketHandler(_socketHandler) {
serverFd = *(socketHandler->listen(_routerEndpoint).begi... | cwe | CWE-362 | C/C++ |
#
# -*- coding: utf-8 -*-#
# Copyright (c) 2010 Red Hat, Inc.
#
# Authors: Jeff Ortel <jortel@redhat.com>
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or F... | cwe | CWE-264 | Python |
public static void square(int[] x, int[] zz)
{
long x_0 = x[0] & M;
long zz_1;
int c = 0, w;
{
int i = 5, j = 12;
do
{
long xVal = (x[i--] & M);
long p = xVal * xVal;
zz[--j] = (c << 31) | (int)(p >>... | cwe | CWE-19 | Java |
static int create_qp_common(struct mlx5_ib_dev *dev, struct ib_pd *pd,
struct ib_qp_init_attr *init_attr,
struct ib_udata *udata, struct mlx5_ib_qp *qp)
{
struct mlx5_ib_resources *devr = &dev->devr;
int inlen = MLX5_ST_SZ_BYTES(create_qp_in);
struct mlx5_core_dev *mdev = dev->mdev;
struct mlx5_ib_... | cwe | CWE-119 | C/C++ |
static int hva_to_pfn_remapped(struct vm_area_struct *vma,
unsigned long addr, bool *async,
bool write_fault, bool *writable,
kvm_pfn_t *p_pfn)
{
kvm_pfn_t pfn;
pte_t *ptep;
spinlock_t *ptl;
int r;
r = follow_pte(vma->vm_mm, addr, &ptep, &ptl);
if (r) {
/*
* get_user_pages fail... | cwe | CWE-119 | C/C++ |
protected function get_remote_contents( &$url, $timeout = 30, $redirect_max = 5, $ua = 'Mozilla/5.0', $fp = null ) {
$method = (function_exists('curl_exec') && !ini_get('safe_mode'))? 'curl_get_contents' : 'fsock_get_contents';
return $this->$method( $url, $timeout, $redirect_max, $ua, $fp );
} | cwe | CWE-89 | JavaScript |
int LibRaw::unpack_thumb(void)
{
CHECK_ORDER_LOW(LIBRAW_PROGRESS_IDENTIFY);
CHECK_ORDER_BIT(LIBRAW_PROGRESS_THUMB_LOAD);
try
{
if (!libraw_internal_data.internal_data.input)
return LIBRAW_INPUT_CLOSED;
int t_colors = libraw_internal_data.unpacker_data.thumb_misc >> 5 & 7;
int t_bytesps = (li... | cwe | CWE-125 | C/C++ |
/**
* Copyright (c) 2010-2020 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.... | cwe | CWE-611 | Java |
static int do_ipv6_getsockopt(struct sock *sk, int level, int optname,
char __user *optval, int __user *optlen, unsigned int flags)
{
struct ipv6_pinfo *np = inet6_sk(sk);
int len;
int val;
if (ip6_mroute_opt(optname))
return ip6_mroute_getsockopt(sk, optname, optval, optlen);
if (get_user(len, optlen))
... | cwe | CWE-416 | Unknown |
int processMultibulkBuffer(client *c) {
char *newline = NULL;
int ok;
long long ll;
if (c->multibulklen == 0) {
/* The client should have been reset */
serverAssertWithInfo(c,NULL,c->argc == 0);
/* Multi bulk length cannot be read without a \r\n */
newline = strchr(c->q... | cwe | CWE-770 | Unknown |
grub_disk_read (grub_disk_t disk, grub_disk_addr_t sector,
grub_off_t offset, grub_size_t size, void *buf)
{
char *tmp_buf;
unsigned real_offset;
/* First of all, check if the region is within the disk. */
if (grub_disk_adjust_range (disk, §or, &offset, size) != GRUB_ERR_NONE)
{
grub_error_pus... | cwe | CWE-119 | C/C++ |
function prepare(_html)
{
// Free and null the old tooltip_div
hide();
//Generate the tooltip div, set it's text and append it to the body tag
tooltip_div = jQuery(_wnd.document.createElement('div'));
tooltip_div.hide();
tooltip_div.append(_html);
tooltip_div.addClass("egw_tooltip");
jQuery(_wnd.docum... | cwe | CWE-79 | JavaScript |
func (p *BinaryProtocol) ReadBinary() ([]byte, error) {
size, e := p.ReadI32()
if e != nil {
return nil, e
}
if size < 0 {
return nil, invalidDataLength
}
if uint64(size) > p.trans.RemainingBytes() {
return nil, invalidDataLength
}
isize := int(size)
buf := make([]byte, isize)
_, err := io.ReadFull(p.t... | cwe | CWE-770 | Go |
static void perf_event_init_cpu(int cpu)
{
struct swevent_htable *swhash = &per_cpu(swevent_htable, cpu);
mutex_lock(&swhash->hlist_mutex);
swhash->online = true;
if (swhash->hlist_refcount > 0) {
struct swevent_hlist *hlist;
hlist = kzalloc_node(sizeof(*hlist), GFP_KERNEL, cpu_to_node(cpu));
WARN_ON(!hlist... | cwe | CWE-416 | Unknown |
MagickExport int LocaleUppercase(const int c)
{
if (c < 0)
return(c);
#if defined(MAGICKCORE_LOCALE_SUPPORT)
if (c_locale != (locale_t) NULL)
return(toupper_l((int) ((unsigned char) c),c_locale));
#endif
return(toupper((int) ((unsigned char) c)));
} | cwe | CWE-125 | Unknown |
QPDF::checkHOutlines(std::list<std::string>& warnings)
{
// Empirically, Acrobat generates the correct value for the object
// number but incorrectly stores the next object number's offset
// as the offset, at least when outlines appear in part 6. It
// also generates an incorrect value for length (spe... | cwe | CWE-787 | Unknown |
TfLiteStatus StoreAllDecodedSequences(
TfLiteContext* context,
const std::vector<std::vector<std::vector<int>>>& sequences,
TfLiteNode* node, int top_paths) {
const int32_t batch_size = sequences.size();
std::vector<int32_t> num_entries(top_paths, 0);
// Calculate num_entries per path
for (const au... | cwe | CWE-125 | C/C++ |
void rfc_process_mx_message(tRFC_MCB* p_mcb, BT_HDR* p_buf) {
uint8_t* p_data = (uint8_t*)(p_buf + 1) + p_buf->offset;
MX_FRAME* p_rx_frame = &rfc_cb.rfc.rx_frame;
uint16_t length = p_buf->len;
uint8_t ea, cr, mx_len;
bool is_command;
p_rx_frame->ea = *p_data & RFCOMM_EA;
p_rx_frame->cr = (*p_data & ... | cwe | CWE-125 | C/C++ |
void FrameFetchContext::AddResourceTiming(const ResourceTimingInfo& info) {
if (!document_)
return;
LocalFrame* frame = document_->GetFrame();
if (!frame)
return;
if (info.IsMainResource()) {
DCHECK(frame->Owner());
frame->Owner()->AddResourceTiming(info);
frame->DidSendResourceTimingInfoT... | cwe | CWE-200 | C/C++ |
this.menus.findWindow&&this.menus.findWindow.window.setVisible(!1),null!=this.menus.findReplaceWindow&&this.menus.findReplaceWindow.window.setVisible(!1))};EditorUi.prototype.initializeEmbedMode=function(){this.setGraphEnabled(!1);if((window.opener||window.parent)!=window&&("1"!=urlParams.spin||this.spinner.spin(docume... | cwe | CWE-20 | JavaScript |
'use strict';
// @ts-check
// ==================================================================================
// internet.js
// ----------------------------------------------------------------------------------
// Description: System Information - library
// for Node.js
// Copyright: (c) 2014 - ... | cwe | CWE-77 | JavaScript |
/*
* The MIT License
*
* Copyright (c) 2014, Steve Wagner
*
* 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-611 | Java |
module.exports = setUser
var assert = require('assert')
var path = require('path')
var fs = require('fs')
var correctMkdir = require('../utils/correct-mkdir.js')
function setUser (cb) {
var defaultConf = this.root
assert(defaultConf !== Object.prototype)
// If global, leave it as-is.
// If not global, then s... | cwe | CWE-732 | JavaScript |
func (c *Client) Update() (data.TargetFiles, error) {
if err := c.UpdateRoots(); err != nil {
if _, ok := err.(verify.ErrExpired); ok {
// For backward compatibility, we wrap the ErrExpired inside
// ErrDecodeFailed.
return nil, ErrDecodeFailed{"root.json", err}
}
return nil, err
}
// Get timestamp.j... | cwe | CWE-354 | Go |
int nego_recv(rdpTransport* transport, wStream* s, void* extra)
{
BYTE li;
BYTE type;
UINT16 length;
rdpNego* nego = (rdpNego*)extra;
if (!tpkt_read_header(s, &length))
return -1;
if (!tpdu_read_connection_confirm(s, &li, length))
return -1;
if (li > 6)
{
/* rdpNegData (optional) */
Stream_Read_UINT8... | cwe | CWE-125 | Unknown |
package com.salesmanager.shop.admin.controller.user;
import com.salesmanager.core.business.services.user.GroupService;
import com.salesmanager.core.model.user.Group;
import com.salesmanager.core.model.user.GroupType;
import com.salesmanager.shop.admin.model.web.Menu;
import org.springframework.stereotype.Controller;
i... | cwe | CWE-639 | Java |
int FdInStream::overrun(int itemSize, int nItems, bool wait)
{
if (itemSize > bufSize)
throw Exception("FdInStream overrun: max itemSize exceeded");
if (end - ptr != 0)
memmove(start, ptr, end - ptr);
offset += ptr - start;
end -= ptr - start;
ptr = start;
int bytes_to_read;
while (end < start ... | cwe | CWE-122 | C/C++ |
public void testMatchOperation() {
JWKMatcher matcher = new JWKMatcher.Builder().keyOperation(KeyOperation.DECRYPT).build();
assertTrue(matcher.matches(new RSAKey.Builder(new Base64URL("n"), new Base64URL("e")).keyID("1")
.keyOperations(new HashSet<>(Collections.singletonList(KeyOperation.DECRYPT))).build()));... | cwe | CWE-347 | Java |
#include "osxkeychain_darwin.h"
#include <CoreFoundation/CoreFoundation.h>
#include <Foundation/NSValue.h>
#include <stdio.h>
#include <string.h>
char *get_error(OSStatus status) {
char *buf = malloc(128);
CFStringRef str = SecCopyErrorMessageString(status, NULL);
int success = CFStringGetCString(str, buf, 128, ... | cwe | CWE-415 | Go |
def tag_to_tag_num(self, tag):
''' Returns tag_num given tag. '''
q = "SELECT rowid FROM tags WHERE tag = '" + tag + "'"
self.query(q)
return self.c.fetchone()[0] | cwe | CWE-89 | Python |
htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
int ret = 0;
htmlParserInputPtr in;
int avail = 0;
xmlChar cur, next;
htmlParserNodeInfo node_info;
#ifdef DEBUG_PUSH
switch (ctxt->instate) {
case XML_PARSER_EOF:
xmlGenericError(xmlGenericErrorContext,
"HPP: try EOF\n"... | cwe | CWE-119 | Unknown |
int install_user_keyrings(void)
{
struct user_struct *user;
const struct cred *cred;
struct key *uid_keyring, *session_keyring;
key_perm_t user_keyring_perm;
char buf[20];
int ret;
uid_t uid;
user_keyring_perm = (KEY_POS_ALL & ~KEY_POS_SETATTR) | KEY_USR_ALL;
cred = current_cred();
user = cred->user;
uid = ... | cwe | CWE-362 | C/C++ |
xfs_set_acl(struct inode *inode, struct posix_acl *acl, int type)
{
int error = 0;
if (!acl)
goto set_acl;
error = -E2BIG;
if (acl->a_count > XFS_ACL_MAX_ENTRIES(XFS_M(inode->i_sb)))
return error;
if (type == ACL_TYPE_ACCESS) {
umode_t mode = inode->i_mode;
error = posix_acl_equiv_mode(acl, &mode);
i... | cwe | CWE-285 | C/C++ |
/*
* Phusion Passenger - https://www.phusionpassenger.com/
* Copyright (c) 2018 Phusion Holding B.V.
*
* "Passenger", "Phusion Passenger" and "Union Station" are registered
* trademarks of Phusion Holding B.V.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this softw... | cwe | CWE-732 | C/C++ |
copy_thread(unsigned long clone_flags, unsigned long stack_start,
unsigned long stk_sz, struct task_struct *p)
{
struct thread_info *thread = task_thread_info(p);
struct pt_regs *childregs = task_pt_regs(p);
memset(&thread->cpu_context, 0, sizeof(struct cpu_context_save));
if (likely(!(p->flags & PF_KTHREAD)... | cwe | CWE-264 | C/C++ |
xfs_attr_rmtval_set(
struct xfs_da_args *args)
{
struct xfs_inode *dp = args->dp;
struct xfs_mount *mp = dp->i_mount;
struct xfs_bmbt_irec map;
xfs_dablk_t lblkno;
xfs_fileoff_t lfileoff = 0;
__uint8_t *src = args->value;
int blkcnt;
int valuelen;
int nmap;
int error;
int offset = 0;
trace_xf... | cwe | CWE-19 | C/C++ |
onBannerChange (input: HTMLInputElement) {
this.bannerfileInput = new ElementRef(input)
const bannerfile = this.bannerfileInput.nativeElement.files[0]
if (bannerfile.size > this.maxBannerSize) {
this.notifier.error('Error', $localize`This image is too large.`)
return
}
const formData =... | cwe | CWE-79 | JavaScript |
static js_Ast *conditional(js_State *J, int notin)
{
js_Ast *a, *b, *c;
a = logor(J, notin);
if (jsP_accept(J, '?')) {
b = assignment(J, 0);
jsP_expect(J, ':');
c = assignment(J, notin);
return EXP3(COND, a, b, c);
}
return a;
} | cwe | CWE-674 | Unknown |
void vnc_zrle_clear(VncState *vs)
{
if (vs->zrle.stream.opaque) {
deflateEnd(&vs->zrle.stream);
}
buffer_free(&vs->zrle.zrle);
buffer_free(&vs->zrle.fb);
buffer_free(&vs->zrle.zlib);
} | cwe | CWE-401 | Unknown |
/* eslint-disable */
// import assign from "nano-assign";
// import sqlAutoCompletions from "./sqlAutoCompletions";
// import {ext} from "vee-validate/dist/rules.esm";
export default {
name: "MonacoJsonEditor",
props: {
value: {
default: "",
type: String
},
theme: {
type: String,
... | cwe | CWE-918 | JavaScript |
- (id <WOActionResults>) logoffAction
{
SOGoWebAuthenticator *auth;
NSString *userName, *value;
WOResponse *response;
NSCalendarDate *date;
WOCookie *cookie;
NSArray *creds;
userName = [[context activeUser] login];
[self logWithFormat: @"user '%@' logged off", userName];
response = [self redirect... | cwe | CWE-352 | Objective-C |
static int bnep_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
{
struct bnep_connlist_req cl;
struct bnep_connadd_req ca;
struct bnep_conndel_req cd;
struct bnep_conninfo ci;
struct socket *nsock;
void __user *argp = (void __user *)arg;
int err;
BT_DBG("cmd %x arg %lx", cmd, arg);
swi... | cwe | CWE-20 | C/C++ |
def render_POST(self, request):
"""
Register with the Identity Server
"""
send_cors(request)
args = get_args(request, ('matrix_server_name', 'access_token'))
result = yield self.client.get_json(
"matrix://%s/_matrix/federation/v1/openid/userinfo?access_token... | cwe | CWE-918 | Python |
bool isWebPType(BasicIo& iIo, bool /*advance*/)
{
const int32_t len = 4;
const unsigned char RiffImageId[4] = { 'R', 'I', 'F' ,'F'};
const unsigned char WebPImageId[4] = { 'W', 'E', 'B' ,'P'};
byte webp[len];
byte data[len];
byte riff[len];
iIo.read(riff, len)... | cwe | CWE-190 | Unknown |
[];for(G=0;G<d.length;G++)C.push(d[G]);d=C;this.confirmImageResize(function(K){L=K;P()},A)}else P()};EditorUi.prototype.isBlankFile=function(){return null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&this.currentPage.getName()==mxResources.get("pageWithNumber",[1])};EditorUi.prototype.confirmImageResize=fu... | cwe | CWE-20 | JavaScript |
static enum gro_result dev_gro_receive(struct napi_struct *napi, struct sk_buff *skb)
{
struct sk_buff **pp = NULL;
struct packet_offload *ptype;
__be16 type = skb->protocol;
struct list_head *head = &offload_base;
int same_flow;
enum gro_result ret;
int grow;
if (!(skb->dev->features & NETIF_F_GRO))
goto no... | cwe | CWE-400 | Unknown |
// imagew-api.c
// Part of ImageWorsener, Copyright (c) 2011 by Jason Summers.
// For more information, see the readme.txt file.
// Most of the functions declared in imagew.h are defined here.
#include "imagew-config.h"
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include "imagew-internals.h"
// Tr... | cwe | CWE-369 | C/C++ |
xmlParseStringEntityRef(xmlParserCtxtPtr ctxt, const xmlChar ** str) {
xmlChar *name;
const xmlChar *ptr;
xmlChar cur;
xmlEntityPtr ent = NULL;
if ((str == NULL) || (*str == NULL))
return(NULL);
ptr = *str;
cur = *ptr;
if (cur != '&')
return(NULL);
ptr++;
name = xmlPar... | cwe | CWE-119 | C/C++ |
/*
* GPAC - Multimedia Framework C SDK
*
* Authors: Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2000-2021
* All rights reserved
*
* This file is part of GPAC / ISO Media File Format sub-project
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU L... | cwe | CWE-120 | C/C++ |
from __future__ import absolute_import
from flask import url_for, redirect, abort, request, Blueprint, current_app
from flask_login import login_required, current_user
import six
from six.moves import filter, map
from sqlalchemy.orm.exc import NoResultFound
from itertools import chain
from .. import ships, systems, db... | cwe | CWE-200 | Python |
static void update_logging() {
bool should_log = module_started &&
(logging_enabled_via_api || stack_config->get_btsnoop_turned_on());
if (should_log == is_logging)
return;
is_logging = should_log;
if (should_log) {
btsnoop_net_open();
const char *log_path = stack_config->get_btsnoop_log_path();
if (st... | cwe | CWE-284 | C/C++ |
/*
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator p... | cwe | CWE-200 | Java |
static void kiocb_batch_free(struct kiocb_batch *batch)
{
struct kiocb *req, *n;
list_for_each_entry_safe(req, n, &batch->head, ki_batch) {
list_del(&req->ki_batch);
kmem_cache_free(kiocb_cachep, req);
}
} | cwe | CWE-400 | C/C++ |
# -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2021, Shuup Commerce Inc. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
from django.http.response import HttpResponseRedirect
from shuup.... | cwe | CWE-79 | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.