code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
/*
* Cantata
*
* Copyright (c) 2011-2018 Craig Drummond <craig.p.drummond@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
* (a... | cwe | CWE-20 | C/C++ |
polkit_backend_session_monitor_get_user_for_subject (PolkitBackendSessionMonitor *monitor,
PolkitSubject *subject,
GError **error)
{
PolkitIdentity *ret;
guint32 uid;
... | cwe | CWE-285 | C/C++ |
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */
#include <assert.h>
#include <inttypes.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include <sys/queue.h>
#include "lsquic.h"
#include "lsquic_int_types.h"
#include "lsquic_varint.h"
#include "lsquic_hq.h"
#include "lsquic_has... | cwe | CWE-476 | C/C++ |
static RAND_DRBG *rand_drbg_new(int secure,
int type,
unsigned int flags,
RAND_DRBG *parent)
{
RAND_DRBG *drbg = secure ? OPENSSL_secure_zalloc(sizeof(*drbg))
: OPENSSL_zalloc(sizeof(*drbg));... | cwe | CWE-330 | Unknown |
ikev1_nonce_print(netdissect_options *ndo, u_char tpay _U_,
const struct isakmp_gen *ext,
u_int item_len _U_,
const u_char *ep,
uint32_t phase _U_, uint32_t doi _U_,
uint32_t proto _U_, int depth _U_)
{
struct isakmp_gen e;
ND_PRINT((ndo,"%s:", NPSTR(ISAKMP_NPTYPE_NONCE)));
ND_TCHECK(*ext);
UN... | cwe | CWE-835 | C/C++ |
/**
* Copyright (c) 2006-2012, JGraph Ltd
*/
/**
* Construcs a new sidebar for the given editor.
*/
function Sidebar(editorUi, container)
{
this.editorUi = editorUi;
this.container = container;
this.palettes = new Object();
this.taglist = new Object();
this.lastCreated = 0;
this.showTooltips = true;
this.gra... | cwe | CWE-79 | Java |
static int ipx_recvmsg(struct kiocb *iocb, struct socket *sock,
struct msghdr *msg, size_t size, int flags)
{
struct sock *sk = sock->sk;
struct ipx_sock *ipxs = ipx_sk(sk);
struct sockaddr_ipx *sipx = (struct sockaddr_ipx *)msg->msg_name;
struct ipxhdr *ipx = NULL;
struct sk_buff *skb;
int copied, rc;
lock_s... | cwe | CWE-20 | C/C++ |
/*
* pam_access module
*
* Written by Alexei Nogin <alexei@nogin.dnttm.ru> 1997/06/15
* (I took login_access from logdaemon-5.6 and converted it to PAM
* using parts of pam_time code.)
*
************************************************************************
* Copyright message from logdaemon-5.6 (original fil... | cwe | CWE-863 | C/C++ |
/************************************************************************
* db.c
* nodau console note taker
* Copyright (C) Lisa Milne 2010-2013 <lisa@ltmnet.com>
*
* db.c 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 F... | cwe | CWE-89 | C/C++ |
_tiffReadProc(thandle_t hdata, tdata_t buf, tsize_t size) {
TIFFSTATE *state = (TIFFSTATE *)hdata;
tsize_t to_read;
TRACE(("_tiffReadProc: %d \n", (int)size));
dump_state(state);
to_read = min(size, min(state->size, (tsize_t)state->eof) - (tsize_t)state->loc);
TRACE(("to_read: %d\n", (int)to_r... | cwe | CWE-787 | Unknown |
server_partial_file_request(struct httpd *env, struct client *clt, char *path,
struct stat *st, char *range_str)
{
struct server_config *srv_conf = clt->clt_srv_conf;
struct http_descriptor *resp = clt->clt_descresp;
struct http_descriptor *desc = clt->clt_descreq;
struct media_type *media, multipart_media;
st... | cwe | CWE-770 | C/C++ |
int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
{
const struct sockaddr_in *usin = (struct sockaddr_in *)uaddr;
struct inet_sock *inet = inet_sk(sk);
struct dccp_sock *dp = dccp_sk(sk);
__be16 orig_sport, orig_dport;
__be32 daddr, nexthop;
struct flowi4 fl4;
struct rtable *rt;
int err... | cwe | CWE-362 | Unknown |
static int vsock_stream_setsockopt(struct socket *sock,
int level,
int optname,
sockptr_t optval,
unsigned int optlen)
{
int err;
struct sock *sk;
struct vsock_sock *vsk;
const struct vsock_transport *transport;
u64 val;
if (level != AF_VSOCK)
return -ENOPROTOOPT;
#define COPY_IN(_... | cwe | CWE-667 | Unknown |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-119 | C/C++ |
PHPAPI zend_string *php_escape_shell_cmd(char *str)
{
register int x, y, l = (int)strlen(str);
size_t estimate = (2 * l) + 1;
zend_string *cmd;
#ifndef PHP_WIN32
char *p = NULL;
#endif
cmd = zend_string_alloc(2 * l, 0);
for (x = 0, y = 0; x < l; x++) {
int mb_len = php_mblen(str + x, (l - x));
/* skip non... | cwe | CWE-189 | C/C++ |
// Copyright 2009,2010 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.
// Darwin system calls.
// This file is compiled as ordinary Go code,
// but it is also input to mksyscall,
// which parses the //sys lines and generates s... | cwe | CWE-287 | Go |
/*
* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. 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.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "lice... | cwe | CWE-918 | Java |
static int audit_log_single_execve_arg(struct audit_context *context,
struct audit_buffer **ab,
int arg_num,
size_t *len_sent,
const char __user *p,
char *buf)
{
char arg_num_len_buf[12];
const char __user *tmp_p = p;
/* how many digits are in arg_num? 5 is the length of ' a=""' */
size_t ... | cwe | CWE-362 | Unknown |
read_non_rle_pixel(tga_source_ptr sinfo)
/* Read one Targa pixel from the input file; no RLE expansion */
{
register FILE *infile = sinfo->pub.input_file;
register int i;
for (i = 0; i < sinfo->pixel_size; i++) {
sinfo->tga_pixel[i] = (U_CHAR)getc(infile);
}
} | cwe | CWE-834 | Unknown |
int64_t OpLevelCostEstimator::CalculateTensorSize(
const OpInfo::TensorProperties& tensor, bool* found_unknown_shapes) {
int64_t count = CalculateTensorElementCount(tensor, found_unknown_shapes);
int size = DataTypeSize(BaseType(tensor.dtype()));
VLOG(2) << "Count: " << count << " DataTypeSize: " << size;
r... | cwe | CWE-190 | C/C++ |
static int fixup_bpf_calls(struct bpf_verifier_env *env)
{
struct bpf_prog *prog = env->prog;
struct bpf_insn *insn = prog->insnsi;
const struct bpf_func_proto *fn;
const int insn_cnt = prog->len;
const struct bpf_map_ops *ops;
struct bpf_insn_aux_data *aux;
struct bpf_insn insn_buf[16];
struct bpf_prog *new_pr... | cwe | CWE-189 | Unknown |
static int apparmor_setprocattr(struct task_struct *task, char *name,
void *value, size_t size)
{
struct common_audit_data sa;
struct apparmor_audit_data aad = {0,};
char *command, *args = value;
size_t arg_size;
int error;
if (size == 0)
return -EINVAL;
/* args points to a PAGE_SIZE buffer, AppAr... | cwe | CWE-119 | C/C++ |
launchExtension({ extensionId }) {
checkAuthentication(this)
const extension = Extensions.findOne({ _id: extensionId })
if (extension) {
eval(extension.server)
return 'notifications.success'
}
return new Meteor.Error('Extension does not exist')
}, | cwe | CWE-285 | JavaScript |
public function fetch($remote = NULL, array $params = NULL)
{
$this->run('fetch', $remote, $params);
return $this;
} | cwe | CWE-88 | PHP |
/*
* linux/kernel/exit.c
*
* Copyright (C) 1991, 1992 Linus Torvalds
*/
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/sched/autogroup.h>
#include <linux/sched/mm.h>
#include <linux/sched/stat.h>
#include <linux/sched/task.h>
#include <linux/sched/task_stack.h>
#include <linux/sched/cputime.h>
#i... | cwe | CWE-200 | C/C++ |
/*
* GPAC Multimedia Framework
*
* Authors: Cyril Concolato, Jean Le Feuvre
* Copyright (c) Telecom ParisTech 2004-2022
* All rights reserved
*
* This file is part of GPAC / SVG Loader module
*
* GPAC is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser... | cwe | CWE-401 | C/C++ |
public function pull($remote = NULL, array $params = NULL)
{
$this->run('pull', $remote, $params);
return $this;
} | cwe | CWE-88 | PHP |
public NettyHttpHeaders() {
this.nettyHeaders = new DefaultHttpHeaders(false);
this.conversionService = ConversionService.SHARED;
} | cwe | CWE-444 | Java |
static int aesni_cbc_hmac_sha1_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
const unsigned char *in, size_t len)
{
EVP_AES_HMAC_SHA1 *key = data(ctx);
unsigned int l;
size_t plen = key->payload_length, iv = 0, /* explicit IV in TLS 1.1 and
... | cwe | CWE-200 | C/C++ |
def __post_init__(self, title: str) -> None: # type: ignore
super().__post_init__()
reference = Reference.from_ref(title)
dedup_counter = 0
while reference.class_name in _existing_enums:
existing = _existing_enums[reference.class_name]
if self.values == existing.... | cwe | CWE-94 | Python |
/*
* Copyright (C) 2013, 2016, 2018 XStream Committers.
* All rights reserved.
*
* The software in this package is published under the terms of the BSD
* style license a copy of which has been included with this distribution in
* the LICENSE.txt file.
*
* Created on 20. September 2013 by Joerg Schaible
*/
pack... | cwe | CWE-502 | Java |
void l2tp_packet_print(const struct l2tp_packet_t *pack,
void (*print)(const char *fmt, ...))
{
const struct l2tp_attr_t *attr;
const struct l2tp_dict_value_t *val;
if (pack->hdr.ver == 2) {
print("[L2TP tid=%u sid=%u", ntohs(pack->hdr.tid), ntohs(pack->hdr.sid));
log_ppp_debug(" Ns=%u Nr=%u", ntohs(pa... | cwe | CWE-119 | C/C++ |
recvfrom_blocking(void *data)
{
struct recvfrom_arg *arg = data;
socklen_t len0 = arg->alen;
ssize_t ret;
ret = recvfrom(arg->fd, RSTRING_PTR(arg->str), RSTRING_LEN(arg->str),
arg->flags, &arg->buf.addr, &arg->alen);
if (ret != -1 && len0 < arg->alen)
arg->alen = len0;
... | cwe | CWE-908 | 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-787 | Python |
int CMS_decrypt(CMS_ContentInfo *cms, EVP_PKEY *pk, X509 *cert,
BIO *dcont, BIO *out, unsigned int flags)
{
int r;
BIO *cont;
if (OBJ_obj2nid(CMS_get0_type(cms)) != NID_pkcs7_enveloped) {
CMSerr(CMS_F_CMS_DECRYPT, CMS_R_TYPE_NOT_ENVELOPED_DATA);
return 0;
}
if (!dcont... | cwe | CWE-327 | Unknown |
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"
import logging
import re
import threading
import time
import wrapt
import octopri... | cwe | CWE-613 | Python |
static int ext4_ext_convert_to_initialized(handle_t *handle,
struct inode *inode,
struct ext4_map_blocks *map,
struct ext4_ext_path *path)
{
struct ext4_extent *ex, newex, orig_ex;
struct ext4_extent *ex1 = NULL;
struct ext4_extent *ex2 = NULL;
struct ext4_extent *ex3 = NULL;
struct ext4_ex... | cwe | CWE-703 | Unknown |
import authDataManager from '../Adapters/Auth';
import { ParseServerOptions } from '../Options';
import { loadAdapter } from '../Adapters/AdapterLoader';
import defaults from '../defaults';
import url from 'url';
// Controllers
import { LoggerController } from './LoggerController';
import { FilesController } from './Fi... | cwe | CWE-1321 | JavaScript |
render() {
const {
isFetching,
isLoggedIn,
profile,
superEdges,
entityCount,
messagesConnect,
heartValue,
heartCount,
links,
title,
queryLink,
isParsed,
} = this.props;
const {
connectionDisplayIndex,
isAddConnectionToggle... | cwe | CWE-200 | JavaScript |
lb_register_characteristic_read_event(lb_context lb_ctx,
lb_bl_device* dev,
const char* uuid,
sd_bus_message_handler_t callback,
void* userdata)
{
#ifdef DEBUG
prin... | cwe | CWE-119 | C/C++ |
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* 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 applic... | cwe | CWE-190 | C/C++ |
null!=l&&l();b.openLink(f,null,!0)});c.className="geBtn gePrimaryBtn";c.style.width=D.style.width;t.appendChild(c);mxUtils.br(t);mxUtils.br(t);mxUtils.write(t,mxResources.get("allowPopups"));this.container=t},ImageDialog=function(b,f,l,d,u,t,D,c){function e(){0<m.value.length?M.removeAttribute("disabled"):M.setAttribut... | cwe | CWE-20 | JavaScript |
////////////////////////////////////////////////////////////////////////////
// **** WAVPACK **** //
// Hybrid Lossless Wavefile Compressor //
// Copyright (c) 1998 - 2016 David Bryant. //
// ... | cwe | CWE-119 | C/C++ |
int ip6_find_1stfragopt(struct sk_buff *skb, u8 **nexthdr)
{
u16 offset = sizeof(struct ipv6hdr);
unsigned int packet_len = skb_tail_pointer(skb) -
skb_network_header(skb);
int found_rhdr = 0;
*nexthdr = &ipv6_hdr(skb)->nexthdr;
while (offset <= packet_len) {
struct ipv6_opt_hdr *exthdr;
switch (**nexthdr)... | cwe | CWE-190 | Unknown |
static int dn_nl_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh)
{
struct net *net = sock_net(skb->sk);
struct nlattr *tb[IFA_MAX+1];
struct net_device *dev;
struct dn_dev *dn_db;
struct ifaddrmsg *ifm;
struct dn_ifaddr *ifa;
int err;
if (!capable(CAP_NET_ADMIN))
return -EPERM;
if (!net_eq(net, &init_ne... | cwe | CWE-264 | Unknown |
TfLiteRegistration FakeFusedRegistration() {
TfLiteRegistration reg = {nullptr};
reg.custom_name = "fake_fused_op";
// Different flavors of the delegate kernel's Invoke(), dependent on
// testing parameters.
if (fail_delegate_node_invoke_) {
reg.invoke = [](TfLiteContext* context,... | cwe | CWE-787 | C/C++ |
/*
* NET An implementation of the SOCKET network access protocol.
*
* Version: @(#)socket.c 1.1.93 18/02/95
*
* Authors: Orest Zborowski, <obz@Kodak.COM>
* Ross Biro
* Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
*
* Fixes:
* Anonymous : NOTSOCK/BADF cleanup. Error fix in
* shutdown()
* Alan Co... | cwe | CWE-264 | C/C++ |
/*
* The MIT License
*
* Copyright (c) 2009 The Broad Institute
*
* 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... | cwe | CWE-668 | Java |
func sendCode(id string) (err error) {
a, err := account.SelectAccount(id, 0)
if err != nil {
logger.Error("发送验证码失败", zap.Error(err))
return
}
if len(a) == 0 {
return errors.New("账号不存在")
}
rand.Seed(time.Now().UnixNano())
c := strconv.FormatFloat(rand.Float64(), 'f', -1, 64)[2:6]
client.GetClient().Se... | cwe | CWE-287 | Go |
parseuid(const char *s, uid_t *uid)
{
struct passwd *pw;
const char *errstr;
if ((pw = getpwnam(s)) != NULL) {
*uid = pw->pw_uid;
return 0;
}
#if !defined(__linux__) && !defined(__NetBSD__)
*uid = strtonum(s, 0, UID_MAX, &errstr);
#else
sscanf(s, "%d", uid);
#endif
if (errstr)
return -1;
return 0;
} | cwe | CWE-863 | C/C++ |
static void save_text_if_changed(const char *name, const char *new_value)
{
/* a text value can't be change if the file is not loaded */
/* returns NULL if the name is not found; otherwise nonzero */
if (!g_hash_table_lookup(g_loaded_texts, name))
return;
const char *old_value = g_cd ? problem_... | cwe | CWE-200 | Unknown |
snmp_message_decode(uint8_t *buf, uint32_t buf_len, snmp_header_t *header,
snmp_varbind_t *varbinds, uint32_t *varbind_num)
{
uint8_t type, len;
uint32_t i, oid_len = SNMP_MSG_OID_MAX_LEN;
buf = snmp_ber_decode_type(buf, &buf_len, &type);
if(buf == NULL) {
LOG_DBG("Could not decode type... | cwe | CWE-125 | C/C++ |
function XMLRPCblockAllocation($imageid, $start, $end, $numMachines,
$usergroupid, $ignoreprivileges=0) {
global $user, $xmlrpcBlockAPIUsers;
if(! in_array($user['id'], $xmlrpcBlockAPIUsers)) {
return array('status' => 'error',
'errorcode' => 34,
'errorms... | cwe | CWE-264 | PHP |
item *do_item_get(const char *key, const size_t nkey, const uint32_t hv) {
//mutex_lock(&cache_lock);
item *it = assoc_find(key, nkey, hv);
if (it != NULL) {
refcount_incr(&it->refcount);
/* Optimization for slab reassignment. prevents popular items from
* jamming in busy wait. Can ... | cwe | CWE-119 | Unknown |
import Immutable, { Map } from 'immutable';
import { getEntity, read, swap, updateEntity } from '../../store/index';
import webApi from '../../core/web_api';
import { closeLock, logIn as coreLogIn, logInSuccess, validateAndSubmit } from '../../core/actions';
import * as l from '../../core/index';
import * as c from '..... | cwe | CWE-79 | JavaScript |
zzip_disk_entry_fopen(ZZIP_DISK * disk, ZZIP_DISK_ENTRY * entry)
{
/* keep this in sync with zzip_mem_entry_fopen */
struct zzip_file_header *header =
zzip_disk_entry_to_file_header(disk, entry);
if (! header)
return 0; /* EBADMSG */
___ ZZIP_DISK_FILE *file = malloc(sizeof(ZZIP_DISK_FIL... | cwe | CWE-119 | C/C++ |
mxClient.IS_IOS?(M.style.padding="0px 10px 20px 10px",M.style.top="6px"):mxClient.IS_FF&&(n.style.paddingTop="0px",n.style.marginTop="-2px");if(null!=A)for(m=0;m<A.length;m++)mxUtils.br(n),mxUtils.write(n,A[m]);if(null!=x&&null==b[x]){y.style.visibility="hidden";mxUtils.setOpacity(n,10);var K=new Spinner({lines:12,leng... | cwe | CWE-20 | JavaScript |
amstar_selfcheck(
application_argument_t *argument)
{
char *option;
if (argument->dle.disk) {
char *qdisk = quote_string(argument->dle.disk);
fprintf(stdout, "OK disk %s\n", qdisk);
amfree(qdisk);
}
fprintf(stdout, "OK amstar version %s\n", VERSION);
fprintf(stdout, "OK amstar\n");
if ... | cwe | CWE-264 | Unknown |
int MemBackendImpl::DoomEntriesBetween(Time initial_time,
Time end_time,
const CompletionCallback& callback) {
if (end_time.is_null())
end_time = Time::Max();
DCHECK_GE(end_time, initial_time);
base::LinkNode<MemEntryImpl>* node = ... | cwe | CWE-416 | C/C++ |
Status CalculateOutputIndex(OpKernelContext* context, int dimension,
const vector<INDEX_TYPE>& parent_output_index,
INDEX_TYPE output_index_multiplier,
INDEX_TYPE output_size,
vector<INDEX_TYPE>* resu... | cwe | CWE-131 | C/C++ |
bool BSONObj::valid() const {
int mySize = objsize();
try {
BSONObjIterator it(*this);
while( it.moreWithEOO() ) {
// both throw exception on failure
BSONElement e = it.next(true);
if ( e.size() >= mySize )
retu... | cwe | CWE-20 | Unknown |
private function _getRowsNormal()
{
$odd_row = true;
$html_output = '';
// for every column present in table
for (
$column_index = 0, $nb = count($this->_columnNames);
$column_index < $nb;
$column_index++
) {
$html_output .= '<t... | cwe | CWE-79 | PHP |
XStoreNamedColor(
register Display *dpy,
Colormap cmap,
_Xconst char *name, /* STRING8 */
unsigned long pixel, /* CARD32 */
int flags) /* DoRed, DoGreen, DoBlue */
{
unsigned int nbytes;
register xStoreNamedColorReq *req;
XcmsCCC ccc;
XcmsColor cmsColor_exact;
XColor scr_def;
#ifdef XCMS
/*
... | cwe | CWE-120 | Unknown |
AnsiUp.prototype.get_next_packet = function () {
var pkt = {
kind: PacketKind.EOS,
text: '',
url: ''
};
var len = this._buffer.length;
if (len == 0)
return pkt;
var pos = this._buffer.indexOf("\x1B");
if (pos == -1) {
... | cwe | CWE-79 | JavaScript |
static bool consume_encoded_name_new(RBuffer *b, ut64 bound, ut32 *len_out, char **str_out) {
ut32 len;
char *orig = NULL;
if (!consume_str_new (b, bound, &len, &orig)) {
return false;
}
// room for even every character getting encoded
size_t maxsize = (len * 4) + 2;
char *sout = malloc (maxsize);
if (!sout)... | cwe | CWE-787 | Unknown |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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 t... | cwe | CWE-79 | JavaScript |
"""Core forms."""
import oath
from django import forms
from django.contrib.auth import (
forms as auth_forms, get_user_model, password_validation
)
from django.db.models import Q
from django.utils.translation import ugettext as _, ugettext_lazy
import django_otp
from modoboa.core.models import User
from modoboa... | cwe | CWE-521 | Python |
static int xen_netbk_tx_check_gop(struct xen_netbk *netbk,
struct sk_buff *skb,
struct gnttab_copy **gopp)
{
struct gnttab_copy *gop = *gopp;
u16 pending_idx = *((u16 *)skb->data);
struct pending_tx_info *pending_tx_info = netbk->pending_tx_info;
struct xenvif *vif = pending_tx_info[pending_idx].vif;
s... | cwe | CWE-399 | C/C++ |
int vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
struct inode *new_dir, struct dentry *new_dentry,
struct inode **delegated_inode, unsigned int flags)
{
int error;
bool is_dir = d_is_dir(old_dentry);
const unsigned char *old_name;
struct inode *source = old_dentry->d_inode;
struct i... | cwe | CWE-362 | C/C++ |
/*************************************************************************
*
* Copyright (C) 2018-2023 Ruilin Peng (Nick) <pymumu@gmail.com>.
*
* smartdns 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, ... | cwe | CWE-787 | C/C++ |
u32 ip_idents_reserve(u32 hash, int segs)
{
u32 *p_tstamp = ip_tstamps + hash % IP_IDENTS_SZ;
atomic_t *p_id = ip_idents + hash % IP_IDENTS_SZ;
u32 old = READ_ONCE(*p_tstamp);
u32 now = (u32)jiffies;
u32 delta = 0;
if (old != now && cmpxchg(p_tstamp, old, now) == old)
delta = prandom_u32_max(now - old);
/* I... | cwe | CWE-327 | Unknown |
NavigateToAboutBlank() {
GURL about_blank(url::kAboutBlankURL);
content::NavigationController::LoadURLParams params(about_blank);
params.frame_tree_node_id = frame_tree_node_id_;
params.source_site_instance = parent_site_instance_;
params.is_renderer_initiated = true;
web_contents()->GetController().LoadURL... | cwe | CWE-362 | C/C++ |
/*
* Copyright (c) 2007-2017, Cameron Rich
*
* 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... | cwe | CWE-347 | C/C++ |
static void mutt_decode_uuencoded (STATE *s, LOFF_T len, int istext, iconv_t cd)
{
char tmps[SHORT_STRING];
char linelen, c, l, out;
char *pt;
char bufi[BUFI_SIZE];
size_t k = 0;
if (istext)
state_set_prefix(s);
while (len > 0)
{
if ((fgets(tmps, sizeof(tmps), s->fpin)) == NULL)
return;
... | cwe | CWE-120 | C/C++ |
MagickExport MagickBooleanType SetQuantumDepth(const Image *image,
QuantumInfo *quantum_info,const size_t depth)
{
size_t
extent,
quantum;
/*
Allocate the quantum pixel buffer.
*/
assert(image != (Image *) NULL);
assert(image->signature == MagickCoreSignature);
if (image->debug != MagickFalse... | cwe | CWE-190 | Unknown |
def self.get_tree(folder_tree, conditions, parent, admin)
if parent.instance_of?(Folder)
tree_id = parent.id.to_s
else
tree_id = parent.to_s
parent = nil
if tree_id != '0'
begin
parent = Folder.find(tree_id)
rescue
end
return folder_tree if pare... | cwe | CWE-89 | Ruby |
callParserIfExistsQuery(parseNumberTypeQueryParams([['requiredNum', false, false], ['optionalNum', true, false], ['optionalNumArr', true, true], ['emptyNum', true, false], ['requiredNumArr', false, true]])),
callParserIfExistsQuery(parseBooleanTypeQueryParams([['bool', false, false], ['optionalBool', true, fals... | cwe | CWE-20 | JavaScript |
def loadVoters(postId: PostId, voteType: Int): Action[Unit] = GetAction { request =>
import request.{dao, requester}
val pageMeta: PageMeta = dao.getThePageMetaForPostId(postId)
val categoriesRootLast = dao.getAncestorCategoriesRootLast(pageMeta.categoryId)
throwNoUnless(Authz.maySeePage(
pageMe... | cwe | CWE-613 | Scala |
public function uploadCustomLogoAction(Request $request)
{
$fileExt = File::getFileExtension($_FILES['Filedata']['name']);
if (!in_array($fileExt, ['svg', 'png', 'jpg'])) {
throw new \Exception('Unsupported file format');
}
if ($fileExt === 'svg' && stripos(file_get_cont... | cwe | CWE-79 | PHP |
client_send_params(gnutls_session_t session,
gnutls_buffer_t extdata,
const gnutls_psk_client_credentials_t cred)
{
int ret, ext_offset = 0;
uint8_t binder_value[MAX_HASH_SIZE];
size_t spos;
gnutls_datum_t username = {NULL, 0};
gnutls_datum_t user_key = {NULL, 0}, rkey = {NULL, 0};
gnutls_datum_t client... | cwe | CWE-416 | C/C++ |
private function sub_resource_download()
{
if (empty($this->response->meta->sub_resource_id)) {
$this->response->meta->sub_resource_id = 0;
}
$attachment = $this->m_devices->read_sub_resource($this->response->meta->id, $this->response->meta->sub_resource, $this->response->meta->s... | cwe | CWE-22 | PHP |
flush_signal_handlers(struct task_struct *t, int force_default)
{
int i;
struct k_sigaction *ka = &t->sighand->action[0];
for (i = _NSIG ; i != 0 ; i--) {
if (force_default || ka->sa.sa_handler != SIG_IGN)
ka->sa.sa_handler = SIG_DFL;
ka->sa.sa_flags = 0;
sigemptyset(&ka->sa.sa_mask);
ka++;
}
} | cwe | CWE-264 | Unknown |
PJ_DEF(pj_status_t) pjmedia_rtcp_fb_build_rpsi(
pjmedia_rtcp_session *session,
void *buf,
pj_size_t *length,
const pjmedia_rtcp_fb_rpsi *rpsi)
{
pjmedia_rtcp_common *hdr;
pj_uint8_t *p;
unsigned bitlen, padlen, len;
PJ_ASSERT_RETURN(session && buf && length && rpsi,... | cwe | CWE-787 | C/C++ |
import vyper.codegen.events as events
import vyper.utils as util
from vyper import ast as vy_ast
from vyper.builtins.functions import STMT_DISPATCH_TABLE
from vyper.codegen import external_call, self_call
from vyper.codegen.context import Constancy, Context
from vyper.codegen.core import (
LOAD,
STORE,
IRno... | cwe | CWE-190 | Python |
import dayjs from 'dayjs'
import utc from 'dayjs/plugin/utc'
import { FlowRouter } from 'meteor/ostrio:flow-router-extra'
import { saveAs } from 'file-saver'
import { NullXlsx } from '@neovici/nullxlsx'
import './dailytimetable.html'
import './pagination.js'
import './limitpicker.js'
import {
getGlobalSetting,
numb... | cwe | CWE-79 | JavaScript |
TabsCustomBindings::TabsCustomBindings(ScriptContext* context)
: ObjectBackedNativeHandler(context) {
RouteFunction("OpenChannelToTab",
base::Bind(&TabsCustomBindings::OpenChannelToTab,
base::Unretained(this)));
} | cwe | CWE-254 | C/C++ |
static bool IsAnsiEscComment(const wchar *Data,size_t Size);
bool Archive::GetComment(Array<wchar> *CmtData)
{
if (!MainComment)
return false;
SaveFilePos SavePos(*this);
#ifndef SFX_MODULE
uint CmtLength;
if (Format==RARFMT14)
{
Seek(SFXSize+SIZEOF_MAINHEAD14,SEEK_SET);
CmtLength=GetByte();
... | cwe | CWE-787 | C/C++ |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-772 | C/C++ |
static void read_module(RBuffer *b, ut64 addr, struct minidump_module *module) {
st64 o_addr = r_buf_seek (b, 0, R_BUF_CUR);
r_buf_seek (b, addr, R_BUF_SET);
module->base_of_image = r_buf_read_le64 (b);
module->size_of_image = r_buf_read_le32 (b);
module->check_sum = r_buf_read_le32 (b);
module->time_date_stamp =... | cwe | CWE-400 | C/C++ |
// disable no-return-await for model functions
/* eslint-disable no-return-await */
module.exports = function(crowi) {
const debug = require('debug')('growi:models:comment');
const mongoose = require('mongoose');
const ObjectId = mongoose.Schema.Types.ObjectId;
const commentSchema = new mongoose.Schema({
... | cwe | CWE-639 | JavaScript |
TPMI_RH_HIERARCHY_AUTH_Unmarshal(TPMI_RH_HIERARCHY_AUTH *target, BYTE **buffer, INT32 *size)
{
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 |
function(){g({message:JSON.parse(n.result).Message})},n.readAsText(L.response))}catch(y){g({})}});L.send(v)}else try{this.doImportVisio(c,e,g,k)}catch(M){g(M)}}else this.spinner.stop(),this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportVisio||this.loadingExtensions||this.isOffline... | cwe | CWE-20 | JavaScript |
struct nfc_llcp_sdp_tlv *nfc_llcp_build_sdreq_tlv(u8 tid, char *uri,
size_t uri_len)
{
struct nfc_llcp_sdp_tlv *sdreq;
pr_debug("uri: %s, len: %zu\n", uri, uri_len);
sdreq = kzalloc(sizeof(struct nfc_llcp_sdp_tlv), GFP_KERNEL);
if (sdreq == NULL)
return NULL;
sdreq->tlv_len = uri_len + 3;
if (uri[ur... | cwe | CWE-476 | C/C++ |
package com.salesmanager.shop.admin.controller.products;
import com.salesmanager.core.business.services.catalog.product.ProductService;
import com.salesmanager.core.business.services.catalog.product.price.ProductPriceService;
import com.salesmanager.core.business.utils.ProductPriceUtils;
import com.salesmanager.core.b... | cwe | CWE-79 | Java |
/*!
Copyright (c) REBUILD <https://getrebuild.com/> and/or its owners. All rights reserved.
rebuild is dual-licensed under commercial and open source licenses (GPLv3).
See LICENSE and COMMERCIAL in the project root for license information.
*/
package com.rebuild.web.general;
import cn.devezhao.commons.ObjectUtils;
i... | cwe | CWE-89 | Java |
function(u,E,J,T,N,Q,R,Y,ba,ea){if(null!=J&&null==mxMarker.markers[J]){var Z=this.getPackageForType(J);null!=Z&&mxStencilRegistry.getStencil(Z)}return V.apply(this,arguments)};var M=mxStencil.prototype.drawShape;mxStencil.prototype.drawShape=function(u,E,J,T,N,Q){"1"==mxUtils.getValue(E.style,"lineShape",null)&&u.setFi... | cwe | CWE-20 | JavaScript |
/*
* Microsoft Advanced Streaming Format demuxer
* Copyright (c) 2014 Alexandra Hájková
*
* 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
* vers... | cwe | CWE-119 | C/C++ |
VOID ixheaacd_shiftrountine_with_rnd_hq(WORD32 *qmf_real, WORD32 *qmf_imag,
WORD32 *filter_states, WORD32 len,
WORD32 shift) {
WORD32 *filter_states_rev = filter_states + len;
WORD32 treal, timag;
WORD32 j;
for (j = (len - 1); j >= ... | cwe | CWE-787 | C/C++ |
TfLiteStatus SelectPrepare(TfLiteContext* context, TfLiteNode* node) {
OpData* data = reinterpret_cast<OpData*>(node->user_data);
TF_LITE_ENSURE_EQ(context, NumInputs(node), 3);
TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1);
const TfLiteTensor* input_condition =
GetInput(context, node, kInputTensorCon... | cwe | CWE-787 | C/C++ |
_hb_ot_layout_init (hb_face_t *face)
{
hb_ot_layout_t *layout = &face->ot_layout;
layout->gdef_blob = Sanitizer<GDEF>::sanitize (hb_face_get_table (face, HB_OT_TAG_GDEF));
layout->gdef = &Sanitizer<GDEF>::lock_instance (layout->gdef_blob);
layout->gsub_blob = Sanitizer<GSUB>::sanitize (hb_face_get_table (face... | cwe | CWE-119 | Unknown |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.