code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
g()?"":Editor.isDarkMode()?"#ff0000":"#ffcfcf"}catch(U){b.handleError(U)}});K.setAttribute("title",mxResources.get("find")+" (Enter)");K.style.float="none";K.style.width="120px";K.style.marginTop="6px";K.style.marginLeft="8px";K.style.overflow="hidden";K.style.textOverflow="ellipsis";K.className="geBtn gePrimaryBtn";t.... | cwe | CWE-20 | JavaScript |
static int process_base_block(struct archive_read* a,
struct archive_entry* entry)
{
struct rar5* rar = get_context(a);
uint32_t hdr_crc, computed_crc;
size_t raw_hdr_size = 0, hdr_size_len, hdr_size;
size_t header_id = 0;
size_t header_flags = 0;
const uint8_t* p;
int ret;
enum HEADER_TYPE {
HEAD_MARK ... | cwe | CWE-125 | C/C++ |
# -*- coding: utf-8 -*-
# rdiffweb, A web interface to rdiff-backup repositories
# Copyright (C) 2012-2021 rdiffweb contributors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version ... | cwe | CWE-601 | Python |
func parseObject(c *parseContext, i int, path string) (int, bool) {
var pmatch, kesc, vesc, ok, hit bool
var key, val string
rp := parseObjectPath(path)
if !rp.more && rp.piped {
c.pipe = rp.pipe
c.piped = true
}
for i < len(c.json) {
for ; i < len(c.json); i++ {
if c.json[i] == '"' {
// parse_key_st... | cwe | CWE-400 | Go |
void Compute(OpKernelContext* ctx) override {
const Tensor& input = ctx->input(0);
const Tensor& input_min_tensor = ctx->input(1);
const Tensor& input_max_tensor = ctx->input(2);
int num_slices = 1;
if (axis_ > -1) {
num_slices = input.dim_size(axis_);
}
OP_REQUIRES(ctx, input_min_ten... | cwe | CWE-125 | C/C++ |
transformCreateStmt(CreateStmt *stmt, const char *queryString)
{
ParseState *pstate;
CreateStmtContext cxt;
List *result;
List *save_alist;
ListCell *elements;
Oid namespaceid;
Oid existing_relid;
ParseCallbackState pcbstate;
bool like_found = false;
bool is_foreign_table = IsA(stmt, CreateForei... | cwe | CWE-94 | Unknown |
/**
* OLAT - Online Learning and Training<br>
* http://www.olat.org
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unl... | cwe | CWE-91 | Java |
function q(I,F,H,R,W){function J(P,Q,S){var Y=document.createElement("li");Y.className="geCommentAction";var ba=document.createElement("a");ba.className=
"geCommentActionLnk";mxUtils.write(ba,P);Y.appendChild(ba);mxEvent.addListener(ba,"click",function(da){Q(da,I);da.preventDefault();mxEvent.consume(da)});T.appendChild... | cwe | CWE-94 | JavaScript |
int udpv6_recvmsg(struct kiocb *iocb, struct sock *sk,
struct msghdr *msg, size_t len,
int noblock, int flags, int *addr_len)
{
struct ipv6_pinfo *np = inet6_sk(sk);
struct inet_sock *inet = inet_sk(sk);
struct sk_buff *skb;
unsigned int ulen, copied;
int peeked, off = 0;
int err;
int is_udplite = IS_UDP... | cwe | CWE-20 | Unknown |
# -*- coding: utf-8 -*-
# Copyright 2014-2016 OpenMarket Ltd
# Copyright 2017 Vector Creations 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/LICEN... | cwe | CWE-20 | Python |
static ssize_t runtime_suspended_time_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
int ret;
u64 tmp = pm_runtime_suspended_time(dev);
do_div(tmp, NSEC_PER_MSEC);
ret = sprintf(buf, "%llu\n", tmp);
return ret;
} | cwe | CWE-787 | Unknown |
static void iwjpeg_scan_exif_ifd(struct iwjpegrcontext *rctx,
struct iw_exif_state *e, iw_uint32 ifd)
{
unsigned int tag_count;
unsigned int i;
unsigned int tag_pos;
unsigned int tag_id;
unsigned int v;
double v_dbl;
if(ifd<8 || ifd>e->d_len-18) return;
tag_count = iw_get_ui16_e(&e->d[ifd],e->endian);
if(ta... | cwe | CWE-125 | C/C++ |
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */
#include <inttypes.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <sys/queue.h>
#include "lsquic.h"
#include "lsquic_int_types.h"
#include "lsquic_conn_flow.h"
#include "lsquic_types.h"
#include "lsquic_rtt.h"
#include "... | cwe | CWE-476 | C/C++ |
int irssi_ssl_handshake(GIOChannel *handle)
{
GIOSSLChannel *chan = (GIOSSLChannel *)handle;
int ret, err;
X509 *cert;
const char *errstr;
ret = SSL_connect(chan->ssl);
if (ret <= 0) {
err = SSL_get_error(chan->ssl, ret);
switch (err) {
case SSL_ERROR_WANT_READ:
return 1;
case SSL_ERROR_WANT_WRITE:... | cwe | CWE-20 | C/C++ |
httpSpecialClientSideHandler(int status,
FdEventHandlerPtr event,
StreamRequestPtr srequest)
{
HTTPConnectionPtr connection = srequest->data;
HTTPRequestPtr request = connection->request;
int push;
if((request->object->flags & OBJECT_ABORTED) ||... | cwe | CWE-617 | Unknown |
bool BaseAudioContext::WouldTaintOrigin(const KURL& url) const {
if (url.ProtocolIsData()) {
return false;
}
Document* document = GetDocument();
if (document && document->GetSecurityOrigin()) {
return !document->GetSecurityOrigin()->CanRequest(url);
}
return true;
} | cwe | CWE-732 | C/C++ |
static void lo_release(struct gendisk *disk, fmode_t mode)
{
struct loop_device *lo = disk->private_data;
int err;
if (atomic_dec_return(&lo->lo_refcnt))
return;
mutex_lock(&lo->lo_ctl_mutex);
if (lo->lo_flags & LO_FLAGS_AUTOCLEAR) {
/*
* In autoclear mode, stop the loop thread
* and remove configu... | cwe | CWE-362 | C/C++ |
'use strict';
const xml2js = require('xml2js');
const DEFAULT_TYPES = ['*/xml', '+xml'];
module.exports = function (bodyParser) {
if (bodyParser.xml) {
// We already setup the XML parser.
// End early.
return;
}
function xml(options) {
options = options || {};
options.type = options.type ... | cwe | CWE-915 | JavaScript |
static int decode_studio_vop_header(Mpeg4DecContext *ctx, GetBitContext *gb)
{
MpegEncContext *s = &ctx->m;
if (get_bits_left(gb) <= 32)
return 0;
s->partitioned_frame = 0;
s->decode_mb = mpeg4_decode_studio_mb;
decode_smpte_tc(ctx, gb);
skip_bits(gb, 10); /* temporal_reference */
... | cwe | CWE-125 | C/C++ |
static size_t TrimTrailingSpaces ( char * firstChar, size_t origLen )
{
if ( origLen == 0 ) return 0;
char * lastChar = firstChar + origLen - 1;
if ( (*lastChar != ' ') && (*lastChar != 0) ) return origLen; // Nothing to do.
while ( (firstChar <= lastChar) && ((*lastChar == ' ') || (*lastChar == 0)) ) --las... | cwe | CWE-416 | C/C++ |
processDSNSFind(struct module_qstate* qstate, struct iter_qstate* iq, int id)
{
struct module_qstate* subq = NULL;
verbose(VERB_ALGO, "processDSNSFind");
if(!iq->dsns_point) {
/* initialize */
iq->dsns_point = iq->qchase.qname;
iq->dsns_point_len = iq->qchase.qname_len;
}
/* robustcheck for internal error: ... | cwe | CWE-400 | Unknown |
RestStatus RestAuthHandler::execute() {
auto const type = _request->requestType();
if (type != rest::RequestType::POST) {
generateError(rest::ResponseCode::METHOD_NOT_ALLOWED, TRI_ERROR_HTTP_METHOD_NOT_ALLOWED);
return RestStatus::DONE;
}
bool parseSuccess = false;
VPackSlice slice = this->parseVPack... | cwe | CWE-613 | C/C++ |
static ssize_t ib_ucm_write(struct file *filp, const char __user *buf,
size_t len, loff_t *pos)
{
struct ib_ucm_file *file = filp->private_data;
struct ib_ucm_cmd_hdr hdr;
ssize_t result;
if (len < sizeof(hdr))
return -EINVAL;
if (copy_from_user(&hdr, buf, sizeof(hdr)))
return -EFAULT;
if (hdr... | cwe | CWE-264 | C/C++ |
static ssize_t _hostfs_write(oe_fd_t* desc, const void* buf, size_t count)
{
ssize_t ret = -1;
file_t* file = _cast_file(desc);
/* Check parameters. */
if (!file || (count && !buf))
OE_RAISE_ERRNO(OE_EINVAL);
/* Call the host. */
if (oe_syscall_write_ocall(&ret, file->host_fd, buf, cou... | cwe | CWE-200 | Unknown |
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */
/*
* lsquic_di_error.c -- A placeholder when things go wrong
*
* This object is used in order to avoid dereferencing NULLs in stream.c
*/
#include <assert.h>
#include <stddef.h>
#include <stdint.h>
#ifdef WIN32
#include <vc_compat.h>
#endif... | cwe | CWE-476 | C/C++ |
int HexInStream::overrun(int itemSize, int nItems, bool wait) {
if (itemSize > bufSize)
throw Exception("HexInStream overrun: max itemSize exceeded");
if (end - ptr != 0)
memmove(start, ptr, end - ptr);
end -= ptr - start;
offset += ptr - start;
ptr = start;
while (end < ptr + itemSize) {
int... | cwe | CWE-122 | C/C++ |
int ssl3_connect(SSL *s)
{
BUF_MEM *buf=NULL;
unsigned long Time=(unsigned long)time(NULL);
void (*cb)(const SSL *ssl,int type,int val)=NULL;
int ret= -1;
int new_state,state,skip=0;
RAND_add(&Time,sizeof(Time),0);
ERR_clear_error();
clear_sys_error();
if (s->info_callback != NULL)
cb=s->info_callback;
e... | cwe | CWE-326 | Unknown |
xmlParseAttValueComplex(xmlParserCtxtPtr ctxt, int *attlen, int normalize) {
xmlChar limit = 0;
xmlChar *buf = NULL;
xmlChar *rep = NULL;
int len = 0;
int buf_size = 0;
int c, l, in_space = 0;
xmlChar *current = NULL;
xmlEntityPtr ent;
if (NXT(0) == '"') {
ctxt->instate = XML_PARSE... | cwe | CWE-119 | C/C++ |
/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/* kdc/do_tgs_req.c - KDC Routines to deal with TGS_REQ's */
/*
* Copyright 1990, 1991, 2001, 2007, 2008, 2009, 2013, 2014 by the
* Massachusetts Institute of Technology. All Rights Reserved.
*
* Export of this software from the United States of Ameri... | cwe | CWE-20 | C/C++ |
http_isfiltered(const struct http *fm, unsigned u, unsigned how)
{
const char *e;
const struct http_hdrflg *f;
if (fm->hdf[u] & HDF_FILTER)
return (1);
e = strchr(fm->hd[u].b, ':');
if (e == NULL)
return (0);
f = http_hdr_flags(fm->hd[u].b, e);
return (f != NULL && f->flag & how);
} | cwe | CWE-703 | C/C++ |
buflist_match(
regmatch_T *rmp,
buf_T *buf,
int ignore_case) // when TRUE ignore case, when FALSE use 'fic'
{
char_u *match;
// First try the short file name, then the long file name.
match = fname_match(rmp, buf->b_sfname, ignore_case);
if (match == NULL)
match = fname_match(rmp, buf->b... | cwe | CWE-476 | C/C++ |
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2012 - 2018 Microchip Technology Inc., and its subsidiaries.
* All rights reserved.
*/
#include "netdev.h"
#define WILC_HIF_SCAN_TIMEOUT_MS 5000
#define WILC_HIF_CONNECT_TIMEOUT_MS 9500
#define WILC_FALSE_FRMWR_CHANNEL 100
#define... | cwe | CWE-125 | C/C++ |
struct net *get_net_ns_by_id(struct net *net, int id)
{
struct net *peer;
if (id < 0)
return NULL;
rcu_read_lock();
spin_lock_bh(&net->nsid_lock);
peer = idr_find(&net->netns_ids, id);
if (peer)
get_net(peer);
spin_unlock_bh(&net->nsid_lock);
rcu_read_unlock();
return peer;
} | cwe | CWE-416 | C/C++ |
_archive_write_data(struct archive *_a, const void *buff, size_t s)
{
struct archive_write *a = (struct archive_write *)_a;
archive_check_magic(&a->archive, ARCHIVE_WRITE_MAGIC,
ARCHIVE_STATE_DATA, "archive_write_data");
archive_clear_error(&a->archive);
return ((a->format_write_data)(a, buff, s));
} | cwe | CWE-189 | C/C++ |
void read_stats_from_file(char from_file[])
{
struct file_magic file_magic;
struct file_activity *file_actlst = NULL;
char rec_hdr_tmp[MAX_RECORD_HEADER_SIZE];
int curr = 1, i, p;
int ifd, rtype;
int rows, eosaf = TRUE, reset = FALSE;
long cnt = 1;
off_t fpos;
/* Get window size */
rows = get_win_height();
... | cwe | CWE-125 | Unknown |
public static function setTransactionPart(Db $zdb, $trans_id, $contrib_id)
{
try {
$update = $zdb->update(self::TABLE);
$update->set(
array(Transaction::PK => $trans_id)
)->where(self::PK . ' = ' . $contrib_id);
$zdb->execute($update);
... | cwe | CWE-89 | PHP |
// Member functions for TileManager.h
/* IIP Server: Tile Cache Handler
Copyright (C) 2005-2021 Ruven Pillay.
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 ... | cwe | CWE-190 | C/C++ |
int CMS_verify(CMS_ContentInfo *cms, STACK_OF(X509) *certs,
X509_STORE *store, BIO *dcont, BIO *out, unsigned int flags)
{
CMS_SignerInfo *si;
STACK_OF(CMS_SignerInfo) *sinfos;
STACK_OF(X509) *cms_certs = NULL;
STACK_OF(X509_CRL) *crls = NULL;
X509 *signer;
int i, scount = 0, ret = 0;
BIO *cmsbio = NULL, *tm... | cwe | CWE-399 | C/C++ |
/*
* PNG image format
* Copyright (c) 2003 Fabrice Bellard
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (a... | cwe | CWE-787 | C/C++ |
TPMT_TK_HASHCHECK_Unmarshal(TPMT_TK_HASHCHECK *target, BYTE **buffer, INT32 *size)
{
TPM_RC rc = TPM_RC_SUCCESS;
if (rc == TPM_RC_SUCCESS) {
rc = TPM_ST_Unmarshal(&target->tag, buffer, size);
}
if (rc == TPM_RC_SUCCESS) {
if (target->tag != TPM_ST_HASHCHECK) {
rc = TPM_RC_TAG;
}
}
if (r... | cwe | CWE-787 | Unknown |
static int __init big_key_init(void)
{
return register_key_type(&key_type_big_key);
} | cwe | CWE-476 | C/C++ |
App.Actions.WEB.update_ftp_username_hint = function(elm, hint) {
if (hint.trim() == '') {
$(elm).parent().find('.hint').html('');
}
hint = hint.replace(/[^\w\d]/gi, '');
$(elm).parent().find('.v-ftp-user').val(hint);
$(elm).parent().find('.hint').text(GLOBAL.FTP_USER_PREFIX + hint);
} | cwe | CWE-79 | JavaScript |
static int try_to_unmap_cluster(unsigned long cursor, unsigned int *mapcount,
struct vm_area_struct *vma, struct page *check_page)
{
struct mm_struct *mm = vma->vm_mm;
pmd_t *pmd;
pte_t *pte;
pte_t pteval;
spinlock_t *ptl;
struct page *page;
unsigned long address;
unsigned long mmun_start; /* For mmu_notifier... | cwe | CWE-264 | C/C++ |
static int mpeg4video_probe(AVProbeData *probe_packet)
{
uint32_t temp_buffer = -1;
int VO = 0, VOL = 0, VOP = 0, VISO = 0, res = 0;
int i;
for (i = 0; i < probe_packet->buf_size; i++) {
temp_buffer = (temp_buffer << 8) + probe_packet->buf[i];
if ((temp_buffer & 0xffffff00) != 0x100)
... | cwe | CWE-476 | Unknown |
/* SSDP responder
*
* Copyright (c) 2017 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 notice appear in all copies.
*
* THE SOFTWA... | cwe | CWE-119 | C/C++ |
# pylint: disable=no-self-use, too-few-public-methods
from django.conf import settings
from django.contrib.sites.models import Site
from django.db.utils import OperationalError, ProgrammingError
from django.http import HttpResponseRedirect
from django.urls import reverse
from django.utils.deprecation import Middleware... | cwe | CWE-79 | Python |
static int snd_ctl_elem_user_tlv(struct snd_kcontrol *kcontrol,
int op_flag,
unsigned int size,
unsigned int __user *tlv)
{
struct user_element *ue = kcontrol->private_data;
int change = 0;
void *new_data;
if (op_flag > 0) {
if (size > 1024 * 128) /* sane value */
return -EINVAL;
new_data = ... | cwe | CWE-362 | C/C++ |
viewController.getData = function (request, cb) {
async.parallel(
[
function (callback) {
if (global.env === 'development') {
require('../../sass/buildsass').build(callback)
} else {
return callback()
}
},
function (callback) {
async.parallel(
... | cwe | CWE-521 | JavaScript |
PHP_METHOD(PharFileInfo, getContent)
{
char *error;
php_stream *fp;
phar_entry_info *link;
PHAR_ENTRY_OBJECT();
if (zend_parse_parameters_none() == FAILURE) {
return;
}
if (entry_obj->ent.entry->is_dir) {
zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC,
"Phar error: Cannot retrieve c... | cwe | CWE-119 | Unknown |
/*
* 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-79 | Java |
/*
* TechnoTrend PVA (.pva) demuxer
* Copyright (c) 2007, 2008 Ivo van Poorten
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 o... | cwe | CWE-400 | C/C++ |
// 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 int unimac_mdio_probe(struct platform_device *pdev)
{
struct unimac_mdio_pdata *pdata = pdev->dev.platform_data;
struct unimac_mdio_priv *priv;
struct device_node *np;
struct mii_bus *bus;
struct resource *r;
int ret;
np = pdev->dev.of_node;
priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
... | cwe | CWE-476 | C/C++ |
AnyP::Uri::parse(const HttpRequestMethod& method, const SBuf &rawUrl)
{
try {
LOCAL_ARRAY(char, login, MAX_URL);
LOCAL_ARRAY(char, foundHost, MAX_URL);
LOCAL_ARRAY(char, urlpath, MAX_URL);
char *t = NULL;
char *q = NULL;
int foundPort;
int l;
int i;
... | cwe | CWE-20 | C/C++ |
public Item getItem(File file, final FollowLinkType followlinks, List<String> followedLinkPaths ) throws FileIOException
{
try
{
Path path = file.toPath();
ItemType type;
if (Files.isSymbolicLink(path))
{
String target;
target = Files.readSymbolicLink(path).toString();
final String fir... | cwe | CWE-22 | Java |
function zipObject(keys, values) {
const out = {};
for (let i = 0, l = keys.length; i < l; ++i) {
out[keys[i]] = values[i];
}
return out;
} | cwe | CWE-1321 | JavaScript |
void WorkerProcessLauncher::Core::OnChannelConnected(int32 peer_pid) {
DCHECK(caller_task_runner_->BelongsToCurrentThread());
if (ipc_enabled_)
worker_delegate_->OnChannelConnected();
} | cwe | CWE-399 | C/C++ |
long vorbis_book_decodevv_add(codebook *book,float **a,long offset,int ch,
oggpack_buffer *b,int n){
long i,j,entry;
int chptr=0;
if(book->used_entries>0){
for(i=offset/ch;i<(offset+n)/ch;){
entry = decode_packed_entry_number(book,b);
if(entry==-1)return(-1);
{... | cwe | CWE-787 | Unknown |
function growl(msg, options, fn) {
var image
, args
, options = options || {}
, fn = fn || function(){};
if (options.exec) {
cmd = {
type: "Custom"
, pkg: options.exec
, range: []
};
}
// noop
if (!cmd) return fn(new Error('growl not supported on this platform'));
a... | cwe | CWE-78 | JavaScript |
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/ory/fosite/handler/openid (interfaces: OpenIDConnectTokenStrategy)
// Package internal is a generated GoMock package.
package internal
import (
context "context"
reflect "reflect"
gomock "github.com/golang/mock/gomock"
fosite "github.com/ory/fosit... | cwe | CWE-287 | Go |
long dd_get_item_size(struct dump_dir *dd, const char *name)
{
if (!str_is_correct_filename(name))
error_msg_and_die("Cannot get item size. '%s' is not a valid file name", name);
long size = -1;
char *iname = concat_path_file(dd->dd_dirname, name);
struct stat statbuf;
if (lstat(iname, &st... | cwe | CWE-20 | Unknown |
package com.salesmanager.core.model.catalog.product.price;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* Transient entity used to display
* different price information in the catalogue
* @author Carl Samson
*
*/
public class FinalPrice implements Se... | cwe | CWE-639 | Java |
FileTransfer::DoUpload(filesize_t *total_bytes, ReliSock *s)
{
int rc;
MyString fullname;
filesize_t bytes;
bool is_the_executable;
bool upload_success = false;
bool do_download_ack = false;
bool do_upload_ack = false;
bool try_again = false;
int hold_code = 0;
int hold_subcode = 0;
MyString error_desc;
boo... | cwe | CWE-134 | C/C++ |
bool IsTraceEventArgsWhitelisted(const char* category_group_name,
const char* event_name) {
base::CStringTokenizer category_group_tokens(
category_group_name, category_group_name + strlen(category_group_name),
",");
while (category_group_tokens.GetNext()) {
cons... | cwe | CWE-399 | C/C++ |
void test_base64_lengths(void)
{
const char *in = "FuseMuse";
char out1[32];
char out2[32];
size_t enclen;
int declen;
/* Encoding a zero-length string should fail */
enclen = mutt_b64_encode(out1, in, 0, 32);
if (!TEST_CHECK(enclen == 0))
{
TEST_MSG("Expected: %zu", 0);
TEST_MSG("Actual : %... | cwe | CWE-119 | Unknown |
"""
Defines helper methods useful for setting up ports, launching servers, and handling `ngrok`
"""
import os
import socket
import threading
from flask import Flask, request, session, jsonify, abort, send_file, render_template, redirect
from flask_cachebuster import CacheBuster
from flask_login import LoginManager, lo... | cwe | CWE-22 | Python |
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
const TfLiteTensor* input = GetInput(context, node, kInputTensor);
TfLiteTensor* output = GetOutput(context, node, kOutputTensor);
const int num_elements = NumElements(input);
switch (input->type) {
case kTfLiteInt64:
memset(GetTensorData<i... | cwe | CWE-787 | C/C++ |
CAMLprim value caml_blit_string(value s1, value ofs1, value s2, value ofs2,
value n)
{
memmove(&Byte(s2, Long_val(ofs2)), &Byte(s1, Long_val(ofs1)), Int_val(n));
return Val_unit;
} | cwe | CWE-119 | C/C++ |
char* parseValue( char* ptr, FileNode& node, int min_indent, bool is_parent_flow )
{
char* endptr = 0;
char c = ptr[0], d = ptr[1];
int value_type = FileNode::NONE;
int len;
bool is_binary_string = false;
bool is_user = false;
if( c == '!' ) // handle explici... | cwe | CWE-476 | Unknown |
QInt32() {} | cwe | CWE-908 | C/C++ |
void luaV_concat (lua_State *L, int total) {
if (total == 1)
return; /* "all" values already concatenated */
do {
StkId top = L->top;
int n = 2; /* number of elements handled in this pass (at least 2) */
if (!(ttisstring(s2v(top - 2)) || cvt2str(s2v(top - 2))) ||
!tostring(L, s2v(top - 1))... | cwe | CWE-787 | Unknown |
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: https://www.espocrm.com
*
* EspoCRM is free software: you can redistribute i... | cwe | CWE-79 | JavaScript |
static int do_ipv6_getsockopt(struct sock *sk, int level, int optname,
char __user *optval, int __user *optlen, unsigned int flags)
{
struct ipv6_pinfo *np = inet6_sk(sk);
int len;
int val;
if (ip6_mroute_opt(optname))
return ip6_mroute_getsockopt(sk, optname, optval, optlen);
if (get_user(len, optlen))
... | cwe | CWE-284 | Unknown |
function H(ha){E&&(ya.scrollTop=0,da.innerHTML="",Ea.spin(da),U=!1,V=!0,fa.innerHTML=mxUtils.htmlEntities(mxResources.get("recentDiag")),ba=null,E(ua,function(){z(mxResources.get("cannotLoad"));ua([])},ha?null:u))} | cwe | CWE-94 | JavaScript |
PJ_DEF(pj_status_t) pjmedia_rtcp_fb_build_pli(
pjmedia_rtcp_session *session,
void *buf,
pj_size_t *length)
{
pjmedia_rtcp_common *hdr;
unsigned len;
PJ_ASSERT_RETURN(session && buf && length, PJ_EINVAL);
len = 12;
if (len > *length)
return PJ_ETOOSMALL;
/* Build RTCP-FB PLI ... | cwe | CWE-125 | C/C++ |
fn parse_quoted_text(input: &str) -> Result<Cow<'_, str>, ParseErrorKind> {
Ok(match input.as_bytes()[0] {
b'"' => {
let mut s = strip_first_last(input);
let mut buf = String::new();
loop {
let mut chars = s.chars();
match chars.next() {
... | cwe | CWE-617 | Rust |
////////////////////////////////////////////////////////////////////////////
// **** WAVPACK **** //
// Hybrid Lossless Wavefile Compressor //
// Copyright (c) 1998 - 2013 Conifer Software. //
// ... | cwe | CWE-125 | 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.
*/
/*
* textobject.c: functions for text obje... | cwe | CWE-125 | C/C++ |
void opj_get_all_encoding_parameters( const opj_image_t *p_image,
const opj_cp_t *p_cp,
OPJ_UINT32 tileno,
OPJ_INT32 * p_tx0,
OPJ_INT32 * p_tx1,
... | cwe | CWE-190 | C/C++ |
CreateTableAsRelExists(CreateTableAsStmt *ctas)
{
Oid nspid;
IntoClause *into = ctas->into;
nspid = RangeVarGetCreationNamespace(into->rel);
if (get_relname_relid(into->rel->relname, nspid))
{
if (!ctas->if_not_exists)
ereport(ERROR,
(errcode(ERRCODE_DUPLICATE_TABLE),
errmsg("relation \"%s\" al... | cwe | CWE-94 | Unknown |
return a},remove:function(a,b){var c=null;if("object"==typeof b)for(var d=mxUtils.indexOf(b,a);0<=d;)b.splice(d,1),c=a,d=mxUtils.indexOf(b,a);for(var e in b)b[e]==a&&(delete b[e],c=a);return c},isNode:function(a,b,c,d){return null==a||isNaN(a.nodeType)||null!=b&&a.nodeName.toLowerCase()!=b.toLowerCase()?!1:null==c||a.g... | cwe | CWE-94 | JavaScript |
static void EncipherAESBlock(AESInfo *aes_info,const unsigned char *plaintext,
unsigned char *ciphertext)
{
ssize_t
i,
j;
static int
map[4][4] =
{
{ 0, 1, 2, 3 },
{ 1, 2, 3, 0 },
{ 2, 3, 0, 1 },
{ 3, 0, 1, 2 }
};
static unsigned int
D[] =
{
0xa56363c6U... | cwe | CWE-369 | Unknown |
void net_dns_print(pid_t pid) {
EUID_ASSERT();
// drop privileges - will not be able to read /etc/resolv.conf for --noroot option
// in case the pid is that of a firejail process, use the pid of the first child process
pid = switch_to_child(pid);
// exit if no permission to join the sandbox
check_join_permissio... | cwe | CWE-269 | Unknown |
fmgr_c_validator(PG_FUNCTION_ARGS)
{
Oid funcoid = PG_GETARG_OID(0);
void *libraryhandle;
HeapTuple tuple;
bool isnull;
Datum tmp;
char *prosrc;
char *probin;
/*
* It'd be most consistent to skip the check if !check_function_bodies,
* but the purpose of that switch is to be helpful for pg_dump... | cwe | CWE-264 | Unknown |
static int check_mem_access(struct bpf_verifier_env *env, int insn_idx, u32 regno, int off,
int bpf_size, enum bpf_access_type t,
int value_regno)
{
struct bpf_verifier_state *state = env->cur_state;
struct bpf_reg_state *regs = cur_regs(env);
struct bpf_reg_state *reg = regs + regno;
int size, err = ... | cwe | CWE-119 | C/C++ |
/*
* Copyright (c) 2016 Hisilicon Limited.
* Copyright (c) 2007, 2008 Mellanox Technologies. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
* General Public License (GPL) Version 2, available from the fi... | cwe | CWE-665 | C/C++ |
static int php_zip_extract_file(struct zip * za, char *dest, char *file, int file_len TSRMLS_DC)
{
php_stream_statbuf ssb;
struct zip_file *zf;
struct zip_stat sb;
char b[8192];
int n, len, ret;
php_stream *stream;
char *fullpath;
char *file_dirname_fullpath;
char file_dirname[MAXPATHLEN];
size_t dir_len;
ch... | cwe | CWE-22 | Unknown |
char **XListExtensions(
register Display *dpy,
int *nextensions) /* RETURN */
{
xListExtensionsReply rep;
char **list = NULL;
char *ch = NULL;
char *chend;
int count = 0;
register unsigned i;
register int length;
_X_UNUSED register xReq *req;
unsigned long rlen = 0;
LockDisplay(dpy);
GetEmptyReq (Li... | cwe | CWE-787 | C/C++ |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-476 | C/C++ |
static inline int ip_ufo_append_data(struct sock *sk,
struct sk_buff_head *queue,
int getfrag(void *from, char *to, int offset, int len,
int odd, struct sk_buff *skb),
void *from, int length, int hh_len, int fragheaderlen,
int transhdrlen, int maxfraglen, unsigned int flags)
{
struct sk_buff *skb... | cwe | CWE-284 | Unknown |
public function testDolEval()
{
global $conf,$user,$langs,$db;
$conf=$this->savconf;
$user=$this->savuser;
$langs=$this->savlangs;
$db=$this->savdb;
$result=dol_eval('1==1', 1, 0);
print "result = ".$result."\n";
$this->assertTrue($result);
$result=dol_eval('1==2', 1, 0);
print "result = ".$resul... | cwe | CWE-94 | PHP |
package com.salesmanager.core.business.services.catalog.product.attribute;
import java.util.List;
import com.salesmanager.core.business.exception.ServiceException;
import com.salesmanager.core.business.services.common.generic.SalesManagerEntityService;
import com.salesmanager.core.model.catalog.product.Product;
impor... | cwe | CWE-639 | Java |
xmlHashCreate(int size) {
xmlHashTablePtr table;
if (size <= 0)
size = 256;
table = xmlMalloc(sizeof(xmlHashTable));
if (table) {
table->dict = NULL;
table->size = size;
table->nbElems = 0;
table->table = xmlMalloc(size * sizeof(xmlHashEntry));
if (table->t... | cwe | CWE-399 | Unknown |
@endpoints.route("/wins")
def wins():
if db == None:
init()
player = request.args.get('tag', default="christmasmike")
sql = "SELECT * FROM matches WHERE winner = '"+str(player)+"' ORDER BY date DESC;"
result = db.exec(sql)
result = [str(x) for x in result]
result = '\n'.join(result)
... | cwe | CWE-89 | Python |
# -*- coding: utf-8 -*-
# rdiffweb, A web interface to rdiff-backup repositories
# Copyright (C) 2012-2021 rdiffweb contributors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version ... | cwe | CWE-770 | Python |
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#define DEBUG_TYPE "typeinference"
#include "hermes/Optimizer/Scalar/TypeInference.h"
#include "hermes/IR/Analysis.h"
#include "... | cwe | CWE-416 | C/C++ |
var parse = require('url').parse
var events = require('events')
var https = require('https')
var http = require('http')
var util = require('util')
var httpsOptions = [
'pfx', 'key', 'passphrase', 'cert', 'ca', 'ciphers',
'rejectUnauthorized', 'secureProtocol', 'servername', 'checkServerIdentity'
]
var bom = [239,... | cwe | CWE-200 | JavaScript |
protected function redirectToGroup(Thread $thread, $group_id)
{
if ($thread->state != Thread::STATE_CHATTING) {
// We can redirect only threads which are in proggress now.
return false;
}
// Redirect the thread
$thread->state = Thread::STATE_WAITING;
... | cwe | CWE-79 | PHP |
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | cwe | CWE-74 | Python |
int TLSOutStream::overrun(int itemSize, int nItems)
{
if (itemSize > bufSize)
throw Exception("TLSOutStream overrun: max itemSize exceeded");
flush();
if (itemSize * nItems > end - ptr)
nItems = (end - ptr) / itemSize;
return nItems;
} | cwe | CWE-122 | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.