code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
function renderIssue(message) {
return issueTemplate({
severity: severityString(message.severity),
severityName: message.severity === 1 ? 'Warning' : 'Error',
lineNumber: message.line,
column: message.column,
message: message.message,
ruleId: message.ruleId,
ruleLink: getRuleLink(message.ruleId)
});
} | cwe | CWE-79 | JavaScript |
dtls1_get_message_fragment(SSL *s, int st1, int stn, long max, int *ok)
{
unsigned char wire[DTLS1_HM_HEADER_LENGTH];
unsigned long len, frag_off, frag_len;
int i,al;
struct hm_header_st msg_hdr;
/* see if we have the required fragment already */
if ((frag_len = dtls1_retrieve_buffered_fragment(s,max,ok)) || *o... | cwe | CWE-399 | Unknown |
/*
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
*
* This file is part of Open5GS.
*
* 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 License, or
... | cwe | CWE-20 | C/C++ |
public Map<String, Object> getHelperUtilities() {
Map<String, Object> variables = new HashMap<String, Object>();
// Array util
variables.put("arrayUtil", ArrayUtil_IW.getInstance());
// Audit message factory
variables.put(
"auditMessageFactoryUtil",
AuditMessageFactoryUtil.getAuditMessageFactory());... | cwe | CWE-264 | Java |
/****************************************************************************
*
* Copyright (C) 2006,2007 A.Kleine
*
* 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... | cwe | CWE-119 | C/C++ |
void __init acpi_debugfs_init(void)
{
acpi_debugfs_dir = debugfs_create_dir("acpi", NULL);
acpi_custom_method_init();
} | cwe | CWE-284 | Unknown |
def empty
Log.add_info(request, params.inspect)
@folder_id = params[:id]
mail_account_id = params[:mail_account_id]
SqlHelper.validate_token([mail_account_id])
trash_folder = MailFolder.get_for(@login_user, mail_account_id, MailFolder::XTYPE_TRASH)
mail_folder = MailFolder.find(@folder_id)
... | cwe | CWE-89 | Ruby |
bool L2NormalizeReduceAxis(Value sq_op, DenseElementsAttr axis) {
if (sq_op.getType().cast<ShapedType>().getRank() - 1 ==
*axis.getValues<int>().begin() ||
*axis.getValues<int>().begin() == -1) {
return true;
}
if (sq_op.getType().cast<ShapedType>().getRank() != axis.getNumElements()) {
re... | cwe | CWE-125 | C/C++ |
k5_asn1_full_decode(const krb5_data *code, const struct atype_info *a,
void **retrep)
{
krb5_error_code ret;
const uint8_t *contents, *remainder;
size_t clen, rlen;
taginfo t;
*retrep = NULL;
ret = get_tag((uint8_t *)code->data, code->length, &t, &contents,
... | cwe | CWE-787 | Unknown |
NORET_TYPE void do_exit(long code)
{
struct task_struct *tsk = current;
int group_dead;
profile_task_exit(tsk);
WARN_ON(atomic_read(&tsk->fs_excl));
if (unlikely(in_interrupt()))
panic("Aiee, killing interrupt handler!");
if (unlikely(!tsk->pid))
panic("Attempted to kill the idle task!");
tracehook_repor... | cwe | CWE-400 | Unknown |
void requestResetPasswordUnexistingUser()
{
when(this.userReference.toString()).thenReturn("user:Foobar");
when(this.userManager.exists(this.userReference)).thenReturn(false);
String exceptionMessage = "User [user:Foobar] doesn't exist";
when(this.localizationManager.getTranslationPl... | cwe | CWE-200 | Java |
void processInputBuffer(client *c) {
server.current_client = c;
/* Keep processing while there is something in the input buffer */
while(sdslen(c->querybuf)) {
/* Return if clients are paused. */
if (!(c->flags & CLIENT_SLAVE) && clientsArePaused()) break;
/* Immediately abort if th... | cwe | CWE-254 | C/C++ |
def logout
session.cluster.logout(name)
end | cwe | CWE-20 | Ruby |
static void pdf_handle_enc(struct pdf_struct *pdf)
{
struct pdf_obj *obj;
uint32_t len, required_flags, n, R, P, length, EM, i, oulen;
char *O, *U;
const char *q, *q2;
if (pdf->enc_objid == ~0u)
return;
if (!pdf->fileID) {
cli_dbgmsg("cli_pdf: pdf_handle_enc no file ID\n");
return;
}
... | cwe | CWE-119 | Unknown |
/*
* Wire
* Copyright (C) 2016 Wire Swiss GmbH
*
* 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 3 of the License, or
* (at your option) any later version.
*
* This progr... | cwe | CWE-134 | C/C++ |
static int on_header_value(
multipart_parser *parser, const char *at, size_t length)
{
multipart_parser_data_t *data = NULL;
ogs_assert(parser);
data = multipart_parser_get_data(parser);
ogs_assert(data);
if (at && length) {
SWITCH(data->header_field)
CASE(OGS_SBI_CONTENT_T... | cwe | CWE-476 | Unknown |
evbuffer_ptr_memcmp(const struct evbuffer *buf, const struct evbuffer_ptr *pos,
const char *mem, size_t len)
{
struct evbuffer_chain *chain;
size_t position;
int r;
ASSERT_EVBUFFER_LOCKED(buf);
if (pos->pos + len > buf->total_len)
return -1;
chain = pos->_internal.chain;
position = pos->_internal.pos_in... | cwe | CWE-189 | Unknown |
miniflow_extract(struct dp_packet *packet, struct miniflow *dst)
{
const struct pkt_metadata *md = &packet->md;
const void *data = dp_packet_data(packet);
size_t size = dp_packet_size(packet);
ovs_be32 packet_type = packet->packet_type;
uint64_t *values = miniflow_values(dst);
struct mf_ctx mf =... | cwe | CWE-400 | Unknown |
bool Item_default_value::fix_fields(THD *thd, Item **items)
{
Item *real_arg;
Item_field *field_arg;
Field *def_field;
DBUG_ASSERT(fixed == 0);
DBUG_ASSERT(arg);
/*
DEFAULT() do not need table field so should not ask handler to bring
field value (mark column for read)
*/
enum_column_usage save_... | cwe | CWE-703 | Unknown |
void ResourceDispatcherHostImpl::PauseRequest(int child_id,
int request_id,
bool pause) {
GlobalRequestID global_id(child_id, request_id);
PendingRequestList::iterator i = pending_requests_.find(global_id);
if (i == pendin... | cwe | CWE-119 | C/C++ |
# -*- coding: utf-8 -*-
# rdiffweb, A web interface to rdiff-backup repositories
# Copyright (C) 2012-2021 rdiffweb contributors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version ... | cwe | CWE-770 | Python |
int hllSparseToDense(robj *o) {
sds sparse = o->ptr, dense;
struct hllhdr *hdr, *oldhdr = (struct hllhdr*)sparse;
int idx = 0, runlen, regval;
uint8_t *p = (uint8_t*)sparse, *end = p+sdslen(sparse);
/* If the representation is already the right one return ASAP. */
hdr = (struct hllhdr*) sparse;... | cwe | CWE-787 | Unknown |
package com.salesmanager.shop.admin.controller.content;
import com.salesmanager.core.business.services.content.ContentService;
import com.salesmanager.core.business.services.reference.language.LanguageService;
import com.salesmanager.core.model.content.Content;
import com.salesmanager.core.model.content.ContentDescrip... | cwe | CWE-639 | Java |
/*
* 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 |
/*
* 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 |
EXTENSIONS['.' + ext] = (module, filename, dirname) => {
if (vm.options.require.context !== 'sandbox') {
try {
module.exports = Contextify.readonly(host.require(filename));
} catch (e) {
throw Contextify.value(e);
}
} else {
let script;
try {
// Load module
let contents = ... | cwe | CWE-1321 | JavaScript |
func (d *partialArray) add(key string, val *lazyNode) error {
if key == "-" {
*d = append(*d, val)
return nil
}
idx, err := strconv.Atoi(key)
if err != nil {
return err
}
ary := make([]*lazyNode, len(*d)+1)
cur := *d
if idx < 0 {
idx *= -1
if idx > len(ary) {
return fmt.Errorf("Unable to acces... | cwe | CWE-787 | Go |
/* 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-190 | C/C++ |
static ssize_t available_instances_show(struct mdev_type *mtype,
struct mdev_type_attribute *attr,
char *buf)
{
const struct mbochs_type *type =
&mbochs_types[mtype_get_type_group_id(mtype)];
int count = (max_mbytes - mbochs_used_mbytes) / type->mbytes;
return sprintf(buf, "%d\n", count);
} | cwe | CWE-401 | Unknown |
parse_tag_3_packet(struct ecryptfs_crypt_stat *crypt_stat,
unsigned char *data, struct list_head *auth_tok_list,
struct ecryptfs_auth_tok **new_auth_tok,
size_t *packet_size, size_t max_packet_size)
{
size_t body_size;
struct ecryptfs_auth_tok_list_item *auth_tok_list_item;
size_t length_size;
int rc... | cwe | CWE-119 | Unknown |
TPMI_RH_ENABLES_Unmarshal(TPMI_RH_ENABLES *target, BYTE **buffer, INT32 *size, BOOL allowNull)
{
TPM_RC rc = TPM_RC_SUCCESS;
if (rc == TPM_RC_SUCCESS) {
rc = TPM_HANDLE_Unmarshal(target, buffer, size);
}
if (rc == TPM_RC_SUCCESS) {
switch (*target) {
case TPM_RH_OWNER:
case TPM_RH_PLATFORM:
... | cwe | CWE-787 | Unknown |
/*
* VC3/DNxHD decoder.
* Copyright (c) 2007 SmartJog S.A., Baptiste Coudurier <baptiste dot coudurier at smartjog dot com>
* Copyright (c) 2011 MirriAd Ltd
* Copyright (c) 2015 Christophe Gisquet
*
* 10 bit support added by MirriAd Ltd, Joseph Artsimovich <joseph@mirriad.com>
* Slice multithreading and MB inter... | cwe | CWE-125 | C/C++ |
function updateGraph(xml)
{
spinner.stop();
errorNode.innerHTML = '';
var doc = mxUtils.parseXml(xml);
var node = editorUi.editor.extractGraphModel(doc.documentElement, true);
if (node != null)
{
pageSelect.style.display = 'none';
pageSelect.innerHTML = '';
... | cwe | CWE-94 | JavaScript |
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/ory/fosite (interfaces: Storage)
// 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"
)
// MockStorage is a mock of ... | cwe | CWE-345 | Go |
/* eslint no-console:0 */
const {
isFunction,
isUndefined,
isPlainObject,
isArray,
isTypedArray,
} = require('lodash');
const { CLIENT_ALIASES } = require('./constants');
// Check if the first argument is an array, otherwise uses all arguments as an
// array.
function normalizeArr() {
const args = new Ar... | cwe | CWE-89 | JavaScript |
int StreamTcpPacket (ThreadVars *tv, Packet *p, StreamTcpThread *stt,
PacketQueue *pq)
{
SCEnter();
DEBUG_ASSERT_FLOW_LOCKED(p->flow);
SCLogDebug("p->pcap_cnt %"PRIu64, p->pcap_cnt);
/* assign the thread id to the flow */
if (unlikely(p->flow->thread_id == 0)) {
p->fl... | cwe | CWE-94 | Unknown |
TPMI_ALG_ASYM_SCHEME_Unmarshal(TPMI_ALG_ASYM_SCHEME *target, BYTE **buffer, INT32 *size, BOOL allowNull)
{
TPM_RC rc = TPM_RC_SUCCESS;
if (rc == TPM_RC_SUCCESS) {
rc = TPM_ALG_ID_Unmarshal(target, buffer, size);
}
if (rc == TPM_RC_SUCCESS) {
switch (*target) {
#if ALG_ECDH
case TPM_ALG_ECDH:
#en... | cwe | CWE-787 | Unknown |
set_acl(struct archive *a, int fd, const char *name,
struct archive_acl *abstract_acl,
int ae_requested_type, const char *tname)
{
int acl_type = 0;
acl_t acl;
acl_entry_t acl_entry;
acl_permset_t acl_permset;
#if ARCHIVE_ACL_FREEBSD_NFS4
acl_flagset_t acl_flagset;
int r;
#endif
int ret;
int ... | cwe | CWE-59 | C/C++ |
nfs4_xdr_dec_getacl(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
struct nfs_getaclres *res)
{
struct compound_hdr hdr;
int status;
status = decode_compound_hdr(xdr, &hdr);
if (status)
goto out;
status = decode_sequence(xdr, &res->seq_res, rqstp);
if (status)
goto out;
status = decode_putfh(xdr);
i... | cwe | CWE-703 | Unknown |
unicode_unfold_key(OnigCodePoint code)
{
static const struct ByUnfoldKey wordlist[] =
{
{0xffffffff, -1, 0}, {0xffffffff, -1, 0}, {0xffffffff, -1, 0}, {0xffffffff, -1, 0}, {0xffffffff, -1, 0},
{0xffffffff, -1, 0}, {0xffffffff, -1, 0}, {0xffffffff, -1, 0}, {0xffffffff, -1, 0}, {0xffffffff, -1, 0},
... | cwe | CWE-787 | Unknown |
def get_pacemaker_version()
begin
stdout, stderror, retval = run_cmd(
PCSAuth.getSuperuserSession, PACEMAKERD, "-$"
)
rescue
stdout = []
end
if retval == 0
match = /(\d+)\.(\d+)\.(\d+)/.match(stdout.join())
if match
return match[1..3].collect { | x | x.to_i }
end
end
retu... | cwe | CWE-384 | Ruby |
/*
* Copyright (C) 2015 Red Hat, Inc.
* All Rights Reserved.
*
* 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, co... | cwe | CWE-772 | C/C++ |
/*
* Video capture interface for Linux version 2
*
* A generic framework to process V4L2 ioctl commands.
*
* 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 Licen... | cwe | CWE-399 | C/C++ |
function PMA_RTN_getRowForList($routine, $rowclass = '')
{
global $ajax_class, $url_query, $db, $titles;
$sql_drop = sprintf('DROP %s IF EXISTS %s',
$routine['ROUTINE_TYPE'],
PMA_backquote($routine['SPECIFIC_NAME']));
$type_link = "item_type={$routine['ROUT... | cwe | CWE-79 | PHP |
/*
* This file is part of the TREZOR project.
*
* Copyright (C) 2016 Alex Beregszaszi <alex@rtfs.hu>
* Copyright (C) 2016 Pavol Rusnak <stick@satoshilabs.com>
* Copyright (C) 2016 Jochen Hoenicke <hoenicke@gmail.com>
*
* This library is free software: you can redistribute it and/or modify
* it under the terms o... | cwe | CWE-120 | C/C++ |
This function decrypts the crypttext */
PHP_FUNCTION(mcrypt_module_get_supported_key_sizes)
{
int i, count = 0;
int *key_sizes;
MCRYPT_GET_MODE_DIR_ARGS(algorithms_dir)
array_init(return_value);
key_sizes = mcrypt_module_get_algo_supported_key_sizes(module, dir, &count);
for (i = 0; i < count; i++) {
add_in... | cwe | CWE-190 | Unknown |
CBINDInstallDlg::RegisterService() {
SC_HANDLE hSCManager;
SC_HANDLE hService;
CString StartName;
if (m_accountName == LOCAL_SERVICE)
StartName = LOCAL_SERVICE;
else
StartName = ".\\" + m_accountName;
/*
* We need to change the service rather than create it
* if the service already exists. Do nothing if ... | cwe | CWE-284 | Unknown |
makeOperatorDependencies(HeapTuple tuple, bool isUpdate)
{
Form_pg_operator oper = (Form_pg_operator) GETSTRUCT(tuple);
ObjectAddress myself,
referenced;
myself.classId = OperatorRelationId;
myself.objectId = oper->oid;
myself.objectSubId = 0;
/*
* If we are updating the operator, delete any existing entr... | cwe | CWE-94 | Unknown |
package com.salesmanager.shop.admin.model.permission;
import java.io.Serializable;
import java.util.List;
import javax.validation.Valid;
import com.salesmanager.core.model.user.Group;
public class GroupDetails implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
@Valid
priva... | cwe | CWE-79 | Java |
/*
* server.c - Provide shadowsocks service
*
* Copyright (C) 2013 - 2017, Max Lv <max.c.lv@gmail.com>
*
* This file is part of the shadowsocks-libev.
*
* shadowsocks-libev 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 ... | cwe | CWE-77 | C/C++ |
function networkStatsSingle(iface) {
function parseLinesWindowsPerfData(sections) {
let perfData = [];
for (let i in sections) {
if ({}.hasOwnProperty.call(sections, i)) {
if (sections[i].trim() !== '') {
let lines = sections[i].trim().split('\r\n');
perfData.push({
... | cwe | CWE-78 | JavaScript |
static void opl3_setup_voice(int dev, int voice, int chn)
{
struct channel_info *info =
&synth_devs[dev]->chn_info[chn];
opl3_set_instr(dev, voice, info->pgm_num);
devc->voc[voice].bender = 0;
devc->voc[voice].bender_range = info->bender_range;
devc->voc[voice].volume = info->controllers[CTL_MAIN_VOLUME];
devc... | cwe | CWE-119 | C/C++ |
public function checkRedirect(RequestInterface $request, array $options, ResponseInterface $response)
{
if (\strpos((string) $response->getStatusCode(), '3') !== 0
|| !$response->hasHeader('Location')
) {
return $response;
}
$this->guardMax($request, $respons... | cwe | CWE-200 | PHP |
protected function _dimensions($path, $mime) {
return ($stat = $this->stat($path)) && isset($stat['width']) && isset($stat['height']) ? $stat['width'].'x'.$stat['height'] : '';
} | cwe | CWE-89 | JavaScript |
static void touch_pud(struct vm_area_struct *vma, unsigned long addr,
pud_t *pud)
{
pud_t _pud;
/*
* We should set the dirty bit only for FOLL_WRITE but for now
* the dirty bit in the pud is meaningless. And if the dirty
* bit will become meaningful and we'll only set it with
* FOLL_WRITE, an atomic set_b... | cwe | CWE-362 | Unknown |
void EvalHybridPerChannel(TfLiteContext* context, TfLiteNode* node,
TfLiteConvParams* params, OpData* data,
const TfLiteTensor* input, const TfLiteTensor* filter,
const TfLiteTensor* bias, TfLiteTensor* im2col,
TfLit... | cwe | CWE-787 | C/C++ |
xmlBufAttrSerializeTxtContent(xmlBufPtr buf, xmlDocPtr doc,
xmlAttrPtr attr, const xmlChar * string)
{
xmlChar *base, *cur;
if (string == NULL)
return;
base = cur = (xmlChar *) string;
while (*cur != 0) {
if (*cur == '\n') {
if (base != cur)
... | cwe | CWE-502 | C/C++ |
#include "extensions/access_loggers/grpc/http_grpc_access_log_impl.h"
#include "common/common/assert.h"
#include "common/network/utility.h"
#include "common/stream_info/utility.h"
#include "extensions/access_loggers/grpc/grpc_access_log_utils.h"
namespace Envoy {
namespace Extensions {
namespace AccessLoggers {
name... | cwe | CWE-400 | C/C++ |
// Copyright 2019 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package unix
import "unsafe"
// FcntlInt performs a fcntl syscall on fd with the provided command and argument.
func FcntlInt(fd uintptr, cmd, arg int) (int, ... | cwe | CWE-287 | Go |
int ssl3_accept(SSL *s)
{
BUF_MEM *buf;
unsigned long alg_k,Time=(unsigned long)time(NULL);
void (*cb)(const SSL *ssl,int type,int val)=NULL;
int ret= -1;
int new_state,state,skip=0;
RAND_add(&Time,sizeof(Time),0);
ERR_clear_error();
clear_sys_error();
if (s->info_callback != NULL)
cb=s->info_callback;
e... | cwe | CWE-326 | Unknown |
"""Classes for manipulating bytestreams containing values that may be fixed-
or variable-size.
"""
import abc
import enum
import io
import struct
import types
import typing
import warnings
from openssh_key import utils
class PascalStyleFormatInstruction(enum.Enum):
"""Format instructions for variable-length val... | cwe | CWE-209 | Python |
def install(filename, target):
'''Run a package's installer script against the given target directory.'''
print(' Unpacking %s...' % filename)
os.system('tar xf ' + filename)
basename = filename.split('.tar')[0]
print(' Installing %s...' % basename)
install_opts = '--prefix=${PWD}/%s --disable-ldconfig' % t... | cwe | CWE-78 | Python |
bit_write_UMC (Bit_Chain *dat, BITCODE_UMC val)
{
int i, j;
int negative;
unsigned char byte[5];
BITCODE_UMC mask;
BITCODE_UMC value;
value = val;
mask = 0x0000007f;
for (i = 4, j = 0; i >= 0; i--, j += 7)
{
byte[i] = (unsigned char)((value & mask) >> j);
byte[i] |= 0x80;
mask = m... | cwe | CWE-125 | C/C++ |
// Copyright 2012 Samuel Stauffer. All rights reserved.
// Use of this source code is governed by a 3-clause BSD
// license that can be found in the LICENSE file.
package socks
import (
"net"
"time"
)
type proxiedConn struct {
conn net.Conn
remoteAddr *proxiedAddr
boundAddr *proxiedAddr
}
func (c *proxi... | cwe | CWE-835 | Go |
def update_date_modified(self):
sql = "UPDATE jdk_entries " + \
"SET date_last_modified = " + CURRENT_DATESTAMP + " " + \
"WHERE jdk_entries.id = '" + self.entry_id + "';"
db_execute(sql)
return None | cwe | CWE-89 | Python |
function handleLoginInOtherBrowserTab() {
const currentUser = debiki2.ReactStore.getMe();
const sessionId = getSetCookie('dwCoSid');
if (currentUser.isLoggedIn) {
if (sessionId) {
// Session id example: (parts: hash, user id, name, login time, random value)
// 'Y1pBlH7vY4JW9A.11.Magnus.13162661027... | cwe | CWE-613 | Scala |
var apersistence = require("./abstractPersistence.js");
function ModelDescription(typeName, description, strategy){
this.persistentProperties = [];
this.transientProperties = []; //these properties are other objects and are loaded lazily
var self = this;
var pkField = "id";
var template = {};
... | cwe | CWE-89 | JavaScript |
/* curve448-eh-to-x.c
Copyright (C) 2017 Daiki Ueno
Copyright (C) 2017 Red Hat, Inc.
This file is part of GNU Nettle.
GNU Nettle is free software: you can redistribute it and/or
modify it under the terms of either:
* the GNU Lesser General Public License as published by the Free
Software ... | cwe | CWE-787 | C/C++ |
/*
* 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 |
package tunnelserver
import (
"context"
"encoding/base64"
"encoding/json"
"fmt"
"io/ioutil"
"os"
"strings"
"sync"
"github.com/pkg/errors"
"github.com/rancher/norman/types/set"
"github.com/rancher/rancher/pkg/peermanager"
"github.com/rancher/rancher/pkg/serviceaccounttoken"
"github.com/rancher/rancher/pkg... | cwe | CWE-331 | Go |
gss_get_mic (minor_status,
context_handle,
qop_req,
message_buffer,
msg_token)
OM_uint32 * minor_status;
gss_ctx_id_t context_handle;
gss_qop_t qop_req;
gss_buffer_t message_buffer;
gss_buffer_t msg_token;
{
OM_uint32 status;
gss_union_ctx_id_t ctx;
gss_mechanism mech;
s... | cwe | CWE-415 | C/C++ |
int vrend_create_shader(struct vrend_context *ctx,
uint32_t handle,
const struct pipe_stream_output_info *so_info,
const char *shd_text, uint32_t offlen, uint32_t num_tokens,
uint32_t type, uint32_t pkt_length)
{
struct v... | cwe | CWE-190 | Unknown |
regmatch(
char_u *scan, // Current node.
proftime_T *tm UNUSED, // timeout limit or NULL
int *timed_out UNUSED) // flag set on timeout or NULL
{
char_u *next; // Next node.
int op;
int c;
regitem_T *rp;
int no;
int status; // one of the RA_ values:
#ifdef FEAT_RELTIME
int tm_... | cwe | CWE-416 | C/C++ |
/*
* INET An implementation of the TCP/IP protocol suite for the LINUX
* operating system. INET is implemented using the BSD Socket
* interface as the means of communication with the user level.
*
* ROUTE - implementation of the IP router.
*
* Authors: Ross Biro
* Fred N. van Kempen, <waltje@uWalt.NL.Mug... | cwe | CWE-326 | C/C++ |
/**
* OLAT - Online Learning and Training<br>
* http://www.olat.org
* <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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unl... | cwe | CWE-22 | Java |
/* 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-787 | Python |
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */
/*
* lsquic_set.c -- A set implementation.
*
* Deleting from a set is not supported. Implemented as a sorted array.
* Optimized for reading. Insertion may trigger realloc, memmove, or
* both.
*/
#include <assert.h>
#include <errno.h>
#in... | cwe | CWE-476 | C/C++ |
/*
* The MIT License
*
* Copyright (c) 2004-2012, Sun Microsystems, Inc., Kohsuke Kawaguchi, Erik Ramfelt,
* Tom Huybrechts, Vincent Latombe
*
* 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... | cwe | CWE-352 | Java |
static int copy_to_user_auth(struct xfrm_algo_auth *auth, struct sk_buff *skb)
{
struct xfrm_algo *algo;
struct nlattr *nla;
nla = nla_reserve(skb, XFRMA_ALG_AUTH,
sizeof(*algo) + (auth->alg_key_len + 7) / 8);
if (!nla)
return -EMSGSIZE;
algo = nla_data(nla);
strcpy(algo->alg_name, auth->alg_name);
memc... | cwe | CWE-200 | C/C++ |
/*
* cotp.c
*
* ISO 8073 Connection Oriented Transport Protocol over TCP (RFC1006)
*
* Partial implementation of the ISO 8073 COTP (ISO TP0) protocol for MMS.
*
* Copyright 2013-2018 Michael Zillgith
*
* This file is part of libIEC61850.
*
* libIEC61850 is free software: you can redistribute it and/or ... | cwe | CWE-191 | C/C++ |
// 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 "components/search_engines/template_url_parser.h"
#include <string.h>
#include <algorithm>
#include <vector>
#include "base/bind.h"
#include "... | cwe | CWE-416 | C/C++ |
void ExtensionsGuestViewMessageFilter::FrameNavigationHelper::FrameDeleted(
RenderFrameHost* render_frame_host) {
if (render_frame_host->GetFrameTreeNodeId() != frame_tree_node_id_)
return;
filter_->ResumeAttachOrDestroy(element_instance_id_,
MSG_ROUTING_NONE /* no plugin fr... | cwe | CWE-787 | C/C++ |
static int test_rand_drbg_reseed(void)
{
RAND_DRBG *master, *public, *private;
unsigned char rand_add_buf[256];
int rv=0;
time_t before_reseed;
/* Check whether RAND_OpenSSL() is the default method */
if (!TEST_ptr_eq(RAND_get_rand_method(), RAND_OpenSSL()))
return 0;
/* All three ... | cwe | CWE-330 | Unknown |
#!/usr/bin/env python
#
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import azure.functions as func
from onefuzztypes.responses import Info
from ..onefuzzlib.azure.creds import (
get_base_region,
get_base_resource_group,
get_insights_appid,
get_insights_instrumentation_key,... | cwe | CWE-285 | Python |
static inline void get_conn_text(const conn *c, const int af,
char* addr, struct sockaddr *sock_addr) {
char addr_text[MAXPATHLEN];
addr_text[0] = '\0';
const char *protoname = "?";
unsigned short port = 0;
switch (af) {
case AF_INET:
(void) inet_ntop(af,
... | cwe | CWE-125 | Unknown |
function isExec(command){
try{
exec(command, { stdio: 'ignore' })
return true
}
catch (_e){
return false
}
} | cwe | CWE-78 | 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-787 | Python |
static int rename_in_ns(int pid, char *oldname, char **newnamep)
{
int fd = -1, ofd = -1, ret, ifindex = -1;
bool grab_newname = false;
ofd = lxc_preserve_ns(getpid(), "net");
if (ofd < 0) {
fprintf(stderr, "Failed opening network namespace path for '%d'.", getpid());
return -1;
}
fd = lxc_preserve_... | cwe | CWE-862 | C/C++ |
std::unique_ptr<service_manager::Service> CreateMediaService() {
return std::unique_ptr<service_manager::Service>(
new ::media::MediaService(base::MakeUnique<CdmMojoMediaClient>()));
} | cwe | CWE-119 | C/C++ |
/*
* 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-284 | C/C++ |
def wrapper(request, *args, **kwargs):
if request.user.is_authenticated:
return redirect(request.GET.get('next', request.user.st.get_absolute_url()))
return view_func(request, *args, **kwargs) | cwe | CWE-601 | Python |
/*
* Copyright (c) 2010 Aurelien Jacobs <aurel@gnuage.org>
*
* 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, or (a... | cwe | CWE-125 | C/C++ |
RestStatus RestAuthHandler::execute() {
auto const type = _request->requestType();
if (type != rest::RequestType::POST) {
generateError(rest::ResponseCode::METHOD_NOT_ALLOWED, TRI_ERROR_HTTP_METHOD_NOT_ALLOWED);
return RestStatus::DONE;
}
bool parseSuccess = false;
VPackSlice slice = this->parseVPack... | cwe | CWE-613 | C/C++ |
func makeStreamDistributedQueryCampaignResultsHandler(svc kolide.Service, jwtKey string, logger kitlog.Logger) http.Handler {
opt := sockjs.DefaultOptions
opt.Websocket = true
opt.RawWebsocket = true
return sockjs.NewHandler("/api/v1/kolide/results", opt, func(session sockjs.Session) {
defer session.Close(0, "non... | cwe | CWE-400 | Go |
dnsc_load_local_data(struct dnsc_env* dnscenv, struct config_file *cfg)
{
size_t i, j;
// Insert 'local-zone: "2.dnscrypt-cert.example.com" deny'
if(!cfg_str2list_insert(&cfg->local_zones,
strdup(dnscenv->provider_name),
strdup("deny"))) {
log_err... | cwe | CWE-190 | C/C++ |
eval_next_non_blank(char_u *arg, evalarg_T *evalarg, int *getnext)
{
char_u *p = skipwhite(arg);
*getnext = FALSE;
if (in_vim9script()
&& evalarg != NULL
&& (evalarg->eval_cookie != NULL || evalarg->eval_cctx != NULL
|| *p == NL)
&& (*p == NUL || *p == NL
|| (vim9_comment_... | cwe | CWE-476 | Unknown |
function f(){} | cwe | CWE-284 | JavaScript |
@staticmethod
def _download_file(bucket, filename, local_dir):
key = bucket.get_key(filename)
local_filename = os.path.join(local_dir, filename)
key.get_contents_to_filename(local_filename)
return local_filename | cwe | CWE-22 | Python |
/*******************************************************************************
* Copyright (c) 2013 Mover Zhou
*
* 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.apac... | cwe | CWE-89 | Java |
static int snd_ctl_elem_write(struct snd_card *card, struct snd_ctl_file *file,
struct snd_ctl_elem_value *control)
{
struct snd_kcontrol *kctl;
struct snd_kcontrol_volatile *vd;
unsigned int index_offset;
int result;
down_read(&card->controls_rwsem);
kctl = snd_ctl_find_id(card, &control->id);
if (kct... | cwe | CWE-416 | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.