code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
static void cmd_anal_esil(RCore *core, const char *input) {
RAnalEsil *esil = core->anal->esil;
ut64 addr = core->offset;
ut64 adr ;
char *n, *n1;
int off;
int stacksize = r_config_get_i (core->config, "esil.stack.depth");
int iotrap = r_config_get_i (core->config, "esil.iotrap");
int romem = r_config_get_i (co... | cwe | CWE-908 | Unknown |
/* packet-eap.c
* Routines for EAP Extensible Authentication Protocol dissection
* RFC 2284, RFC 3748
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "config.h"
#include <stdio.h> /* f... | cwe | CWE-404 | C/C++ |
package hamt
import (
"context"
"fmt"
bitfield "github.com/ipfs/go-bitfield"
"github.com/ipfs/go-unixfsnode/data"
"github.com/ipfs/go-unixfsnode/iter"
dagpb "github.com/ipld/go-codec-dagpb"
"github.com/ipld/go-ipld-prime"
"github.com/ipld/go-ipld-prime/schema"
)
const (
// HashMurmur3 is the multiformats id... | cwe | CWE-400 | Go |
[req.locale]: self.getBrowserBundles(req.locale)
};
if (req.locale !== self.defaultLocale) {
i18n[self.defaultLocale] = self.getBrowserBundles(self.defaultLocale);
}
const result = {
i18n,
locale: req.locale,
defaultLocale: self.defaultLocale,
... | cwe | CWE-613 | JavaScript |
process_demand_active(STREAM s)
{
uint8 type;
uint16 len_src_descriptor, len_combined_caps;
/* at this point we need to ensure that we have ui created */
rd_create_ui();
in_uint32_le(s, g_rdp_shareid);
in_uint16_le(s, len_src_descriptor);
in_uint16_le(s, len_combined_caps);
in_uint8s(s, len_src_descriptor);
... | cwe | CWE-787 | Unknown |
static CURLcode smtp_connect(struct connectdata *conn,
bool *done) /* see description above */
{
CURLcode result;
struct smtp_conn *smtpc = &conn->proto.smtpc;
struct SessionHandle *data = conn->data;
struct pingpong *pp = &smtpc->pp;
const char *path = conn->data->state.path;
i... | cwe | CWE-89 | C/C++ |
/*
* Copyright 2000-2020 Vaadin Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | cwe | CWE-200 | Java |
function getGttsCmdWithArgs(fields) {
var text = fields.textToSpeech,
language = fields.language,
speed = fields.speed,
speedParam = speed ? ' -s' : '',
cmd = 'gtts-cli' + ' -l ' + language + speedParam + ' --nocheck \"' + text + '\"' + ' | play -t mp3 -';
return cmd;
} | cwe | CWE-78 | JavaScript |
static int ldb_dn_escape_internal(char *dst, const char *src, int len)
{
const char *p, *s;
char *d;
size_t l;
p = s = src;
d = dst;
while (p - src < len) {
p += strcspn(p, ",=\n\r+<>#;\\\" ");
if (p - src == len) /* found no escapable chars */
break;
/* copy the part of the string before the stop */... | cwe | CWE-200 | Unknown |
static int packet_diag_dump(struct sk_buff *skb, struct netlink_callback *cb)
{
int num = 0, s_num = cb->args[0];
struct packet_diag_req *req;
struct net *net;
struct sock *sk;
bool may_report_filterinfo;
net = sock_net(skb->sk);
req = nlmsg_data(cb->nlh);
may_report_filterinfo = ns_capable(net->user_ns, CAP_N... | cwe | CWE-264 | Unknown |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-119 | C/C++ |
/**
* Licensed to The Apereo Foundation under one or more contributor license
* agreements. See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
*
* The Apereo Foundation licenses this file to you under the Educational
* Community License, Version 2.0 (the ... | cwe | CWE-327 | Java |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-20 | C/C++ |
from datetime import timedelta
from django.contrib.auth import get_user_model
from django.db import models
from django.utils import timezone
from team.models import Team
class InviteCode(models.Model):
code = models.CharField(max_length=64, unique=True)
uses = models.IntegerField(default=0)
max_uses = m... | cwe | CWE-287 | Python |
def paginate_by_sql(model, sql, per_page, options={})
if options[:count]
if options[:count].is_a?(Integer)
total = options[:count]
else
total = model.count_by_sql(options[:count])
end
else
total = model.count_by_sql_wrapping_select_query(sql)
end
object_pages = m... | cwe | CWE-89 | Ruby |
function link(scope, elem, attrs, ctrl) {
var data, panel;
elem = elem.find('.piechart-panel__chart');
var $tooltip = $('<div id="tooltip">');
ctrl.events.on('render', function () {
render(false);
if (panel.legendType === 'Right side') {
setTimeout(function () {
render(tru... | cwe | CWE-79 | JavaScript |
child_setup_func (gpointer user_data)
{
ChildSetupData *data = (ChildSetupData *) user_data;
FdMapEntry *fd_map = data->fd_map;
sigset_t set;
int i;
flatpak_close_fds_workaround (3);
if (data->instance_id_fd != -1)
drop_cloexec (data->instance_id_fd);
/* Unblock all signals */
sigemptyset (&set);... | cwe | CWE-74 | Unknown |
var path = require('path')
module.exports = {
entry: '', // karma will set this
output: '', // karma will set this
devtool: 'source-map',
resolve: {
alias: {
'src': path.resolve(__dirname, 'src'),
'lib': path.resolve(__dirname, 'lib')
}
},
module: {
rules: [
{
test: /\... | cwe | CWE-94 | JavaScript |
PJ_DEF(pj_status_t) pjmedia_rtcp_fb_build_nack(
pjmedia_rtcp_session *session,
void *buf,
pj_size_t *length,
unsigned nack_cnt,
const pjmedia_rtcp_fb_nack nack[])
{
pjmedia_rtcp_common *hdr;
pj_uint8_t *p;
unsigned len, i;
PJ_ASSERT_RETURN(session && buf && length && nack_cnt &... | cwe | CWE-787 | C/C++ |
JPEGSetupEncode(TIFF* tif)
{
JPEGState* sp = JState(tif);
TIFFDirectory *td = &tif->tif_dir;
static const char module[] = "JPEGSetupEncode";
#if defined(JPEG_DUAL_MODE_8_12) && !defined(TIFFInitJPEG)
if( tif->tif_dir.td_bitspersample == 12 )
return TIFFReInitJPEG_12( tif, COMPRESSION_JPEG, 1 );
... | cwe | CWE-20 | Unknown |
void updateHandshakeState(QuicServerConnectionState& conn) {
// Zero RTT read cipher is available after chlo is processed with the
// condition that early data attempt is accepted.
auto handshakeLayer = conn.serverHandshakeLayer;
auto zeroRttReadCipher = handshakeLayer->getZeroRttReadCipher();
auto zeroRttHea... | cwe | CWE-703 | C/C++ |
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/ory/fosite/handler/oauth2 (interfaces: AuthorizeCodeStorage)
// 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"
)
... | cwe | CWE-345 | Go |
/* Common methods shared between FTP and TFTP engines
*
* Copyright (c) 2014-2019 Joachim Nilsson <troglobit@gmail.com>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission noti... | cwe | CWE-22 | C/C++ |
from django.core.exceptions import ValidationError
from shuup.utils.django_compat import force_text
# This file is part of Shuup.
#
# Copyright (c) 2012-2021, Shuup Commerce Inc. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this s... | cwe | CWE-79 | Python |
"""CILogon OAuthAuthenticator for JupyterHub
Uses OAuth 2.0 with cilogon.org (override with CILOGON_HOST)
Caveats:
- For allowed user list /admin purposes, username will be the ePPN by default.
This is typically an email address and may not work as a Unix userid.
Normalization may be required to turn the Jupyter... | cwe | CWE-639 | Python |
static int ext4_fill_flex_info(struct super_block *sb)
{
struct ext4_sb_info *sbi = EXT4_SB(sb);
struct ext4_group_desc *gdp = NULL;
ext4_group_t flex_group_count;
ext4_group_t flex_group;
int groups_per_flex = 0;
size_t size;
int i;
sbi->s_log_groups_per_flex = sbi->s_es->s_log_groups_per_flex;
groups... | cwe | CWE-189 | C/C++ |
gss_verify_mic (minor_status,
context_handle,
message_buffer,
token_buffer,
qop_state)
OM_uint32 * minor_status;
gss_ctx_id_t context_handle;
gss_buffer_t message_buffer;
gss_buffer_t token_buffer;
gss_qop_t * qop_state;
{
OM_uint32 status;
gss_union_ctx_id_t ctx;
gss_mechanism mech;
i... | cwe | CWE-415 | C/C++ |
unsigned _gnutls_fips_mode_enabled(void)
{
unsigned f1p = 0, f2p;
FILE* fd;
const char *p;
if (_fips_mode != -1)
return _fips_mode;
p = getenv("GNUTLS_FORCE_FIPS_MODE");
if (p) {
if (p[0] == '1')
_fips_mode = 1;
else if (p[0] == '2')
_fips_mode = 2;
else
_fips_mode = 0;
return _fips_mode;
}
f... | cwe | CWE-20 | Unknown |
int llhttp__after_headers_complete(llhttp_t* parser, const char* p,
const char* endp) {
int hasBody;
hasBody = parser->flags & F_CHUNKED || parser->content_length > 0;
if (parser->upgrade && (parser->method == HTTP_CONNECT ||
(parser->flags & F_SKIPBOD... | cwe | CWE-444 | Unknown |
/*
* Copyright 2021 ThoughtWorks, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | cwe | CWE-79 | Java |
package io.onedev.server.web.component.markdown;
import java.io.IOException;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import javax.inject.Singleton;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServ... | cwe | CWE-502 | Java |
/* $Id$ */
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "gd_intern.h"
/* 2.03: don't include zlib here or we can't build without PNG */
#include "gd.h"
#include "gdhelpers.h"
#include "gd_color.h"
#include "... | cwe | CWE-20 | C/C++ |
static u32 __ipv6_select_ident(struct net *net,
const struct in6_addr *dst,
const struct in6_addr *src)
{
const struct {
struct in6_addr dst;
struct in6_addr src;
} __aligned(SIPHASH_ALIGNMENT) combined = {
.dst = *dst,
.src = *src,
};
u32 hash, id;
/* Note the following code is not sa... | cwe | CWE-327 | Unknown |
g_markup_parse_context_end_parse (GMarkupParseContext *context,
GError **error)
{
g_return_val_if_fail (context != NULL, FALSE);
g_return_val_if_fail (!context->parsing, FALSE);
g_return_val_if_fail (context->state != STATE_ERROR, FALSE);
if (context->partial_chu... | cwe | CWE-476 | C/C++ |
processDescription (event, router, conf, sessionManager, SessionValidator) {
var argsURLFragment = event ? (event.args ? event.args[0] : "") : "",
urlParams = URIUtils.parseQueryString(argsURLFragment),
gotoURL = urlParams.goto;
SessionValidator.stop();
... | cwe | CWE-601 | JavaScript |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible 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) an... | cwe | CWE-20 | Python |
public function checkPersistCode($persistCode)
{
if (!$persistCode || !$this->persist_code) {
return false;
}
return $persistCode == $this->persist_code;
} | cwe | CWE-287 | PHP |
psf_fwrite (const void *ptr, sf_count_t bytes, sf_count_t items, SF_PRIVATE *psf)
{ sf_count_t total = 0 ;
ssize_t count ;
DWORD dwNumberOfBytesWritten ;
if (psf->virtual_io)
return psf->vio.write (ptr, bytes * items, psf->vio_user_data) / bytes ;
items *= bytes ;
/* Do this check after the multiplication abo... | cwe | CWE-369 | Unknown |
ex_substitute(exarg_T *eap)
{
linenr_T lnum;
long i = 0;
regmmatch_T regmatch;
static subflags_T subflags = {FALSE, FALSE, FALSE, TRUE, FALSE,
FALSE, FALSE, 0};
#ifdef FEAT_EVAL
subflags_T subflags_save;
#endif
int save_do_all; // remember user specified 'g' flag
int save_do_... | cwe | CWE-787 | C/C++ |
export default function addStickyControl() {
extend(DiscussionListState.prototype, 'requestParams', function(params) {
if (app.current.matches(IndexPage) || app.current.matches(DiscussionPage)) {
params.include.push('firstPost');
}
});
extend(DiscussionListItem.prototype, 'infoItems', function(item... | cwe | CWE-79 | JavaScript |
function t(){e=!0;if(0==c.length)E.innerHTML=mxUtils.htmlEntities(mxResources.get("noPlugins"));else{E.innerHTML=
"";for(var x=0;x<c.length;x++){var z=document.createElement("span");z.style.whiteSpace="nowrap";var y=document.createElement("span");y.className="geSprite geSprite-delete";y.style.position="relative";y.styl... | cwe | CWE-94 | JavaScript |
status_t OMXNodeInstance::updateNativeHandleInMeta(
OMX_U32 portIndex, const sp<NativeHandle>& nativeHandle, OMX::buffer_id buffer) {
Mutex::Autolock autoLock(mLock);
OMX_BUFFERHEADERTYPE *header = findBufferHeader(buffer, portIndex);
if (header == NULL) {
ALOGE("b/25884056");
return BAD_VALUE;
... | cwe | CWE-200 | C/C++ |
l2tp_bearer_type_print(netdissect_options *ndo, const u_char *dat)
{
const uint32_t *ptr = (const uint32_t *)dat;
if (EXTRACT_32BITS(ptr) & L2TP_BEARER_TYPE_ANALOG_MASK) {
ND_PRINT((ndo, "A"));
}
if (EXTRACT_32BITS(ptr) & L2TP_BEARER_TYPE_DIGITAL_MASK) {
ND_PRINT((ndo, "D"));
}
} | cwe | CWE-125 | C/C++ |
expr_context_name(expr_context_ty ctx)
{
switch (ctx) {
case Load:
return "Load";
case Store:
return "Store";
case Del:
return "Del";
case AugLoad:
return "AugLoad";
case AugStore:
return "AugStore";
case Param:
return "Param";
default:
... | cwe | CWE-125 | C/C++ |
static int atalk_create(struct net *net, struct socket *sock, int protocol,
int kern)
{
struct sock *sk;
int rc = -ESOCKTNOSUPPORT;
if (!net_eq(net, &init_net))
return -EAFNOSUPPORT;
/*
* We permit SOCK_DGRAM and RAW is an extension. It is trivial to do
* and gives you the full ELAP frame. Should be hand... | cwe | CWE-276 | C/C++ |
init_ctx_reselect(OM_uint32 *minor_status, spnego_gss_ctx_id_t sc,
OM_uint32 acc_negState, gss_OID supportedMech,
gss_buffer_t *responseToken, gss_buffer_t *mechListMIC,
OM_uint32 *negState, send_token_flag *tokflag)
{
OM_uint32 tmpmin;
size_t i;
generic_gss_release_oid(&tmpmin, &sc->internal_mech);
... | cwe | CWE-415 | C/C++ |
static int pvc_getname(struct socket *sock, struct sockaddr *sockaddr,
int *sockaddr_len, int peer)
{
struct sockaddr_atmpvc *addr;
struct atm_vcc *vcc = ATM_SD(sock);
if (!vcc->dev || !test_bit(ATM_VF_ADDR, &vcc->flags))
return -ENOTCONN;
*sockaddr_len = sizeof(struct sockaddr_atmpvc);
addr = (stru... | cwe | CWE-200 | C/C++ |
'use strict';
const http = require('http');
const https = require('https');
const urllib = require('url');
const zlib = require('zlib');
const PassThrough = require('stream').PassThrough;
const Cookies = require('./cookies');
const packageData = require('../../package.json');
const MAX_REDIRECTS = 5;
module.exports ... | cwe | CWE-74 | Java |
/*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This 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
* th... | cwe | CWE-601 | Java |
// SPDX-License-Identifier: GPL-2.0
#include <linux/types.h>
#include <linux/tty.h>
#include <linux/tty_flip.h>
#include <linux/slab.h>
#include "speakup.h"
#include "spk_types.h"
#include "spk_priv.h"
struct spk_ldisc_data {
char buf;
struct completion completion;
bool buf_free;
};
static struct spk_synth *spk_t... | cwe | CWE-476 | C/C++ |
private static void checkCEKLength(final SecretKey cek, final EncryptionMethod enc)
throws KeyLengthException {
if (enc.cekBitLength() != ByteUtils.bitLength(cek.getEncoded())) {
throw new KeyLengthException("The Content Encryption Key (CEK) length for " + enc + " must be " + enc.cekBitLength() + " bits");
}
... | cwe | CWE-345 | Java |
package identify
import (
"context"
"fmt"
"io"
"runtime/debug"
"sync"
"time"
"github.com/libp2p/go-libp2p-core/crypto"
"github.com/libp2p/go-libp2p-core/event"
"github.com/libp2p/go-libp2p-core/host"
"github.com/libp2p/go-libp2p-core/network"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-l... | cwe | CWE-400 | Go |
int CLASS parse_tiff_ifd(int base)
{
unsigned entries, tag, type, len, plen = 16, save;
int ifd, use_cm = 0, cfa, i, j, c, ima_len = 0;
char *cbuf, *cp;
uchar cfa_pat[16], cfa_pc[] = {0, 1, 2, 3}, tab[256];
double fm[3][4], cc[4][4], cm[4][3], cam_xyz[4][3], num;
double ab[] = {1, 1, 1, 1}, asn[] = {0, 0, 0... | cwe | CWE-476 | C/C++ |
_gcry_ecc_gost_sign (gcry_mpi_t input, ECC_secret_key *skey,
gcry_mpi_t r, gcry_mpi_t s)
{
gpg_err_code_t rc = 0;
gcry_mpi_t k, dr, sum, ke, x, e;
mpi_point_struct I;
gcry_mpi_t hash;
const void *abuf;
unsigned int abits, qbits;
mpi_ec_t ctx;
if (DBG_CIPHER)
log_mpidump ("gost ... | cwe | CWE-203 | Unknown |
sctp_disposition_t sctp_sf_eat_fwd_tsn_fast(
const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
{
struct sctp_chunk *chunk = arg;
struct sctp_fwdtsn_hdr *fwdtsn_hdr;
__u16 len;
__u32 tsn;
if (!sctp_vtag_verify(chunk, asoc)) {
... | cwe | CWE-119 | Unknown |
void NetworkHandler::GetResponseBodyForInterception(
const String& interception_id,
std::unique_ptr<GetResponseBodyForInterceptionCallback> callback) {
DevToolsInterceptorController* interceptor =
DevToolsInterceptorController::FromBrowserContext(
process_->GetBrowserContext());
if (!int... | cwe | CWE-20 | C/C++ |
/* Copyright 2019 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | cwe | CWE-665 | Python |
void ComputeEasyCases(OpKernelContext* context, bool* done,
std::vector<Tlen>* split_sizes_vec) {
const int32_t num_split = context->num_outputs();
const Tensor& input = context->input(0);
const TensorShape& input_shape = input.shape();
const Tensor& split_tensor = context->input... | cwe | CWE-703 | C/C++ |
int ssl3_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek)
{
int al, i, j, ret;
unsigned int n;
SSL3_RECORD *rr;
void (*cb) (const SSL *ssl, int type2, int val) = NULL;
if (s->s3->rbuf.buf == NULL) /* Not initialized yet */
if (!ssl3_setup_read_buffer(s))
retur... | cwe | CWE-200 | Unknown |
DwaCompressor::uncompress
(const char *inPtr,
int inSize,
IMATH_NAMESPACE::Box2i range,
const char *&outPtr)
{
int minX = range.min.x;
int maxX = std::min (range.max.x, _max[0]);
int minY = range.min.y;
int maxY = std::min (range.max.y, _max[1]);
Int64 iSize = static_cast<Int64>(... | cwe | CWE-476 | C/C++ |
"""
Copyright 2014-2015. Jorgen Maas <jorgen.maas@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is d... | cwe | CWE-434 | Python |
void luaD_call (lua_State *L, StkId func, int nresults) {
lua_CFunction f;
retry:
switch (ttypetag(s2v(func))) {
case LUA_VCCL: /* C closure */
f = clCvalue(s2v(func))->f;
goto Cfunc;
case LUA_VLCF: /* light C function */
f = fvalue(s2v(func));
Cfunc: {
int n; /* number of r... | cwe | CWE-787 | Unknown |
static void cmdloop(void)
{
int c;
int usinguid, havepartition, havenamespace, recursive;
static struct buf tag, cmd, arg1, arg2, arg3;
char *p, shut[MAX_MAILBOX_PATH+1], cmdname[100];
const char *err;
const char * commandmintimer;
double commandmintimerd = 0.0;
struct sync_reserve_list ... | cwe | CWE-20 | Unknown |
status_t OMXNodeInstance::enableNativeBuffers(
OMX_U32 portIndex, OMX_BOOL graphic, OMX_BOOL enable) {
Mutex::Autolock autoLock(mLock);
CLOG_CONFIG(enableNativeBuffers, "%s:%u%s, %d", portString(portIndex), portIndex,
graphic ? ", graphic" : "", enable);
OMX_STRING name = const_c... | cwe | CWE-264 | C/C++ |
public void handle(String target, HttpServletRequest request, HttpServletResponse response, boolean[] isHandled) {
//便于Wappalyzer读取
response.addHeader("X-ZrLog", BlogBuildInfoUtil.getVersion());
boolean isPluginPath = false;
for (String path : pluginHandlerPaths) {
if (target... | cwe | CWE-863 | Java |
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* SPI master driver using generic bitbanged GPIO
*
* Copyright (C) 2006,2008 David Brownell
* Copyright (C) 2017 Linus Walleij
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/gpio/consumer.h>
#include <linux/o... | cwe | CWE-401 | C/C++ |
// Copyright 2015 CNI authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... | cwe | CWE-20 | Go |
# -*- 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-521 | Python |
package io.swagger.client.api;
import io.swagger.client.ApiException;
import io.swagger.client.ApiClient;
import io.swagger.client.ApiResponse;
import io.swagger.client.Configuration;
import io.swagger.client.Pair;
import javax.ws.rs.core.GenericType;
import io.swagger.client.model.User;
import java.util.ArrayList;... | cwe | CWE-200 | Java |
disable_priv_mode ()
{
int e;
if (setuid (current_user.uid) < 0)
{
e = errno;
sys_error (_("cannot set uid to %d: effective uid %d"), current_user.uid, current_user.euid);
#if defined (EXIT_ON_SETUID_FAILURE)
if (e == EAGAIN)
exit (e);
#endif
}
if (setgid (current_user.gid) < 0)
sy... | cwe | CWE-787 | C/C++ |
static void settings_init(void) {
settings.use_cas = true;
settings.access = 0700;
settings.port = 11211;
settings.udpport = 11211;
/* By default this string should be NULL for getaddrinfo() */
settings.inter = NULL;
settings.maxbytes = 64 * 1024 * 1024; /* default is 64MB */
settings.ma... | cwe | CWE-20 | Unknown |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import json
import os
import pickle
import random
from abc import ABC, abstractmethod
from dataclasses import dataclass,... | cwe | CWE-502 | Python |
/**
* @preserve tableExport.jquery.plugin
*
* Version 1.22.0
*
* Copyright (c) 2015-2022 hhurz,
* https://github.com/hhurz/tableExport.jquery.plugin
*
* Based on https://github.com/kayalshri/tableExport.jquery.plugin
*
* Licensed under the MIT License
**/
"use strict";(function($){$.fn.tableExport=function... | cwe | CWE-79 | JavaScript |
struct dst_entry *inet6_csk_route_req(const struct sock *sk,
struct flowi6 *fl6,
const struct request_sock *req,
u8 proto)
{
struct inet_request_sock *ireq = inet_rsk(req);
const struct ipv6_pinfo *np = inet6_sk(sk);
struct in6_addr *final_p, final;
struct dst_entry *dst;
memset(fl6,... | cwe | CWE-416 | C/C++ |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may n... | cwe | CWE-668 | Java |
import logging
import pathlib
from s3file.storages import local_dev, storage
from . import views
logger = logging.getLogger("s3file")
class S3FileMiddleware:
def __init__(self, get_response):
self.get_response = get_response
def __call__(self, request):
file_fields = request.POST.getlist("... | cwe | CWE-22 | Python |
const cheerio = require('cheerio');
const got = require('@/utils/got');
module.exports = async (ctx) => {
const url = `http://${ctx.params.url}`;
const res = await got.get(`${url}/archives/`);
const $ = cheerio.load(res.data);
const list = $('.post-header');
const count = [];
for (let i = 0; ... | cwe | CWE-918 | JavaScript |
/*
* Wire
* Copyright (C) 2019 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 program is dis... | cwe | CWE-134 | C/C++ |
int FFmpegVideoDecoder::GetVideoBuffer(AVCodecContext* codec_context,
AVFrame* frame) {
VideoFrame::Format format = PixelFormatToVideoFormat(codec_context->pix_fmt);
if (format == VideoFrame::UNKNOWN)
return AVERROR(EINVAL);
DCHECK(format == VideoFrame::YV12 || format ==... | cwe | CWE-119 | C/C++ |
package com.publiccms.common.constants;
import java.util.UUID;
import com.publiccms.common.copyright.CmsCopyright;
import com.publiccms.common.copyright.Copyright;
import com.publiccms.common.copyright.License;
/**
*
* CmsVersion
*
*/
public class CmsVersion {
private static final String clusterId = UUID.ran... | cwe | CWE-200 | Java |
/*
+----------------------------------------------------------------------+
| HipHop for PHP |
+----------------------------------------------------------------------+
| Copyright (c) 2010-present Facebook, Inc. (http://www.facebook.com) |
| Copyrigh... | cwe | CWE-787 | C/C++ |
static Jsi_RC jsi_ArraySliceCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,Jsi_Value **ret, Jsi_Func *funcPtr) {
if (_this->vt != JSI_VT_OBJECT || !Jsi_ObjIsArray(interp, _this->d.obj))
return Jsi_LogError("expected array object");
Jsi_RC rc = JSI_OK;
int istart = 0, iend, n, nsiz;
Js... | cwe | CWE-190 | C/C++ |
static int read_request_line(request_rec *r, apr_bucket_brigade *bb)
{
const char *ll;
const char *uri;
const char *pro;
unsigned int major = 1, minor = 0; /* Assume HTTP/1.0 if non-"HTTP" protocol */
char http[5];
apr_size_t len;
int num_blank_lines = 0;
int max_blank_lines = r->serv... | cwe | CWE-703 | Unknown |
int is_ntfs_dotgit(const char *name)
{
size_t len;
for (len = 0; ; len++)
if (!name[len] || name[len] == '\\' || is_dir_sep(name[len])) {
if (only_spaces_and_periods(name, len, 4) &&
!strncasecmp(name, ".git", 4))
return 1;
if (only_spaces_and_periods(name, len, 5) &&
!strncasecmp(name, "git~1"... | cwe | CWE-20 | C/C++ |
static int rd_build_device_space(struct rd_dev *rd_dev)
{
u32 i = 0, j, page_offset = 0, sg_per_table, sg_tables, total_sg_needed;
u32 max_sg_per_table = (RD_MAX_ALLOCATION_SIZE /
sizeof(struct scatterlist));
struct rd_dev_sg_table *sg_table;
struct page *pg;
struct scatterlist *sg;
if (rd_dev->rd_page_c... | cwe | CWE-200 | C/C++ |
def __parse_jeos_images(self):
log = logging.getLogger('%s.%s' % (__name__, self.__class__.__name__))
# Loop through all JEOS configuration files to populate our jeos_images dictionary
config_path = self.configuration['jeos_config']
listing = os.listdir(config_path)
for infile in... | cwe | CWE-22 | Python |
/* 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-369 | Python |
long Segment::DoLoadCluster(
long long& pos,
long& len)
{
if (m_pos < 0)
return DoLoadClusterUnknownSize(pos, len);
long long total, avail;
long status = m_pReader->Length(&total, &avail);
if (status < 0) //error
return status;
assert((total < 0) || (avail <= total))... | cwe | CWE-119 | C/C++ |
def check_gui_status_of_nodes(session, nodes, check_mutuality=false, timeout=10)
options = {}
options[:check_auth_only] = '' if not check_mutuality
threads = []
not_authorized_nodes = []
online_nodes = []
offline_nodes = []
nodes = nodes.uniq.sort
nodes.each { |node|
threads << Thread.new {
c... | cwe | CWE-384 | Ruby |
buildItem(node) {
let clonedNode = node.cloneNode(true);
clonedNode.querySelector("span.clicks")?.remove();
const li = document.createElement("li");
li.classList.add("d-toc-item");
li.classList.add(`d-toc-${clonedNode.tagName.toLowerCase()}`);
li.innerHTML = `<a href="#" data-d-toc="${clonedNo... | cwe | CWE-79 | JavaScript |
CreateSchemaCommand(CreateSchemaStmt *stmt, const char *queryString,
int stmt_location, int stmt_len)
{
const char *schemaName = stmt->schemaname;
Oid namespaceId;
OverrideSearchPath *overridePath;
List *parsetree_list;
ListCell *parsetree_item;
Oid owner_uid;
Oid saved_uid;
int save_sec_conte... | cwe | CWE-94 | Unknown |
TfLiteStatus LogSoftmaxPrepare(TfLiteContext* context, TfLiteNode* node) {
LogSoftmaxOpData* data = reinterpret_cast<LogSoftmaxOpData*>(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, 0);
Tf... | cwe | CWE-125 | C/C++ |
#!/usr/bin/env python3
"""
This is the main CLI for lookatme
"""
import click
import logging
import io
import os
import pygments.styles
import sys
import tempfile
import lookatme.tui
import lookatme.log
import lookatme.config
from lookatme.pres import Presentation
from lookatme.schemas import StyleSchema
@click.... | cwe | CWE-78 | Python |
def get_cms_details(url):
# this function will fetch cms details using cms_detector
response = {}
cms_detector_command = 'python3 /usr/src/github/CMSeeK/cmseek.py -u {} --random-agent --batch --follow-redirect'.format(url)
os.system(cms_detector_command)
response['status'] = False
response['mes... | cwe | CWE-78 | Python |
/*
* 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 |
void Compute(OpKernelContext* context) override {
// Get the stamp token.
const Tensor* stamp_token_t;
OP_REQUIRES_OK(context, context->input("stamp_token", &stamp_token_t));
int64_t stamp_token = stamp_token_t->scalar<int64>()();
// Get the tree ensemble proto.
const Tensor* tree_ensemble_seri... | cwe | CWE-416 | C/C++ |
void IndexedDBDatabase::ForceClose() {
scoped_refptr<IndexedDBDatabase> protect(this);
while (!pending_requests_.empty()) {
std::unique_ptr<ConnectionRequest> request =
std::move(pending_requests_.front());
pending_requests_.pop();
request->AbortForForceClose();
}
auto it = connections_... | cwe | CWE-787 | C/C++ |
function pdfinfo (filename, options) {
this.options = options || {};
this.options.additional = ['"' + filename + '"'];
pdfinfo.prototype.add_options = function(optionArray) {
if (typeof optionArray.length !== undefined) {
var self = this;
optionArray.forEach(function(el) {
if (el.in... | cwe | CWE-78 | JavaScript |
/*
** vm.c - virtual machine for mruby
**
** See Copyright Notice in mruby.h
*/
#include <mruby.h>
#include <mruby/array.h>
#include <mruby/class.h>
#include <mruby/hash.h>
#include <mruby/irep.h>
#include <mruby/numeric.h>
#include <mruby/proc.h>
#include <mruby/range.h>
#include <mruby/string.h>
#include <mruby/vari... | cwe | CWE-125 | C/C++ |
SProcXkbSelectEvents(ClientPtr client)
{
REQUEST(xkbSelectEventsReq);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xkbSelectEventsReq);
swaps(&stuff->deviceSpec);
swaps(&stuff->affectWhich);
swaps(&stuff->clear);
swaps(&stuff->selectAll);
swaps(&stuff->affectMap);
swaps(&stuff->map)... | cwe | CWE-191 | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.