code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
mail_config_ews_autodiscover_run_cb (GObject *source_object,
GAsyncResult *result,
gpointer user_data)
{
AsyncContext *async_context = user_data;
EMailConfigEwsAutodiscover *autodiscover;
EAlertSink *alert_sink;
GError *error = NULL;
EMailCo... | cwe | CWE-295 | Unknown |
// Raw
// -------
const inherits = require('inherits');
const helpers = require('./helpers');
const { EventEmitter } = require('events');
const debug = require('debug');
const {
assign,
reduce,
isPlainObject,
isObject,
isUndefined,
isNumber,
} = require('lodash');
const saveAsyncStack = require('./util/sav... | cwe | CWE-89 | JavaScript |
static inline int restore_fpu_checking(struct task_struct *tsk)
{
/* AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception
is pending. Clear the x87 state here by setting it to fixed
values. "m" is a random variable that should be in L1 */
alternative_input(
ASM_NOP8 ASM_NOP2,
"emms\n\t" /* ... | cwe | CWE-264 | C/C++ |
/* Copyright 2016 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-843 | Python |
(function()
{
// Adds Arrow shapes with control points
Sidebar.prototype.addArrows2Palette = function()
{
var s = 'html=1;shadow=0;dashed=0;align=center;verticalAlign=middle;shape=mxgraph.arrows2.';
var s2 = 'html=1;shadow=0;dashed=0;fillColor=none;strokeColor=none;shape=mxgraph.arrows2.';
var gn = 'mxgraph.ar... | cwe | CWE-79 | Java |
/**
* FreeRDP: A Remote Desktop Protocol Implementation
* ZGFX (RDP8) Bulk Data Compression
*
* Copyright 2014 Marc-Andre Moreau <marcandre.moreau@gmail.com>
* Copyright 2017 Armin Novak <armin.novak@thincast.com>
* Copyright 2017 Thincast Technologies GmbH
*
* Licensed under the Apache License, Version 2.0 (th... | cwe | CWE-119 | C/C++ |
PixarLogSetupDecode(TIFF* tif)
{
static const char module[] = "PixarLogSetupDecode";
TIFFDirectory *td = &tif->tif_dir;
PixarLogState* sp = DecoderState(tif);
tmsize_t tbuf_size;
assert(sp != NULL);
/* Make sure no byte swapping happens on the data
* after decompression. */
tif->tif_postdecode = _TIFFNoPostD... | cwe | CWE-369 | Unknown |
var exec = require('child_process').exec;
module.exports = function (iface, callback) {
exec("ifconfig " + iface, function (err, out) {
if (err) {
callback(err, null);
return;
}
var match = /[a-f0-9]{2}(:[a-f0-9]{2}){5}/.exec(out.toLowerCase());
if (!match) {... | cwe | CWE-78 | Java |
_rsa_sec_compute_root_tr(const struct rsa_public_key *pub,
const struct rsa_private_key *key,
void *random_ctx, nettle_random_func *random,
mp_limb_t *x, const mp_limb_t *m, size_t mn)
{
TMP_GMP_DECL (c, mp_limb_t);
TMP_GMP_DECL (ri, mp_limb_t);
TMP_GMP_DECL (scratch, mp_limb_t);
size_t key_limb_siz... | cwe | CWE-20 | Unknown |
/* mqtt_client.c
*
* Copyright (C) 2006-2021 wolfSSL Inc.
*
* This file is part of wolfMQTT.
*
* wolfMQTT 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 2 of the License, or
* (at your... | cwe | CWE-787 | C/C++ |
void DoCanonicalizeRef(const CHAR* spec,
const Component& ref,
CanonOutput* output,
Component* out_ref) {
if (ref.len < 0) {
*out_ref = Component();
return;
}
output->push_back('#');
out_ref->begin = output->length();
int end = ref... | cwe | CWE-79 | C/C++ |
render()
{
let item = null;
const story = this.state.story;
if (story)
{
// 如果没有 img 要处理,否则不好看。
item = (
<div
id={`story${story.id}`}
className="flex-tile"
ref="self"
>... | cwe | CWE-200 | JavaScript |
/*
* Copyright 2017-2019 original authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | cwe | CWE-400 | Java |
/*
+----------------------------------------------------------------------+
| HipHop for PHP |
+----------------------------------------------------------------------+
| Copyright (c) 2010-present Facebook, Inc. (http://www.facebook.com) |
+---------... | cwe | CWE-787 | C/C++ |
ptaReadStream(FILE *fp)
{
char typestr[128];
l_int32 i, n, ix, iy, type, version;
l_float32 x, y;
PTA *pta;
PROCNAME("ptaReadStream");
if (!fp)
return (PTA *)ERROR_PTR("stream not defined", procName, NULL);
if (fscanf(fp, "\n Pta Version %d\n", &version) != 1)
return (PTA... | cwe | CWE-787 | C/C++ |
errno_t sssctl_logs_fetch(struct sss_cmdline *cmdline,
struct sss_tool_ctx *tool_ctx,
void *pvt)
{
const char *file;
const char *cmd;
errno_t ret;
/* Parse command line. */
ret = sss_tool_popt_ex(cmdline, NULL, SSS_TOOL_OPT_OPTIONAL, NULL, NULL,
... | cwe | CWE-78 | Unknown |
var quantityUnitsTable = $('#quantityunits-table').DataTable({
'order': [[1, 'asc']],
'columnDefs': [
{ 'orderable': false, 'targets': 0 },
{ 'searchable': false, "targets": 0 }
]
});
$('#quantityunits-table tbody').removeClass("d-none");
quantityUnitsTable.columns.adjust().draw();
$("#search").on("keyup", Del... | cwe | CWE-79 | JavaScript |
char *my_asctime(time_t t)
{
struct tm *tm;
char *str;
int len;
tm = localtime(&t);
str = g_strdup(asctime(tm));
len = strlen(str);
if (len > 0) str[len-1] = '\0';
return str;
} | cwe | CWE-416 | C/C++ |
static void detect_allow_debuggers(int argc, char **argv) {
int i;
for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "--allow-debuggers") == 0) {
arg_allow_debuggers = 1;
break;
}
if (strcmp(argv[i], "--") == 0)
break;
if (strncmp(argv[i], "--", 2) != 0)
break;
}
} | cwe | CWE-703 | Unknown |
public function checkout($name)
{
$this->run('checkout', $name);
return $this;
} | cwe | CWE-88 | PHP |
static int persistent_prepare_exception(struct dm_exception_store *store,
struct dm_exception *e)
{
struct pstore *ps = get_info(store);
uint32_t stride;
chunk_t next_free;
sector_t size = get_dev_size(dm_snap_cow(store->snap)->bdev);
/* Is there enough room ? */
if (size < ((ps->next_free + 1) * store->chu... | cwe | CWE-200 | Unknown |
// 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 |
ins_comp_get_next_word_or_line(
buf_T *ins_buf, // buffer being scanned
pos_T *cur_match_pos, // current match position
int *match_len,
int *cont_s_ipos) // next ^X<> will set initial_pos
{
char_u *ptr;
int len;
*match_len = 0;
ptr = ml_get_buf(ins_buf, cur_match_pos->lnum, FALSE) +
cur_match_... | cwe | CWE-122 | C/C++ |
public function renameTag($oldName, $newName)
{
// http://stackoverflow.com/a/1873932
// create new as alias to old (`git tag NEW OLD`)
$this->run('tag', $newName, $oldName);
// delete old (`git tag -d OLD`)
$this->removeTag($oldName);
return $this;
} | cwe | CWE-88 | PHP |
"url("+Editor.plusImage+")",aa.setAttribute("title",mxResources.get("insert")),aa.style.width="24px",ua=!0)}));la();E.addListener("darkModeChanged",la);E.addListener("sketchModeChanged",la)}else E.editor.addListener("statusChanged",mxUtils.bind(this,function(){E.setStatusText(E.editor.getStatus())}));if(null!=C){var Aa... | cwe | CWE-20 | JavaScript |
# encoding: utf-8
"""An object for managing IPython profile directories."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import os
import shutil
import errno
from pathlib import Path
from traitlets.config.configurable import LoggingConfigurable
from ..paths imp... | cwe | CWE-269 | Python |
public function doUpdates($current_version = null) {
if ($current_version === null) {
if ($this->version === null) {
throw new \RuntimeException('Cannot process updates without any version specified!');
}
$current_version = $this->version;
}
$DB = $this->DB;
... | cwe | CWE-798 | PHP |
int dccp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
{
const struct dccp_sock *dp = dccp_sk(sk);
const int flags = msg->msg_flags;
const int noblock = flags & MSG_DONTWAIT;
struct sk_buff *skb;
int rc, size;
long timeo;
trace_dccp_probe(sk, len);
if (len > dp->dccps_mss_cache)
return -EMSGSIZE;... | cwe | CWE-476 | Unknown |
from warcio.timeutils import timestamp_to_datetime, timestamp_to_sec
from warcio.timeutils import timestamp_now
from pywb.utils.loaders import load
from six.moves.urllib.parse import urlsplit, quote
from jinja2 import Environment, TemplateNotFound, contextfunction
from jinja2 import FileSystemLoader, PackageLoader, ... | cwe | CWE-79 | Python |
/*
* Copyright © 2015-2018 Aeneas Rekkas <aeneas+oss@aeneas.io>
*
* 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... | cwe | CWE-755 | Go |
public function render($ignoreCli = false)
{
if (!$ignoreCli && php_sapi_name() == 'cli') {
$this->log();
file_put_contents('php://stderr', $this->getException()->__toString()."\n");
exit(1);
}
$view = Kwf_Debug::getView();
$view->exception = $thi... | cwe | CWE-79 | PHP |
/**
* Helpers.
*/
var s = 1000;
var m = s * 60;
var h = m * 60;
var d = h * 24;
var y = d * 365.25;
/**
* Parse or format the given `val`.
*
* Options:
*
* - `long` verbose formatting [false]
*
* @param {String|Number} val
* @param {Object} [options]
* @throws {Error} throw an error if val is not a non-em... | cwe | CWE-1333 | JavaScript |
function ame_ajax_set_visibility( post_id, status, posttype ) {
var ame_sack = new sack( ajaxurl );
ame_sack.execute = 1;
ame_sack.method = 'POST';
ame_sack.setVar( "action", "ame_toggle_visibility" );
ame_sack.setVar( "category_id", post_id );
ame_sack.setVar( "vis_status", status );
ame_sack.setVar( "posttype"... | cwe | CWE-352 | JavaScript |
static OPJ_BOOL opj_j2k_write_sod(opj_j2k_t *p_j2k,
opj_tcd_t * p_tile_coder,
OPJ_BYTE * p_data,
OPJ_UINT32 * p_data_written,
OPJ_UINT32 p_total_data_size,
... | cwe | CWE-416 | Unknown |
/**
* Connect is a middleware framework for node,
* shipping with over 18 bundled middleware and a rich selection of
* 3rd-party middleware.
*
* var app = connect()
* .use(connect.logger('dev'))
* .use(connect.static('public'))
* .use(function(req, res){
* res.end('hello world\n'... | cwe | CWE-79 | Java |
notify_oldest_id = 0;
notify_latest_id = 0;
notify_update_timeout = 30000;
notify_update_timeout_adjust = 1.2; // factor to adjust between each timeout.
function notify_update() {
jsonWrapper(URL_NOTIFY_GET_NEW+notify_latest_id+'/', function (data) {
if (data.success) {
$('.notification-cnt').html(data.tot... | cwe | CWE-79 | Python |
static inline char *parse_ip_address_ex(const char *str, size_t str_len, int *portno, int get_err, zend_string **err)
{
char *colon;
char *host = NULL;
#ifdef HAVE_IPV6
char *p;
if (*(str) == '[' && str_len > 1) {
/* IPV6 notation to specify raw address with port (i.e. [fe80::1]:80) */
p = memchr(str + 1, ']'... | cwe | CWE-20 | C/C++ |
/*
* JFFS2 -- Journalling Flash File System, Version 2.
*
* Copyright © 2006 NEC Corporation
*
* Created by KaiGai Kohei <kaigai@ak.jp.nec.com>
*
* For licensing information, see the file 'LICENCE' in this directory.
*
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/kernel.h>
#include <linux/... | cwe | CWE-285 | C/C++ |
init_connection_options(MYSQL *mysql)
{
#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
if (opt_use_ssl)
{
mysql_ssl_set(mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher);
mysql_options(mysql, MYSQL_OPT_SSL_CRL, opt_ssl_crl);
mysql_options(mysql, MYS... | cwe | CWE-295 | Unknown |
njs_generate_try_catch(njs_vm_t *vm, njs_generator_t *generator,
njs_parser_node_t *node)
{
njs_int_t ret;
njs_index_t exit_index;
njs_vmcode_finally_t *finally;
njs_generator_patch_t *patch;
njs_generator_block_t *block, *try_block;
njs_generator_try_ct... | cwe | CWE-754 | Unknown |
/*
* Copyright 2020 ThoughtWorks, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | cwe | CWE-668 | Java |
status_t Camera3Device::createDefaultRequest(int templateId,
CameraMetadata *request) {
ATRACE_CALL();
ALOGV("%s: for template %d", __FUNCTION__, templateId);
Mutex::Autolock il(mInterfaceLock);
Mutex::Autolock l(mLock);
switch (mStatus) {
case STATUS_ERROR:
CLOGE("Device h... | cwe | CWE-264 | C/C++ |
replace: function(value, context, parseContext) {
var m = PARSE_RX.exec(parseContext.value);
if (!m) { return value; }
var newValue = context.env[m[1]] || m[3] || '';
return value.slice(0, parseContext.start) + newValue + value.slice(parseContext.end);
} | cwe | CWE-1321 | JavaScript |
// Copyright Istio Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in wri... | cwe | CWE-400 | Go |
require('../services/Requisitions');
import Util from 'lib/util';
const QuickNode = require('../model/QuickNode');
/**
* @author Alejandro Galue <agalue@opennms.org>
* @copyright 2014 The OpenNMS Group, Inc.
*/
(function() {
'use strict';
const quickAddPanelBasicView = require('../../views/quick-add-panel-basi... | cwe | CWE-352 | Java |
function ame_ajax_set_commentstatus( postid, status, posttype ) {
var ame_sack = new sack( ajaxurl );
ame_sack.execute = 1;
ame_sack.method = 'POST';
ame_sack.setVar( "action", "ame_ajax_set_commentstatus" );
ame_sack.setVar( "postid", postid );
ame_sack.setVar( "comment_status", status );
ame_sack.setVar( "post... | cwe | CWE-352 | JavaScript |
open_pcsc_reader_wrapped (const char *portstr)
{
int slot;
reader_table_t slotp;
int fd, rp[2], wp[2];
int n, i;
pid_t pid;
size_t len;
unsigned char msgbuf[9];
int err;
unsigned int dummy_status;
/* Note that we use the constant and not the fucntion because this
code won't be be used under Wi... | cwe | CWE-20 | Unknown |
static int cac_read_binary(sc_card_t *card, unsigned int idx,
unsigned char *buf, size_t count, unsigned long flags)
{
cac_private_data_t * priv = CAC_DATA(card);
int r = 0;
u8 *val = NULL;
u8 *cert_ptr;
size_t val_len;
size_t len, cert_len;
u8 cert_type;
SC_FUNC_CALLED(card->ctx, SC_LOG_DEBUG_VERBOSE);
/*... | cwe | CWE-119 | C/C++ |
static int get_name(int counter,
unsigned char *pkt, unsigned char *start, unsigned char *max,
unsigned char *output, int output_max, int *output_len,
unsigned char **end, char *name, int *name_len)
{
unsigned char *p;
/* Limit recursion to 10 (this means up to 10 labels in domain name) */
if (counter > 10)
... | cwe | CWE-119 | Unknown |
void printIFD(std::ostream& out, PrintStructureOption option, uint64_t dir_offset, int depth)
{
BasicIo& io = Image::io();
depth++;
bool bFirst = true;
// buffer
bool bPrint = true;
... | cwe | CWE-125 | Unknown |
void Compute(OpKernelContext* context) override {
const Tensor& data = context->input(0);
const Tensor& weights = context->input(1);
bool use_weights = weights.NumElements() > 0;
OP_REQUIRES(context,
TensorShapeUtils::IsVector(data.shape()) ||
TensorShapeUtils::IsMat... | cwe | CWE-369 | Unknown |
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qtextlayout.h"
#include "qtextengine_p.h"
#include <qthread.h>
#include <qfont.h>
#include <qmath.h>
#include <qpainter.h>
#include <qvarlengtharray.h>
#include <qt... | cwe | CWE-120 | C/C++ |
import { isTestSuiteActive } from "../../support/page_objects/projectConstants";
import { mainPage } from "../../support/page_objects/mainPage";
export const genTest = (apiType, dbType) => {
if (!isTestSuiteActive(apiType, dbType)) return;
describe(`${
dbType === "xcdb" ? "Meta - " : ""
}${apiType... | cwe | CWE-918 | JavaScript |
QPDF::recoverStreamLength(PointerHolder<InputSource> input,
int objid, int generation,
qpdf_offset_t stream_offset)
{
// Try to reconstruct stream length by looking for
// endstream or endobj
warn(QPDFExc(qpdf_e_damaged_pdf, input->getName(),
this->m->last_object_descriptio... | cwe | CWE-787 | Unknown |
#include "webcc/string.h"
#include <random>
#include "boost/algorithm/string/trim.hpp"
namespace webcc {
// Ref: https://stackoverflow.com/a/24586587
std::string RandomString(std::size_t length) {
static const char chrs[] =
"0123456789"
"abcdefghijklmnopqrstuvwxyz"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ";
... | cwe | CWE-22 | C/C++ |
/*
Copyright (c) 2013, David C Horton
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, modify, merge, publish, distribute,... | cwe | CWE-125 | C/C++ |
_gd2GetHeader (gdIOCtxPtr in, int *sx, int *sy,
int *cs, int *vers, int *fmt, int *ncx, int *ncy,
t_chunk_info ** chunkIdx)
{
int i;
int ch;
char id[5];
t_chunk_info *cidx;
int sidx;
int nc;
GD2_DBG (printf ("Reading gd2 header info\n"));
for (i = 0; i < 4; i++) {
ch = gdGetC (... | cwe | CWE-190 | C/C++ |
char const* parse_int(char const* start, char const* end, char delimiter, boost::int64_t& val)
{
while (start < end && *start != delimiter)
{
if (!is_digit(*start)) { return 0; }
val *= 10;
val += *start - '0';
++start;
}
return start;
} | cwe | CWE-119 | C/C++ |
# -*- coding: utf-8 -*-
from django import forms
from .models import Finding, FINDING_SEVERITIES
ENGINE_TYPES = (
('json', 'json'),
('nessus', 'Nessus'),
)
class ImportFindingsForm(forms.Form):
class Meta:
fields = ['engine', 'min_level', 'file']
engine = forms.CharField(widget=forms.Select... | cwe | CWE-434 | Python |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may n... | cwe | CWE-502 | Java |
static int proc_keys_show(struct seq_file *m, void *v)
{
struct rb_node *_p = v;
struct key *key = rb_entry(_p, struct key, serial_node);
struct timespec now;
unsigned long timo;
key_ref_t key_ref, skey_ref;
char xbuf[16];
int rc;
struct keyring_search_context ctx = {
.index_key.type = key->type,
.index_k... | cwe | CWE-20 | Unknown |
explicit AsStringOp(OpKernelConstruction* ctx) : OpKernel(ctx) {
int32 precision;
bool scientific;
bool shortest;
int32 width;
string fill_string;
DataType dtype;
OP_REQUIRES_OK(ctx, ctx->GetAttr("T", &dtype));
OP_REQUIRES_OK(ctx, ctx->GetAttr("precision", &precision));
OP_REQUIRES_O... | cwe | CWE-134 | C/C++ |
/**
* @file
* IMAP login authentication method
*
* @authors
* Copyright (C) 1999-2001,2005,2009 Brendan Cully <brendan@kublai.com>
*
* @copyright
* 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
* Fo... | cwe | CWE-78 | C/C++ |
SYSCALL_DEFINE2(fchmod, unsigned int, fd, mode_t, mode)
{
struct inode * inode;
struct dentry * dentry;
struct file * file;
int err = -EBADF;
struct iattr newattrs;
file = fget(fd);
if (!file)
goto out;
dentry = file->f_path.dentry;
inode = dentry->d_inode;
audit_inode(NULL, dentry);
err = mnt_want_wri... | cwe | CWE-732 | Unknown |
long ContentEncoding::ParseCompressionEntry(long long start, long long size,
IMkvReader* pReader,
ContentCompression* compression) {
assert(pReader);
assert(compression);
long long pos = start;
const long long stop = start ... | cwe | CWE-415 | Unknown |
public function videoThumbnailTreeAction()
{
$this->checkPermission('thumbnails');
$thumbnails = [];
$list = new Asset\Video\Thumbnail\Config\Listing();
$groups = [];
foreach ($list->getThumbnails() as $item) {
if ($item->getGroup()) {
if (!$gro... | cwe | CWE-79 | PHP |
static int crypto_pcomp_report(struct sk_buff *skb, struct crypto_alg *alg)
{
struct crypto_report_comp rpcomp;
snprintf(rpcomp.type, CRYPTO_MAX_ALG_NAME, "%s", "pcomp");
if (nla_put(skb, CRYPTOCFGA_REPORT_COMPRESS,
sizeof(struct crypto_report_comp), &rpcomp))
goto nla_put_failure;
return 0;
nla_put_fail... | cwe | CWE-310 | C/C++ |
"""
Copyright 2014-2015. Jorgen Maas <jorgen.maas@gmail.com>
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 2 of the License, or
(at your option) any later version.
This program is d... | cwe | CWE-94 | Python |
static void band_destroy(jpc_enc_band_t *band)
{
jpc_enc_prc_t *prc;
jpc_enc_rlvl_t *rlvl;
uint_fast32_t prcno;
if (band->prcs) {
rlvl = band->rlvl;
for (prcno = 0, prc = band->prcs; prcno < rlvl->numprcs;
++prcno, ++prc) {
prc_destroy(prc);
}
jas_free(band->prcs);
}
if (band->data) {
jas_seq2d_... | cwe | CWE-416 | Unknown |
huff_get_next_word(Jbig2HuffmanState *hs, int offset)
{
uint32_t word = 0;
Jbig2WordStream *ws = hs->ws;
if ((ws->get_next_word(ws, offset, &word)) && ((hs->offset_limit == 0) || (offset < hs->offset_limit)))
hs->offset_limit = offset;
return word;
} | cwe | CWE-190 | C/C++ |
def get_cluster_name()
if ISRHEL6
stdout, stderror, retval = run_cmd(
PCSAuth.getSuperuserSession, COROSYNC_CMAPCTL, "cluster"
)
if retval == 0
stdout.each { |line|
match = /^cluster\.name=(.*)$/.match(line)
return match[1] if match
}
end
begin
cluster_conf ... | cwe | CWE-384 | Ruby |
public function rules()
{
$rules = [
// 'title' => 'required', // todo with multilanguage
];
return $rules;
} | cwe | CWE-190 | PHP |
h2v2_merged_upsample_565_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
JDIMENSION in_row_group_ctr,
JSAMPARRAY output_buf)
{
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
register int y, cred, cgreen, cblue;
int cb, cr;
... | cwe | CWE-476 | Unknown |
int main(int argc, char *argv[])
{
int ret;
struct lxc_lock *lock;
lock = lxc_newlock(NULL, NULL);
if (!lock) {
fprintf(stderr, "%d: failed to get unnamed lock\n", __LINE__);
exit(1);
}
ret = lxclock(lock, 0);
if (ret) {
fprintf(stderr, "%d: failed to take unnamed lock (%d)\n", __LINE__, ret);
exit(1);
... | cwe | CWE-59 | Unknown |
# -*- 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-22 | Python |
static void early_init_amd(struct cpuinfo_x86 *c)
{
early_init_amd_mc(c);
/*
* c->x86_power is 8000_0007 edx. Bit 8 is TSC runs at constant rate
* with P/T states and does not stop in deep C-states
*/
if (c->x86_power & (1 << 8)) {
set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC);
set_cpu_cap(c, X86_FEATURE_NONST... | cwe | CWE-399 | C/C++ |
TPM2B_MAX_NV_BUFFER_Marshal(TPM2B_MAX_NV_BUFFER *source, BYTE **buffer, INT32 *size)
{
UINT16 written = 0;
written += TPM2B_Marshal(&source->b, buffer, size);
return written;
} | cwe | CWE-787 | Unknown |
def create_new_repo(folder, which_branch):
# create the folder & initialize an empty bare repo
os.makedirs(folder, mode=0o770)
os.chdir(folder)
# note: --initial-branch option requires git 2.28.0 or greater
os.system(f'git init --bare --shared --initial-branch={which_branch}')
# unfortuantely,... | cwe | CWE-78 | Python |
public function uploadCompanyLogo(Request $request)
{
$company = Company::find($request->header('company'));
$this->authorize('manage company', $company);
$data = json_decode($request->company_logo);
if ($data) {
$company = Company::find($request->header('company'));
... | cwe | CWE-434 | PHP |
public InternetAddress requestResetPassword(UserReference user) throws ResetPasswordException
{
if (this.authorizationManager.hasAccess(Right.PROGRAM)) {
ResetPasswordRequestResponse resetPasswordRequestResponse =
this.resetPasswordManager.requestResetPassword(user);
... | cwe | CWE-640 | Java |
package operator
// Supported versions of the Grafana Agent.
var (
AgentCompatibilityMatrix = []string{
"v0.14.0",
"v0.15.0",
// "v0.16.0", // Pulled due to critical bug fixed in v0.16.1.
"v0.16.1",
"v0.17.0",
"v0.18.0",
"v0.18.1",
"v0.18.2",
"v0.18.3",
"v0.18.4",
"v0.19.0",
"v0.20.0",
"v0.2... | cwe | CWE-200 | Go |
void BinaryParameter::getData(void** data_, int* length_) const {
LOCK_CONFIG;
if (length_) *length_ = length;
if (data_) {
*data_ = new char[length];
memcpy(*data_, value, length);
}
} | cwe | CWE-122 | C/C++ |
# Copyright (C) 2009-2010 Canonical Ltd.
# Copyright (C) 2012, 2013 Hewlett-Packard Development Company, L.P.
#
# Author: Scott Moser <scott.moser@canonical.com>
# Author: Juerg Haefliger <juerg.haefliger@hp.com>
#
# This file is part of cloud-init. See LICENSE file for license information.
"""
Set Passwords
---------... | cwe | CWE-532 | Python |
static void usbredir_handle_bulk_data(USBRedirDevice *dev, USBPacket *p,
uint8_t ep)
{
struct usb_redir_bulk_packet_header bulk_packet;
size_t size = usb_packet_size(p);
const int maxp = dev->endpoint[EP2I(ep)].max_packet_size;
if (usbredir_already_in_flight(dev, p... | cwe | CWE-770 | Unknown |
static void vmxnet3_process_tx_queue(VMXNET3State *s, int qidx)
{
struct Vmxnet3_TxDesc txd;
uint32_t txd_idx;
uint32_t data_len;
hwaddr data_pa;
for (;;) {
if (!vmxnet3_pop_next_tx_descr(s, qidx, &txd, &txd_idx)) {
break;
}
vmxnet3_dump_tx_descr(&txd);
... | cwe | CWE-20 | C/C++ |
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
ruy::profiler::ScopeLabel label("MirrorPad");
const TfLiteTensor* input_tensor = GetInput(context, node, 0);
const TfLiteTensor* padding_matrix = GetInput(context, node, 1);
auto* params =
reinterpret_cast<TfLiteMirrorPaddingParams*>(node->buil... | cwe | CWE-787 | C/C++ |
void ImmutableConstantOp::Compute(OpKernelContext* ctx) {
std::unique_ptr<MemmappedTensorAllocator> allocator(
new MemmappedTensorAllocator());
OP_REQUIRES_OK(ctx,
allocator->InitializeFromRegion(region_name_, ctx->env()));
ctx->set_output(0, Tensor(allocator.get(), dtype_, shape_));
OP_... | cwe | CWE-125 | Unknown |
bool read(ReadonlyBytes buffer)
{
auto fields_size = sizeof(LocalFileHeader) - (sizeof(u8*) * 3);
if (buffer.size() < fields_size)
return false;
if (memcmp(buffer.data(), local_file_header_signature, sizeof(local_file_header_signature)) != 0)
return false;
mem... | cwe | CWE-120 | C/C++ |
B44Compressor::B44Compressor
(const Header &hdr,
size_t maxScanLineSize,
size_t numScanLines,
bool optFlatFields)
:
Compressor (hdr),
_maxScanLineSize (maxScanLineSize),
_optFlatFields (optFlatFields),
_format (XDR),
_numScanLines (numScanLines),
_tmpBuffer (0),
_outBuffer... | cwe | CWE-400 | C/C++ |
$comments->records[$key]->avatar = $db->selectObject('user_avatar',"user_id='".$record->poster."'");
}
if (empty($this->params['config']['disable_nested_comments'])) $comments->records = self::arrangecomments($comments->records);
// eDebug($sql, true);
// count the unapproved c... | cwe | CWE-89 | PHP |
/**
* Testing dockable windows.
*/
EditorUi.windowed = urlParams['windows'] != '0';
/**
* Code for the minimal UI theme.
*/
EditorUi.initMinimalTheme = function()
{
// Disabled in lightbox and chromeless mode
if (urlParams['lightbox'] == '1' || urlParams['chrome'] == '0' || typeof window.Format === 'undefined' |... | cwe | CWE-79 | JavaScript |
gnutls_x509_crt_import(gnutls_x509_crt_t cert,
const gnutls_datum_t * data,
gnutls_x509_crt_fmt_t format)
{
int result = 0;
int version;
if (cert == NULL) {
gnutls_assert();
return GNUTLS_E_INVALID_REQUEST;
}
if (cert->der.data) {
gnutls_free(cert->der.data);
cert->der.data = NULL;
}
... | cwe | CWE-295 | Unknown |
package jenkins.security;
import hudson.util.Secret;
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;
import java.io.IOException;
import java.security.GeneralSecurityException;
/**
* {@link ConfidentialKey} that stores a {@link SecretKey} for shared-secret cryptogra... | cwe | CWE-326 | Java |
static int r_core_cmd_subst_i(RCore *core, char *cmd, char *colon) {
const char *quotestr = "`";
const char *tick = NULL;
char *ptr, *ptr2, *str;
char *arroba = NULL;
int i, ret = 0, pipefd;
bool usemyblock = false;
int scr_html = -1;
int scr_color = -1;
bool eos = false;
bool haveQuote = false;
if (!cmd) {... | cwe | CWE-119 | Unknown |
return ka}function B(){function fa(ta,ka){var Ja=mxResources.get(ta);null==Ja&&(Ja=ta.substring(0,1).toUpperCase()+ta.substring(1));18<Ja.length&&(Ja=Ja.substring(0,18)+"…");return Ja+" ("+ka.length+")"}function sa(ta,ka,Ja){mxEvent.addListener(ka,"click",function(){Ha!=ka&&(Ha.style.backgroundColor="",Ha=ka,Ha.... | cwe | CWE-94 | JavaScript |
/* Copyright 2016 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-665 | C/C++ |
IndexedDBDispatcher::~IndexedDBDispatcher() {
g_idb_dispatcher_tls.Pointer()->Set(NULL);
} | cwe | CWE-399 | C/C++ |
ShouldCancelAndIgnore(NavigationHandle* handle) {
return handle->GetFrameTreeNodeId() == frame_tree_node_id_;
} | cwe | CWE-787 | C/C++ |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-20 | C/C++ |
def verify_email(self, member):
query = "SELECT COUNT(email) FROM members WHERE email = '{email}'".format(email = member)
self.cursor.execute(query)
result = self.cursor.fetchone()
if (int(result[0]) > 0):
return True
else:
return False | cwe | CWE-89 | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.