code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
def set_user_password(self, context, user_id, user):
return self.update_user(context, user_id, user) | cwe | CWE-264 | Python |
static errno_t sssctl_backup(bool force)
{
const char *files[] = {SSS_BACKUP_USER_OVERRIDES,
SSS_BACKUP_GROUP_OVERRIDES,
NULL};
enum sssctl_prompt_result prompt;
errno_t ret;
ret = sssctl_create_backup_dir(SSS_BACKUP_DIR);
if (ret != EOK) {
... | cwe | CWE-78 | Unknown |
Object.keys(req.query as any).length ? validateOrReject(Object.assign(new Validators.Query(), req.query as any), validatorOptions) : null
]) | cwe | CWE-20 | JavaScript |
Mangle(input, control) /* returns a pointer to a controlled Mangle */
char *input;
char *control;
{
int limit;
register char *ptr;
static char area[STRINGSIZE];
char area2[STRINGSIZE];
area[0] = '\0';
strcpy(area, input);
for (ptr = control; *ptr; ptr++)
{
switch (*ptr)
{
ca... | cwe | CWE-787 | C/C++ |
ciphertext_to_compressed (gnutls_session_t session,
gnutls_datum_t *ciphertext,
uint8_t * compress_data,
int compress_size,
uint8_t type, record_parameters_st * params,
uint64* sequence)
{... | cwe | CWE-310 | Unknown |
static void show_frame(WriterContext *w, AVFrame *frame, AVStream *stream,
AVFormatContext *fmt_ctx)
{
AVBPrint pbuf;
char val_str[128];
const char *s;
int i;
av_bprint_init(&pbuf, 1, AV_BPRINT_SIZE_UNLIMITED);
writer_print_section_header(w, SECTION_ID_FRAME);
s = a... | cwe | CWE-476 | Unknown |
export function createCatalogWriteAction() {
return createTemplateAction<{ name?: string; entity: Entity }>({
id: 'catalog:write',
description: 'Writes the catalog-info.yaml for your template',
schema: {
input: {
type: 'object',
properties: {
entity: {
title: 'E... | cwe | CWE-22 | JavaScript |
static int sql_auxprop_store(void *glob_context,
sasl_server_params_t *sparams,
struct propctx *ctx,
const char *user,
unsigned ulen)
{
char *userid = NULL;
char *realm = NULL;
const char *user_realm = NULL;
int ret = SASL_FAIL;
const struct propval *to_store, *cur;
... | cwe | CWE-89 | Unknown |
new_msg_register_event (u_int32_t seqnum, struct lsa_filter_type *filter)
{
u_char buf[OSPF_API_MAX_MSG_SIZE];
struct msg_register_event *emsg;
int len;
emsg = (struct msg_register_event *) buf;
len = sizeof (struct msg_register_event) +
filter->num_areas * sizeof (struct in_addr);
emsg->filter.typema... | cwe | CWE-119 | C/C++ |
static void ext4_free_io_end(ext4_io_end_t *io)
{
BUG_ON(!io);
iput(io->inode);
kfree(io);
} | cwe | CWE-703 | Unknown |
_client_protocol_timeout (GsmXSMPClient *client)
{
g_debug ("GsmXSMPClient: client_protocol_timeout for client '%s' in ICE status %d",
client->priv->description,
IceConnectionStatus (client->priv->ice_connection));
gsm_client_set_status (GSM_CLIENT (client), GSM_CLIENT_... | cwe | CWE-835 | C/C++ |
/*
* Ut Video decoder
* Copyright (c) 2011 Konstantin Shishkov
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, o... | cwe | CWE-125 | C/C++ |
/* nbdkit
* Copyright (C) 2013-2019 Red Hat Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the f... | cwe | CWE-406 | C/C++ |
'use strict';
const extend = Object.assign;
const express = require('express');
const domain = require('domain');
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const flash = require('connect-flash');
const path = require('path');
const fs = require('fs');
const csrf = require('csurf');
const ro... | cwe | CWE-601 | JavaScript |
void MediaStreamDispatcherHost::StopStreamDevice(const std::string& device_id,
int32_t session_id) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
media_stream_manager_->StopStreamDevice(render_process_id_, render_frame_id_,
d... | cwe | CWE-189 | C/C++ |
import logging
import yaml
import requests
from redash import settings
from redash.query_runner import *
from redash.utils import json_dumps
logger = logging.getLogger(__name__)
try:
import pandas as pd
import xlrd
import openpyxl
import numpy as np
enabled = True
except ImportError:
enabled ... | cwe | CWE-918 | Python |
static void timerfd_remove_cancel(struct timerfd_ctx *ctx)
{
if (ctx->might_cancel) {
ctx->might_cancel = false;
spin_lock(&cancel_lock);
list_del_rcu(&ctx->clist);
spin_unlock(&cancel_lock);
}
} | cwe | CWE-416 | Unknown |
const got = require('@/utils/got');
const cheerio = require('cheerio');
module.exports = async (ctx) => {
const baseUrl = 'https://gouhuo.qq.com';
const url = `${baseUrl}/guide`;
const response = await got({
method: 'get',
url: url,
headers: {
Referer: `https://gouhuo.qq... | cwe | CWE-74 | JavaScript |
static pj_status_t decode_errcode_attr(pj_pool_t *pool,
const pj_uint8_t *buf,
const pj_stun_msg_hdr *msghdr,
void **p_attr)
{
pj_stun_errcode_attr *attr;
pj_str_t value;
PJ_UNUSED_ARG(msghdr);
/* Create the attribute */
attr = PJ_POOL_ZALLOC_T(pool, pj_stun_errc... | cwe | CWE-191 | Unknown |
static int wanxl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
const size_t size = sizeof(sync_serial_settings);
sync_serial_settings line;
port_t *port = dev_to_port(dev);
if (cmd != SIOCWANDEV)
return hdlc_ioctl(dev, ifr, cmd);
switch (ifr->ifr_settings.type) {
case IF_GET_IFACE:
ifr->ifr_se... | cwe | CWE-399 | C/C++ |
function searchkey(query,res){
connection.query('select * from bi_posts where concat(title,content) like "%'+ query +'%"', function(err, rows) {
if(err){ log(err,3);}
if(rows[0] === undefined){
res.contentType('application/json');
res.send('{"error":2}');
return;
}
var result = {
... | cwe | CWE-89 | JavaScript |
static MagickBooleanType WritePSImage(const ImageInfo *image_info,Image *image)
{
#define WriteRunlengthPacket(image,pixel,length,p) \
{ \
if ((image->matte != MagickFalse) && (length != 0) &&\
(GetPixelOpacity(p) == (Quantum) TransparentOpacity)) \
{ \
q=PopHexPixel(hex_digits,0xff,q); \
q=PopH... | cwe | CWE-787 | C/C++ |
// Copyright (c) 2012-2016 The Revel Framework Authors, All rights reserved.
// Revel Framework source code and usage is governed by a MIT style
// license that can be found in the LICENSE file.
package revel
import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"mime/multipart"
"os"
"reflect"
"strconv"
"strings"
... | cwe | CWE-770 | Go |
scoped_refptr<PermissionSet> UnpackPermissionSet(
const Permissions& permissions, std::string* error) {
APIPermissionSet apis;
std::vector<std::string>* permissions_list = permissions.permissions.get();
if (permissions_list) {
PermissionsInfo* info = PermissionsInfo::GetInstance();
for (std::vector... | cwe | CWE-264 | C/C++ |
def download(url, remote_headers = {})
headers = remote_headers.
reverse_merge('User-Agent' => "CarrierWave/#{CarrierWave::VERSION}")
begin
file = OpenURI.open_uri(process_uri(url.to_s), headers)
rescue StandardError => e
raise CarrierWave::DownloadError, "could not... | cwe | CWE-918 | Ruby |
MagickExport Image *AdaptiveThresholdImage(const Image *image,
const size_t width,const size_t height,const ssize_t offset,
ExceptionInfo *exception)
{
#define ThresholdImageTag "Threshold/Image"
CacheView
*image_view,
*threshold_view;
Image
*threshold_image;
MagickBooleanType
status;
M... | cwe | CWE-125 | C/C++ |
/*
* 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 |
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);
const TfLiteTensor* axis = GetInput(context, node, kAxisTensor);
TF_LITE_ENSURE_... | cwe | CWE-125 | C/C++ |
int ssl3_client_hello(SSL *s)
{
unsigned char *buf;
unsigned char *p, *d;
int i;
unsigned long l;
int al = 0;
#ifndef OPENSSL_NO_COMP
int j;
SSL_COMP *comp;
#endif
buf = (unsigned char *)s->init_buf->data;
if (s->state == SSL3_ST_CW_CLNT_HELLO_A) {
SSL_SESSION *sess = s->ses... | cwe | CWE-310 | Unknown |
srtp_unprotect_aead (srtp_ctx_t *ctx, srtp_stream_ctx_t *stream, int delta,
xtd_seq_num_t est, void *srtp_hdr, unsigned int *pkt_octet_len)
{
srtp_hdr_t *hdr = (srtp_hdr_t*)srtp_hdr;
uint32_t *enc_start; /* pointer to start of encrypted portion */
unsigned int enc_octet_len = 0; /* nu... | cwe | CWE-119 | Unknown |
function createCaptionElement(caption, isAudioDescription) {
var captionElement = document.createElement('div');
$(captionElement).addClass('captions');
if(isAudioDescription) {
$(captionElement).addClass('audio-description');
}
$(captionElement).addClass(caption.css... | cwe | CWE-79 | JavaScript |
/* Copyright 2020 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | cwe | CWE-617 | C/C++ |
lex(struct scanner *s, union lvalue *val)
{
skip_more_whitespace_and_comments:
/* Skip spaces. */
while (is_space(peek(s)))
if (next(s) == '\n')
return TOK_END_OF_LINE;
/* Skip comments. */
if (chr(s, '#')) {
skip_to_eol(s);
goto skip_more_whitespace_and_comments;
... | cwe | CWE-835 | C/C++ |
public function show()
{
$task = $this->getTask();
$subtask = $this->getSubtask();
$this->response->html($this->template->render('subtask_converter/show', array(
'subtask' => $subtask,
'task' => $task,
)));
} | cwe | CWE-639 | PHP |
void ModuleSQL::init()
{
Dispatcher = new DispatcherThread(this);
ServerInstance->Threads->Start(Dispatcher);
Implementation eventlist[] = { I_OnRehash, I_OnUnloadModule };
ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
OnRehash(NULL);
} | cwe | CWE-476 | Unknown |
resolve_ops (FlatpakTransaction *self,
GCancellable *cancellable,
GError **error)
{
FlatpakTransactionPrivate *priv = flatpak_transaction_get_instance_private (self);
GList *l;
for (l = priv->ops; l != NULL; l = l->next)
{
FlatpakTransactionOperation *op = l->... | cwe | CWE-276 | C/C++ |
static MagickBooleanType WriteMIFFImage(const ImageInfo *image_info,
Image *image,ExceptionInfo *exception)
{
#if defined(MAGICKCORE_BZLIB_DELEGATE)
bz_stream
bzip_info;
#endif
char
buffer[MagickPathExtent];
CompressionType
compression;
const char
*property,
*value;
#if defined(MAGICKC... | cwe | CWE-401 | Unknown |
package com.salesmanager.core.business.repositories.catalog.product.attribute;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import com.salesmanager.core.model.catalog.product.attribute.ProductOptionSet;
public interface Pr... | cwe | CWE-639 | Java |
ipv6_renew_options(struct sock *sk, struct ipv6_txoptions *opt,
int newtype,
struct ipv6_opt_hdr __user *newopt, int newoptlen)
{
int tot_len = 0;
char *p;
struct ipv6_txoptions *opt2;
int err;
if (opt) {
if (newtype != IPV6_HOPOPTS && opt->hopopt)
tot_len += CMSG_ALIGN(ipv6_optlen(opt->hopopt));
... | cwe | CWE-264 | C/C++ |
void LEX::relink_hack(st_select_lex *select_lex)
{
if (!select_stack_top) // Statements of the second type
{
if (!select_lex->get_master()->get_master())
((st_select_lex *) select_lex->get_master())->
set_master(&builtin_select);
if (!builtin_select.get_slave())
builtin_select.set_slave(... | cwe | CWE-703 | Unknown |
int64_t GmfOpenMesh(const char *FilNam, int mod, ...)
{
int KwdCod, res, *PtrVer, *PtrDim, err;
int64_t MshIdx;
char str[ GmfStrSiz ];
va_list VarArg;
GmfMshSct *msh;
/*---------------------*/
/* MESH STRUCTURE INIT */
/*---------------------*/
if(!(msh = calloc(1, sizeof(GmfMshS... | cwe | CWE-120 | Unknown |
rsvg_handle_write_impl (RsvgHandle * handle, const guchar * buf, gsize count, GError ** error)
{
GError *real_error = NULL;
int result;
rsvg_return_val_if_fail (handle != NULL, FALSE, error);
handle->priv->error = &real_error;
if (handle->priv->ctxt == NULL) {
handle->priv->ctxt = xmlCreat... | cwe | CWE-20 | 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-770 | Python |
function escapeArgBash(arg, interpolation, quoted) {
let result = arg.replace(/\u0000/g, "");
if (interpolation) {
result = result
.replace(/\\/g, "\\\\")
.replace(/\n/g, " ")
.replace(/(^|\s)(~|#)/g, "$1\\$2")
.replace(/(\*|\?)/g, "\\$1")
.replace(/(\$|\;|\&|\|)/g, "\\$1")
... | cwe | CWE-400 | JavaScript |
function update(e) {
setOutput(e.getValue());
//If a title is added to the document it will be the new document.title, otherwise use default
var headerElements = document.querySelectorAll('h1');
if (headerElements.length > 0 && headerElements[0].textContent.length > 0) {
title = headerElements[... | cwe | CWE-79 | JavaScript |
require('dotenv').config()
const User = require('../../model/user')
const Org = require('../../model/org')
const logger = require('../../middleware/logger')
const argon2 = require('argon2')
const CONSTANTS = require('../../constants')
const cryptoRandomString = require('crypto-random-string')
const uuid = require('uuid... | cwe | CWE-732 | JavaScript |
const {type, store = JsonEntityStore.from(type), ...next} = options;
const propertiesMap = getPropertiesStores(store);
let keys = Object.keys(src);
const additionalProperties = propertiesMap.size ? !!store.schema.get("additionalProperties") || options.additionalProperties : true;
const out: any = new type(src)... | cwe | CWE-1321 | JavaScript |
static int chacha20_poly1305_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg,
void *ptr)
{
EVP_CHACHA_AEAD_CTX *actx = aead_data(ctx);
switch(type) {
case EVP_CTRL_INIT:
if (actx == NULL)
actx = ctx->cipher_data
= OPENSSL_zalloc(sizeof(*act... | cwe | CWE-327 | Unknown |
import discord , subprocess , datetime
from discord.ext import commands
from setting import *
from os import path , getcwd , chdir
from assets import CommandInjection
from assets import getIp
from assets import randomStrings
from assets import removeColors
from assets import Duplicates
from assets import removeString
... | cwe | CWE-78 | Python |
static void ptirq_free_irte(const struct ptirq_remapping_info *entry)
{
struct intr_source intr_src;
if (entry->irte_idx < CONFIG_MAX_IR_ENTRIES) {
if (entry->intr_type == PTDEV_INTR_MSI) {
intr_src.is_msi = true;
intr_src.src.msi.value = entry->phys_sid.msi_id.bdf;
} else {
intr_src.is_msi = false;
... | cwe | CWE-787 | Unknown |
static int parseFileInner(MaState *state, cchar *path)
{
MaDirective *directive;
char *tok, *key, *line, *value;
assert(state);
assert(path && *path);
if (openConfig(state, path) < 0) {
return MPR_ERR_CANT_OPEN;
}
for (state->lineNumber = 1; state->file && (line = mprRea... | cwe | CWE-476 | C/C++ |
ExprAppendMultiKeysymList(ExprDef *expr, ExprDef *append)
{
unsigned nSyms = darray_size(expr->keysym_list.syms);
unsigned numEntries = darray_size(append->keysym_list.syms);
darray_append(expr->keysym_list.symsMapIndex, nSyms);
darray_append(expr->keysym_list.symsNumEntries, numEntries);
darray_... | cwe | CWE-416 | C/C++ |
/*
* 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, version 2 of the
* License.
*/
#include <linux/stat.h>
#include <linux/sysctl.h>
#include <linux/slab.h>
#include <linux/cred.h>
#inc... | cwe | CWE-416 | C/C++ |
function fromUrl (giturl, opts) {
if (giturl == null || giturl === '') return
var url = fixupUnqualifiedGist(
isGitHubShorthand(giturl) ? 'github:' + giturl : giturl
)
var parsed = parseGitUrl(url)
var shortcutMatch = url.match(new RegExp('^([^:]+):(?:(?:[^@:]+(?:[^@]+)?@)?([^/]*))[/](.+?)(?:[.]git)?($|#)... | cwe | CWE-1333 | JavaScript |
const parser = require('@/utils/rss-parser');
const config = require('@/config').value;
module.exports = async (ctx) => {
const scheme = ctx.params.https || 'https';
const cdn = config.wordpress.cdnUrl;
const domain = `${scheme}://${ctx.params.domain}`;
const feed = await parser.parseURL(`${domain}/fe... | cwe | CWE-918 | JavaScript |
public function create($data)
{
if ($this->securityController->isWikiHibernated()) {
throw new \Exception(_t('WIKI_IN_HIBERNATION'));
}
// If ID is not set or if it is already used, find a new ID
if (!$data['bn_id_nature'] || $this->getOne($data['bn_id_nature'])) {
... | cwe | CWE-89 | PHP |
static BOOL rfx_process_message_tileset(RFX_CONTEXT* context, RFX_MESSAGE* message, wStream* s,
UINT16* pExpectedBlockType)
{
BOOL rc;
int i, close_cnt;
size_t pos;
BYTE quant;
RFX_TILE* tile;
RFX_TILE** tmpTiles;
UINT32* quants;
UINT16 subtype, numTiles;
UINT32 blockLen... | cwe | CWE-125 | Unknown |
/*
Copyright (c) 2009 Dave Gamble
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, distr... | cwe | CWE-401 | C/C++ |
package docker
import (
"bufio"
"context"
"encoding/json"
"fmt"
"io"
"strconv"
"strings"
"time"
"emperror.dev/errors"
"github.com/apex/log"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/mount"
"github.com/docker/docker/client"
"g... | cwe | CWE-770 | Go |
updateDevice(const struct header * headers, time_t t)
{
struct device ** pp = &devlist;
struct device * p = *pp; /* = devlist; */
while(p)
{
if( p->headers[HEADER_NT].l == headers[HEADER_NT].l
&& (0==memcmp(p->headers[HEADER_NT].p, headers[HEADER_NT].p, headers[HEADER_NT].l))
&& p->headers[HEADER_USN].l ... | cwe | CWE-416 | C/C++ |
def _update_volume_stats(self):
"""Retrieve stats info from volume group."""
LOG.debug(_("Updating volume stats"))
data = {}
data['vendor_name'] = 'IBM'
data['driver_version'] = '1.1'
data['storage_protocol'] = list(self._enabled_protocols)
data['total_capacity... | cwe | CWE-78 | Python |
def writeToDb(self, url):
try:
self.cursor.execute("INSERT INTO queue (url, visited) VALUES ('{}', '0');".format(url))
self.db.commit()
except Exception as e:
print(e) | cwe | CWE-89 | Python |
NAN_METHOD(XmlDocument::FromXml)
{
Nan::HandleScope scope;
v8::Local<v8::Array> errors = Nan::New<v8::Array>();
xmlResetLastError();
xmlSetStructuredErrorFunc(reinterpret_cast<void *>(&errors),
XmlSyntaxError::PushToArray);
v8::Local<v8::Object> options = Nan::To<v8::Object>(info[1]).T... | cwe | CWE-400 | Unknown |
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | cwe | CWE-369 | Python |
static ssize_t driver_override_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
struct platform_device *pdev = to_platform_device(dev);
char *driver_override, *old = pdev->driver_override, *cp;
if (count > PATH_MAX)
return -EINVAL;
driver_override = kst... | cwe | CWE-284 | Unknown |
struct error_obj run_pam_auth(const char *username, char *password) {
// PAM frees pam_response for us.
struct pam_response *reply = malloc(sizeof(struct pam_response));
if (reply == NULL) {
struct error_obj ret_val;
ret_val.status = 2;
ret_val.func_name = "malloc";
ret_val.e... | cwe | CWE-613 | Unknown |
static int string_scan_range(RList *list, RBinFile *bf, int min,
const ut64 from, const ut64 to, int type, int raw, RBinSection *section) {
RBin *bin = bf->rbin;
ut8 tmp[R_STRING_SCAN_BUFFER_SIZE];
ut64 str_start, needle = from;
int count = 0, i, rc, runes;
int str_type = R_STRING_TYPE_DETECT;
// if lis... | cwe | CWE-125 | C/C++ |
aiff_read_chanmap (SF_PRIVATE * psf, unsigned dword)
{ const AIFF_CAF_CHANNEL_MAP * map_info ;
unsigned channel_bitmap, channel_decriptions, bytesread ;
int layout_tag ;
bytesread = psf_binheader_readf (psf, "444", &layout_tag, &channel_bitmap, &channel_decriptions) ;
if ((map_info = aiff_caf_of_channel_layout_ta... | cwe | CWE-119 | C/C++ |
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-703 | Unknown |
#include <iostream>
#include <string>
#include <mutex>
#include <numeric>
#include <inja.hpp>
#include <yaml-cpp/yaml.h>
#include "../config/binding.h"
#include "../generator/config/nodemanip.h"
#include "../generator/config/ruleconvert.h"
#include "../generator/config/subexport.h"
#include "../generator/template/tem... | cwe | CWE-434 | C/C++ |
otError Commissioner::GeneratePskc(const char * aPassPhrase,
const char * aNetworkName,
const Mac::ExtendedPanId &aExtPanId,
Pskc & aPskc)
{
otError error = ... | cwe | CWE-787 | C/C++ |
static void suboption(struct Curl_easy *data)
{
struct curl_slist *v;
unsigned char temp[2048];
ssize_t bytes_written;
size_t len;
int err;
char varname[128] = "";
char varval[128] = "";
struct TELNET *tn = data->req.p.telnet;
struct connectdata *conn = data->conn;
printsub(data, '<', (unsigned cha... | cwe | CWE-909 | C/C++ |
static ssize_t o2nm_node_ipv4_address_store(struct config_item *item,
const char *page,
size_t count)
{
struct o2nm_node *node = to_o2nm_node(item);
struct o2nm_cluster *cluster = to_o2nm_cluster_from_node(node);
int ret, i;
struct rb_node **p, *parent;
unsigned int octets[4];
__be32 ipv4_addr =... | cwe | CWE-476 | Unknown |
/*
* Copyright (c) 2004-2021, University of Oslo
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
* list of cond... | cwe | CWE-89 | Java |
int vrend_create_vertex_elements_state(struct vrend_context *ctx,
uint32_t handle,
unsigned num_elements,
const struct pipe_vertex_element *elements)
{
struct vrend_vertex_element_array *v = CALLOC... | cwe | CWE-772 | C/C++ |
lambda_function_body(
char_u **arg,
typval_T *rettv,
evalarg_T *evalarg,
garray_T *newargs,
garray_T *argtypes,
int varargs,
garray_T *default_args,
char_u *ret_type)
{
int evaluate = (evalarg->eval_flags & EVAL_EVALUATE);
garray_T *gap = &evalarg->eval_ga;
garray_T *freeg... | cwe | CWE-416 | C/C++ |
void ipc_rcu_putref(void *ptr)
{
if (--container_of(ptr, struct ipc_rcu_hdr, data)->refcount > 0)
return;
if (container_of(ptr, struct ipc_rcu_hdr, data)->is_vmalloc) {
call_rcu(&container_of(ptr, struct ipc_rcu_grace, data)->rcu,
ipc_schedule_free);
} else {
kfree_rcu(container_of(ptr, struct ipc_rcu... | cwe | CWE-189 | C/C++ |
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
const OpData* op_data = reinterpret_cast<OpData*>(node->user_data);
TF_LITE_ENSURE(context, node->inputs->size > 0);
// The first input is the condition.
const TfLiteTensor* cond = GetInput(context, node, 0);
// Currently only bool is supporte... | cwe | CWE-125 | C/C++ |
public final void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException {
if (skipFilter((HttpServletRequest) request)) {
chain.doFilter(request, response);
} else {
HttpServletRequest httpRequest = (HttpServletRequest) request;
Http... | cwe | CWE-22 | Java |
from typing import Any, List
import bleach
from .rest_api import ValidationError
allowed_tags_strict = [
"a",
"img", # links and images
"br",
"p",
"span",
"blockquote", # text layout
"strike",
"del",
"ins",
"strong",
"u",
"em",
"sup",
"sub",
"pre", # te... | cwe | CWE-79 | Python |
#!/usr/bin/env python3
"""An installer for Modoboa."""
import argparse
import datetime
import os
try:
import configparser
except ImportError:
import ConfigParser as configparser
import sys
from modoboa_installer import compatibility_matrix
from modoboa_installer import constants
from modoboa_installer import... | cwe | CWE-307 | Python |
lp8000_print_page(gx_device_printer *pdev, gp_file *prn_stream)
{
int line_size = gdev_mem_bytes_per_scan_line((gx_device *)pdev);
int in_size = line_size;
unsigned int report_size;
byte *buf1 = (byte *)gs_malloc(pdev->memory, in_size, 1, "lp8000_print_page(buf1)");
byte *buf2 ... | cwe | CWE-787 | Unknown |
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
const TfLiteTensor* input = GetInput(context, node, kInputTensor);
switch (input->type) { // Already know in/out types are same.
case kTfLiteFloat32:
return EvalImpl<kernel_type, kTfLiteFloat32>(context, node);
case kTfLiteUInt8:
re... | cwe | CWE-125 | C/C++ |
/* $OpenBSD: sftp-server.c,v 1.110 2016/09/12 01:22:38 deraadt Exp $ */
/*
* Copyright (c) 2000-2004 Markus Friedl. All rights reserved.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this pe... | cwe | CWE-269 | C/C++ |
'use strict';
exports.json = function (input) {
return JSON.stringify(input, null, ' ');
};
exports.convertBytes = function (input) {
input = parseInt(input, 10);
if (Number.isNaN(input)) {
return '0 Bytes';
}
if (input < 1024) {
return input.toString() + ' Bytes';
}
if (input < 1024 * 1024) ... | cwe | CWE-79 | JavaScript |
nfs3svc_decode_writeargs(struct svc_rqst *rqstp, __be32 *p,
struct nfsd3_writeargs *args)
{
unsigned int len, v, hdr, dlen;
u32 max_blocksize = svc_max_payload(rqstp);
struct kvec *head = rqstp->rq_arg.head;
struct kvec *tail = rqstp->rq_arg.tail;
p = decode_fh(p, &args->fh);
if (!p)
return 0;
p = xdr_de... | cwe | CWE-119 | C/C++ |
xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) {
int ret = 0;
int avail, tlen;
xmlChar cur, next;
const xmlChar *lastlt, *lastgt;
if (ctxt->input == NULL)
return(0);
#ifdef DEBUG_PUSH
switch (ctxt->instate) {
case XML_PARSER_EOF:
xmlGenericError(xmlGenericErrorContext,... | cwe | CWE-119 | Unknown |
static void gx_ttfReader__Read(ttfReader *self, void *p, int n)
{
gx_ttfReader *r = (gx_ttfReader *)self;
const byte *q;
if (!r->error) {
if (r->extra_glyph_index != -1) {
q = r->glyph_data.bits.data + r->pos;
r->error = (r->glyph_data.bits.size - r->pos < n ?
... | cwe | CWE-125 | C/C++ |
/*
+----------------------------------------------------------------------+
| HipHop for PHP |
+----------------------------------------------------------------------+
| Copyright (c) 2010-present Facebook, Inc. (http://www.facebook.com) |
| Copyrigh... | cwe | CWE-125 | C/C++ |
// SPDX-License-Identifier: GPL-2.0
/* Copyright(c) 2009-2012 Realtek Corporation.*/
#include "wifi.h"
#include "core.h"
#include "usb.h"
#include "base.h"
#include "ps.h"
#include "rtl8192c/fw_common.h"
#include <linux/export.h>
#include <linux/module.h>
MODULE_AUTHOR("lizhaoming <chaoming_li@realsil.com.cn>");
MOD... | cwe | CWE-400 | C/C++ |
/*
* Copyright (C) 2004-2018 ZNC, see the NOTICE file for details.
*
* 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 requi... | cwe | CWE-20 | C/C++ |
CharString *Formattable::internalGetCharString(UErrorCode &status) {
if(fDecimalStr == NULL) {
if (fDecimalQuantity == NULL) {
// No decimal number for the formattable yet. Which means the value was
// set directly by the user as an int, int64 or double. If the value came
// from par... | cwe | CWE-190 | Java |
# -*- 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-613 | 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 not use ... | cwe | CWE-254 | Python |
#include "mongoose.h"
#ifdef MG_MODULE_LINES
#line 1 "mongoose/src/mg_internal.h"
#endif
/*
* Copyright (c) 2014 Cesanta Software Limited
* All rights reserved
*/
#ifndef CS_MONGOOSE_SRC_INTERNAL_H_
#define CS_MONGOOSE_SRC_INTERNAL_H_
/* Amalgamated: #include "common/mg_mem.h" */
#ifndef MBUF_REALLOC
#define MBUF... | cwe | CWE-787 | C/C++ |
const { resolve } = require('path');
const exec = require('async-execute');
const exist = require('@does/exist');
/**
* Create and push a git tag with the last commit message
* @param {String} path Path to file
* @return {Date}
*/
module.exports = async function(path) {
if (!path || typeof path !== 'string') {
... | cwe | CWE-88 | JavaScript |
TfLiteStatus ResizeOutputTensor(TfLiteContext* context,
const TfLiteTensor* data,
const TfLiteTensor* segment_ids,
TfLiteTensor* output) {
int max_index = -1;
const int segment_id_size = segment_ids->dims->data[0];
if ... | cwe | CWE-703 | Unknown |
protected function _mkfile($path, $name)
{
$path = $this->_joinPath($path, $name);
return $this->connect->put($path, '') ? $path : false;
/*
if ($this->tmp) {
$path = $this->_joinPath($path, $name);
$local = $this->getTempFile();
$res = touch($local) && $t... | cwe | CWE-22 | PHP |
def parse_jwt_token(request: func.HttpRequest) -> Result[UserInfo]:
"""Obtains the Access Token from the Authorization Header"""
token_str = get_auth_token(request)
if token_str is None:
return Error(
code=ErrorCode.INVALID_REQUEST,
errors=["unable to find authorization token... | cwe | CWE-863 | Python |
static int show_modified(struct oneway_unpack_data *cbdata,
struct cache_entry *old,
struct cache_entry *new,
int report_missing,
int cached, int match_missing)
{
unsigned int mode, oldmode;
const unsigned char *sha1;
struct rev_info *revs = cbdata->revs;
if (get_stat_data(new, &sha1, &mode, cached... | cwe | CWE-119 | Unknown |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.