code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
/*
* Unsquash a squashfs filesystem. This is a highly compressed read only
* filesystem.
*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, 2019, 2021
* Phillip Lougher <phillip@squashfs.org.uk>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public... | cwe | CWE-59 | C/C++ |
void* TFE_HandleToDLPack(TFE_TensorHandle* h, TF_Status* status) {
const Tensor* tensor = GetTensorFromHandle(h, status);
TF_DataType data_type = static_cast<TF_DataType>(tensor->dtype());
TensorReference tensor_ref(*tensor); // This will call buf_->Ref()
auto* tf_dlm_tensor_ctx = new TfDlManagedTensorCtx(ten... | cwe | CWE-476 | C/C++ |
/*
* client_example_control.c
*
* How to control a device ... intended to be used with server_example_control
*/
#include "iec61850_client.h"
#include "hal_thread.h"
#include <stdlib.h>
#include <stdio.h>
static void commandTerminationHandler(void *parameter, ControlObjectClient connection)
{
LastApplError... | cwe | CWE-754 | C/C++ |
def self.run_gpg(*args)
fragments = [
'gpg',
'--no-default-keyring'
] + args
command_line = fragments.join(' ')
output_file = Tempfile.new('gpg-output')
begin
output_file.close
result = system("#{command_line} > #{output_file.path} 2>&1")
ensure
... | cwe | CWE-94 | Ruby |
TfLiteStatus EvalHashtable(TfLiteContext* context, TfLiteNode* node) {
TF_LITE_ENSURE(context, node->user_data != nullptr);
const auto* params =
reinterpret_cast<const TfLiteHashtableParams*>(node->user_data);
// The resource id is generated based on the given table name.
const int resource_id = std::has... | cwe | CWE-125 | C/C++ |
var jq = function() {
if (isDefined(jq.name_)) return jq.name_;
var el;
var i, ii = ngAttrPrefixes.length, prefix, name;
for (i = 0; i < ii; ++i) {
prefix = ngAttrPrefixes[i];
el = window.document.querySelector('[' + prefix.replace(':', '\\:') + 'jq]');
if (el) {
name = el.getAttribute(prefix ... | cwe | CWE-74 | JavaScript |
static void nbd_recv_coroutines_enter_all(NBDClientSession *s)
{
int i;
for (i = 0; i < MAX_NBD_REQUESTS; i++) {
qemu_coroutine_enter(s->recv_coroutine[i]);
qemu_coroutine_enter(s->recv_coroutine[i]);
}
} | cwe | CWE-20 | C/C++ |
static int ndp_sock_recv(struct ndp *ndp)
{
struct ndp_msg *msg;
enum ndp_msg_type msg_type;
size_t len;
int err;
msg = ndp_msg_alloc();
if (!msg)
return -ENOMEM;
len = ndp_msg_payload_maxlen(msg);
err = myrecvfrom6(ndp->sock, msg->buf, &len, 0,
&msg->addrto, &msg->ifindex);
if (err) {
err(ndp, "Fai... | cwe | CWE-284 | C/C++ |
(function(stylesheet, stencils)
{
// Callbacks:
// mxClientOnLoad is called after the script is loaded with the stylesheet and the function to create a
// graph (wich takes the container as an argument and returns the graph instance that was created).
// mxClientOnCreate is called when a graph has been created... | cwe | CWE-94 | JavaScript |
struct sk_buff **udp_gro_receive(struct sk_buff **head, struct sk_buff *skb,
struct udphdr *uh)
{
struct udp_offload_priv *uo_priv;
struct sk_buff *p, **pp = NULL;
struct udphdr *uh2;
unsigned int off = skb_gro_offset(skb);
int flush = 1;
if (NAPI_GRO_CB(skb)->udp_mark ||
(skb->ip_summed != CHECKSUM_PA... | cwe | CWE-400 | C/C++ |
static void vnc_tight_stop(VncState *vs)
{
// switch back to normal output/zlib buffers
vs->tight.tight = vs->output;
vs->output = vs->tight.tmp;
} | cwe | CWE-401 | Unknown |
static int copy_from_user_mmap_sem(void *dst, const void __user *src, size_t n)
{
int partial;
pagefault_disable();
partial = __copy_from_user_inatomic(dst, src, n);
pagefault_enable();
/*
* Didn't copy everything, drop the mmap_sem and do a faulting copy
*/
if (unlikely(partial)) {
up_read(¤t->mm->... | cwe | CWE-94 | Unknown |
_WM_ParseNewMidi(uint8_t *midi_data, uint32_t midi_size) {
struct _mdi *mdi;
uint32_t tmp_val;
uint32_t midi_type;
uint32_t track_size;
uint8_t **tracks;
uint32_t end_of_tracks = 0;
uint32_t no_tracks;
uint32_t i;
uint32_t divisions = 96;
uint32_t tempo = 500000;
floa... | cwe | CWE-125 | C/C++ |
"use strict";
const beccaService = require('../../becca/becca_service');
const protectedSessionService = require('../../services/protected_session');
const noteRevisionService = require('../../services/note_revisions');
const utils = require('../../services/utils');
const sql = require('../../services/sql');
const pat... | cwe | CWE-79 | JavaScript |
e1000e_ring_empty(E1000ECore *core, const E1000E_RingInfo *r)
{
return core->mac[r->dh] == core->mac[r->dt];
} | cwe | CWE-835 | C/C++ |
bool MYSQL_LOG::open(
#ifdef HAVE_PSI_INTERFACE
PSI_file_key log_file_key,
#endif
const char *log_name, enum_log_type log_type_arg,
const char *new_name, enum cache_type io_cache_type_arg)
{
char buff[FN_REFLEN];
MY_STAT f_stat;
File file= -1;
int o... | cwe | CWE-264 | Unknown |
function peg$parsefloat() {
var s0, s1, s2, s3;
peg$silentFails++;
s0 = peg$currPos;
s1 = peg$parseinteger();
if (s1 !== peg$FAILED) {
if (input.charCodeAt(peg$currPos) === 46) {
s2 = peg$c50;
peg$currPos++;
} else {
s2 = peg$FAILED;
... | cwe | CWE-1321 | JavaScript |
public Claims validateToken(String token) throws AuthenticationException {
try {
RsaKeyUtil rsaKeyUtil = new RsaKeyUtil();
PublicKey publicKey = rsaKeyUtil.fromPemEncoded(keycloakPublicKey);
return (Claims) Jwts.parser().setSigningKey(publicKey).parse(token.replace("Bearer "... | cwe | CWE-290 | Java |
def mode_close(self, request):
"""
This is called by render_POST when the client is signalling
that it is about to be closed.
Args:
request (Request): Incoming request.
"""
csessid = request.args.get('csessid')[0]
try:
sess = self.session... | cwe | CWE-79 | Python |
def make_tarfile(
output_filename: str,
source_dir: str,
archive_name: str,
custom_filter: Optional[Callable] = None,
) -> None:
# Helper for filtering out modification timestamps
def _filter_timestamps(tar_info: "tarfile.TarInfo") -> Optional["tarfile.TarInfo"]:
tar_info.mtime = 0
... | cwe | CWE-377 | Python |
void CoreUserInputHandler::handleMsg(const BufferInfo &bufferInfo, const QString &msg)
{
Q_UNUSED(bufferInfo);
if (!msg.contains(' '))
return;
QString target = msg.section(' ', 0, 0);
QByteArray encMsg = userEncode(target, msg.section(' ', 1));
#ifdef HAVE_QCA2
putPrivmsg(serverEncode(targ... | cwe | CWE-399 | Unknown |
BOOL update_recv(rdpUpdate* update, wStream* s)
{
BOOL rc = FALSE;
UINT16 updateType;
rdpContext* context = update->context;
if (Stream_GetRemainingLength(s) < 2)
{
WLog_ERR(TAG, "Stream_GetRemainingLength(s) < 2");
return FALSE;
}
Stream_Read_UINT16(s, updateType); /* updateType (2 bytes) */
WLog_Print(u... | cwe | CWE-125 | C/C++ |
void recalc_intercepts(struct vcpu_svm *svm)
{
struct vmcb_control_area *c, *h, *g;
unsigned int i;
vmcb_mark_dirty(svm->vmcb, VMCB_INTERCEPTS);
if (!is_guest_mode(&svm->vcpu))
return;
c = &svm->vmcb->control;
h = &svm->vmcb01.ptr->control;
g = &svm->nested.ctl;
for (i = 0; i < MAX_INTERCEPT; i++)
c->in... | cwe | CWE-862 | Unknown |
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <setjmp.h>
#include <limits.h>
#include "regexp.h"
#include "utf.h"
#define emit regemit
#define next regnext
#define accept regaccept
#define nelem(a) (int)(sizeof (a) / sizeof (a)[0])
#define REPINF 255
#define MAXSUB REG_MAXSUB
#define MAXPROG (... | cwe | CWE-400 | C/C++ |
HandleUltraZipBPP (rfbClient* client, int rx, int ry, int rw, int rh)
{
rfbZlibHeader hdr;
int i=0;
int toRead=0;
int inflateResult=0;
unsigned char *ptr=NULL;
lzo_uint uncompressedBytes = ry + (rw * 65535);
unsigned int numCacheRects = rx;
if (!ReadFromRFBServer(client, (char *)&hdr, sz_rfbZlibHeader)... | cwe | CWE-476 | Unknown |
function(){n=I.name;v="";L()})));k.appendChild(H)})(G[N],N);100==G.length&&(k.appendChild(z),A=function(){k.scrollTop>=k.scrollHeight-k.offsetHeight&&C()},mxEvent.addListener(k,"scroll",A))}}),y)}),M=mxUtils.bind(this,function(u){null==u&&(k.innerHTML="",u=1);var D=new mxXmlRequest(this.baseUrl+"/user/repos?per_page=10... | cwe | CWE-94 | JavaScript |
import discord
from typing import Optional
from datetime import datetime
from redbot.core import commands, checks, Config, modlog
class Ticketer(commands.Cog):
"""Ticketer"""
__version__="1.0.0"
async def red_delete_data_for_user(self, *, requester, user_id):
# This cog stores no EUD
retu... | cwe | CWE-77 | C/C++ |
static int stimer_set_count(struct kvm_vcpu_hv_stimer *stimer, u64 count,
bool host)
{
struct kvm_vcpu *vcpu = hv_stimer_to_vcpu(stimer);
struct kvm_vcpu_hv_synic *synic = to_hv_synic(vcpu);
if (!synic->active && !host)
return 1;
trace_kvm_hv_stimer_set_count(hv_stimer_to_vcpu(stimer)->vcpu_id,
... | cwe | CWE-476 | Unknown |
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published ... | cwe | CWE-918 | Java |
function addEntryHandler(cat, entry, subCat)
{
mxEvent.addListener(entry, 'click', function()
{
if (currentEntry != entry)
{
currentEntry.style.backgroundColor = '';
currentEntry = entry;
currentEntry.style.backgroundColor = leftHighlight;
div.scrollTop = 0;
div.innerHTML ... | cwe | CWE-94 | JavaScript |
int dtls1_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_buffers(s))
return (... | cwe | CWE-203 | Unknown |
static void ssl_write_signature_algorithms_ext( ssl_context *ssl,
unsigned char *buf,
size_t *olen )
{
unsigned char *p = buf;
size_t sig_alg_len = 0;
#if defined(POLARSSL_RSA_C) || defined(POLARSSL_ECDSA_C)
unsi... | cwe | CWE-119 | Unknown |
function escapeArgBash(arg, interpolation, quoted) {
let result = arg.replace(/\0/gu, "");
if (interpolation) {
result = result
.replace(/\\/gu, "\\\\")
.replace(/\n/gu, " ")
.replace(/(^|\s)(~|#)/gu, "$1\\$2")
.replace(/(\*|\?)/gu, "\\$1")
.replace(/([$&;|])/gu, "\\$1")
.re... | cwe | CWE-1333 | JavaScript |
/*
Copyright 2016 Christian Hoene, Symonics GmbH
*/
/* IV.A.1.b. Version 2 Data Object Header Prefix
00000030 4f 48 44 52 02 2d d3 18 2b 53 d3 18 2b 53 d3 18 |OHDR.-..+S..+S..|
00000040 2b 53 d3 18 2b 53 f4 01 02 22 00 00 00 00 |+S..+S..."......|
....
00000230 00 00 00 00 00 00 00 00 00 00 00 00... | cwe | CWE-787 | C/C++ |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% CCC U U TTTTT ... | cwe | CWE-20 | C/C++ |
static jpc_enc_cblk_t *cblk_create(jpc_enc_cblk_t *cblk,
jpc_enc_prc_t *prc)
{
jpc_enc_band_t *band;
uint_fast32_t cblktlx;
uint_fast32_t cblktly;
uint_fast32_t cblkbrx;
uint_fast32_t cblkbry;
jpc_enc_rlvl_t *rlvl;
uint_fast32_t cblkxind;
uint_fast32_t cblkyind;
uint_fast32_t cblkno;
uint_fast32_t tlcblktlx... | cwe | CWE-787 | Unknown |
xmlBufAddHead(xmlBufPtr buf, const xmlChar *str, int len) {
unsigned int needSize;
if ((buf == NULL) || (buf->error))
return(-1);
CHECK_COMPAT(buf)
if (buf->alloc == XML_BUFFER_ALLOC_IMMUTABLE) return -1;
if (str == NULL) {
#ifdef DEBUG_BUFFER
xmlGenericError(xmlGenericErrorContext,... | cwe | CWE-399 | Unknown |
init_rc(void)
{
int i;
struct stat st;
FILE *f;
if (rc_dir != NULL)
goto open_rc;
rc_dir = expandPath(RC_DIR);
i = strlen(rc_dir);
if (i > 1 && rc_dir[i - 1] == '/')
rc_dir[i - 1] = '\0';
#ifdef USE_M17N
display_charset_str = wc_get_ces_list();
document_charset_str = display_cha... | cwe | CWE-59 | C/C++ |
import XLSX from 'xlsx'
import { UITypes } from '~/components/project/spreadsheet/helpers/uiTypes'
import TemplateGenerator from '~/components/import/templateParsers/TemplateGenerator'
import { getCheckboxValue, isCheckboxType } from '~/components/import/templateParsers/parserHelpers'
const excelTypeToUidt = {
d: UI... | cwe | CWE-918 | JavaScript |
open_cmdwin(void)
{
bufref_T old_curbuf;
win_T *old_curwin = curwin;
bufref_T bufref;
win_T *wp;
int i;
linenr_T lnum;
int histtype;
garray_T winsizes;
int save_restart_edit = restart_edit;
int save_State = State;
int save_exmode = exmode_active;
#ifdef FEAT_R... | cwe | CWE-787 | Unknown |
void CtcpHandler::parse(Message::Type messageType, const QString &prefix, const QString &target, const QByteArray &message) {
QByteArray ctcp;
QByteArray dequotedMessage = lowLevelDequote(message);
CtcpType ctcptype = messageType == Message::Notice
? CtcpReply
: CtcpQuery;
Message::Flags flags = (mes... | cwe | CWE-399 | C/C++ |
xsltKeyFunction(xmlXPathParserContextPtr ctxt, int nargs){
xmlXPathObjectPtr obj1, obj2;
if (nargs != 2) {
xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
"key() : expects two arguments\n");
ctxt->error = XPATH_INVALID_ARITY;
return;
}
/*
* Get the key's value.
*/
o... | cwe | CWE-476 | C/C++ |
void WebGL2RenderingContextBase::bindSampler(GLuint unit,
WebGLSampler* sampler) {
if (isContextLost())
return;
bool deleted;
if (!CheckObjectToBeBound("bindSampler", sampler, deleted))
return;
if (deleted) {
SynthesizeGLError(GL_INVALID_OPERATION, "b... | cwe | CWE-787 | C/C++ |
long Block::Parse(const Cluster* pCluster)
{
if (pCluster == NULL)
return -1;
if (pCluster->m_pSegment == NULL)
return -1;
assert(m_start >= 0);
assert(m_size >= 0);
assert(m_track <= 0);
assert(m_frames == NULL);
assert(m_frame_count <= 0);
long long pos = m_start;... | cwe | CWE-119 | C/C++ |
GIT_INLINE(bool) only_spaces_and_dots(const char *path)
{
const char *c = path;
for (;; c++) {
if (*c == '\0')
return true;
if (*c != ' ' && *c != '.')
return false;
}
return true;
} | cwe | CWE-20 | C/C++ |
package libp2p
// This file contains all libp2p configuration options (except the defaults,
// those are in defaults.go).
import (
"errors"
"fmt"
"time"
"github.com/libp2p/go-libp2p-core/connmgr"
"github.com/libp2p/go-libp2p-core/crypto"
"github.com/libp2p/go-libp2p-core/metrics"
"github.com/libp2p/go-libp2p-... | cwe | CWE-400 | Go |
static Image *ReadFLIFImage(const ImageInfo *image_info,
ExceptionInfo *exception)
{
FLIF_DECODER
*flifdec;
FLIF_IMAGE
*flifimage;
Image
*image;
MagickBooleanType
status;
register PixelPacket
*q;
register ssize_t
x;
register unsigned short
*p;
size_t
count,
i... | cwe | CWE-401 | Unknown |
public static function getHelpVersion($version_id) {
global $db;
return $db->selectValue('help_version', 'version', 'id="'.$version_id.'"');
} | cwe | CWE-89 | PHP |
/*
* Copyright (c) 2014-2015 Hisilicon Limited.
*
* 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.
*/
#include <l... | cwe | CWE-119 | C/C++ |
static int shmem_remount_fs(struct super_block *sb, int *flags, char *data)
{
struct shmem_sb_info *sbinfo = SHMEM_SB(sb);
struct shmem_sb_info config = *sbinfo;
unsigned long inodes;
int error = -EINVAL;
if (shmem_parse_options(data, &config, true))
return error;
spin_lock(&sbinfo->stat_lock);
inodes ... | cwe | CWE-399 | C/C++ |
import dayjs from 'dayjs'
import utc from 'dayjs/plugin/utc'
import { saveAs } from 'file-saver'
import { FlowRouter } from 'meteor/ostrio:flow-router-extra'
import { NullXlsx } from '@neovici/nullxlsx'
import bootstrap from 'bootstrap'
import { i18nReady, t } from '../../utils/i18n.js'
import Timecards from '../../api... | cwe | CWE-79 | JavaScript |
static void ifb_setup(struct net_device *dev)
{
/* Initialize the device structure. */
dev->destructor = free_netdev;
dev->netdev_ops = &ifb_netdev_ops;
/* Fill in device structure with ethernet-generic values. */
ether_setup(dev);
dev->tx_queue_len = TX_Q_LIMIT;
dev->features |= IFB_FEATURES;
dev->vlan_featu... | cwe | CWE-703 | Unknown |
/*
Copyright 2008-2017 LibRaw LLC (info@libraw.org)
LibRaw is free software; you can redistribute it and/or modify
it under the terms of the one of two licenses as you choose:
1. GNU LESSER GENERAL PUBLIC LICENSE version 2.1
(See file LICENSE.LGPL provided in LibRaw distribution archive for details).
2. COMMON... | cwe | CWE-125 | C/C++ |
void ExtensionTtsController::CheckSpeechStatus() {
if (!current_utterance_)
return;
if (!current_utterance_->extension_id().empty())
return;
if (GetPlatformImpl()->IsSpeaking() == false) {
FinishCurrentUtterance();
SpeakNextUtterance();
}
if (current_utterance_ && current_utterance_->exte... | cwe | CWE-20 | C/C++ |
static gboolean try_preload(TGAContext *ctx, GError **err)
{
if (!ctx->hdr) {
if (ctx->in->size >= sizeof(TGAHeader)) {
ctx->hdr = g_try_malloc(sizeof(TGAHeader));
if (!ctx->hdr) {
g_set_error_literal(err, GDK_PIXBUF_ERROR,
GDK_PIXBUF_ERROR_INSUFFICIENT_M... | cwe | CWE-119 | Unknown |
def deletePost(self,postid):
sqlText="delete from post where post.postid=%d"%(postid)
result=sql.deleteDB(self.conn,sqlText)
return result; | cwe | CWE-89 | Python |
func (ctx *cbcAEAD) computeAuthTag(aad, nonce, ciphertext []byte) []byte {
buffer := make([]byte, len(aad)+len(nonce)+len(ciphertext)+8)
n := 0
n += copy(buffer, aad)
n += copy(buffer[n:], nonce)
n += copy(buffer[n:], ciphertext)
binary.BigEndian.PutUint64(buffer[n:], uint64(len(aad)*8))
// According to documen... | cwe | CWE-190 | Go |
/*
* Copyright (C) 2016 Red Hat, Inc.
* Copyright (C) 2005 Anthony Liguori <anthony@codemonkey.ws>
*
* Network Block Device Client Side
*
* 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 Found... | cwe | CWE-119 | C/C++ |
public function onInfoAction( $context, &$pageInfo ) {
$shortdesc = HookUtils::getShortDescription( $context->getTitle() );
if ( !$shortdesc ) {
// The page has no short description
return;
}
$pageInfo['header-basic'][] = [
$context->msg( 'shortdescription-info-label' ),
$shortdesc
];
} | cwe | CWE-79 | JavaScript |
setActiveElements(activeElements){const lastActive=this._active||[];const active=activeElements.map(({datasetIndex,index})=>{const meta=this.getDatasetMeta(datasetIndex);if(!meta){throw new Error('No dataset found at index '+datasetIndex);}
return{datasetIndex,element:meta.data[index],index,};});const changed=!_element... | cwe | CWE-1321 | JavaScript |
static const char *GetOpenCLCacheDirectory()
{
if (cache_directory == (char *) NULL)
{
if (cache_directory_lock == (SemaphoreInfo *) NULL)
ActivateSemaphoreInfo(&cache_directory_lock);
LockSemaphoreInfo(cache_directory_lock);
if (cache_directory == (char *) NULL)
{
char... | cwe | CWE-476 | Unknown |
horizontalDifference8(unsigned char *ip, int n, int stride,
unsigned short *wp, uint16 *From8)
{
register int r1, g1, b1, a1, r2, g2, b2, a2, mask;
#undef CLAMP
#define CLAMP(v) (From8[(v)])
mask = CODE_MASK;
if (n >= stride) {
if (stride == 3) {
r2 = wp[0] = CLAMP(ip[0]); g2 = wp[1] = CLAMP(i... | cwe | CWE-119 | C/C++ |
#############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
#
# 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 SOFTWARE IS PROVIDED "AS IS... | cwe | CWE-915 | Python |
/**
* Copyright (c) 2006-2012, JGraph Ltd
*/
/**
* Editor constructor executed on page load.
*/
Editor = function(chromeless, themes, model, graph, editable)
{
mxEventSource.call(this);
this.chromeless = (chromeless != null) ? chromeless : this.chromeless;
this.initStencilRegistry();
this.graph = graph || this.... | cwe | CWE-79 | JavaScript |
static struct dentry *__lookup_hash(struct qstr *name,
struct dentry *base, struct nameidata *nd)
{
struct dentry *dentry;
struct inode *inode;
int err;
inode = base->d_inode;
/*
* See if the low-level filesystem might want
* to use its own hash..
*/
if (base->d_op && base->d_op->d_hash) {
err = base-... | cwe | CWE-120 | Unknown |
_resolvePath(path = '.') {
const clientPath = (() => {
path = nodePath.normalize(path);
if (nodePath.isAbsolute(path)) {
return nodePath.join(path);
} else {
return nodePath.join(this.cwd, path);
}
})();
const fsPath = (() => {
const resolvedPath = nodePath.joi... | cwe | CWE-22 | JavaScript |
// Copyright (C) 2016 University of Dundee & Open Microscopy Environment.
// All rights reserved.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// ... | cwe | CWE-116 | Python |
var vm = require('vm');
var isPlainObject = require('lodash.isplainobject');
var getValue = function(obj, key) {
var o = obj;
var keys = Array.isArray(key) ? key : key.split('.');
for (var x = 0; x < keys.length -1; ++x) {
var k = keys[x];
if (!o[k]) return;
o = o[k];
}
return o[keys[keys.lengt... | cwe | CWE-20 | JavaScript |
ExtensionNavigationThrottle::WillStartOrRedirectRequest() {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
content::WebContents* web_contents = navigation_handle()->GetWebContents();
ExtensionRegistry* registry =
ExtensionRegistry::Get(web_contents->GetBrowserContext());
const GURL& url = navigation_ha... | cwe | CWE-20 | C/C++ |
int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
{
int ret=0;
int top,al,bl;
BIGNUM *rr;
#if defined(BN_MUL_COMBA) || defined(BN_RECURSION)
int i;
#endif
#ifdef BN_RECURSION
BIGNUM *t=NULL;
int j=0,k;
#endif
#ifdef BN_COUNT
fprintf(stderr,"BN_mul %d * %d\n",a->top,b->top);
#endif
bn_check... | cwe | CWE-20 | Unknown |
GC_API GC_ATTR_MALLOC void * GC_CALL GC_generic_malloc(size_t lb, int k)
{
void * result;
DCL_LOCK_STATE;
GC_ASSERT(k < MAXOBJKINDS);
if (EXPECT(GC_have_errors, FALSE))
GC_print_all_errors();
GC_INVOKE_FINALIZERS();
GC_DBG_COLLECT_AT_MALLOC(lb);
if (SMALL_OBJ(lb)) {
LOCK();
... | cwe | CWE-119 | Unknown |
IndexedDBTransaction::IndexedDBTransaction(
int64_t id,
IndexedDBConnection* connection,
const std::set<int64_t>& object_store_ids,
blink::WebIDBTransactionMode mode,
IndexedDBBackingStore::Transaction* backing_store_transaction)
: id_(id),
object_store_ids_(object_store_ids),
mod... | cwe | CWE-416 | C/C++ |
@app.route('/get_all_referrers')
def get_all_referrers():
account_id = request.args.get('account_id')
if not isObject(account_id):
ws.send('{"id":1, "method":"call", "params":[0,"lookup_account_names",[["' + account_id + '"], 0]]}')
result_l = ws.recv()
j_l = json.loads(result_l)
... | cwe | CWE-89 | Python |
package client
import (
"context"
"fmt"
"io"
"github.com/libp2p/go-libp2p-core/network"
"github.com/libp2p/go-libp2p-core/host"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p-core/transport"
ma "github.com/multiformats/go-multiaddr"
)
var circuitProtocol = ma.ProtocolWithCode(ma.P_CIR... | cwe | CWE-400 | Go |
MagickExport Image *CropImageToTiles(const Image *image,
const char *crop_geometry,ExceptionInfo *exception)
{
Image
*next,
*crop_image;
MagickStatusType
flags;
RectangleInfo
geometry;
assert(image != (Image *) NULL);
assert(image->signature == MagickCoreSignature);
if (image->debug != ... | cwe | CWE-190 | Unknown |
foreach ($mergedPermissions as $mergedPermission => $value) {
// Strip the '*' off the beginning of the permission.
$checkPermission = substr($permission, 1);
// We will make sure that the merged permission does not
// exactly match our pe... | cwe | CWE-287 | PHP |
/*
* 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 |
/**
* @overview Contains functionality specifically for Windows systems.
* @license MPL-2.0
* @author Eric Cornelissen <ericornelissen@gmail.com>
*/
/**
* Escape a shell argument.
*
* @param {string} arg The argument to escape.
* @returns {string} The escaped argument.
*/
function escapeShellArg(arg) {
retu... | cwe | CWE-88 | JavaScript |
static int dn_nl_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh)
{
struct net *net = sock_net(skb->sk);
struct nlattr *tb[IFA_MAX+1];
struct dn_dev *dn_db;
struct ifaddrmsg *ifm;
struct dn_ifaddr *ifa;
struct dn_ifaddr __rcu **ifap;
int err = -EINVAL;
if (!capable(CAP_NET_ADMIN))
return -EPERM;
if (!net... | cwe | CWE-264 | Unknown |
int vnc_tight_send_framebuffer_update(VncState *vs, int x, int y,
int w, int h)
{
vs->tight.type = VNC_ENCODING_TIGHT;
return tight_send_framebuffer_update(vs, x, y, w, h);
} | cwe | CWE-401 | Unknown |
/*-------------------------------------------------------------------------
*
* pglogical_sync.c
* table synchronization functions
*
* Copyright (c) 2015, PostgreSQL Global Development Group
*
* IDENTIFICATION
* pglogical_sync.c
*
*-------------------------------------------------------------------------
... | cwe | CWE-77 | C/C++ |
func cmdList(args *docopt.Args, client *tuf.Client) error {
if _, err := client.Update(); err != nil && !tuf.IsLatestSnapshot(err) {
return err
}
targets, err := client.Targets()
if err != nil {
return err
}
w := tabwriter.NewWriter(os.Stdout, 1, 2, 2, ' ', 0)
defer w.Flush()
fmt.Fprintln(w, "PATH\tSIZE")
... | cwe | CWE-354 | Go |
static int decode_frame(AVCodecContext *avctx, void *data,
int *got_frame, AVPacket *avpkt)
{
EXRContext *s = avctx->priv_data;
ThreadFrame frame = { .f = data };
AVFrame *picture = data;
uint8_t *ptr;
int i, y, ret, ymax;
int planes;
int out_line_size;
int nb_bl... | cwe | CWE-787 | C/C++ |
static int run(const CommandLineOptions& options)
{
IR::Module irModule;
// Load the module.
if(!loadModule(options.filename, irModule)) { return EXIT_FAILURE; }
if(options.onlyCheck) { return EXIT_SUCCESS; }
// Compile the module.
Runtime::Module* module = nullptr;
if(!options.precompiled) { module = Runtime:... | cwe | CWE-476 | Unknown |
PyImaging_MapBuffer(PyObject* self, PyObject* args)
{
Py_ssize_t y, size;
Imaging im;
PyObject* target;
Py_buffer view;
char* mode;
char* codec;
PyObject* bbox;
Py_ssize_t offset;
int xsize, ysize;
int stride;
int ystep;
if (!PyArg_ParseTuple(args, "O(ii)sOn(sii)", &tar... | cwe | CWE-190 | C/C++ |
/*
* Copyright (C) 2014-2016 Canonical Ltd
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT A... | cwe | CWE-284 | JavaScript |
tgs_make_reply(krb5_context context,
krb5_kdc_configuration *config,
KDC_REQ_BODY *b,
krb5_const_principal tgt_name,
const EncTicketPart *tgt,
const krb5_keyblock *replykey,
int rk_is_subkey,
const EncryptionKey *serverkey,
const krb5_keyblock *sessionkey,... | cwe | CWE-295 | C/C++ |
local block_state deflate_huff(s, flush)
deflate_state *s;
int flush;
{
int bflush; /* set if current block must be flushed */
for (;;) {
/* Make sure that we have a literal to write. */
if (s->lookahead == 0) {
fill_window(s);
if (s->lookahead == 0) ... | cwe | CWE-284 | Unknown |
(function (tree) {
tree.JavaScript = function (string, index, escaped) {
this.escaped = escaped;
this.expression = string;
this.index = index;
};
tree.JavaScript.prototype = {
type: "JavaScript",
eval: function (env) {
var result,
that = this,
context = {};
... | cwe | CWE-74 | Java |
WORD32 ih264d_create(iv_obj_t *dec_hdl, void *pv_api_ip, void *pv_api_op)
{
ih264d_create_op_t *ps_create_op;
WORD32 ret;
ps_create_op = (ih264d_create_op_t *)pv_api_op;
ps_create_op->s_ivd_create_op_t.u4_error_code = 0;
ret = ih264d_allocate_static_bufs(&dec_hdl, pv_api_ip, pv_api_op);
... | cwe | CWE-770 | C/C++ |
def run(self):
# (use the exposed "run" method, because if we specify a thread target
# of a private method, threading.Thread will keep a reference to it
# indefinitely, creating a GC cycle and not letting Transport ever be
# GC'd. it's a bug in Thread.)
# Hold reference to 'sys... | cwe | CWE-287 | Python |
static RCoreSymCacheElement *parseDragons(RBinFile *bf, RBuffer *buf, int off, int bits, R_OWN char *file_name) {
D eprintf ("Dragons at 0x%x\n", off);
ut64 size = r_buf_size (buf);
if (off >= size) {
return NULL;
}
size -= off;
if (!size) {
return NULL;
}
ut8 *b = malloc (size);
if (!b) {
return NULL;
... | cwe | CWE-787 | C/C++ |
void ImageBitmapFactories::ImageBitmapLoader::LoadBlobAsync(
Blob* blob) {
loader_->Start(blob->GetBlobDataHandle());
} | cwe | CWE-787 | C/C++ |
(function(stylesheet, stencils)
{
// Callbacks:
// mxClientOnLoad is called after the script is loaded with the stylesheet and the function to create a
// graph (wich takes the container as an argument and returns the graph instance that was created).
// mxClientOnCreate is called when a graph has been created... | cwe | CWE-79 | JavaScript |
/*
. .o8 oooo
.o8 "888 `888
.o888oo oooo d8b oooo oooo .oooo888 .ooooo. .oooo.o 888 oooo
888 `888""8P `888 `888 d88' `888 d88' `88b d88( "8 888 .8P'
888 888 888 888 888 888 888o... | cwe | CWE-434 | JavaScript |
static Jsi_RC StringSearchCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
Jsi_Value **ret, Jsi_Func *funcPtr)
{
int sLen, bLen;
const char *source_str;
ChkString(_this, funcPtr, source_str, &sLen, &bLen);
char *v = _this->d.obj->d.s.str;
Jsi_Value *seq = Jsi_ValueArrayIndex(inte... | cwe | CWE-120 | C/C++ |
Status BuildFeatureReaders(const OpInputList& ragged_values_list,
const OpInputList& ragged_splits_list,
const OpInputList& sparse_indices_list,
const OpInputList& sparse_values_list,
const OpInputList& d... | cwe | CWE-369 | C/C++ |
static int kvaser_usb_leaf_set_opt_mode(const struct kvaser_usb_net_priv *priv)
{
struct kvaser_cmd *cmd;
int rc;
cmd = kmalloc(sizeof(*cmd), GFP_KERNEL);
if (!cmd)
return -ENOMEM;
cmd->id = CMD_SET_CTRL_MODE;
cmd->len = CMD_HEADER_LEN + sizeof(struct kvaser_cmd_ctrl_mode);
cmd->u.ctrl_mode.tid = 0xff;
cmd-... | cwe | CWE-908 | Unknown |
/*
* TUN - Universal TUN/TAP device driver.
* Copyright (C) 1999-2002 Maxim Krasnyansky <maxk@qualcomm.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 L... | cwe | CWE-476 | C/C++ |
"""Datasource for LXD, reads /dev/lxd/sock representation of instance data.
Notes:
* This datasource replaces previous NoCloud datasource for LXD.
* Older LXD images may not have updates for cloud-init so NoCloud may
still be detected on those images.
* Detect LXD datasource when /dev/lxd/sock is an active socke... | cwe | CWE-532 | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.