code stringlengths 10 33.4M | task stringclasses 2
values | label stringclasses 121
values | language stringclasses 13
values |
|---|---|---|---|
/**
* Copyright (c) 2006-2017, JGraph Ltd
* Copyright (c) 2006-2017, Gaudenz Alder
*/
TrelloClient = function(editorUi)
{
DrawioClient.call(this, editorUi, 'tauth');
Trello.setKey(this.key);
};
// Extends DrawioClient
mxUtils.extend(TrelloClient, DrawioClient);
TrelloClient.prototype.key = (window.location.hostn... | cwe | CWE-79 | JavaScript |
inline void skip(int bytes) {
while (bytes > 0) {
int n = check(1, bytes);
ptr += n;
bytes -= n;
}
} | cwe | CWE-787 | C/C++ |
static int ahci_populate_sglist(AHCIDevice *ad, QEMUSGList *sglist, int offset)
{
AHCICmdHdr *cmd = ad->cur_cmd;
uint32_t opts = le32_to_cpu(cmd->opts);
int sglist_alloc_hint = opts >> AHCI_CMD_HDR_PRDT_LEN;
dma_addr_t prdt_len = (sglist_alloc_hint * sizeof(AHCI_SG));
dma_addr_t real_prdt_len = p... | cwe | CWE-399 | C/C++ |
/*
* linux/fs/hfsplus/posix_acl.c
*
* Vyacheslav Dubeyko <slava@dubeyko.com>
*
* Handler for Posix Access Control Lists (ACLs) support.
*/
#include "hfsplus_fs.h"
#include "xattr.h"
#include "acl.h"
struct posix_acl *hfsplus_get_posix_acl(struct inode *inode, int type)
{
struct posix_acl *acl;
char *xattr_nam... | cwe | CWE-285 | C/C++ |
/*****************************************************************
|
| AP4 - sample entries
|
| Copyright 2002-2008 Axiomatic Systems, LLC
|
|
| This file is part of Bento4/AP4 (MP4 Atom Processing Library).
|
| Unless you have obtained Bento4 under a difference license,
| this version of Bento4 is Bento... | cwe | CWE-119 | C/C++ |
/**
* $Id: ProxyServlet.java,v 1.4 2013/12/13 13:18:11 david Exp $
* Copyright (c) 2011-2012, JGraph Ltd
*/
package com.mxgraph.online;
import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.... | cwe | CWE-284 | Java |
function handleWhiteboardAnnotations({ header, body }, meetingId) {
check(header, Object);
if (header.userId !== 'nodeJSapp') { return false; }
check(meetingId, String);
check(body, Object);
const { annotations, whiteboardId, multiUser } = body;
check(annotations, Array);
check(whiteboardId, String);
... | cwe | CWE-918 | JavaScript |
void TabletModeWindowManager::Init() {
{
ScopedObserveWindowAnimation scoped_observe(GetTopWindow(), this,
/*exiting_tablet_mode=*/false);
ArrangeWindowsForTabletMode();
}
AddWindowCreationObservers();
display::Screen::GetScreen()->AddObserver(this);
Sh... | cwe | CWE-362 | C/C++ |
/*
* Ultra Wide Band
* Neighborhood Management Daemon
*
* Copyright (C) 2005-2006 Intel Corporation
* Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version
* 2 as published by... | cwe | CWE-119 | C/C++ |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | cwe | CWE-863 | Java |
function l(){var b,c,d,e,f,h,i,k;if(Bc++,b=vc,c=m(),c!==X){for(d=[],e=S();e!==X;)d.push(e),e=S();d!==X?(e=O(),e!==X?(f=j(),f!==X?(h=q(),h!==X?(i=n(),i===X&&(i=ba),i!==X?(wc=vc,k=ca(c,f,h,i),k=k?da:aa,k!==X?(wc=b,c=ea(c,f,h,i),b=c):(vc=b,b=aa)):(vc=b,b=aa)):(vc=b,b=aa)):(vc=b,b=aa)):(vc=b,b=aa)):(vc=b,b=aa)}else vc=b,b=... | cwe | CWE-1321 | JavaScript |
function get_quick_search_results_no_cache($q, $options)
{
global $conf;
$q = trim(stripslashes($q));
$search_results =
array(
'items' => array(),
'qs' => array('q'=>$q),
);
$q = trigger_change('qsearch_pre', $q);
$scopes = array();
$scopes[] = new QSearchScope('tag', array('tags'));
... | cwe | CWE-79 | PHP |
static int on_part_data(
multipart_parser *parser, const char *at, size_t length)
{
multipart_parser_data_t *data = NULL;
ogs_assert(parser);
data = multipart_parser_get_data(parser);
ogs_assert(data);
if (at && length) {
SWITCH(data->part[data->num_of_part].content_type)
C... | cwe | CWE-787 | Unknown |
Simditor.prototype.setValue = function(val) {
this.hidePopover();
this.textarea.val(val);
this.body.get(0).innerHTML = val;
this.formatter.format();
this.formatter.decorate();
this.util.reflow(this.body);
this.inputManager.lastCaretPosition = null;
return this.trigger('valuechanged');
... | cwe | CWE-79 | JavaScript |
/*
* Copyright 2021 ThoughtWorks, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | cwe | CWE-79 | Java |
OJPEGReadHeaderInfoSecTablesQTable(TIFF* tif)
{
static const char module[]="OJPEGReadHeaderInfoSecTablesQTable";
OJPEGState* sp=(OJPEGState*)tif->tif_data;
uint8 m;
uint8 n;
uint32 oa;
uint8* ob;
uint32 p;
if (sp->qtable_offset[0]==0)
{
TIFFErrorExt(tif->tif_clientdata,module,"Missing JPEG tables");
return... | cwe | CWE-772 | Unknown |
initialize(container) {
this.chatService = container.lookup("service:chat");
if (!this.chatService.userCanChat) {
return;
}
withPluginApi("1.3.0", (api) => {
const currentUser = api.getCurrentUser();
const hasPublicChannels =
currentUser?.chat_channels?.public_channels?.lengt... | cwe | CWE-79 | JavaScript |
package keeper
import (
"context"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/x/authz"
)
var _ authz.MsgServer = Keeper{}
// GrantAuthorization implements the MsgServer.Grant method.
func (k Keeper) Grant(goCtx context.Context, msg... | cwe | CWE-754 | Go |
function(){g({message:JSON.parse(n.result).Message})},n.readAsText(L.response))}catch(y){g({})}});L.send(v)}else try{this.doImportVisio(c,e,g,k)}catch(M){g(M)}}else this.spinner.stop(),this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportVisio||this.loadingExtensions||this.isOffline... | cwe | CWE-20 | JavaScript |
zipx_lzma_alone_init(struct archive_read *a, struct zip *zip)
{
lzma_ret r;
const uint8_t* p;
#pragma pack(push)
#pragma pack(1)
struct _alone_header {
uint8_t bytes[5];
uint64_t uncompressed_size;
} alone_header;
#pragma pack(pop)
if(zip->zipx_lzma_valid) {
lzma_end(&zip->zipx_lzma_stream);
zip->z... | cwe | CWE-703 | C/C++ |
#include "LogHandler.hpp"
INITIALIZE_EASYLOGGINGPP
namespace et {
el::Configurations LogHandler::setupLogHandler(int *argc, char ***argv) {
// easylogging parse verbose arguments, see [Application Arguments]
// in https://github.com/muflihun/easyloggingpp/blob/master/README.md
START_EASYLOGGINGPP(*argc, *argv);... | cwe | CWE-120 | C/C++ |
MagickExport MagickBooleanType PasskeyDecipherImage(Image *image,
const StringInfo *passkey,ExceptionInfo *exception)
{
assert(image != (Image *) NULL);
assert(image->signature == MagickCoreSignature);
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);... | cwe | CWE-369 | Unknown |
l2tp_proxy_auth_type_print(netdissect_options *ndo, const u_char *dat)
{
const uint16_t *ptr = (const uint16_t *)dat;
ND_PRINT((ndo, "%s", tok2str(l2tp_authentype2str,
"AuthType-#%u", EXTRACT_16BITS(ptr))));
} | cwe | CWE-125 | C/C++ |
check_compat_entry_size_and_hooks(struct compat_arpt_entry *e,
struct xt_table_info *newinfo,
unsigned int *size,
const unsigned char *base,
const unsigned char *limit,
const unsigned int *hook_entries,
const unsigned int *underflows,
const char *name)
{
struct xt_entry_target... | cwe | CWE-264 | Unknown |
$scope.deleteNode = function(node) {
bootbox.confirm('Are you sure you want to remove the node ' + node.nodeLabel + '?', function(ok) {
if (ok) {
RequisitionsService.startTiming();
RequisitionsService.deleteNode(node).then(
function() { // success
var index = ... | cwe | CWE-79 | JavaScript |
NamespaceString IDLParserErrorContext::parseNSCollectionRequired(StringData dbName,
const BSONElement& element) {
uassert(ErrorCodes::BadValue,
str::stream() << "collection name has invalid type " << typeName(element.type()),
e... | cwe | CWE-20 | Unknown |
chrand_principal_2_svc(chrand_arg *arg, struct svc_req *rqstp)
{
static chrand_ret ret;
krb5_keyblock *k;
int nkeys;
char *prime_arg, *funcname;
gss_buffer_desc client_name,
service_name;
OM_uint32 ... | cwe | CWE-772 | C/C++ |
require('../services/Requisitions');
import Util from 'lib/util';
const QuickNode = require('../model/QuickNode');
/**
* @author Alejandro Galue <agalue@opennms.org>
* @copyright 2014 The OpenNMS Group, Inc.
*/
(function() {
'use strict';
const quickAddPanelBasicView = require('../../views/quick-add-panel-basi... | cwe | CWE-79 | Java |
bool CanCommitURL(const GURL& url) {
SchemeMap::const_iterator judgment(scheme_policy_.find(url.scheme()));
if (judgment != scheme_policy_.end())
return judgment->second;
if (url.SchemeIs(url::kFileScheme)) {
base::FilePath path;
if (net::FileURLToFilePath(url, &path))
return Con... | cwe | CWE-264 | C/C++ |
"none"};var Fa=function(){pa.innerHTML="";if(null!=F.currentPage){mxUtils.write(pa,F.currentPage.getName());var aa=null!=F.pages?F.pages.length:1,ca=F.getPageIndex(F.currentPage);ca=null!=ca?ca+1:1;var na=F.currentPage.getId();pa.setAttribute("title",F.currentPage.getName()+" ("+ca+"/"+aa+")"+(null!=na?" ["+na+"]":""))... | cwe | CWE-94 | JavaScript |
private JiffleRuntime createRuntimeInstance(RuntimeModel model, Class<? extends JiffleRuntime> runtimeClass, boolean scriptInDocs) throws
it.geosolutions.jaiext.jiffle.JiffleException {
if (!isCompiled()) {
throw new it.geosolutions.jaiext.jiffle.JiffleException("The script ... | cwe | CWE-94 | Java |
static VALUE cState_indent_set(VALUE self, VALUE indent)
{
unsigned long len;
GET_STATE(self);
Check_Type(indent, T_STRING);
len = RSTRING_LEN(indent);
if (len == 0) {
if (state->indent) {
ruby_xfree(state->indent);
state->indent = NULL;
state->indent_len ... | cwe | CWE-787 | Unknown |
static int proc_sys_readdir(struct file *file, struct dir_context *ctx)
{
struct ctl_table_header *head = grab_header(file_inode(file));
struct ctl_table_header *h = NULL;
struct ctl_table *entry;
struct ctl_dir *ctl_dir;
unsigned long pos;
if (IS_ERR(head))
return PTR_ERR(head);
ctl_dir = container_of(head,... | cwe | CWE-399 | C/C++ |
rsa_decrypt(const struct rsa_private_key *key,
size_t *length, uint8_t *message,
const mpz_t gibberish)
{
mpz_t m;
int res;
mpz_init(m);
rsa_compute_root(key, m, gibberish);
res = pkcs1_decrypt (key->size, m, length, message);
mpz_clear(m);
return res;
} | cwe | CWE-20 | Unknown |
static MagickBooleanType TIFFGetProfiles(TIFF *tiff,Image *image,
ExceptionInfo *exception)
{
MagickBooleanType
status;
uint32
length = 0;
unsigned char
*profile = (unsigned char *) NULL;
status=MagickTrue;
#if defined(TIFFTAG_ICCPROFILE)
if ((TIFFGetField(tiff,TIFFTAG_ICCPROFILE,&length,&pro... | cwe | CWE-125 | C/C++ |
IW_IMPL(unsigned int) iw_get_ui32le(const iw_byte *b)
{
return b[0] | (b[1]<<8) | (b[2]<<16) | (b[3]<<24);
} | cwe | CWE-682 | C/C++ |
static void ok_jpg_decode2(ok_jpg_decoder *decoder) {
ok_jpg *jpg = decoder->jpg;
// Read header
uint8_t jpg_header[2];
if (!ok_read(decoder, jpg_header, 2)) {
return;
}
if (jpg_header[0] != 0xFF || jpg_header[1] != 0xD8) {
ok_jpg_error(jpg, OK_JPG_ERROR_INVALID, "Invalid signat... | cwe | CWE-787 | Unknown |
foreach($return as $index => $value) {
if(! is_string($value))
$return[$index] = $defaultvalue;
elseif($addslashes)
$return[$index] = addslashes($value);
} | cwe | CWE-264 | PHP |
def update
return unless access_granted?(params[:id])
id = params[:article][:id] || params[:id]
@article = Article.find(id)
if params[:article][:draft]
fetch_fresh_or_existing_draft_for_article
else
@article = Article.find(@article.parent_id) unless @article.parent_id.nil?
end
... | cwe | CWE-639 | Ruby |
public function doUpdates($current_version = null) {
if ($current_version === null) {
if ($this->version === null) {
throw new \RuntimeException('Cannot process updates without any version specified!');
}
$current_version = $this->version;
}
$DB = $this->DB;
... | cwe | CWE-798 | PHP |
'use strict';
// add default escape function for escaping HTML entities
const escapeCharMap = Object.freeze({
'&': '&',
'<': '<',
'>': '>',
'"': '"',
"'": ''',
'`': '`',
'=': '=',
});
function replaceChar(c) {
return escapeCharMap[c];
}
const escapeChars = /[&<>"'`=]/g;
const HT... | cwe | CWE-338 | JavaScript |
int TLSInStream::overrun(int itemSize, int nItems, bool wait)
{
if (itemSize > bufSize)
throw Exception("TLSInStream overrun: max itemSize exceeded");
if (end - ptr != 0)
memmove(start, ptr, end - ptr);
offset += ptr - start;
end -= ptr - start;
ptr = start;
while (end < start + itemSize) {
i... | cwe | CWE-122 | C/C++ |
static struct sock *tcp_v6_syn_recv_sock(const struct sock *sk, struct sk_buff *skb,
struct request_sock *req,
struct dst_entry *dst,
struct request_sock *req_unhash,
bool *own_req)
{
struct inet_request_sock *ireq;
struct ipv6_pinfo *newnp;
const struct ipv6_pinfo *np = inet6_sk(sk);
struct... | cwe | CWE-264 | C/C++ |
libvirt_vmessage(xentoollog_logger *logger_in,
xentoollog_level level,
int errnoval,
const char *context,
const char *format,
va_list args)
{
xentoollog_logger_libvirt *lg = (xentoollog_logger_libvirt *)logger_in;
FILE *logFile... | cwe | CWE-667 | Unknown |
parse_key_usage (PKT_signature * sig)
{
int key_usage = 0;
const byte *p;
size_t n;
byte flags;
p = parse_sig_subpkt (sig->hashed, SIGSUBPKT_KEY_FLAGS, &n);
if (p && n)
{
/* First octet of the keyflags. */
flags = *p;
if (flags & 1)
{
key_usage |= PUBKEY_USAGE_CERT;
flags &= ... | cwe | CWE-310 | Unknown |
function signUp(id) {
const m = read(getEntity, 'lock', id);
const fields = ['email', 'password'];
// Skip the username validation if signUpHideUsernameField option is enabled.
// We will generate a random username to avoid name collusion before we make the signup API call.
if (databaseConnectionRequiresUser... | cwe | CWE-79 | JavaScript |
package za.org.grassroot.integration.authentication;
import org.springframework.http.HttpHeaders;
import za.org.grassroot.integration.PublicCredentials;
import java.util.List;
/**
* Created by luke on 2017/05/22.
*/
public interface JwtService {
String USER_UID_KEY = "USER_UID";
String SYSTEM_ROLE_KEY = "... | cwe | CWE-347 | Java |
long ContentEncoding::ParseContentEncodingEntry(long long start, long long size,
IMkvReader* pReader) {
assert(pReader);
long long pos = start;
const long long stop = start + size;
int compression_count = 0;
int encryption_count = 0;
while (pos < stop) {
long long id, size;
const long status = ParseElement... | cwe | CWE-20 | C/C++ |
def get_user(self):
if not hasattr(self, '_user'):
qs = "select * from account_access where access_token = '%s'" % self.access_token
result = self.db.get(qs)
if result:
self._user = result
else:
self._user = None
re... | cwe | CWE-89 | Python |
public static function upload_user_avatar() {
$file = $_FILES['lp-upload-avatar'];
$upload_dir = learn_press_user_profile_picture_upload_dir();
add_filter( 'upload_dir', array( __CLASS__, '_user_avatar_upload_dir' ), 10000 );
$result = wp_handle_upload(
$file,
array(
'test_form' => fals... | cwe | CWE-327 | PHP |
uint64_t winsdb_set_maxVersion(struct winsdb_handle *h, uint64_t newMaxVersion)
{
int trans;
int ret;
struct ldb_dn *dn;
struct ldb_result *res = NULL;
struct ldb_message *msg = NULL;
struct ldb_context *wins_db = h->ldb;
TALLOC_CTX *tmp_ctx = talloc_new(wins_db);
uint64_t oldMaxVersion = 0;
trans = ldb_trans... | cwe | CWE-200 | Unknown |
decompileAction(int n, SWF_ACTION *actions, int maxn)
{
if( n > maxn ) SWF_error("Action overflow!!");
#ifdef DEBUG
fprintf(stderr,"%d:\tACTION[%3.3d]: %s\n",
actions[n].SWF_ACTIONRECORD.Offset, n,
actionName(actions[n].SWF_ACTIONRECORD.ActionCode));
#endif
switch(actions[n].SWF_ACTIONRECORD.Act... | cwe | CWE-125 | Unknown |
xmlParseChunk(xmlParserCtxtPtr ctxt, const char *chunk, int size,
int terminate) {
int end_in_lf = 0;
int remain = 0;
size_t old_avail = 0;
size_t avail = 0;
if (ctxt == NULL)
return(XML_ERR_INTERNAL_ERROR);
if ((ctxt->errNo != XML_ERR_OK) && (ctxt->disableSAX == 1))
... | cwe | CWE-119 | Unknown |
void MACH0_(iterate_chained_fixups)(struct MACH0_(obj_t) *bin, ut64 limit_start, ut64 limit_end, ut32 event_mask, RFixupCallback callback, void * context) {
int i = 0;
for (; i < bin->nsegs && i < bin->segs_count; i++) {
if (!bin->chained_starts[i]) {
continue;
}
int page_size = bin->chained_starts[i]->page_... | cwe | CWE-476 | C/C++ |
const pkgConfigPath = function () {
if (process.platform !== 'win32') {
const brewPkgConfigPath = spawnSync('which brew >/dev/null 2>&1 && eval $(brew --env) && echo $PKG_CONFIG_LIBDIR', spawnSyncOptions).stdout || '';
return [
brewPkgConfigPath.trim(),
env.PKG_CONFIG_PATH,
'/usr/local/lib/p... | cwe | CWE-78 | JavaScript |
static inline int __tcp_mtu_to_mss(struct sock *sk, int pmtu)
{
const struct tcp_sock *tp = tcp_sk(sk);
const struct inet_connection_sock *icsk = inet_csk(sk);
int mss_now;
/* Calculate base mss without TCP options:
It is MMS_S - sizeof(tcphdr) of rfc1122
*/
mss_now = pmtu - icsk->icsk_af_ops->net_header_le... | cwe | CWE-190 | Unknown |
# transition module to convert from new types to old types
import vyper.codegen.types as old
import vyper.semantics.types as new
from vyper.exceptions import InvalidType
def new_type_to_old_type(typ: new.BasePrimitive) -> old.NodeType:
if isinstance(typ, new.BoolDefinition):
return old.BaseType("bool")
... | cwe | CWE-120 | Python |
static int update_remove_entry(struct libmnt_update *upd, struct libmnt_lock *lc)
{
struct libmnt_table *tb;
int rc = 0, u_lc = -1;
assert(upd);
assert(upd->target);
DBG(UPDATE, mnt_debug_h(upd, "%s: remove entry", upd->filename));
if (lc)
mnt_lock_file(lc);
else if (upd->userspace_only)
u_lc = utab_lock(... | cwe | CWE-399 | Unknown |
/*
* Copyright(c) 2015-2020 Intel Corporation.
*
* This file is provided under a dual BSD/GPLv2 license. When using or
* redistributing this file, you may do so under either license.
*
* GPL LICENSE SUMMARY
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of versio... | cwe | CWE-416 | C/C++ |
static int reencrypt_keyslot_update(struct crypt_device *cd,
const struct luks2_reencrypt *rh)
{
json_object *jobj_keyslot, *jobj_area, *jobj_area_type;
struct luks2_hdr *hdr;
if (!(hdr = crypt_get_hdr(cd, CRYPT_LUKS2)))
return -EINVAL;
jobj_keyslot = LUKS2_get_keyslot_jobj(hdr, rh->reenc_keyslot);
if (!jobj_... | cwe | CWE-345 | Unknown |
/*
* This file is part of the Goobi viewer - a content presentation and management
* application for digitized objects.
*
* Visit these websites for more information.
* - http://www.intranda.com
* - http://digiverso.com
*
* This program is free software; you can redistribute it and/or modify i... | cwe | CWE-79 | Java |
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% ... | cwe | CWE-122 | C/C++ |
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | cwe | CWE-74 | Python |
unsigned long insn_get_seg_base(struct pt_regs *regs, int seg_reg_idx)
{
struct desc_struct *desc;
short sel;
sel = get_segment_selector(regs, seg_reg_idx);
if (sel < 0)
return -1L;
if (v8086_mode(regs))
/*
* Base is simply the segment selector shifted 4
* bits to the right.
*/
return (unsigned lo... | cwe | CWE-362 | Unknown |
package com.salesmanager.shop.admin.model.orders;
import com.salesmanager.core.model.common.Billing;
import com.salesmanager.core.model.common.Delivery;
import com.salesmanager.core.model.order.orderstatus.OrderStatus;
import javax.persistence.Embedded;
import java.io.Serializable;
import java.util.Arrays;
import jav... | cwe | CWE-639 | Java |
SYSCALL_DEFINE2(timerfd_create, int, clockid, int, flags)
{
int ufd;
struct timerfd_ctx *ctx;
/* Check the TFD_* constants for consistency. */
BUILD_BUG_ON(TFD_CLOEXEC != O_CLOEXEC);
BUILD_BUG_ON(TFD_NONBLOCK != O_NONBLOCK);
if ((flags & ~TFD_CREATE_FLAGS) ||
(clockid != CLOCK_MONOTONIC &&
clockid !... | cwe | CWE-416 | Unknown |
static int dprintf_formatf(
void *data, /* untouched by format(), just sent to the stream() function in
the second argument */
/* function pointer called for each output character */
int (*stream)(int, FILE *),
const char *format, /* %-formatted string */
va_list ap_save) /* list of parame... | cwe | CWE-119 | C/C++ |
/*************************************************************************
This project implements a complete(!) JPEG (Recommendation ITU-T
T.81 | ISO/IEC 10918-1) codec, plus a library that can be used to
encode and decode JPEG streams.
It also implements ISO/IEC 18477 aka JPEG XT which is an extensi... | cwe | CWE-617 | C/C++ |
apr_status_t ap_http_filter(ap_filter_t *f, apr_bucket_brigade *b,
ap_input_mode_t mode, apr_read_type_e block, apr_off_t readbytes)
{
core_server_config *conf;
apr_bucket *e;
http_ctx_t *ctx = f->ctx;
apr_status_t rv;
apr_off_t totalread;
int again;
conf = (core_server_config *)
... | cwe | CWE-17 | C/C++ |
/*
* HTTP protocol for ffmpeg client
* Copyright (c) 2000, 2001 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 ... | cwe | CWE-119 | C/C++ |
static NTSTATUS setInfoTrustedDomain_base(struct dcesrv_call_state *dce_call,
struct lsa_policy_state *p_state,
TALLOC_CTX *mem_ctx,
struct ldb_message *dom_msg,
enum lsa_TrustDomInfoEnum level,
union lsa_TrustedDomainInfo *info)
{
uint32_t *posix_offset = NULL;
struct lsa_TrustDoma... | cwe | CWE-200 | Unknown |
package io.hawt.system;
import java.util.Arrays;
import java.util.Objects;
import java.util.function.Function;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.servlet.ServletContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Co... | cwe | CWE-918 | Java |
package com.salesmanager.shop.admin.controller.payments;
import com.salesmanager.core.business.modules.integration.IntegrationException;
import com.salesmanager.core.business.services.payments.PaymentService;
import com.salesmanager.core.model.merchant.MerchantStore;
import com.salesmanager.core.model.payments.Transac... | cwe | CWE-79 | Java |
bus_server_init (void)
{
GError *error = NULL;
dbus = bus_dbus_impl_get_default ();
ibus = bus_ibus_impl_get_default ();
bus_dbus_impl_register_object (dbus, (IBusService *)ibus);
/* init server */
GDBusServerFlags flags = G_DBUS_SERVER_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS;
gchar *guid = g... | cwe | CWE-862 | Unknown |
static inline ut32 r_read_at_le32(const void *src, size_t offset) {
const ut8 *s = (const ut8*)src + offset;
return r_read_le32 (s);
} | cwe | CWE-476 | Unknown |
/* package identityHandlers provides a collection of handlers for target systems,
these handlers create accounts and sso tokens */
package identityHandlers
import (
"fmt"
logger "github.com/TykTechnologies/tyk-identity-broker/log"
"github.com/TykTechnologies/tyk-identity-broker/tap"
"github.com/sirupsen/logrus"
"... | cwe | CWE-287 | Go |
static int cmd_starttls_start(struct smtp_server_connection *conn)
{
const struct smtp_server_callbacks *callbacks = conn->callbacks;
e_debug(conn->event, "Starting TLS");
if (callbacks != NULL && callbacks->conn_start_tls != NULL) {
struct smtp_server_connection *tmp_conn = conn;
struct istream *input = conn-... | cwe | CWE-77 | Unknown |
static void record_init(node_t * n)
{
field_t *info;
pointf ul, sz;
int flip, len;
char *textbuf; /* temp buffer for storing labels */
int sides = BOTTOM | RIGHT | TOP | LEFT;
/* Always use rankdir to determine how records are laid out */
flip = NOT(GD_realflip(agraphof(n)));
reclblp =... | cwe | CWE-120 | Unknown |
EC_GROUP *EC_GROUP_new_from_ecparameters(const ECPARAMETERS *params)
{
int ok = 0, tmp;
EC_GROUP *ret = NULL, *dup = NULL;
BIGNUM *p = NULL, *a = NULL, *b = NULL;
EC_POINT *point = NULL;
long field_bits;
int curve_name = NID_undef;
BN_CTX *ctx = NULL;
if (!params->fieldID || !params->fi... | cwe | CWE-125 | Unknown |
import os
from shutil import ExecError
import time
import re
import logging
import uuid
from lxml.html.clean import clean_html
import pypandoc
import knowledge_graph
import random
import string
from flask import Flask, render_template, request, redirect, url_for, send_from_directory, make_response
from werkzeug.utils ... | cwe | CWE-22 | Python |
# Natural Language Toolkit: Transformation-based learning
#
# Copyright (C) 2001-2013 NLTK Project
# Author: Marcus Uneson <marcus.uneson@gmail.com>
# based on previous (nltk2) version by
# Christopher Maloof, Edward Loper, Steven Bird
# URL: <https://www.nltk.org/>
# For license information, see LICENSE.TXT
impo... | cwe | CWE-1333 | Python |
protected void handleResponse(HttpRequest<?> request, MutableHttpResponse<?> response) {
HttpHeaders headers = request.getHeaders();
Optional<String> originHeader = headers.getOrigin();
originHeader.ifPresent(requestOrigin -> {
Optional<CorsOriginConfiguration> optionalConfig = getC... | cwe | CWE-400 | Java |
setCustomMarker(title, editable) {
const marker = document.createElement('div');
marker.className = `vis-custom-time-marker`;
marker.innerHTML = title;
marker.style.position = 'absolute';
if (editable) {
marker.setAttribute('contenteditable', 'true');
marker.addEventListener('pointerdow... | cwe | CWE-79 | JavaScript |
package handlers
import (
"net/http"
"strconv"
"strings"
)
// CORSOption represents a functional option for configuring the CORS middleware.
type CORSOption func(*cors) error
type cors struct {
h http.Handler
allowedHeaders []string
allowedMethods []string
allowedOrigins ... | cwe | CWE-346 | Go |
ecc_decrypt_raw (gcry_sexp_t *r_plain, gcry_sexp_t s_data, gcry_sexp_t keyparms)
{
unsigned int nbits;
gpg_err_code_t rc;
struct pk_encoding_ctx ctx;
gcry_sexp_t l1 = NULL;
gcry_mpi_t data_e = NULL;
ECC_secret_key sk;
gcry_mpi_t mpi_g = NULL;
char *curvename = NULL;
mpi_ec_t ec = NULL;
mpi_point_str... | cwe | CWE-200 | C/C++ |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may n... | cwe | CWE-732 | Java |
static void coroutine_fn mirror_wait_on_conflicts(MirrorOp *self,
MirrorBlockJob *s,
uint64_t offset,
uint64_t bytes)
{
uint64_t self_start_chunk = offset / s->granul... | cwe | CWE-476 | C/C++ |
static void pdf_handle_enc(struct pdf_struct *pdf)
{
struct pdf_obj *obj;
uint32_t len, required_flags, n, R, P, length, EM, i, oulen;
char *O, *U;
const char *q, *q2;
if (pdf->enc_objid == ~0u)
return;
if (!pdf->fileID) {
cli_dbgmsg("cli_pdf: pdf_handle_enc no file ID\n");
return;
}
... | cwe | CWE-79 | Unknown |
static int crypto_rng_init_tfm(struct crypto_tfm *tfm)
{
struct crypto_rng *rng = __crypto_rng_cast(tfm);
struct rng_alg *alg = crypto_rng_alg(rng);
struct old_rng_alg *oalg = crypto_old_rng_alg(rng);
if (oalg->rng_make_random) {
rng->generate = generate;
rng->seed = rngapi_reset;
rng->seedsize = oalg->seeds... | cwe | CWE-476 | Unknown |
'use strict';
const path = require('path');
const execa = require('execa');
const chalk = require('chalk');
/**
* Gets the package version on npm. Will fail if the package does not exist
* @param {string} packageName - Name to look up on npm, may include a specific version
* @returns {Object}
*/
async function ge... | cwe | CWE-77 | JavaScript |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
from collections import OrderedDict
import re
from io import StringIO
from configparser import ConfigParser, NoOptionError
from .regex import URL_REGEX, HASH_REGEX
from .dependencies import DependencyFile, Dependency
from packaging.re... | cwe | CWE-400 | Python |
def get_lines(command: str) -> List[str]:
"""
Run a command and return lines of output
:param str command: the command to run
:returns: list of whitespace-stripped lines output by command
"""
stdout = get_output(command)
return [line.strip().decode() for line in stdout.splitlines()] | cwe | CWE-78 | Python |
mxTooltipHandler.prototype.reset=function(a,b,c){if(!this.ignoreTouchEvents||mxEvent.isMouseEvent(a.getEvent()))if(this.resetTimer(),c=null!=c?c:this.getStateForEvent(a),b&&this.isEnabled()&&null!=c&&(null==this.div||"hidden"==this.div.style.visibility)){var d=a.getSource(),e=a.getX(),f=a.getY(),g=a.isSource(c.shape)||... | cwe | CWE-94 | JavaScript |
return u};Graph.getFontUrl=function(u,E){u=Graph.customFontElements[u.toLowerCase()];null!=u&&(E=u.url);return E};Graph.processFontAttributes=function(u){u=u.getElementsByTagName("*");for(var E=0;E<u.length;E++){var J=u[E].getAttribute("data-font-src");if(null!=J){var T="FONT"==u[E].nodeName?u[E].getAttribute("face"):u... | cwe | CWE-20 | JavaScript |
void libxsmm_sparse_csc_reader( libxsmm_generated_code* io_generated_code,
const char* i_csc_file_in,
unsigned int** o_row_idx,
unsigned int** o_column_idx,
doubl... | cwe | CWE-295 | Unknown |
freelist (char **cpp)
{
int i;
if (cpp == NULL)
return;
for (i = 0; cpp[i] != NULL; ++i)
{
free(cpp[i]);
cpp[i] = NULL;
}
} | cwe | CWE-189 | Unknown |
int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
const ASN1_ITEM *it,
int tag, int aclass, char opt, ASN1_TLC *ctx)
{
const ASN1_TEMPLATE *tt, *errtt = NULL;
const ASN1_COMPAT_FUNCS *cf;
const ASN1_EXTERN_FUNCS *ef;
const ASN1_AUX *aux... | cwe | CWE-200 | Unknown |
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-20 | PHP |
virtual Status explain(OperationContext* opCtx,
const std::string& dbname,
const BSONObj& cmdObj,
ExplainOptions::Verbosity verbosity,
BSONObjBuilder* out) const {
const bool isExplain = true;
Loc... | cwe | CWE-20 | Unknown |
/*
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator p... | cwe | CWE-200 | Java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.