code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
xmlBufferResize(xmlBufferPtr buf, unsigned int size)
{
unsigned int newSize;
xmlChar* rebuf = NULL;
size_t start_buf;
if (buf == NULL)
return(0);
if (buf->alloc == XML_BUFFER_ALLOC_IMMUTABLE) return(0);
/* Don't resize if we don't have to */
if (size < buf->size)
return 1;... | cwe | CWE-190 | Unknown |
static bool is_legal_file(const std::string &filename)
{
DBG_FS << "Looking for '" << filename << "'.\n";
if (filename.empty()) {
LOG_FS << " invalid filename\n";
return false;
}
if (filename.find("..") != std::string::npos) {
ERR_FS << "Illegal path '" << filename << "' (\"..\" not allowed).\n";
return ... | cwe | CWE-200 | C/C++ |
rdata_copy(sldns_buffer* pkt, struct packed_rrset_data* data, uint8_t* to,
struct rr_parse* rr, time_t* rr_ttl, uint16_t type,
sldns_pkt_section section)
{
uint16_t pkt_len;
const sldns_rr_descriptor* desc;
*rr_ttl = sldns_read_uint32(rr->ttl_data);
/* RFC 2181 Section 8. if msb of ttl is set treat as if zero. ... | cwe | CWE-787 | C/C++ |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-787 | C/C++ |
std::string& attrf(int ncid, int varId, const char * attrName, std::string& alloc)
{
alloc = "";
size_t len = 0;
nc_inq_attlen(ncid, varId, attrName, &len);
if(len < 1)
{
return alloc;
}
char attr_vals[NC_MAX_NAME + 1];
memset(at... | cwe | CWE-787 | C/C++ |
/*
* Copyright (c) 2012-2019 Belledonne Communications SARL.
*
* This file is part of belle-sip.
*
* 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
* (... | cwe | CWE-444 | C/C++ |
"""
Defines Presentation specific objects
"""
import mistune
import os
import threading
import time
import lookatme.config
import lookatme.contrib
from lookatme.parser import Parser
import lookatme.themes
import lookatme.tui
from lookatme.utils import dict_deep_update
class Presentation(object):
"""Defines a ... | cwe | CWE-78 | Python |
pango_glyph_string_set_size (PangoGlyphString *string, gint new_len)
{
g_return_if_fail (new_len >= 0);
while (new_len > string->space)
{
if (string->space == 0)
string->space = 1;
else
string->space *= 2;
if (string->space < 0)
{
g_warning ("glyph string length overflows maximum integ... | cwe | CWE-189 | C/C++ |
function XMLRPCdeployServer($imageid, $start, $end, $admingroup='',
$logingroup='', $ipaddr='', $macaddr='',
$monitored=0, $foruser='') {
global $user, $remoteIP;
if(! in_array("serverProfileAdmin", $user["privileges"])) {
return array('status' => 'error',
... | cwe | CWE-264 | PHP |
*/
static void php_wddx_push_element(void *user_data, const XML_Char *name, const XML_Char **atts)
{
st_entry ent;
wddx_stack *stack = (wddx_stack *)user_data;
if (!strcmp(name, EL_PACKET)) {
int i;
if (atts) for (i=0; atts[i]; i++) {
if (!strcmp(atts[i], EL_VERSION)) {
/* nothing for now */
}
}
}... | cwe | CWE-125 | Unknown |
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 |
int ssl_verify_cert_chain(SSL *s, STACK_OF(X509) *sk)
{
X509 *x;
int i = 0;
X509_STORE *verify_store;
X509_STORE_CTX *ctx = NULL;
X509_VERIFY_PARAM *param;
if ((sk == NULL) || (sk_X509_num(sk) == 0))
return 0;
if (s->cert->verify_store)
verify_store = s->cert->verify_store;... | cwe | CWE-835 | Unknown |
create_backup (char const *to, const struct stat *to_st, bool leave_original)
{
/* When the input to patch modifies the same file more than once, patch only
backs up the initial version of each file.
To figure out which files have already been backed up, patch remembers the
files that replace the orig... | cwe | CWE-59 | Unknown |
vhost_user_check_and_alloc_queue_pair(struct virtio_net *dev,
struct vhu_msg_context *ctx)
{
uint32_t vring_idx;
switch (ctx->msg.request.master) {
case VHOST_USER_SET_VRING_KICK:
case VHOST_USER_SET_VRING_CALL:
case VHOST_USER_SET_VRING_ERR:
vring_idx = ctx->msg.payload.u64 & VHOST_USER_VRING_IDX_MASK;
br... | cwe | CWE-787 | C/C++ |
polarssl_connect_step1(struct connectdata *conn,
int sockindex)
{
struct SessionHandle *data = conn->data;
struct ssl_connect_data* connssl = &conn->ssl[sockindex];
bool sni = TRUE; /* default is SNI enabled */
int ret = -1;
#ifdef ENABLE_IPV6
struct in6_addr addr;
#else
struct in_addr... | cwe | CWE-20 | C/C++ |
int imap_open_connection (IMAP_DATA* idata)
{
if (mutt_socket_open (idata->conn) < 0)
return -1;
idata->state = IMAP_CONNECTED;
if (imap_cmd_step (idata) != IMAP_CMD_OK)
{
imap_close_connection (idata);
return -1;
}
if (ascii_strncasecmp ("* OK", idata->buf, 4) == 0)
{
if (ascii_strncas... | cwe | CWE-200 | C/C++ |
static int synic_set_msr(struct kvm_vcpu_hv_synic *synic,
u32 msr, u64 data, bool host)
{
struct kvm_vcpu *vcpu = hv_synic_to_vcpu(synic);
int ret;
if (!synic->active && !host)
return 1;
trace_kvm_hv_synic_set_msr(vcpu->vcpu_id, msr, data, host);
ret = 0;
switch (msr) {
case HV_X64_MSR_SCONTROL:
synic... | cwe | CWE-476 | Unknown |
/*
* Copyright 2017-2019 original 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 agre... | cwe | CWE-400 | Java |
void luaV_execute (lua_State *L, CallInfo *ci) {
LClosure *cl;
TValue *k;
StkId base;
const Instruction *pc;
int trap;
#if LUA_USE_JUMPTABLE
#include "ljumptab.h"
#endif
tailcall:
trap = L->hookmask;
cl = clLvalue(s2v(ci->func));
k = cl->p->k;
pc = ci->u.l.savedpc;
if (trap) {
if (cl->p->is_var... | cwe | CWE-125 | Unknown |
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-1236 | JavaScript |
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
auto* params = reinterpret_cast<TfLiteDivParams*>(node->builtin_data);
OpData* data = reinterpret_cast<OpData*>(node->user_data);
TF_LITE_ENSURE_EQ(context, NumInputs(node), 2);
TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1);
const TfLiteTens... | cwe | CWE-125 | C/C++ |
$this->setType('folder');
}
// do not allow PHP and .htaccess files
if (preg_match("@\.ph(p[\d+]?|t|tml|ps)$@i", $this->getFilename()) || $this->getFilename() == '.htaccess') {
$this->setFilename($this->getFilename() . '.txt');
}
if(mb_strlen($this->getFilename()) >... | cwe | CWE-502 | PHP |
bool CheckClientDownloadRequest::ShouldUploadForMalwareScan(
DownloadCheckResultReason reason) {
if (!base::FeatureList::IsEnabled(kDeepScanningOfDownloads))
return false;
if (reason != DownloadCheckResultReason::REASON_DOWNLOAD_SAFE &&
reason != DownloadCheckResultReason::REASON_DOWNLOAD_UNCOMMON &&... | cwe | CWE-20 | C/C++ |
package schema
import (
"strings"
"github.com/answerdev/answer/internal/base/reason"
"github.com/answerdev/answer/internal/base/validator"
"github.com/answerdev/answer/pkg/converter"
"github.com/segmentfault/pacman/errors"
)
// SearchTagLikeReq get tag list all request
type SearchTagLikeReq struct {
// tag
Ta... | cwe | CWE-79 | Go |
function get_language_attributes( $doctype = 'html' ) {
$attributes = array();
if ( function_exists( 'is_rtl' ) && is_rtl() )
$attributes[] = 'dir="rtl"';
if ( $lang = get_bloginfo('language') ) {
if ( get_option('html_type') == 'text/html' || $doctype == 'html' )
$attributes[] = "lang=\"$lang\"";
if ( g... | cwe | CWE-79 | PHP |
/**
* Copyright (c) 2006-2012, JGraph Ltd
*/
/**
* Constructs a new open dialog.
*/
var OpenDialog = function()
{
var iframe = document.createElement('iframe');
iframe.style.backgroundColor = 'transparent';
iframe.allowTransparency = 'true';
iframe.style.borderStyle = 'none';
iframe.style.borderWidth = '0px';
... | cwe | CWE-20 | Java |
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | cwe | CWE-190 | Python |
def __init__(self, protocol='http', hostname='localhost', port='8080',
subsystem=None, accept='application/json',
trust_env=None, verify=False): | cwe | CWE-295 | Python |
TEE_Result syscall_asymm_verify(unsigned long state,
const struct utee_attribute *usr_params,
size_t num_params, const void *data, size_t data_len,
const void *sig, size_t sig_len)
{
TEE_Result res;
struct tee_cryp_state *cs;
struct tee_ta_session *sess;
struct tee_obj *o;
size_t hash_size;
int salt_len ... | cwe | CWE-119 | Unknown |
ResponsePtr Server::ServeStatic(RequestPtr request) {
assert(request->method() == methods::kGet);
if (doc_root_.empty()) {
LOG_INFO("The doc root was not specified");
return {};
}
fs::path path = doc_root_ / request->url().path();
try {
// NOTE: FileBody might throw Error::kFileError.
auto ... | cwe | CWE-22 | C/C++ |
static UINT32 nsc_rle_encode(BYTE* in, BYTE* out, UINT32 originalSize)
{
UINT32 left;
UINT32 runlength = 1;
UINT32 planeSize = 0;
left = originalSize;
/**
* We quit the loop if the running compressed size is larger than the original.
* In such cases data will be sent uncompressed.
*/
while (left > 4 && ... | cwe | CWE-787 | C/C++ |
fgetwln(FILE *stream, size_t *lenp)
{
struct filewbuf *fb;
wint_t wc;
size_t wused = 0;
/* Try to diminish the possibility of several fgetwln() calls being
* used on different streams, by using a pool of buffers per file. */
fb = &fb_pool[fb_pool_cur];
if (fb->fp != stream && fb->fp != NULL) {
fb_pool_cur++;... | cwe | CWE-119 | C/C++ |
def initialize(string)
super("'#{string}' is not a valid object id.")
end | cwe | CWE-20 | Ruby |
/* curve448-eh-to-x.c
Copyright (C) 2017 Daiki Ueno
Copyright (C) 2017 Red Hat, Inc.
This file is part of GNU Nettle.
GNU Nettle is free software: you can redistribute it and/or
modify it under the terms of either:
* the GNU Lesser General Public License as published by the Free
Software ... | cwe | CWE-327 | C/C++ |
libxlDomainShutdownThread(void *opaque)
{
struct libxlEventHandlerThreadInfo *shutdown_info = opaque;
virDomainObj *vm = shutdown_info->vm;
libxl_event *ev = shutdown_info->event;
libxlDriverPrivate *driver = shutdown_info->driver;
virObjectEvent *dom_event = NULL;
libxl_shutdown_reason xl_reaso... | cwe | CWE-703 | Unknown |
# -*- 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 |
cdp_decode(struct lldpd *cfg, char *frame, int s,
struct lldpd_hardware *hardware,
struct lldpd_chassis **newchassis, struct lldpd_port **newport)
{
struct lldpd_chassis *chassis;
struct lldpd_port *port;
struct lldpd_mgmt *mgmt;
struct in_addr addr;
#if 0
u_int16_t cksum;
#endif
u_int8_t *software = NULL... | cwe | CWE-703 | Unknown |
static void mux_chr_accept_input(CharDriverState *chr)
{
MuxDriver *d = chr->opaque;
int m = d->focus;
while (d->prod[m] != d->cons[m] &&
d->chr_can_read[m] &&
d->chr_can_read[m](d->ext_opaque[m])) {
d->chr_read[m](d->ext_opaque[m],
&d->buffer[m][d->cons... | cwe | CWE-416 | Unknown |
static ssize_t parse8BIM(Image *ifile, Image *ofile)
{
char
brkused,
quoted,
*line,
*token,
*newstr,
*name;
int
state,
next;
unsigned char
dataset;
unsigned int
recnum;
int
inputlen = MaxTextExtent;
MagickOffsetType
savedpos,
currentpos;
ssize_t
... | cwe | CWE-125 | C/C++ |
'use strict';
var Utils = require('../../utils')
, SqlString = require('../../sql-string')
, Model = require('../../model')
, DataTypes = require('../../data-types')
, _ = require('lodash')
, util = require('util')
, Dottie = require('dottie')
, BelongsTo = require('../../associations/belongs-to')
, ... | cwe | CWE-89 | JavaScript |
O.appendChild(ka)}return O};var ba=Menus.prototype.init;Menus.prototype.init=function(){ba.apply(this,arguments);var O=this.editorUi,X=O.editor.graph;O.actions.get("editDiagram").label=mxResources.get("formatXml")+"...";O.actions.get("createShape").label=mxResources.get("shape")+"...";O.actions.get("outline").label=mxR... | cwe | CWE-20 | JavaScript |
static void vmx_save_host_state(struct kvm_vcpu *vcpu)
{
struct vcpu_vmx *vmx = to_vmx(vcpu);
int i;
if (vmx->host_state.loaded)
return;
vmx->host_state.loaded = 1;
/*
* Set host fs and gs selectors. Unfortunately, 22.2.3 does not
* allow segment selectors with cpl > 0 or ti == 1.
*/
vmx->host_state.ld... | cwe | CWE-400 | Unknown |
static void gf_m2ts_process_pmt(GF_M2TS_Demuxer *ts, GF_M2TS_SECTION_ES *pmt, GF_List *sections, u8 table_id, u16 ex_table_id, u8 version_number, u8 last_section_number, u32 status)
{
u32 info_length, pos, desc_len, evt_type, nb_es,i;
u32 nb_sections;
u32 data_size;
u32 nb_hevc, nb_hevc_temp, nb_shvc, nb_shvc_temp,... | cwe | CWE-125 | C/C++ |
/*
* card-cac.c: Support for CAC from NIST SP800-73
* card-default.c: Support for cards with no driver
*
* Copyright (C) 2001, 2002 Juha Yrjölä <juha.yrjola@iki.fi>
* Copyright (C) 2005,2006,2007,2008,2009,2010 Douglas E. Engert <deengert@anl.gov>
* Copyright (C) 2006, Identity Alliance, Thomas Harning <thomas.h... | cwe | CWE-119 | C/C++ |
public void addViolation(String msg) {
violationOccurred = true;
context.buildConstraintViolationWithTemplate(msg)
.addConstraintViolation();
} | cwe | CWE-74 | Java |
ssize_t nbd_wr_syncv(QIOChannel *ioc,
struct iovec *iov,
size_t niov,
size_t length,
bool do_read)
{
ssize_t done = 0;
Error *local_err = NULL;
struct iovec *local_iov = g_new(struct iovec, niov);
struct iovec *local_iov... | cwe | CWE-617 | C/C++ |
private SearchResult lookupUser(String accountName) throws NamingException {
InitialDirContext context = initContext();
String searchString = searchFilter.replace(":login", accountName);
SearchControls searchControls = new SearchControls();
String[] attributeFilter = {idAttribute, name... | cwe | CWE-74 | Java |
ba,ja,ia){function ma(La,Ta){null==Ja?(Ga=La,Ga=/^https?:\/\//.test(Ga)&&!b.editor.isCorsEnabledForUrl(Ga)?PROXY_URL+"?url="+encodeURIComponent(Ga):TEMPLATE_PATH+"/"+Ga,mxUtils.get(Ga,mxUtils.bind(this,function(Ua){200<=Ua.getStatus()&&299>=Ua.getStatus()&&(Ja=Ua.getText());Ta(Ja,Ga)}))):Ta(Ja,Ga)}function qa(La,Ta,Ua)... | cwe | CWE-20 | JavaScript |
void *create_directory_config(apr_pool_t *mp, char *path)
{
directory_config *dcfg = (directory_config *)apr_pcalloc(mp, sizeof(directory_config));
if (dcfg == NULL) return NULL;
#ifdef DEBUG_CONF
ap_log_perror(APLOG_MARK, APLOG_STARTUP|APLOG_NOERRNO, 0, mp, "Created directory config %pp path %s", dcfg... | cwe | CWE-611 | Unknown |
empe_inlinepgp_encrypted_parse (EMailParserExtension *extension,
EMailParser *parser,
CamelMimePart *part,
GString *part_id,
GCancellable *cancellable,
GQueue *... | cwe | CWE-347 | Unknown |
bool Item_func_round::fix_length_and_dec()
{
int decimals_to_set;
longlong val1;
bool val1_unsigned;
unsigned_flag= args[0]->unsigned_flag;
if (!args[1]->const_item())
{
decimals= args[0]->decimals;
max_length= float_length(decimals);
if (args[0]->result_type() == DECIMAL_RESULT)
... | cwe | CWE-120 | Unknown |
function editComment(comment, cdiv, saveCallback, deleteOnCancel)
{
curEdited = {div: cdiv, comment: comment, saveCallback: saveCallback, deleteOnCancel: deleteOnCancel};
var commentTxt = cdiv.querySelector('.geCommentTxt');
var actionsDiv = cdiv.querySelector('.geCommentActionsList');
var textArea = doc... | cwe | CWE-94 | JavaScript |
'use strict';
(function (factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory();
process.profile = function (operation, start) {
console.log('%s took %d milliseconds', operation, process.elapsedTimeSince(start));
};
process.elapsedTimeSince = function (start) {
const... | cwe | CWE-338 | JavaScript |
int bson_ensure_space( bson *b, const int bytesNeeded ) {
int pos = b->cur - b->data;
char *orig = b->data;
int new_size;
if ( pos + bytesNeeded <= b->dataSize )
return BSON_OK;
new_size = 1.5 * ( b->dataSize + bytesNeeded );
if( new_size < b->dataSize ) {
if( ( b->dataSize + ... | cwe | CWE-190 | C/C++ |
func doesPolicySignatureV2Match(formValues http.Header) APIErrorCode {
cred := globalActiveCred
accessKey := formValues.Get(xhttp.AmzAccessKeyID)
cred, _, s3Err := checkKeyValid(accessKey)
if s3Err != ErrNone {
return s3Err
}
policy := formValues.Get("Policy")
signature := formValues.Get(xhttp.AmzSignatureV2)
... | cwe | CWE-863 | Go |
static void put_crypt_info(struct fscrypt_info *ci)
{
if (!ci)
return;
key_put(ci->ci_keyring_key);
crypto_free_skcipher(ci->ci_ctfm);
kmem_cache_free(fscrypt_info_cachep, ci);
} | cwe | CWE-476 | Unknown |
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | cwe | CWE-20 | Python |
App.prototype.descriptorChanged = function()
{
var file = this.getCurrentFile();
if (file != null)
{
if (this.fname != null)
{
this.fnameWrapper.style.display = 'block';
this.fname.innerHTML = '';
var filename = (file.getTitle() != null) ? file.getTitle() : this.defaultFilename;
mxUtils.write(this.... | cwe | CWE-94 | JavaScript |
package settings
import (
"context"
"crypto/rand"
"crypto/sha256"
"crypto/tls"
"crypto/x509"
"encoding/base64"
"fmt"
"math/big"
"net/url"
"path"
"reflect"
"strconv"
"strings"
"sync"
"time"
timeutil "github.com/argoproj/pkg/time"
"github.com/ghodss/yaml"
log "github.com/sirupsen/logrus"
apiv1 "k8s.i... | cwe | CWE-863 | Go |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-20 | C/C++ |
private func initStreamsWithData(_ data: Data, _ port: Int) {
//higher level API we will cut over to at some point
//NSStream.getStreamsToHostWithName(url.host, port: url.port.integerValue, inputStream: &inputStream, outputStream: &outputStream)
// Disconnect and clean up any existing streams b... | cwe | CWE-295 | Swift |
static pj_status_t respond_digest( pj_pool_t *pool,
pjsip_digest_credential *cred,
const pjsip_digest_challenge *chal,
const pj_str_t *uri,
const pjsip_cred_info *cred_info,
const pj_str_t *cnonce,
pj_uint32_t nc,
const pj_str_t *method)
{
const pj_str_t pjsip_AKAv1_... | cwe | CWE-120 | Unknown |
irc_server_set_prefix_modes_chars (struct t_irc_server *server,
const char *prefix)
{
char *pos;
int i, length_modes, length_chars;
if (!server || !prefix)
return;
/* free previous values */
if (server->prefix_modes)
{
free (server->prefix_mod... | cwe | CWE-120 | C/C++ |
export default async function ({ addon, console }) {
await addon.tab.loadScript("https://cdn.jsdelivr.net/npm/linkifyjs@2.1.9/dist/linkify.min.js");
await addon.tab.loadScript("https://cdn.jsdelivr.net/npm/linkifyjs@2.1.9/dist/linkify-element.min.js");
const pageType = document.location.pathname.substr(1).split(... | cwe | CWE-79 | JavaScript |
/* Copyright JS Foundation and other contributors, http://js.foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless r... | cwe | CWE-476 | C/C++ |
'use strict';
const CDP = require('chrome-remote-interface');
class Renderer {
_loadPage(client, url, options, config) {
/**
* Finds any meta tags setting the status code.
* @return {?number} status code
*/
function getStatusCode() {
const metaElement = document.querySelector('meta[name... | cwe | CWE-284 | JavaScript |
package de.presti.ree6.commands.impl.community;
import de.presti.ree6.commands.Category;
import de.presti.ree6.commands.CommandEvent;
import de.presti.ree6.commands.interfaces.Command;
import de.presti.ree6.commands.interfaces.ICommand;
import de.presti.ree6.main.Main;
import net.dv8tion.jda.api.Permission;
import net... | cwe | CWE-863 | Java |
function sigRenderTag ($input, array $args, Parser $parser, PPFrame $frame) {
$username = $input;
$img_url = sigGetAvatarUrl($username);
$o = '<br>'
. '<span class="scratch-sig">'
. '<a href="/wiki/User:'.$username.'">'
. '<img src="' . $img_url . '" width="18px" height="18px">'
... | cwe | CWE-79 | PHP |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-125 | C/C++ |
/**
* FreeRDP: A Remote Desktop Protocol Implementation
* ZGFX (RDP8) Bulk Data Compression
*
* Copyright 2014 Marc-Andre Moreau <marcandre.moreau@gmail.com>
* Copyright 2017 Armin Novak <armin.novak@thincast.com>
* Copyright 2017 Thincast Technologies GmbH
*
* Licensed under the Apache License, Version 2.0 (th... | cwe | CWE-787 | C/C++ |
/* OpenClinica is distributed under the
* GNU Lesser General Public License (GNU LGPL).
* For details see: http://www.openclinica.org/license
* copyright 2003-2005 Akaza Research
*/
package org.akaza.openclinica.control.admin;
import org.akaza.openclinica.bean.core.Role;
import org.akaza.openclinica.bean.submit.C... | cwe | CWE-22 | Java |
void Utf8DecoderBase::Reset(uint16_t* buffer,
unsigned buffer_length,
const uint8_t* stream,
unsigned stream_length) {
// Assume everything will fit in the buffer and stream won't be needed.
last_byte_of_buffer_unused_ = false;
un... | cwe | CWE-119 | Unknown |
public function set_controller($controller, $action)
{
include CLASS_DIR . 'module.php';
$module = new Module($controller);
define ('MODULE_NAME', $module->get_name());
$class_file = APP_DIR . 'controller/' . MODULE_NAME . '.php';
$class_name = ucfirst(MODULE_NAME) . '_Controller';
$class_method = ucfir... | cwe | CWE-79 | PHP |
latin_ptr2len(char_u *p)
{
return MB_BYTE2LEN(*p);
} | cwe | CWE-787 | Unknown |
/*
** class.c - Class class
**
** See Copyright Notice in mruby.h
*/
#include <mruby.h>
#include <mruby/array.h>
#include <mruby/hash.h>
#include <mruby/class.h>
#include <mruby/numeric.h>
#include <mruby/proc.h>
#include <mruby/string.h>
#include <mruby/variable.h>
#include <mruby/error.h>
#include <mruby/data.h>
#in... | cwe | CWE-476 | C/C++ |
void ResourceHandle::FromProto(const ResourceHandleProto& proto) {
set_device(proto.device());
set_container(proto.container());
set_name(proto.name());
set_hash_code(proto.hash_code());
set_maybe_type_name(proto.maybe_type_name());
std::vector<DtypeAndPartialTensorShape> dtypes_and_shapes;
for (const aut... | cwe | CWE-617 | C/C++ |
def is_authenticated(self, user, password):
# The content of the file is not cached because reading is generally a
# very cheap operation, and it's useful to get live updates of the
# htpasswd file.
with open(self.filename) as fd:
for line in fd:
line = line.s... | cwe | CWE-362 | Python |
PJ_DEF(pj_status_t) pjmedia_rtcp_fb_parse_rpsi(
const void *buf,
pj_size_t length,
pjmedia_rtcp_fb_rpsi *rpsi)
{
pjmedia_rtcp_common *hdr = (pjmedia_rtcp_common*) buf;
pj_uint8_t *p;
pj_uint8_t padlen;
pj_size_t rpsi_len;
PJ_ASSERT_RETURN(buf && rpsi, PJ_EINVAL);
PJ_ASSERT_RETURN... | cwe | CWE-125 | C/C++ |
char* problem_data_save(problem_data_t *pd)
{
load_abrt_conf();
struct dump_dir *dd = create_dump_dir_from_problem_data(pd, g_settings_dump_location);
char *problem_id = NULL;
if (dd)
{
problem_id = xstrdup(dd->dd_dirname);
dd_close(dd);
}
log_info("problem id: '%s'"... | cwe | CWE-200 | C/C++ |
def create_access(request, topic_id):
topic_private = TopicPrivate.objects.for_create_or_404(topic_id, request.user)
form = TopicPrivateInviteForm(
topic=topic_private.topic,
data=post_data(request))
if form.is_valid():
form.save()
notify_access(user=form.get_user(), topic_p... | cwe | CWE-601 | Python |
package org.togglz.console.handlers.edit;
import java.io.IOException;
import java.util.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.togglz.console.RequestEvent;
import org.togglz.console.RequestHandlerBase;
import org.togglz.servlet.spi.CSRFToken;
import ... | cwe | CWE-352 | Java |
/* vi:set ts=8 sts=4 sw=4 noet:
*
* VIM - Vi IMproved by Bram Moolenaar
*
* Do ":help uganda" in Vim to read copying and usage conditions.
* Do ":help credits" in Vim to see a list of people who contributed.
* See README.txt for an overview of the Vim source code.
*/
#include "vim.h"
/*
* Vim originated fro... | cwe | CWE-787 | C/C++ |
static bool load_buffer(RBinFile *bf, void **bin_obj, RBuffer *buf, ut64 loadaddr, Sdb *sdb) {
QnxObj *qo = R_NEW0 (QnxObj);
if (!qo) {
return false;
}
lmf_record lrec;
lmf_resource lres;
lmf_data ldata;
ut64 offset = QNX_RECORD_SIZE;
RList *sections = NULL;
RList *fixups = NULL;
if (!qo) {
goto beach;
... | cwe | CWE-400 | C/C++ |
package com.salesmanager.shop.filter;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletReq... | cwe | CWE-79 | Java |
/*
* QEMU model of SUN GEM ethernet controller
*
* As found in Apple ASICs among others
*
* Copyright 2016 Ben Herrenschmidt
* Copyright 2017 Mark Cave-Ayland
*/
#include "qemu/osdep.h"
#include "hw/pci/pci.h"
#include "hw/qdev-properties.h"
#include "migration/vmstate.h"
#include "qemu/log.h"
#include "qemu/mo... | cwe | CWE-835 | C/C++ |
lldp_mgmt_addr_tlv_print(netdissect_options *ndo,
const u_char *pptr, u_int len)
{
uint8_t mgmt_addr_len, intf_num_subtype, oid_len;
const u_char *tptr;
u_int tlen;
char *mgmt_addr;
tlen = len;
tptr = pptr;
if (tlen < 1) {
return 0;
}
mgmt_addr_len ... | cwe | CWE-125 | C/C++ |
export default function semverRegex() {
return /(?<=^v?|\sv?)(?:(?:0|[1-9]\d*)\.){2}(?:0|[1-9]\d*)(?:-(?:0|[1-9]\d*|[\da-z-]*[a-z-][\da-z-]*)(?:\.(?:0|[1-9]\d*|[\da-z-]*[a-z-][\da-z-]*))*)?(?:\+[\da-z-]+(?:\.[\da-z-]+)*)?\b/gi;
} | cwe | CWE-1333 | JavaScript |
ks_http_fetch (ctrl_t ctrl, const char *url, unsigned int flags,
estream_t *r_fp)
{
gpg_error_t err;
http_session_t session = NULL;
unsigned int session_flags;
http_t http = NULL;
int redirects_left = MAX_REDIRECTS;
estream_t fp = NULL;
char *request_buffer = NULL;
parsed_uri_t uri = NULL... | cwe | CWE-352 | Unknown |
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <limits.h>
#include <stdint.h>
#ifndef JSI_AMALGAMATION
#include "jsiInt.h"
#endif
#define REBUILD_MULTIPLIER 3
#if JSI_IS64BIT
#define RANDOM_INDEX HashOneWord
#define DOWNSHIFT_START 62
#else
#define RANDOM_INDEX(tablePtr, i) \
(((... | cwe | CWE-120 | C/C++ |
/*!
Copyright (c) REBUILD <https://getrebuild.com/> and/or its owners. All rights reserved.
rebuild is dual-licensed under commercial and open source licenses (GPLv3).
See LICENSE and COMMERCIAL in the project root for license information.
*/
/* eslint-disable react/no-string-refs */
const wpc = window.__PageConfig
... | cwe | CWE-89 | Java |
ExtensionsGuestViewMessageFilter::FrameNavigationHelper::FrameNavigationHelper(
RenderFrameHost* plugin_rfh,
int32_t guest_instance_id,
int32_t element_instance_id,
bool is_full_page_plugin,
ExtensionsGuestViewMessageFilter* filter)
: content::WebContentsObserver(
content::WebContents:... | cwe | CWE-787 | C/C++ |
static u_char *php_parserr(u_char *cp, querybuf *answer, int type_to_fetch, int store, int raw, zval **subarray)
{
u_short type, class, dlen;
u_long ttl;
long n, i;
u_short s;
u_char *tp, *p;
char name[MAXHOSTNAMELEN];
int have_v6_break = 0, in_v6_break = 0;
*subarray = NULL;
n = dn_expand(answer->qb2,... | cwe | CWE-119 | C/C++ |
/*
* GPAC - Multimedia Framework C SDK
*
* Author: Romain Bouqueau, Jean Le Feuvre
* Copyright (c) Romain Bouqueau 2012- Telecom Paris 2019-
* All rights reserved
*
* Note: this development was kindly sponsorized by Vizion'R (http://vizionr.com)
*
* This file is part of GPAC / ISO Media File... | cwe | CWE-401 | C/C++ |
amstar_restore(
application_argument_t *argument)
{
char *cmd;
GPtrArray *argv_ptr = g_ptr_array_new();
char **env;
int j;
char *e;
if (!star_path) {
error(_("STAR-PATH not defined"));
}
if (!check_exec_for_suid(star_path, FALSE)) {
error("'%s' binary is ... | cwe | CWE-264 | Unknown |
/**
* This file is part of alf.io.
*
* alf.io 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.
*
* alf.io is distributed in the ... | cwe | CWE-79 | Java |
/*
* 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-203 | Java |
onBannerChange (input: HTMLInputElement) {
this.bannerfileInput = new ElementRef(input)
const bannerfile = this.bannerfileInput.nativeElement.files[0]
if (bannerfile.size > this.maxBannerSize) {
this.notifier.error('Error', $localize`This image is too large.`)
return
}
const formData =... | cwe | CWE-79 | JavaScript |
const idrErr = require('../../utils/error')
class OrgControllerError extends idrErr.IDRError {
orgDneParam (shortname) { // org
const err = {}
err.error = 'ORG_DNE_PARAM'
err.message = `The '${shortname}' organization designated by the shortname parameter does not exist.`
return err
}
userDne (u... | cwe | CWE-732 | JavaScript |
function ame_ajax_set_commentstatus( postid, status, posttype ) {
var ame_sack = new sack( ajaxurl );
ame_sack.execute = 1;
ame_sack.method = 'POST';
ame_sack.setVar( "action", "ame_ajax_set_commentstatus" );
ame_sack.setVar( "postid", postid );
ame_sack.setVar( "comment_status", status );
ame_sack.setVar( "post... | cwe | CWE-352 | JavaScript |
/*
+--------------------------------------------------------------------+
| PECL :: http |
+--------------------------------------------------------------------+
| Redistribution and use in source and binary forms, with or without |
| modificatio... | cwe | CWE-119 | C/C++ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.