code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
ReadUserLogState::SetState( const ReadUserLog::FileState &state )
{
const ReadUserLogFileState::FileState *istate;
if ( !convertState(state, istate) ) {
return false;
}
if ( strcmp( istate->m_signature, FileStateSignature ) ) {
m_init_error = true;
return false;
}
if ( istate->m_version != FILESTATE_VERSIO... | cwe | CWE-134 | C/C++ |
find_alternate_tgs(kdc_realm_t *kdc_active_realm, krb5_principal princ,
krb5_db_entry **server_ptr, const char **status)
{
krb5_error_code retval;
krb5_principal *plist = NULL, *pl2;
krb5_data tmp;
krb5_db_entry *server = NULL;
*server_ptr = NULL;
assert(is_cross_tgs_principa... | cwe | CWE-20 | C/C++ |
/*
* Copyright ConsenSys AG.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing... | cwe | CWE-681 | Java |
static MagickBooleanType ReadPSDChannelZip(Image *image,const size_t channels,
const ssize_t type,const PSDCompressionType compression,
const size_t compact_size,ExceptionInfo *exception)
{
MagickBooleanType
status;
register unsigned char
*p;
size_t
count,
length,
packet_size,
row_si... | cwe | CWE-772 | Unknown |
static int jas_icclut16_input(jas_iccattrval_t *attrval, jas_stream_t *in,
int cnt)
{
int i;
int j;
int clutsize;
jas_icclut16_t *lut16 = &attrval->data.lut16;
lut16->clut = 0;
lut16->intabs = 0;
lut16->intabsbuf = 0;
lut16->outtabs = 0;
lut16->outtabsbuf = 0;
if (jas_iccgetuint8(in, &lut16->numinchans) ||
... | cwe | CWE-189 | Unknown |
package service
import (
"context"
"fmt"
"net/http"
"time"
"github.com/fleetdm/fleet/v4/server/contexts/authz"
authz_ctx "github.com/fleetdm/fleet/v4/server/contexts/authz"
"github.com/fleetdm/fleet/v4/server/contexts/ctxerr"
"github.com/fleetdm/fleet/v4/server/contexts/logging"
"github.com/fleetdm/fleet/v4/... | cwe | CWE-863 | Go |
public void onHeadersRead(ChannelHandlerContext ctx, int streamId, Http2Headers headers, int streamDependency,
short weight, boolean exclusive, int padding, boolean endOfStream) throws Http2Exception {
Http2Stream stream = connection.stream(streamId);
boolean allowHalfClosedRemot... | cwe | CWE-444 | Java |
/*
* Kernel-based Virtual Machine driver for Linux
*
* This module enables machines with Intel VT-x extensions to run virtual
* machines without emulation or binary translation.
*
* Copyright (C) 2006 Qumranet, Inc.
* Copyright 2010 Red Hat, Inc. and/or its affiliates.
*
* Authors:
* Avi Kivity <avi@qumra... | cwe | CWE-416 | C/C++ |
int fuse_readdir(struct file *file, struct dir_context *ctx)
{
struct fuse_file *ff = file->private_data;
struct inode *inode = file_inode(file);
int err;
if (is_bad_inode(inode))
return -EIO;
mutex_lock(&ff->readdir.lock);
err = UNCACHED;
if (ff->open_flags & FOPEN_CACHE_DIR)
err = fuse_readdir_cached(fi... | cwe | CWE-459 | Unknown |
const bootbox = require('bootbox');
require('../services/Requisitions');
/**
* @author Alejandro Galue <agalue@opennms.org>
* @copyright 2014 The OpenNMS Group, Inc.
*/
(function() {
'use strict';
const policyView = require('../../views/policy.html');
const moveView = require('../../views/move.html');
cons... | cwe | CWE-79 | Java |
# -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2012-2019 cervinko, idalin, SiphonSquirrel, ouzklcn, akushsky,
# OzzieIsaacs, bodybybuddha, jkrehm, matthazinski, janeczku
#
# This program is free software: you can ... | cwe | CWE-918 | Python |
static int __poke_user_compat(struct task_struct *child,
addr_t addr, addr_t data)
{
struct compat_user *dummy32 = NULL;
__u32 tmp = (__u32) data;
addr_t offset;
if (addr < (addr_t) &dummy32->regs.acrs) {
struct pt_regs *regs = task_pt_regs(child);
/*
* psw, gprs, acrs and orig_gpr2 are stored on t... | cwe | CWE-264 | Unknown |
long long EBMLHeader::Parse(
IMkvReader* pReader,
long long& pos)
{
assert(pReader);
long long total, available;
long status = pReader->Length(&total, &available);
if (status < 0) //error
return status;
pos = 0;
long long end = (available >= 1024) ? 1024 : available;
... | cwe | CWE-119 | C/C++ |
void SoftAMR::onQueueFilled(OMX_U32 /* portIndex */) {
List<BufferInfo *> &inQueue = getPortQueue(0);
List<BufferInfo *> &outQueue = getPortQueue(1);
if (mSignalledError || mOutputPortSettingsChange != NONE) {
return;
}
while (!inQueue.empty() && !outQueue.empty()) {
BufferInfo *inInfo = *inQueue.begi... | cwe | CWE-264 | C/C++ |
showEmptyFolder: function (albumPath, errorMessage) {
var message = '<div class="icon-gallery"></div>';
var uploadAllowed = true;
this.element.children().detach();
this.removeLoading();
if (!_.isUndefined(errorMessage) && errorMessage !== null) {
message += '<h2>' + t('gallery',
'Album cannot... | cwe | CWE-79 | PHP |
// Copyright (C) 2016 University of Dundee & Open Microscopy Environment.
// All rights reserved.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// ... | cwe | CWE-116 | Python |
ossl_cipher_set_key(VALUE self, VALUE key)
{
EVP_CIPHER_CTX *ctx;
int key_len;
StringValue(key);
GetCipher(self, ctx);
key_len = EVP_CIPHER_CTX_key_length(ctx);
if (RSTRING_LEN(key) != key_len)
ossl_raise(rb_eArgError, "key must be %d bytes", key_len);
if (EVP_CipherInit_ex(ctx, NULL, NU... | cwe | CWE-310 | Unknown |
/*
* 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 |
void sendResetPasswordEmailRequest() throws Exception
{
when(this.referenceSerializer.serialize(this.userReference)).thenReturn("user:Foobar");
when(this.userProperties.getFirstName()).thenReturn("Foo");
when(this.userProperties.getLastName()).thenReturn("Bar");
AuthenticationResour... | cwe | CWE-640 | Java |
void SimpleModule::runPull()
{
pull(m_outChunk->frameCount);
run(*m_inChunk, *m_outChunk);
} | cwe | CWE-787 | Unknown |
const got = require('@/utils/got');
const cheerio = require('cheerio');
const { parseDate } = require('@/utils/parse-date');
const { extractArticle, extractWork } = require('./utils');
module.exports = async (ctx) => {
const { uid } = ctx.params;
let pageUrl = `https://www.zcool.com.cn/u/${uid}`;
if (isNaN... | cwe | CWE-918 | JavaScript |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-119 | C/C++ |
/**
* Simple engine for creating PDF files.
* It supports text, shapes, images etc...
* Capable of handling millions of objects without too much performance
* penalty.
* Public domain license - no warrenty implied; use at your own risk.
*/
/**
* PDF HINTS & TIPS
* The following sites have various bits & pieces... | cwe | CWE-125 | C/C++ |
snmp_message_encode(unsigned char *out, uint32_t *out_len, snmp_header_t *header,
snmp_varbind_t *varbinds, uint32_t varbind_num)
{
snmp_varbind_t *varbind;
uint32_t original_out_len, last_out_len;
int8_t i;
original_out_len = *out_len;
for(i = varbind_num - 1; i >= 0; i--) {
varbind ... | cwe | CWE-125 | C/C++ |
/**
* Created by ctalmacel on 12/15/15.
*/
exports.registerTypeConverters = function(persistence){
persistence.registerConverter("string",
function(value){
return value;
},
function(value){
return value;
},
'varchar'
)
persistence.registerC... | cwe | CWE-89 | JavaScript |
def loadAuthorBlocks(postId: Int): Action[Unit] = GetAction { request =>
val blocks: Seq[Block] = request.dao.loadAuthorBlocks(postId)
var json = blocksSummaryJson(blocks, request.ctime)
if (request.user.exists(_.isStaff)) {
json += "blocks" -> JsArray(blocks map blockToJson)
}
OkSafeJson(json... | cwe | CWE-613 | Scala |
static bool load_buffer(RBinFile *bf, void **bin_obj, RBuffer *buf, ut64 loadaddr, Sdb *sdb) {
RBuffer *fbuf = r_buf_ref (buf);
struct MACH0_(opts_t) opts;
MACH0_(opts_set_default) (&opts, bf);
struct MACH0_(obj_t) *main_mach0 = MACH0_(new_buf) (fbuf, &opts);
if (!main_mach0) {
return false;
}
RRebaseInfo *re... | cwe | CWE-476 | C/C++ |
function editComment(comment, cdiv, saveCallback, deleteOnCancel)
{
curEdited = {div: cdiv, comment: comment, saveCallback: saveCallback, deleteOnCancel: deleteOnCancel};
var commentTxt = cdiv.querySelector('.geCommentTxt');
var actionsDiv = cdiv.querySelector('.geCommentActionsList');
var textArea = doc... | cwe | CWE-94 | JavaScript |
void Http2Stream::SubmitRstStream(const uint32_t code) {
CHECK(!this->is_destroyed());
code_ = code;
// If RST_STREAM frame is received and stream is not writable
// because it is busy reading data, don't try force purging it.
// Instead add the stream to pending stream list and process
// the pending data... | cwe | CWE-416 | Unknown |
enum_sig_subpkt (const subpktarea_t * pktbuf, sigsubpkttype_t reqtype,
size_t * ret_n, int *start, int *critical)
{
const byte *buffer;
int buflen;
int type;
int critical_dummy;
int offset;
size_t n;
int seq = 0;
int reqseq = start ? *start : 0;
if (!critical)
critical = &critical_dummy;
if... | cwe | CWE-20 | Unknown |
void FileAPIMessageFilter::RegisterFileAsBlob(const GURL& blob_url,
const FilePath& virtual_path,
const FilePath& platform_path) {
FilePath::StringType extension = virtual_path.Extension();
if (!extension.empty())
ext... | cwe | CWE-264 | C/C++ |
function g(){var C=document.createElement("div");C.style.width="100%";C.style.height="100%";C.style.boxSizing="border-box";null!=y&&y!=mxConstants.NONE?(C.style.border="1px solid black",C.style.backgroundColor=y):(C.style.backgroundPosition="center center",C.style.backgroundRepeat="no-repeat",C.style.backgroundImage="u... | cwe | CWE-94 | JavaScript |
function ame_ajax_toggle_orderoptions( status ) {
jQuery("#ame_order2_loader").html(ameAjaxL10n.pleaseWait);
var ame_sack = new sack( ajaxurl );
ame_sack.execute = 1;
ame_sack.method = 'POST';
ame_sack.setVar( "action", "ame_toggle_orderoptions" );
ame_sack.setVar( "status", status );
ame_sack.onError = function... | cwe | CWE-352 | JavaScript |
/*
* 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 |
static int lxc_mount_auto_mounts(struct lxc_conf *conf, int flags, struct lxc_handler *handler)
{
int r;
size_t i;
static struct {
int match_mask;
int match_flag;
const char *source;
const char *destination;
const char *fstype;
unsigned long flags;
const char *options;
} default_mounts[] = {
/* Read... | cwe | CWE-59 | C/C++ |
Status ShapeRefiner::InferShapesForFunctionSubNode(
const Node* node, InferenceContext* outer_context) {
TF_RETURN_IF_ERROR(AddNodeInternal(node, outer_context));
InferenceContext* node_context = CHECK_NOTNULL(GetContext(node));
if (StringPiece(node->type_string()) == kArgOp) {
// Handle special node: fu... | cwe | CWE-416 | C/C++ |
void CLASS xtrans_interpolate(int passes)
{
int c, d, f, g, h, i, v, ng, row, col, top, left, mrow, mcol;
#ifdef LIBRAW_LIBRARY_BUILD
int cstat[4]={0,0,0,0};
#endif
int val, ndir, pass, hm[8], avg[4], color[3][8];
static const short orth[12] = {1, 0, 0, 1, -1, 0, 0, -1, 1, 0, 0, 1},
patt[... | cwe | CWE-125 | C/C++ |
'use strict';
// The Console constructor is not actually used to construct the global
// console. It's exported for backwards compatibility.
const {
ArrayFrom,
ArrayIsArray,
Boolean,
Error,
Map,
ObjectDefineProperties,
ObjectDefineProperty,
ObjectKeys,
ObjectPrototypeHasOwnProperty,
ObjectValues,
... | cwe | CWE-1321 | JavaScript |
RC4::RC4(unsigned char const* key_data, int key_len)
{
if (key_len == -1)
{
key_len = strlen(reinterpret_cast<char const*>(key_data));
}
for (int i = 0; i < 256; ++i)
{
key.state[i] = i;
}
key.x = 0;
key.y = 0;
int i1 = 0;
int i2 = 0;
for (int i = 0; i < 256; ++i)
... | cwe | CWE-787 | Unknown |
int sja1105_static_config_upload(struct sja1105_private *priv)
{
unsigned long port_bitmap = GENMASK_ULL(SJA1105_NUM_PORTS - 1, 0);
struct sja1105_static_config *config = &priv->static_config;
const struct sja1105_regs *regs = priv->info->regs;
struct device *dev = &priv->spidev->dev;
struct sja1105_status status;... | cwe | CWE-401 | C/C++ |
void Compute(OpKernelContext* ctx) override {
const Tensor& in0 = ctx->input(0);
const Tensor& in1 = ctx->input(1);
ValidateInputTensors(ctx, in0, in1);
MatMulBCast bcast(in0.shape().dim_sizes(), in1.shape().dim_sizes());
OP_REQUIRES(
ctx, bcast.IsValid(),
errors::InvalidArgument(
... | cwe | CWE-787 | C/C++ |
def parse(socket=nil)
@socket = socket
begin
@peeraddr = socket.respond_to?(:peeraddr) ? socket.peeraddr : []
@addr = socket.respond_to?(:addr) ? socket.addr : []
rescue Errno::ENOTCONN
raise HTTPStatus::EOFError
end
read_request_line(socket)
if @http_version... | cwe | CWE-444 | Ruby |
/*
The MIT License (MIT)
Copyright (c) 2014-2017 DutchCoders [https://github.com/dutchcoders/]
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 th... | cwe | CWE-79 | Go |
def deleteUser(userId: UserId, byWho: Who): UserInclDetails = {
val (user, usersGroupIds) = readWriteTransaction { tx =>
tx.deferConstraints()
val deleter = tx.loadTheParticipant(byWho.id)
require(userId == deleter.id || deleter.isAdmin, "TyE7UKBW1")
val anonUsername = "anon" + nextRandomL... | cwe | CWE-613 | Scala |
ut64 MACH0_(get_main)(struct MACH0_(obj_t)* bin) {
ut64 addr = 0LL;
struct symbol_t *symbols;
int i;
if (!(symbols = MACH0_(get_symbols) (bin))) {
return 0;
}
for (i = 0; !symbols[i].last; i++) {
if (!strcmp (symbols[i].name, "_main")) {
addr = symbols[i].addr;
break;
}
}
free (symbols);
if (!add... | cwe | CWE-416 | C/C++ |
package com.salesmanager.shop.mapper.catalog;
import javax.inject.Inject;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.Validate;
import org.springframework.stereotype.Component;
import com.salesmanager.core.business.services.catalog.product.ProductService;
import com.salesmanager.core... | cwe | CWE-639 | Java |
QPDF::readHSharedObject(BitStream h)
{
HSharedObject& t = this->m->shared_object_hints;
t.first_shared_obj = h.getBits(32); // 1
t.first_shared_offset = h.getBits(32); // 2
t.nshared_first_page = h.getBits(32); // 3
t.nshared_total = h.getBits(32); // 4
t.nbits_nobjects = ... | cwe | CWE-787 | Unknown |
static inline signed short ReadPropertySignedShort(const EndianType endian,
const unsigned char *buffer)
{
union
{
unsigned short
unsigned_value;
signed short
signed_value;
} quantum;
unsigned short
value;
if (endian == LSBEndian)
{
value=(unsigned short) ((buffer[1] << ... | cwe | CWE-125 | Unknown |
package com.salesmanager.shop.admin.controller.products;
import com.salesmanager.core.business.services.catalog.product.ProductService;
import com.salesmanager.core.business.utils.ajax.AjaxPageableResponse;
import com.salesmanager.core.business.utils.ajax.AjaxResponse;
import com.salesmanager.core.model.catalog.produc... | cwe | CWE-639 | Java |
/*
* Interface between ext4 and JBD
*/
#include "ext4_jbd2.h"
#include <trace/events/ext4.h>
/* Just increment the non-pointer handle value */
static handle_t *ext4_get_nojournal(void)
{
handle_t *handle = current->journal_info;
unsigned long ref_cnt = (unsigned long)handle;
BUG_ON(ref_cnt >= EXT4_NOJOURNAL_MA... | cwe | CWE-416 | C/C++ |
package de.presti.ree6.commands.impl.community;
import de.presti.ree6.commands.Category;
import de.presti.ree6.commands.CommandEvent;
import de.presti.ree6.commands.interfaces.Command;
import de.presti.ree6.commands.interfaces.ICommand;
import de.presti.ree6.main.Main;
import net.dv8tion.jda.api.Permission;
import net... | cwe | CWE-863 | Java |
DECLAREContigPutFunc(putcontig8bitYCbCr42tile)
{
uint32* cp1 = cp+w+toskew;
int32 incr = 2*toskew+w;
(void) y;
fromskew = (fromskew * 10) / 4;
if ((h & 3) == 0 && (w & 1) == 0) {
for (; h >= 2; h -= 2) {
x = w>>2;
do {
int32 Cb = pp[8];
... | cwe | CWE-119 | Unknown |
static OPJ_BOOL opj_t2_encode_packet(OPJ_UINT32 tileno,
opj_tcd_tile_t * tile,
opj_tcp_t * tcp,
opj_pi_iterator_t *pi,
OPJ_BYTE *dest,
... | cwe | CWE-416 | C/C++ |
public function checkForReassign($operator)
{
$operator_name = ($this->locale == get_home_locale())
? $operator['vclocalename']
: $operator['vccommonname'];
$is_operator_correct = $this->nextAgent == $operator['operatorid']
|| $this->agentId == $operator['operato... | cwe | CWE-79 | PHP |
jinit_merged_upsampler(j_decompress_ptr cinfo)
{
my_upsample_ptr upsample;
upsample = (my_upsample_ptr)
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
sizeof(my_upsampler));
cinfo->upsample = (struct jpeg_upsampler *)upsample;
upsample->pub.start_pass = start_... | cwe | CWE-476 | Unknown |
m,q)}),aa,mxResources.get("changeUser"),mxUtils.bind(this,function(){function Y(){ea.innerHTML="";for(var ka=0;ka<pa.length;ka++){var ja=document.createElement("option");mxUtils.write(ja,pa[ka].displayName);ja.value=ka;ea.appendChild(ja);ja=document.createElement("option");ja.innerHTML=" ";mxUtils.writ... | cwe | CWE-94 | JavaScript |
PJ_DEF(pj_status_t) pjsip_ua_unregister_dlg( pjsip_user_agent *ua,
pjsip_dialog *dlg )
{
struct dlg_set *dlg_set;
pjsip_dialog *d;
/* Sanity-check arguments. */
PJ_ASSERT_RETURN(ua && dlg, PJ_EINVAL);
/* Check that dialog has been registered. */
PJ_ASSERT_RETURN(dlg->dlg_set, PJ_EINV... | cwe | CWE-416 | C/C++ |
const bootbox = require('bootbox');
require('../services/Requisitions');
const RequisitionNode = require('../model/RequisitionNode');
const RequisitionMetaDataEntry = require('../model/RequisitionMetaDataEntry');
/**
* @author Alejandro Galue <agalue@opennms.org>
* @copyright 2014 The OpenNMS Group, Inc.
*/
(functi... | cwe | CWE-79 | Java |
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/ory/fosite/handler/oauth2 (interfaces: AuthorizeCodeStrategy)
// Package internal is a generated GoMock package.
package internal
import (
context "context"
reflect "reflect"
gomock "github.com/golang/mock/gomock"
fosite "github.com/ory/fosite"
)
... | cwe | CWE-287 | Go |
static void unix_copy_addr(struct msghdr *msg, struct sock *sk)
{
struct unix_sock *u = unix_sk(sk);
msg->msg_namelen = 0;
if (u->addr) {
msg->msg_namelen = u->addr->len;
memcpy(msg->msg_name, u->addr->name, u->addr->len);
}
} | cwe | CWE-20 | 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-787 | C/C++ |
/* Copyright 2018 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 |
def login():
from flask_login import current_user
redirect_url = request.args.get("redirect", request.script_root + url_for("index"))
permissions = sorted(
filter(
lambda x: x is not None and isinstance(x, OctoPrintPermission),
map(
lambda x: getattr(Permissi... | cwe | CWE-79 | Python |
function PMA_getColumnsList($db, $from=0, $num=25)
{
$cfgCentralColumns = PMA_centralColumnsGetParams();
if (empty($cfgCentralColumns)) {
return array();
}
$pmadb = $cfgCentralColumns['db'];
$GLOBALS['dbi']->selectDb($pmadb, $GLOBALS['controllink']);
$central_list_table = $cfgCentralColu... | cwe | CWE-89 | PHP |
*/
private int
mconvert(struct magic_set *ms, struct magic *m, int flip)
{
union VALUETYPE *p = &ms->ms_value;
switch (cvt_flip(m->type, flip)) {
case FILE_BYTE:
cvt_8(p, m);
return 1;
case FILE_SHORT:
cvt_16(p, m);
return 1;
case FILE_LONG:
case FILE_DATE:
case FILE_LDATE:
cvt_32(p, m);
return 1;
... | cwe | CWE-119 | C/C++ |
void cms_set_pw_data(cms_context *cms, secuPWData *pwdata)
{
ingress();
switch (cms->pwdata.source) {
case PW_SOURCE_INVALID:
case PW_PROMPT:
case PW_DEVICE:
case PW_SOURCE_MAX:
break;
case PW_FROMFD:
if (cms->pwdata.intdata >= 0 &&
!(pwdata->source == PW_FROMFD &&
cms->pwdata.intdata == pwda... | cwe | CWE-787 | Unknown |
#
# 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 FITNESS
# FOR A PARTICULAR... | cwe | CWE-264 | Python |
void ConnPoolImplBase::checkForIdleAndCloseIdleConnsIfDraining() {
if (is_draining_for_deletion_) {
closeIdleConnectionsForDrainingPool();
}
if (isIdleImpl()) {
ENVOY_LOG(debug, "invoking idle callbacks - is_draining_for_deletion_={}",
is_draining_for_deletion_);
for (const Instance::Id... | cwe | CWE-674 | Unknown |
import random
import string
import secrets
import pyotp
from django.contrib.auth import get_user_model
from django.core.validators import EmailValidator
from django.db import transaction
from django.utils.decorators import method_decorator
from django.views.decorators.debug import sensitive_post_parameters
from django... | cwe | CWE-287 | Python |
local block_state deflate_rle(s, flush)
deflate_state *s;
int flush;
{
int bflush; /* set if current block must be flushed */
uInt prev; /* byte at distance one to match */
Bytef *scan, *strend; /* scan goes up to strend for length of run */
for (;;) {
/* Make... | cwe | CWE-284 | Unknown |
#include "PortForwardHandler.hpp"
namespace et {
PortForwardHandler::PortForwardHandler(
shared_ptr<SocketHandler> _networkSocketHandler,
shared_ptr<SocketHandler> _pipeSocketHandler)
: networkSocketHandler(_networkSocketHandler),
pipeSocketHandler(_pipeSocketHandler) {}
void PortForwardHandler::upd... | cwe | CWE-120 | C/C++ |
static int ehci_process_itd(EHCIState *ehci,
EHCIitd *itd,
uint32_t addr)
{
USBDevice *dev;
USBEndpoint *ep;
uint32_t i, len, pid, dir, devaddr, endp;
uint32_t pg, off, ptr1, ptr2, max, mult;
ehci->periodic_sched_active = PERIODIC_ACTIVE;
... | cwe | CWE-772 | C/C++ |
/*
* Copyright (C) 2012 The Android Open Source Project
*
* 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 app... | cwe | CWE-200 | Java |
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t():"function"==typeof define&&define.amd?define(t):t()}(0,function(){"use strict";if("undefined"!=typeof window){var e=window.$||window.jQuery||window.Zepto;e&&(e.fn.shave=function(e,t){return function(e,t){var n=2<arguments.length&&void 0!==arguments... | cwe | CWE-79 | JavaScript |
// 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-20 | Go |
#include "rar.hpp"
#if !defined(RARDLL)
int main(int argc, char *argv[])
{
#ifdef _UNIX
setlocale(LC_ALL,"");
#endif
InitConsole();
ErrHandler.SetSignalHandlers(true);
#ifdef SFX_MODULE
wchar ModuleName[NM];
#ifdef _WIN_ALL
GetModuleFileName(NULL,ModuleName,ASIZE(ModuleName));
#else
CharToWide(argv[0],M... | cwe | CWE-787 | C/C++ |
DH *get_dh2048(void)
{
static unsigned char dhp_2048[] = {
0xD5, 0x75, 0xF1, 0x23, 0xC1, 0x81, 0x4B, 0x44, 0x23, 0xBE,
0x97, 0x81, 0x7A, 0xDA, 0x97, 0x1F, 0x1F, 0x0D, 0xD5, 0xEC,
0xC5, 0x5F, 0x86, 0x42, 0x7F, 0x38, 0xA3, 0x95, 0xEE, 0xA0,
0x52, 0x2C, 0xB7, 0x20, 0x29, 0xC1, 0xC7, 0xE... | cwe | CWE-295 | C/C++ |
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/ory/fosite/handler/oauth2 (interfaces: CoreStrategy)
// Package internal is a generated GoMock package.
package internal
import (
context "context"
reflect "reflect"
gomock "github.com/golang/mock/gomock"
fosite "github.com/ory/fosite"
)
// MockC... | cwe | CWE-287 | Go |
"geTempDlgCreateBtn geTempDlgBtnDisabled")}function y(fa,ca){if(null!=I){var ba=function(oa){qa.isExternal?e(qa,function(na){ja(na,oa)},ia):qa.url?mxUtils.get(TEMPLATE_PATH+"/"+qa.url,mxUtils.bind(this,function(na){200<=na.getStatus()&&299>=na.getStatus()?ja(na.getText(),oa):ia()})):ja(b.emptyDiagramXml,oa)},ja=functio... | cwe | CWE-20 | JavaScript |
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/renderer_context_menu/render_view_context_menu.h"
#include <stddef.h>
#include <algorithm>
#include <memory>
#include <set>
#in... | cwe | CWE-416 | C/C++ |
void Compute(OpKernelContext* context) override {
const Tensor& input = context->input(0);
const Tensor& bias = context->input(1);
const float input_min = context->input(2).flat<float>()(0);
const float input_max = context->input(3).flat<float>()(0);
const float bias_min = context->input(4).flat<flo... | cwe | CWE-369 | C/C++ |
static int fix_paths(void)
{
char buff[FN_REFLEN],*pos;
convert_dirname(mysql_home,mysql_home,NullS);
/* Resolve symlinks to allow 'mysql_home' to be a relative symlink */
my_realpath(mysql_home,mysql_home,MYF(0));
/* Ensure that mysql_home ends in FN_LIBCHAR */
pos=strend(mysql_home);
if (pos[-1] != FN_L... | cwe | CWE-264 | Unknown |
def call(env)
return @app.call(env) unless env['PATH_INFO'].start_with? "#{@bus.base_route}message-bus/_diagnostics"
route = env['PATH_INFO'].split("#{@bus.base_route}message-bus/_diagnostics")[1]
if @bus.is_admin_lookup.nil? || !@bus.is_admin_lookup.call(env)
return [403, {}, ['not allowed']]
e... | cwe | CWE-22 | Ruby |
function(O){O=da.apply(this,arguments);var X=this.editorUi,ea=X.editor.graph;if(ea.isEnabled()&&"1"==urlParams.sketch){var ka=this.createOption(mxResources.get("sketch"),function(){return Editor.sketchMode},function(ja,U){X.setSketchMode(!Editor.sketchMode);null!=U&&mxEvent.isShiftDown(U)||ea.updateCellStyles({sketch:j... | cwe | CWE-20 | JavaScript |
// Ogg Vorbis audio decoder - v1.11 - public domain
// http://nothings.org/stb_vorbis/
//
// Original version written by Sean Barrett in 2007.
//
// Originally sponsored by RAD Game Tools. Seeking sponsored
// by Phillip Bennefall, Marc Andersen, Aaron Baker, Elias Software,
// Aras Pranckevicius, and Sean Barrett.
//
... | cwe | CWE-119 | C/C++ |
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-434 | Python |
db.get("SELECT id,note FROM notes WHERE id = '"+data.id+"'",function(err,row){
if(row){
socket.emit('setNote', { note: row.note });
} else {
socket.emit('setNote', { note: "" });
}
//res.send(row.note);
}); | cwe | CWE-89 | JavaScript |
static void ProcessExifDir(unsigned char * DirStart, unsigned char * OffsetBase,
unsigned ExifLength, int NestingLevel)
{
int de;
int a;
int NumDirEntries;
unsigned ThumbnailOffset = 0;
unsigned ThumbnailSize = 0;
char IndentString[25];
printf("ProcessExifDir");
if (NestingLevel > 4){
ErrNonfatal("Maximum... | cwe | CWE-119 | C/C++ |
static Image *ReadPESImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
char
filename[MagickPathExtent];
FILE
*file;
Image
*image;
ImageInfo
*read_info;
int
delta_x,
delta_y,
j,
unique_file,
x,
y;
MagickBooleanType
status;
PESBlockInfo
block... | cwe | CWE-835 | C/C++ |
void StartSync(const StartSyncArgs& args,
OneClickSigninSyncStarter::StartSyncMode start_mode) {
if (start_mode == OneClickSigninSyncStarter::UNDO_SYNC) {
LogOneClickHistogramValue(one_click_signin::HISTOGRAM_UNDO);
return;
}
OneClickSigninSyncStarter::ConfirmationRequired confirmation ... | cwe | CWE-200 | C/C++ |
/**
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at the
* <a href="http://www.apache... | cwe | CWE-23 | Java |
def analyze_smashgg(self, urls, name):
LOG.info('we are about to analyze scene {} with {} brackets'.format(name, len(urls)))
for url in urls:
# Before we process this URL, check to see if we already have
sql = "SELECT * FROM analyzed where base_url='{}'".format(url)
r... | cwe | CWE-89 | Python |
const exec = require('async-execute');
/**
* Create and push a git tag with the last commit message
* @param {String} tag
* @return {void}
*/
module.exports = async function(tag) {
if (!tag || ![ 'string', 'number' ].includes(typeof tag)) {
throw new TypeError(`string was expected, instead got ${tag}`);
}
c... | cwe | CWE-88 | JavaScript |
krb5_ldap_put_principal(krb5_context context, krb5_db_entry *entry,
char **db_args)
{
int l=0, kerberos_principal_object_type=0;
unsigned int ntrees=0, tre=0;
krb5_error_code st=0, tempst=0;
LDAP *ld=NULL;
... | cwe | CWE-476 | Unknown |
static int xfrm_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
{
struct net *net = sock_net(skb->sk);
struct nlattr *attrs[XFRMA_MAX+1];
const struct xfrm_link *link;
int type, err;
type = nlh->nlmsg_type;
if (type > XFRM_MSG_MAX)
return -EINVAL;
type -= XFRM_MSG_BASE;
link = &xfrm_dispatch[type];
... | cwe | CWE-264 | Unknown |
/*******************************************************************************
* This file is part of OpenNMS(R).
*
* Copyright (C) 2002-2014 The OpenNMS Group, Inc.
* OpenNMS(R) is Copyright (C) 1999-2014 The OpenNMS Group, Inc.
*
* OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc.
*
* OpenNMS(... | cwe | CWE-79 | Java |
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
TF_LITE_ENSURE_EQ(context, NumInputs(node), 2);
TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1);
const TfLiteTensor* input = GetInput(context, node, kInputTensor);
TfLiteIntArray* input_dims = input->dims;
int input_dims_size = input_dims->size;... | cwe | CWE-787 | C/C++ |
static void php_wddx_push_element(void *user_data, const XML_Char *name, const XML_Char **atts)
{
st_entry ent;
wddx_stack *stack = (wddx_stack *)user_data;
if (!strcmp(name, EL_PACKET)) {
int i;
if (atts) for (i=0; atts[i]; i++) {
if (!strcmp(atts[i], EL_VERSION)) {
/* nothing for now */
}
}
} el... | cwe | CWE-125 | Unknown |
import { configFromStringAndFormat } from './from-string-and-format';
import { createUTCDate } from './date-from-array';
import { hooks } from '../utils/hooks';
import { deprecate } from '../utils/deprecate';
import getParsingFlags from './parsing-flags';
import { defaultLocaleMonthsShort } from '../units/month';
impor... | cwe | CWE-400 | JavaScript |
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */
/*
* lsquic_varint.c -- routines dealing with IETF QUIC varint.
*/
#include <assert.h>
#include <stdint.h>
#include <string.h>
#include "lsquic_byteswap.h"
#include "lsquic_varint.h"
/* Returns number of bytes read from p (1, 2, 4, or 8), or... | cwe | CWE-476 | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.