code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
function check_admin_referer( $action = -1, $query_arg = '_wpnonce' ) {
if ( -1 == $action ) {
_doing_it_wrong( __FUNCTION__, __( 'You should specify a nonce action to be verified by using the first parameter.' ), '3.2.0' );
}
$adminurl = strtolower( admin_url() );
$referer = strtolower( wp_get_referer() )... | cwe | CWE-352 | PHP |
function &getAll(&$dbh, $proposalId)
{
$sql = "SELECT *, UNIX_TIMESTAMP(timestamp) AS timestamp FROM package_proposal_votes WHERE pkg_prop_id = ". $dbh->quoteSmart($proposalId) ." ORDER BY timestamp ASC";
$res = $dbh->query($sql);
if (DB::isError($res)) {
return $res;
}
... | cwe | CWE-640 | PHP |
def create
exists = true
if params.has_key?(:inflated_object)
params[:name] ||= params[:inflated_object].name
# We can only get here if we're admin or the validator. Only
# allow creating admin clients if we're already an admin.
if @auth_user.admin
params[:admin] ||= params[:inf... | cwe | CWE-264 | Ruby |
int CIFSFindNext(const int xid, struct cifs_tcon *tcon,
__u16 searchHandle, struct cifs_search_info *psrch_inf)
{
TRANSACTION2_FNEXT_REQ *pSMB = NULL;
TRANSACTION2_FNEXT_RSP *pSMBr = NULL;
T2_FNEXT_RSP_PARMS *parms;
char *response_data;
int rc = 0;
int bytes_returned, name_len;
__u16 params, byte_count;
... | cwe | CWE-189 | C/C++ |
function B(aa,ca,na){var la=F.menus.get(aa),qa=J.addMenu(mxResources.get(aa),mxUtils.bind(this,function(){la.funct.apply(this,arguments)}),W);qa.className=
"1"==urlParams.sketch?"geToolbarButton":"geMenuItem";qa.style.display="inline-block";qa.style.boxSizing="border-box";qa.style.top="6px";qa.style.marginRight="6px";q... | cwe | CWE-94 | JavaScript |
apr_status_t h2_session_process(h2_session *session, int async)
{
apr_status_t status = APR_SUCCESS;
conn_rec *c = session->c;
int rv, mpm_state, trace = APLOGctrace3(c);
apr_time_t now;
if (trace) {
ap_log_cerror( APLOG_MARK, APLOG_TRACE3, status, c,
H2_SSSN_MSG(s... | cwe | CWE-770 | Unknown |
function X(e){const t=K(V(e)),n=["absolute","fixed"].includes(_(e).position)&&O(e)?G(e):e;return N(n)?t.filter((e=>N(e)&&function(e,t){const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&P(n)){let n=t;do{if(n&&e===n)return!0;n=n.parentNode||n.host}while(n)}return!1}(e,n)&&"body"!==k(e))):... | cwe | CWE-284 | JavaScript |
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
auto* params =
reinterpret_cast<TfLiteAudioSpectrogramParams*>(node->user_data);
TF_LITE_ENSURE_EQ(context, NumInputs(node), 1);
TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1);
const TfLiteTensor* input = GetInput(context, node, kInputTen... | cwe | CWE-787 | C/C++ |
/* vi:set ts=8 sts=4 sw=4 noet:
*
* VIM - Vi IMproved by Bram Moolenaar
*
* Do ":help uganda" in Vim to read copying and usage conditions.
* Do ":help credits" in Vim to see a list of people who contributed.
* See README.txt for an overview of the Vim source code.
*/
#include "vim.h"
#if defined(HAVE_WCHAR_H)... | cwe | CWE-125 | C/C++ |
static enum discovery_result setup_git_directory_gently_1(struct strbuf *dir,
struct strbuf *gitdir,
int die_on_error)
{
const char *env_ceiling_dirs = getenv(CEILING_DIRECTORIES_ENVIRONMENT);
struct string_list ceiling_dirs = STRING_LIST_INIT_DUP;
const char *gitdirenv;
int ceil_offset = -1, min_... | cwe | CWE-22 | Unknown |
##############################################################################
#
# Copyright (c) 2002 Zope Corporation and Contributors. All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFT... | cwe | CWE-79 | Python |
static void set_k_acc(struct SYMBOL *s)
{
int i, j, nacc;
char accs[8], pits[8];
static char sharp_tb[8] = {26, 23, 27, 24, 21, 25, 22};
static char flat_tb[8] = {22, 25, 21, 24, 20, 23, 26};
if (s->u.key.sf > 0) {
for (nacc = 0; nacc < s->u.key.sf; nacc++) {
accs[nacc] = A_SH;
pits[nacc] = sharp_tb[nacc]... | cwe | CWE-787 | C/C++ |
generateWebProxyAccessToken () {
return this._transport
.execute('signer_generateWebProxyAccessToken');
} | cwe | CWE-346 | Rust |
int propagate_mnt(struct mount *dest_mnt, struct mountpoint *dest_mp,
struct mount *source_mnt, struct hlist_head *tree_list)
{
struct mount *m, *n;
int ret = 0;
/*
* we don't want to bother passing tons of arguments to
* propagate_one(); everything is serialized by namespace_sem,
* so globals will do j... | cwe | CWE-703 | Unknown |
/**
* Jooby https://jooby.io
* Apache License Version 2.0 https://jooby.io/LICENSE.txt
* Copyright 2014 Edgar Espina
*/
package io.jooby.internal.netty;
import com.typesafe.config.Config;
import io.jooby.Body;
import io.jooby.ByteRange;
import io.jooby.Context;
import io.jooby.Cookie;
import io.jooby.DefaultContex... | cwe | CWE-444 | Java |
func AcceptBasketRequests(w http.ResponseWriter, r *http.Request) {
name := strings.Split(r.URL.Path, "/")[1]
if !validBasketName.MatchString(name) {
http.Error(w, "invalid basket name; ["+name+"] does not match pattern: "+validBasketName.String(), http.StatusBadRequest)
} else if basket := basketsDb.Get(name); b... | cwe | CWE-79 | Go |
'entityType': this.translateEntityType(this.model.get('parentType')),
}; | cwe | CWE-79 | JavaScript |
QPDFWriter::writeXRefStream(int xref_id, int max_id, qpdf_offset_t max_offset,
trailer_e which, int first, int last, int size,
qpdf_offset_t prev, int hint_id,
qpdf_offset_t hint_offset,
qpdf_offset_t hint_length,
bool skip_compression,
... | cwe | CWE-787 | Unknown |
Cluster::GetEntry(
const CuePoint& cp,
const CuePoint::TrackPosition& tp) const
{
assert(m_pSegment);
#if 0
LoadBlockEntries();
if (m_entries == NULL)
return NULL;
const long long count = m_entries_count;
if (count <= 0)
return NULL;
const long long tc = cp.GetTimeCode();
if ((tp.m_block >... | cwe | CWE-119 | C/C++ |
CURLcode Curl_follow(struct Curl_easy *data,
char *newurl, /* the Location: string */
followtype type) /* see transfer.h */
{
#ifdef CURL_DISABLE_HTTP
(void)data;
(void)newurl;
(void)type;
/* Location: following will not happen when HTTP is disabled */
return CURLE... | cwe | CWE-200 | C/C++ |
# Natural Language Toolkit: Glue Semantics
#
# Author: Dan Garrette <dhgarrette@gmail.com>
#
# Copyright (C) 2001-2021 NLTK Project
# URL: <https://www.nltk.org/>
# For license information, see LICENSE.TXT
import os
from itertools import chain
import nltk
from nltk.internals import Counter
from nltk.sem import drt, l... | cwe | CWE-1333 | Python |
static int qh_echo(int sd, char *buf, unsigned int len)
{
int result = 0;
if (!strcmp(buf, "help")) {
nsock_printf_nul(sd,
"Query handler that simply echoes back what you send it.");
return 0;
}
result = write(sd, buf, len);
if (result == -1) {
logit(NSLOG_RUNTIME_ERROR, TRUE, "qh: qh_echo() error on ... | cwe | CWE-476 | Unknown |
void ServerWrapper::OnHttpRequest(int connection_id,
const net::HttpServerRequestInfo& info) {
server_->SetSendBufferSize(connection_id, kSendBufferSizeForDevTools);
if (base::StartsWith(info.path, "/json", base::CompareCase::SENSITIVE)) {
BrowserThread::PostTask(BrowserTh... | cwe | CWE-20 | C/C++ |
juniper_mfr_print(netdissect_options *ndo,
const struct pcap_pkthdr *h, register const u_char *p)
{
struct juniper_l2info_t l2info;
memset(&l2info, 0, sizeof(l2info));
l2info.pictype = DLT_JUNIPER_MFR;
if (juniper_parse_header(ndo, p, h, &l2info) == 0)
retu... | cwe | CWE-125 | C/C++ |
void macvlan_common_setup(struct net_device *dev)
{
ether_setup(dev);
dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
dev->netdev_ops = &macvlan_netdev_ops;
dev->destructor = free_netdev;
dev->header_ops = &macvlan_hard_header_ops,
dev->ethtool_ops = &macvlan_ethtool_ops;
} | cwe | CWE-264 | Unknown |
function fullpath2pathname(path) {
const index = path.lastIndexOf('/');
return index === -1 ? '/' : path.substring(0, index + 1);
} | cwe | CWE-79 | JavaScript |
rm_cred_handler(Service * /*service*/, int /*i*/, Stream *stream) {
char * name = NULL;
int rtnVal = FALSE;
int rc;
bool found_cred;
CredentialWrapper * cred_wrapper = NULL;
char * owner = NULL;
const char * user;
ReliSock * socket = (ReliSock*)stream;
if (!socket->triedAuthentication()) {
Condo... | cwe | CWE-134 | C/C++ |
static int phar_tar_writeheaders_int(phar_entry_info *entry, void *argument) /* {{{ */
{
tar_header header;
size_t pos;
struct _phar_pass_tar_info *fp = (struct _phar_pass_tar_info *)argument;
char padding[512];
if (entry->is_mounted) {
return ZEND_HASH_APPLY_KEEP;
}
if (entry->is_deleted) {
if (entry->fp_... | cwe | CWE-119 | C/C++ |
/* Copyright 2017 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-125 | Python |
fm_mgr_config_init
(
OUT p_fm_config_conx_hdlt *p_hdl,
IN int instance,
OPTIONAL IN char *rem_address,
OPTIONAL IN char *community
)
{
fm_config_conx_hdl *hdl;
fm_mgr_config_errno_t res = FM_CONF_OK;
if ( (hdl = calloc(1,sizeof(fm_config_conx_hdl))) == NULL )
{
res = FM_CON... | cwe | CWE-362 | C/C++ |
date.compile = function (formatString) {
var re = /\[([^\[\]]*|\[[^\[\]]*\])*\]|([A-Za-z])\2+|\.{3}|./g, keys, pattern = [formatString];
while ((keys = re.exec(formatString))) {
pattern[pattern.length] = keys[0];
}
return pattern;
}; | cwe | CWE-400 | JavaScript |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
# Search
from __future__ import unicode_literals
import frappe, json
from frappe.utils import cstr, unique, cint
from frappe.permissions import has_permission
from frappe.handler import is_whitelisted
from frappe import... | cwe | CWE-79 | Python |
void xaddCommand(client *c) {
streamID id;
int id_given = 0; /* Was an ID different than "*" specified? */
long long maxlen = -1; /* If left to -1 no trimming is performed. */
int approx_maxlen = 0; /* If 1 only delete whole radix tree nodes, so
the maximum length is not... | cwe | CWE-190 | Unknown |
function validateBaseUrl(url: string) {
// from this MIT-licensed gist: https://gist.github.com/dperini/729294
return /^(?:(?:(?:https?|ftp):)?\/\/)(?:(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-... | cwe | CWE-697 | JavaScript |
/* Copyright 2017 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-122 | C/C++ |
from pathlib import Path
from os.path import sep
from pkg_resources import require
from shutil import which
import frontmatter
from flask import (
render_template,
flash,
redirect,
request,
url_for,
send_file,
send_from_directory,
)
from flask_login import login_user, current_user, logout_u... | cwe | CWE-601 | Python |
/*
* Copyright (c) 2014 Cesanta Software Limited
* All rights reserved
*/
#if MG_ENABLE_MQTT
#include <string.h>
#include "mg_internal.h"
#include "mg_mqtt.h"
static uint16_t getu16(const char *p) {
const uint8_t *up = (const uint8_t *) p;
return (up[0] << 8) + up[1];
}
static const char *scanto(const char ... | cwe | CWE-119 | C/C++ |
static void php_html_entities(INTERNAL_FUNCTION_PARAMETERS, int all)
{
char *str, *hint_charset = NULL;
int str_len, hint_charset_len = 0;
size_t new_len;
long flags = ENT_COMPAT;
char *replaced;
zend_bool double_encode = 1;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ls!b", &str, &str_len, &flags, ... | cwe | CWE-190 | C/C++ |
wb_print(netdissect_options *ndo,
register const void *hdr, register u_int len)
{
register const struct pkt_hdr *ph;
ph = (const struct pkt_hdr *)hdr;
if (len < sizeof(*ph) || !ND_TTEST(*ph)) {
ND_PRINT((ndo, "%s", tstr));
return;
}
len -= sizeof(*ph);
if (ph->ph_flags)
ND_PRINT((ndo, "*"));
swi... | cwe | CWE-125 | Unknown |
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Copyright (c) 2000-2001 Vojtech Pavlik
* Copyright (c) 2006-2010 Jiri Kosina
*
* HID to Linux Input mapping
*/
/*
*
* Should you need to contact me, the author, you can do so either by
* e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
* Vo... | cwe | CWE-787 | C/C++ |
function restoreConfig(baseURL: string): ?Object {
const key = `${_CONFIG_STORE_PREFIX}/${baseURL}`;
const config = jitsiLocalStorage.getItem(key);
if (config) {
try {
return JSON.parse(config) || undefined;
} catch (e) {
// Somehow incorrect data ended up in the sto... | cwe | CWE-1321 | JavaScript |
_equalConstraint(const Constraint *a, const Constraint *b)
{
COMPARE_SCALAR_FIELD(contype);
COMPARE_STRING_FIELD(conname);
COMPARE_SCALAR_FIELD(deferrable);
COMPARE_SCALAR_FIELD(initdeferred);
COMPARE_LOCATION_FIELD(location);
COMPARE_SCALAR_FIELD(is_no_inherit);
COMPARE_NODE_FIELD(raw_expr);
COMPARE_STRING_FIE... | cwe | CWE-362 | Unknown |
static Image *ReadTXTImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
char
colorspace[MagickPathExtent],
text[MagickPathExtent];
Image
*image;
long
x_offset,
y_offset;
PixelInfo
pixel;
MagickBooleanType
status;
QuantumAny
range;
register ssize_t
i,
... | cwe | CWE-835 | C/C++ |
private function drain(StreamInterface $source, StreamInterface $sink)
{
Psr7\copy_to_stream($source, $sink);
$sink->seek(0);
$source->close();
return $sink;
} | cwe | CWE-89 | JavaScript |
static struct task_struct *copy_process(unsigned long clone_flags,
unsigned long stack_start,
struct pt_regs *regs,
unsigned long stack_size,
int __user *child_tidptr,
struct pid *pid,
int trace)
{
int retval;
struct task_struct *p;
int cgroup_callbacks_done = 0;
if ((clone_flags & (C... | cwe | CWE-400 | C/C++ |
int ext4_ext_get_blocks(handle_t *handle, struct inode *inode,
ext4_lblk_t iblock,
unsigned int max_blocks, struct buffer_head *bh_result,
int flags)
{
struct ext4_ext_path *path = NULL;
struct ext4_extent_header *eh;
struct ext4_extent newex, *ex, *last_ex;
ext4_fsblk_t newblock;
int err = 0, depth, ret,... | cwe | CWE-703 | Unknown |
/* $OpenBSD: monitor.c,v 1.165 2016/09/05 13:57:31 djm Exp $ */
/*
* Copyright 2002 Niels Provos <provos@citi.umich.edu>
* Copyright 2002 Markus Friedl <markus@openbsd.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the... | cwe | CWE-119 | C/C++ |
xsltAddTemplate(xsltStylesheetPtr style, xsltTemplatePtr cur,
const xmlChar *mode, const xmlChar *modeURI) {
xsltCompMatchPtr pat, list, next;
/*
* 'top' will point to style->xxxMatch ptr - declaring as 'void'
* avoids gcc 'type-punned pointer' warning.
*/
void **top = NULL;
co... | cwe | CWE-119 | C/C++ |
/*
* $Id$
*
* Copyright 2000-2005 The Apache Software Foundation.
*
* 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... | cwe | CWE-20 | Java |
package ldap
import (
"fmt"
"gopkg.in/asn1-ber.v1"
)
// LDAP Result Codes
const (
LDAPResultSuccess = 0
LDAPResultOperationsError = 1
LDAPResultProtocolError = 2
LDAPResultTimeLimitExceeded = 3
LDAPResultSizeLimitExceeded = 4
LDAPResultCo... | cwe | CWE-255 | Go |
/*
* Copyright (C) 2003, 2004, 2005 Joe Walnes.
* Copyright (C) 2006, 2007, 2010, 2011, 2013, 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... | cwe | CWE-400 | Java |
def self.get_copies_folder(user_id)
my_folder = User.get_my_folder(user_id)
unless my_folder.nil?
con = "(parent_id=#{my_folder.id}) and (name='#{Item.copies_folder}')"
begin
copies_folder = Folder.where(con).first
rescue
end
if copies_folder.nil?
folder = Folder... | cwe | CWE-89 | Ruby |
int regcomp(regex_t *preg, const char *pattern, int cflags)
{
conopt_t globopts;
globopts.nested_negative_tags = !(cflags & (REG_NFA | REG_REGLESS));
globopts.FFlag = true;
globopts.backward = cflags & REG_BACKWARD;
globopts.stadfa = cflags & REG_STADFA;
Msg msg;
Opt opts(globopts, msg);
... | cwe | CWE-787 | Unknown |
icmp_print(netdissect_options *ndo, const u_char *bp, u_int plen, const u_char *bp2,
int fragmented)
{
char *cp;
const struct icmp *dp;
const struct icmp_ext_t *ext_dp;
const struct ip *ip;
const char *str, *fmt;
const struct ip *oip;
const struct udphdr *ouh;
const uint8_t *obj_tptr;
... | cwe | CWE-125 | Unknown |
########################################################################
# File name: xhu.py
# This file is part of: xmpp-http-upload
#
# LICENSE
#
# 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... | cwe | CWE-22 | Python |
authhavekey(
keyid_t id
)
{
symkey * sk;
authkeylookups++;
if (0 == id || cache_keyid == id) {
return TRUE;
}
/*
* Seach the bin for the key. If found and the key type
* is zero, somebody marked it trusted without specifying
* a key or key type. In this case consider the key missing.
*/
authkeyunca... | cwe | CWE-287 | Unknown |
void TensorSliceReader::LoadShard(int shard) const {
CHECK_LT(shard, sss_.size());
if (sss_[shard] || !status_.ok()) {
return; // Already loaded, or invalid.
}
string value;
SavedTensorSlices sts;
const string fname = fnames_[shard];
VLOG(1) << "Reading meta data from file " << fname << "...";
Tabl... | cwe | CWE-345 | C/C++ |
static __u8 *sp_report_fixup(struct hid_device *hdev, __u8 *rdesc,
unsigned int *rsize)
{
if (*rsize >= 107 && rdesc[104] == 0x26 && rdesc[105] == 0x80 &&
rdesc[106] == 0x03) {
hid_info(hdev, "fixing up Sunplus Wireless Desktop report descriptor\n");
rdesc[105] = rdesc[110] = 0x03;
rdesc[106] = rdesc[111] =... | cwe | CWE-119 | C/C++ |
def get(self, arg,word=None):
#print "match auto"
try:
limit = self.get_argument("limit")
word = self.get_argument("word")
callback = self.get_argument("callback") #jsonp
result = rtxcomplete.prefix(word,limit)
result = callback+"("+json.dump... | cwe | CWE-79 | Python |
static void __exit xfrm6_tunnel_fini(void)
{
unregister_pernet_subsys(&xfrm6_tunnel_net_ops);
xfrm6_tunnel_spi_fini();
xfrm6_tunnel_deregister(&xfrm46_tunnel_handler, AF_INET);
xfrm6_tunnel_deregister(&xfrm6_tunnel_handler, AF_INET6);
xfrm_unregister_type(&xfrm6_tunnel_type, AF_INET6);
} | cwe | CWE-362 | C/C++ |
func (set *IdmapSet) doUidshiftIntoContainer(dir string, testmode bool, how string) error {
convert := func(path string, fi os.FileInfo, err error) (e error) {
uid, gid, err := GetOwner(path)
if err != nil {
return err
}
var newuid, newgid int
switch how {
case "in":
newuid, newgid = set.ShiftIntoNs(... | cwe | CWE-362 | Go |
def _async_render_POST(self, request):
try:
try:
# json.loads doesn't allow bytes in Python 3.5
body = json.loads(request.content.read().decode("UTF-8"))
except ValueError:
request.setResponseCode(400)
request.write(dict_to_... | cwe | CWE-20 | Python |
static inline unsigned int ScaleQuantumToLong(const Quantum quantum)
{
#if !defined(MAGICKCORE_HDRI_SUPPORT)
return((unsigned int) (16843009UL*quantum));
#else
if (quantum <= 0.0)
return(0UL);
if ((16843009.0*quantum) >= 4294967295.0)
return(4294967295UL);
return((unsigned int) (16843009.0*quantum+0.5))... | cwe | CWE-190 | Unknown |
bool kvm_irq_delivery_to_apic_fast(struct kvm *kvm, struct kvm_lapic *src,
struct kvm_lapic_irq *irq, int *r, struct dest_map *dest_map)
{
struct kvm_apic_map *map;
unsigned long bitmap;
struct kvm_lapic **dst = NULL;
int i;
bool ret;
*r = -1;
if (irq->shorthand == APIC_DEST_SELF) {
*r = kvm_apic_set_irq(s... | cwe | CWE-476 | C/C++ |
static void fanout_release(struct sock *sk)
{
struct packet_sock *po = pkt_sk(sk);
struct packet_fanout *f;
f = po->fanout;
if (!f)
return;
mutex_lock(&fanout_mutex);
po->fanout = NULL;
if (atomic_dec_and_test(&f->sk_ref)) {
list_del(&f->list);
dev_remove_pack(&f->prot_hook);
fanout_release_data(f);
... | cwe | CWE-362 | C/C++ |
/* @flow */
import type {PersonObject} from '../../types.js';
const validateLicense = require('validate-npm-package-license');
export function isValidLicense(license: string): boolean {
return !!license && validateLicense(license).validForNewPackages;
}
export function stringifyPerson(person: mixed): any {
if (... | cwe | CWE-59 | JavaScript |
/*
* 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-22 | C/C++ |
static void cil_reset_perm(struct cil_perm *perm)
{
cil_reset_classperms_list(perm->classperms);
} | cwe | CWE-416 | Unknown |
/*
* Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd.
*
* Author: zccrs <zccrs@live.com>
*
* Maintainer: zccrs <zhangjide@deepin.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 Foun... | cwe | CWE-59 | C/C++ |
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */
/*
* lsquic_frab_list.c -- List of buffer for simple reading and writing
*/
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <sys/queue.h>
#include "lsquic_frab_list.h"
static void *
fral_alloc (void *ctx, size_t size)
{... | cwe | CWE-476 | C/C++ |
eval_next_line(char_u *arg, evalarg_T *evalarg)
{
garray_T *gap = &evalarg->eval_ga;
char_u *line;
if (arg != NULL)
{
if (*arg == NL)
return newline_skip_comments(arg);
// Truncate before a trailing comment, so that concatenating the lines
// won't turn the rest into a comment.
if (*skipwhite(... | cwe | CWE-416 | C/C++ |
process_ra(struct Interface *iface, unsigned char *msg, int len,
struct sockaddr_in6 *addr)
{
struct nd_router_advert *radvert;
char addr_str[INET6_ADDRSTRLEN];
uint8_t *opt_str;
print_addr(&addr->sin6_addr, addr_str);
radvert = (struct nd_router_advert *) msg;
if ((radvert->nd_ra_curhoplimit && iface->AdvCur... | cwe | CWE-119 | C/C++ |
void PacketReader::getLabelFromContent(const vector<uint8_t>& content, uint16_t& frompos, string& ret, int recurs)
{
if(recurs > 1000) // the forward reference-check below should make this test 100% obsolete
throw MOADNSException("Loop");
// it is tempting to call reserve on ret, but it turns out it creates a ... | cwe | CWE-399 | Unknown |
static inline LineContribType *_gdContributionsCalc(unsigned int line_size, unsigned int src_size, double scale_d, const interpolation_method pFilter)
{
double width_d;
double scale_f_d = 1.0;
const double filter_width_d = DEFAULT_BOX_RADIUS;
int windows_size;
unsigned int u;
LineContribType *res;
if (scale_d ... | cwe | CWE-125 | C/C++ |
_makeHeader(name) {
let div = document.createElement('div');
div.className = 'vis-configuration vis-config-header';
div.innerHTML = name;
this._makeItem([],div);
} | cwe | CWE-79 | JavaScript |
/* pb_decode.c -- decode a protobuf using minimal resources
*
* 2011 Petteri Aimonen <jpa@kapsi.fi>
*/
/* Use the GCC warn_unused_result attribute to check that all return values
* are propagated correctly. On other compilers and gcc before 3.4.0 just
* ignore the annotation.
*/
#if !defined(__GNUC__) || ( __GNU... | cwe | CWE-125 | JavaScript |
$chats[$index]->link = erLhcoreClassXMP::getBaseHost() . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurl('user/login').'/(r)/'.rawurlencode(base64_encode('chat/single/'.$chat->id));
}
} | cwe | CWE-116 | PHP |
//For jQuery 1.3.2
dojo.provide("dojox.jq");
dojo.require("dojo.NodeList-traverse");
dojo.require("dojo.NodeList-manipulate");
dojo.require("dojo.io.script");
/*
To get jquery tests to pass:
- add spaces between span>form selectors, other ones like one,two
- .last() instead of :last
- $("<div>").find("#foo") does not... | cwe | CWE-74 | Java |
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
auto* params = reinterpret_cast<TfLiteAddParams*>(node->builtin_data);
OpData* data = reinterpret_cast<OpData*>(node->user_data);
const TfLiteTensor* input1 = GetInput(context, node, kInputTensor1);
const TfLiteTensor* input2 = GetInput(context, nod... | cwe | CWE-125 | C/C++ |
static Sdb *store_versioninfo_gnu_verdef(ELFOBJ *bin, Elf_(Shdr) *shdr, int sz) {
const char *section_name = "";
const char *link_section_name = "";
char *end = NULL;
Elf_(Shdr) *link_shdr = NULL;
ut8 dfs[sizeof (Elf_(Verdef))] = {0};
Sdb *sdb;
int cnt, i;
if (shdr->sh_link > bin->ehdr.e_shnum) {
return false... | cwe | CWE-476 | Unknown |
package io.onedev.server.web.page.admin.brandingsetting;
import java.io.File;
import java.io.IOException;
import java.util.List;
import org.apache.commons.io.FileUtils;
import org.apache.wicket.Component;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.Button;
import org.ap... | cwe | CWE-552 | Java |
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
OpData* data = reinterpret_cast<OpData*>(node->user_data);
ruy::profiler::ScopeLabel label("SquaredDifference");
const TfLiteTensor* input1 = GetInput(context, node, kInputTensor1);
const TfLiteTensor* input2 = GetInput(context, node, kInputTensor2)... | cwe | CWE-787 | C/C++ |
static int sfq_change(struct Qdisc *sch, struct nlattr *opt)
{
struct sfq_sched_data *q = qdisc_priv(sch);
struct tc_sfq_qopt *ctl = nla_data(opt);
struct tc_sfq_qopt_v1 *ctl_v1 = NULL;
unsigned int qlen, dropped = 0;
struct red_parms *p = NULL;
struct sk_buff *to_free = NULL;
struct sk_buff *tail = NULL;
if (... | cwe | CWE-330 | Unknown |
cmdopts_t *cmdopts_parse(int argc, char **argv)
{
enum {
CMDOPT_HELP = 0,
CMDOPT_VERBOSE,
CMDOPT_QUIET,
CMDOPT_INFILE,
CMDOPT_INFMT,
CMDOPT_INOPT,
CMDOPT_OUTFILE,
CMDOPT_OUTFMT,
CMDOPT_OUTOPT,
CMDOPT_VERSION,
CMDOPT_DEBUG,
CMDOPT_CMPTNO,
CMDOPT_SRGB,
CMDOPT_MAXMEM,
CMDOPT_LIST_ENABLED_COD... | cwe | CWE-703 | C/C++ |
def _start_fc_map(self, fc_map_id, source, target):
try:
out, err = self._run_ssh('svctask startfcmap %s' % fc_map_id)
except exception.ProcessExecutionError as e:
with excutils.save_and_reraise_exception():
LOG.error(_('_start_fc_map: Failed to start FlashCopy '
... | cwe | CWE-78 | Python |
/*
+----------------------------------------------------------------------+
| HipHop for PHP |
+----------------------------------------------------------------------+
| Copyright (c) 2010-present Facebook, Inc. (http://www.facebook.com) |
| Copyrigh... | cwe | CWE-787 | C/C++ |
public function LoadContainingTag($commit)
{
if (!$commit)
return;
$args = array();
$args[] = '--tags';
$args[] = $commit->GetHash();
$revs = explode("\n", $this->exe->Execute($commit->GetProject()->GetPath(), GIT_NAME_REV, $args));
foreach ($revs as $revline) {
if (preg_match('/^([0-9a-fA-F]{40})\... | cwe | CWE-78 | PHP |
static int __init sit_init(void)
{
int err;
printk(KERN_INFO "IPv6 over IPv4 tunneling driver\n");
if (xfrm4_tunnel_register(&sit_handler, AF_INET6) < 0) {
printk(KERN_INFO "sit init: Can't add protocol\n");
return -EAGAIN;
}
err = register_pernet_device(&sit_net_ops);
if (err < 0)
xfrm4_tunnel_deregiste... | cwe | CWE-362 | C/C++ |
def get_files(self, submit_id, password=None, astree=False):
"""
Returns files from a submitted analysis.
@param password: The password to unlock container archives with
@param astree: sflock option; determines the format in which the files are returned
@return: A tree of files
... | cwe | CWE-22 | Python |
/**********************************************************************************************
*
* rcore - Basic functions to manage windows, OpenGL context and input on multiple platforms
*
* PLATFORMS SUPPORTED:
* - PLATFORM_DESKTOP: Windows (Win32, Win64)
* - PLATFORM_DESKTOP: Linux (X11 desktop mod... | cwe | CWE-79 | C/C++ |
static int fuse_xattr_get(const struct xattr_handler *handler,
struct dentry *dentry, struct inode *inode,
const char *name, void *value, size_t size)
{
return fuse_getxattr(inode, name, value, size);
} | cwe | CWE-459 | Unknown |
bool NuMediaExtractor::getTotalBitrate(int64_t *bitrate) const {
if (mTotalBitrate >= 0) {
*bitrate = mTotalBitrate;
return true;
}
off64_t size;
if (mDurationUs >= 0 && mDataSource->getSize(&size) == OK) {
*bitrate = size * 8000000ll / mDurationUs; // in bits/sec
return true;
... | cwe | CWE-369 | C/C++ |
init (callback) {
return this.exec("init", callback);
} | cwe | CWE-77 | JavaScript |
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2021 MinIO, Inc.
//
// 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 ... | cwe | CWE-306 | Go |
static void core_anal_bytes(RCore *core, const ut8 *buf, int len, int nops, int fmt) {
int stacksize = r_config_get_i (core->config, "esil.stack.depth");
bool iotrap = r_config_get_i (core->config, "esil.iotrap");
bool romem = r_config_get_i (core->config, "esil.romem");
bool stats = r_config_get_i (core->config, "... | cwe | CWE-125 | Unknown |
static BIGNUM *srp_Calc_k(BIGNUM *N, BIGNUM *g)
{
/* k = SHA1(N | PAD(g)) -- tls-srp draft 8 */
unsigned char digest[SHA_DIGEST_LENGTH];
unsigned char *tmp;
EVP_MD_CTX ctxt;
int longg ;
int longN = BN_num_bytes(N);
if ((tmp = OPENSSL_malloc(longN)) == NULL)
return NULL;
BN_bn2bin(N,tmp) ;
EVP_MD_CTX_init... | cwe | CWE-119 | Unknown |
#!/usr/bin/python3
import gettext
import logging
from gi.repository import GObject, GLib, Gio
import grpc
import transfers
import prefs
import util
import notifications
from util import OpStatus, OpCommand, TransferDirection, ReceiveError
_ = gettext.gettext
class CommonOp(GObject.Object):
__gsignals__ = {
... | cwe | CWE-22 | Python |
CString CWebSock::GetSkinPath(const CString& sSkinName) {
CString sRet = CZNC::Get().GetZNCPath() + "/webskins/" + sSkinName;
if (!CFile::IsDir(sRet)) {
sRet = CZNC::Get().GetCurPath() + "/webskins/" + sSkinName;
if (!CFile::IsDir(sRet)) {
sRet = CString(_SKINDIR_) + "/" + sSkinNam... | cwe | CWE-22 | Unknown |
/*
* PKCS15 emulation layer for TCOS based preformatted cards
*
* Copyright (C) 2011, Peter Koch <pk@opensc-project.org>
*
* This library 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
*... | cwe | CWE-252 | C/C++ |
read_Header(struct archive_read *a, struct _7z_header_info *h,
int check_header_id)
{
struct _7zip *zip = (struct _7zip *)a->format->data;
const unsigned char *p;
struct _7z_folder *folders;
struct _7z_stream_info *si = &(zip->si);
struct _7zip_entry *entries;
uint32_t folderIndex, indexInFolder;
unsigned i;... | cwe | CWE-125 | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.