code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
// Package pomerium houses the main pomerium CLI command. // package pomerium import ( "context" "fmt" "net/http" "os" "os/signal" "syscall" envoy_service_auth_v3 "github.com/envoyproxy/go-control-plane/envoy/service/auth/v3" "github.com/rs/zerolog" "golang.org/x/sync/errgroup" "github.com/pomerium/pomeriu...
cwe
CWE-200
Go
static int gemsafe_get_cert_len(sc_card_t *card) { int r; u8 ibuf[GEMSAFE_MAX_OBJLEN]; u8 *iptr; struct sc_path path; struct sc_file *file; size_t objlen, certlen; unsigned int ind, i=0; sc_format_path(GEMSAFE_PATH, &path); r = sc_select_file(card, &path, &file); if (r != SC_SUCCESS || !file) return SC_ER...
cwe
CWE-415
Unknown
""" Copyright 2007-2009, Red Hat, Inc and Others Michael DeHaan <michael.dehaan AT gmail> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any late...
cwe
CWE-434
Python
/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\...
cwe
CWE-415
C/C++
R_API RBinJavaAttrInfo *r_bin_java_inner_classes_attr_new(RBinJavaObj *bin, ut8 *buffer, ut64 sz, ut64 buf_offset) { RBinJavaClassesAttribute *icattr; RBinJavaAttrInfo *attr = NULL; RBinJavaCPTypeObj *obj; ut32 i = 0; ut64 offset = 0, curpos; attr = r_bin_java_default_attr_new (bin, buffer, sz, buf_offset); offs...
cwe
CWE-787
C/C++
int asn1_ex_i2c(ASN1_VALUE **pval, unsigned char *cout, int *putype, const ASN1_ITEM *it) { ASN1_BOOLEAN *tbool = NULL; ASN1_STRING *strtmp; ASN1_OBJECT *otmp; int utype; const unsigned char *cont; unsigned char c; int len; const ASN1_PRIMITIVE_FUNCS *pf; pf = it->fun...
cwe
CWE-119
Unknown
def accepts?(env) session = session env token = session[:csrf] ||= session['_csrf_token'] || random_string safe?(env) || env['HTTP_X_CSRF_TOKEN'] == token || Request.new(env).params[options[:authenticity_param]] == token end
cwe
CWE-203
Ruby
function ame_ajax_slug_save( cat_id, typenumber ) { var newslug = jQuery("input#ame_slug" + cat_id).prop('value'); if ( newslug == '' || newslug == ' ' || newslug == ' ' ) { alert( ameAjaxL10n.slugEmpty ); return; } var ame_sack = new sack( ajaxurl ); ame_sack.execute = 1; ame_sack.method = 'POST'; ame_sack...
cwe
CWE-352
JavaScript
// Package samlsp provides helpers that can be used to protect web services using SAML. package samlsp import ( "context" "crypto/rsa" "crypto/x509" "net/http" "net/url" "time" "github.com/crewjam/saml" "github.com/crewjam/saml/logger" ) // Options represents the parameters for creating a new middleware type...
cwe
CWE-287
Go
void build_ntlmssp_negotiate_blob(unsigned char *pbuffer, struct cifs_ses *ses) { NEGOTIATE_MESSAGE *sec_blob = (NEGOTIATE_MESSAGE *)pbuffer; __u32 flags; memset(pbuffer, 0, sizeof(NEGOTIATE_MESSAGE)); memcpy(sec_blob->Signature, NTLMSSP_SIGNATURE, 8); sec_blob->MessageType = NtLmNegotiate; /* BB is NTLMV...
cwe
CWE-476
Unknown
static BOOL zgfx_decompress_segment(ZGFX_CONTEXT* zgfx, wStream* stream, size_t segmentSize) { BYTE c; BYTE flags; UINT32 extra = 0; int opIndex; int haveBits; int inPrefix; UINT32 count; UINT32 distance; BYTE* pbSegment; size_t cbSegment = segmentSize - 1; if ((Stream_GetRemainingLength(stream) < segme...
cwe
CWE-119
C/C++
void RilSapSocket::sendDisconnect() { size_t encoded_size = 0; uint32_t written_size; size_t buffer_size = 0; pb_ostream_t ostream; bool success = false; RIL_SIM_SAP_DISCONNECT_REQ disconnectReq; if ((success = pb_get_encoded_size(&encoded_size, RIL_SIM_SAP_DISCONNECT_REQ_fields, &disconnectReq...
cwe
CWE-264
C/C++
package org.yaxim.androidclient.service; import java.io.File; import java.text.Collator; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.Comparator; import java.util.Date; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.uti...
cwe
CWE-346
Java
/* Copyright 2018 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-125
Python
void smp_proc_enc_info(tSMP_CB* p_cb, tSMP_INT_DATA* p_data) { uint8_t* p = p_data->p_data; SMP_TRACE_DEBUG("%s", __func__); STREAM_TO_ARRAY(p_cb->ltk, p, BT_OCTET16_LEN); smp_key_distribution(p_cb, NULL); }
cwe
CWE-125
C/C++
static int sctp_setsockopt_auto_asconf(struct sock *sk, char __user *optval, unsigned int optlen) { int val; struct sctp_sock *sp = sctp_sk(sk); if (optlen < sizeof(int)) return -EINVAL; if (get_user(val, (int __user *)optval)) return -EFAULT; if (!sctp_is_ep_boundall(sk) && val) return -EINVAL; if (...
cwe
CWE-362
C/C++
def run_query(self, query, user): query = parse_query(query) if not isinstance(query, dict): raise QueryParseError( "Query should be a YAML object describing the URL to query." ) if "url" not in query: raise QueryParseError("Query must includ...
cwe
CWE-918
Python
/** * Testing dockable windows. */ EditorUi.windowed = urlParams['windows'] != '0'; /** * Code for the minimal UI theme. */ EditorUi.initMinimalTheme = function() { // Disabled in lightbox and chromeless mode if (urlParams['lightbox'] == '1' || urlParams['chrome'] == '0' || typeof window.Format === 'undefined' |...
cwe
CWE-94
JavaScript
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { const TfLiteTensor* input = GetInput(context, node, kInputTensor); TfLiteTensor* output = GetOutput(context, node, kOutputTensor); switch (input->type) { case kTfLiteInt64: reference_ops::Negate( GetTensorShape(input), GetTensorData...
cwe
CWE-787
C/C++
GF_Err text_box_read(GF_Box *s, GF_BitStream *bs) { GF_Err e; u16 pSize; GF_TextSampleEntryBox *ptr = (GF_TextSampleEntryBox*)s; ISOM_DECREASE_SIZE(ptr, 51); e = gf_isom_base_sample_entry_read((GF_SampleEntryBox *)ptr, bs); if (e) return e; ptr->displayFlags = gf_bs_read_u32(bs); /*Display flags*/ ptr->tex...
cwe
CWE-476
Unknown
OMX_ERRORTYPE SoftG711::internalSetParameter( OMX_INDEXTYPE index, const OMX_PTR params) { switch (index) { case OMX_IndexParamAudioPcm: { OMX_AUDIO_PARAM_PCMMODETYPE *pcmParams = (OMX_AUDIO_PARAM_PCMMODETYPE *)params; if (pcmParams->nPortIndex != 0 && pcmParams-...
cwe
CWE-119
C/C++
/* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions ...
cwe
CWE-120
C/C++
/* * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Sof...
cwe
CWE-668
Java
public function __construct() { $this->headers = \App\Controller\Headers::getInstance(); if (!self::$activatedLocale && \App\Config::performance('CHANGE_LOCALE')) { \App\Language::initLocale(); self::$activatedLocale = true; } if (!self::$activatedCsrf) { if ($this->csrfActive && \App\Config::security...
cwe
CWE-352
PHP
qtdemux_tag_add_str_full (GstQTDemux * qtdemux, GstTagList * taglist, const char *tag, const char *dummy, GNode * node) { const gchar *env_vars[] = { "GST_QT_TAG_ENCODING", "GST_TAG_ENCODING", NULL }; GNode *data; char *s; int len; guint32 type; int offset; gboolean ret = TRUE; const gchar *charset ...
cwe
CWE-125
C/C++
static struct ext4_dir_entry_2 *do_split(handle_t *handle, struct inode *dir, struct buffer_head **bh,struct dx_frame *frame, struct dx_hash_info *hinfo) { unsigned blocksize = dir->i_sb->s_blocksize; unsigned count, continued; struct buffer_head *bh2; ext4_lblk_t newblock; u32 hash2; struct dx_map_entry *m...
cwe
CWE-125
C/C++
ConnectionExists(struct SessionHandle *data, struct connectdata *needle, struct connectdata **usethis, bool *force_reuse) { struct connectdata *check; struct connectdata *chosen = 0; bool canPipeline = IsPipeliningPossible(data, needle); bool wantNTLMhttp = ((d...
cwe
CWE-264
C/C++
static int dalvik_disassemble (RAsm *a, RAsmOp *op, const ut8 *buf, int len) { int vA, vB, vC, payload = 0, i = (int) buf[0]; int size = dalvik_opcodes[i].len; char str[1024], *strasm; ut64 offset; const char *flag_str; op->buf_asm[0] = 0; if (buf[0] == 0x00) { /* nop */ switch (buf[1]) { case 0x01: /* pac...
cwe
CWE-787
Unknown
int udhcpc_main(int argc UNUSED_PARAM, char **argv) { uint8_t *message; const char *str_V, *str_h, *str_F, *str_r; IF_FEATURE_UDHCPC_ARPING(const char *str_a = "2000";) IF_FEATURE_UDHCP_PORT(char *str_P;) void *clientid_mac_ptr; llist_t *list_O = NULL; llist_t *list_x = NULL; int tryagain_timeout = 20; int dis...
cwe
CWE-125
Unknown
package com.salesmanager.shop.admin.controller.content; import com.salesmanager.core.business.services.catalog.product.relationship.ProductRelationshipService; import com.salesmanager.core.business.services.content.ContentService; import com.salesmanager.core.business.services.reference.language.LanguageService; impor...
cwe
CWE-79
Java
/** * Copyright (c) 2006-2016, JGraph Ltd */ /** * No CSS and resources available in embed mode. Parameters and docs: * https://www.diagrams.net/doc/faq/embed-html-options */ GraphViewer = function(container, xmlNode, graphConfig) { this.init(container, xmlNode, graphConfig); }; // Editor inherits from mxEventSo...
cwe
CWE-79
Java
public void init() throws TemplateException { if (_velocityEngine != null) { return; } _velocityEngine = new VelocityEngine(); LiferayResourceLoader.setVelocityResourceListeners( PropsValues.VELOCITY_ENGINE_RESOURCE_LISTENERS); ExtendedProperties extendedProperties = new FastExtendedProperties(); ...
cwe
CWE-264
Java
import dayjs from 'dayjs' import { Random } from 'meteor/random' import { FlowRouter } from 'meteor/ostrio:flow-router-extra' import { t } from '../../utils/i18n.js' import './administration.html' import { Globalsettings } from '../../api/globalsettings/globalsettings' import { displayUserAvatar, validateEmail, showToa...
cwe
CWE-285
JavaScript
static void ftrace_syscall_exit(void *data, struct pt_regs *regs, long ret) { struct trace_array *tr = data; struct ftrace_event_file *ftrace_file; struct syscall_trace_exit *entry; struct syscall_metadata *sys_data; struct ring_buffer_event *event; struct ring_buffer *buffer; unsigned long irq_flags; int pc; ...
cwe
CWE-125
Unknown
void ConnectDialog::on_qaUrl_triggered() { ServerItem *si = static_cast<ServerItem *>(qtwServers->currentItem()); if (! si || si->qsUrl.isEmpty()) return; QDesktopServices::openUrl(QUrl(si->qsUrl)); }
cwe
CWE-61
Unknown
int ext4_mb_add_groupinfo(struct super_block *sb, ext4_group_t group, struct ext4_group_desc *desc) { int i; int metalen = 0; struct ext4_sb_info *sbi = EXT4_SB(sb); struct ext4_group_info **meta_group_info; struct kmem_cache *cachep = get_groupinfo_cache(sb->s_blocksize_bits); /* * First check if this gr...
cwe
CWE-416
Unknown
void LineBitmapRequester::ReconstructRegion(const RectAngle<LONG> &orgregion,const struct RectangleRequest *rr) { class ColorTrafo *ctrafo = ColorTrafoOf(false,!rr->rr_bColorTrafo); UBYTE i; if (m_bSubsampling && rr->rr_bUpsampling) { for(i = rr->rr_usFirstComponent;i <= rr->rr_usLastComponent;i++) { ...
cwe
CWE-476
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 m...
cwe
CWE-89
Java
/* * The Python Imaging Library. * $Id: //modules/pil/libImaging/TiffDecode.c#1 $ * * LibTiff-based Group3 and Group4 decoder * * * started modding to use non-private tiff functions to port to libtiff 4.x * eds 3/12/12 * */ #include "Imaging.h" #ifdef HAVE_LIBTIFF #ifndef uint #define uint uint32 #endif #...
cwe
CWE-787
Python
cwd: _pwd().toString(), env: process.env, maxBuffer: DEFAULT_MAXBUFFER_SIZE, encoding: 'utf8', }, opts); if (fs.existsSync(codeFile)) common.unlinkSync(codeFile); if (fs.existsSync(paramsFile)) common.unlinkSync(paramsFile); if (fs.existsSync(stderrFile)) common.unlinkSync(stderrFile); if (fs.exi...
cwe
CWE-78
JavaScript
void QuicClientPromisedInfo::OnPromiseHeaders(const SpdyHeaderBlock& headers) { SpdyHeaderBlock::const_iterator it = headers.find(kHttp2MethodHeader); DCHECK(it != headers.end()); if (!(it->second == "GET" || it->second == "HEAD")) { QUIC_DVLOG(1) << "Promise for stream " << id_ << " has invalid method " ...
cwe
CWE-119
C/C++
/* Copyright 2019 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License");; you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or ...
cwe
CWE-476
C/C++
static NTSTATUS smb_set_file_unix_link(connection_struct *conn, struct smb_request *req, const char *pdata, int total_data, const struct smb_filename *smb_fname) { char *link_target = NULL; const char *newname = smb_fname->base_name; NTSTATUS status = NT_STATUS_OK; TALLOC...
cwe
CWE-22
Unknown
mutateAndGetPayload: async (_args, context, mutationInfo) => { try { const { config, auth, info } = context; const viewer = await getUserFromSessionToken( config, info, mutationInfo, 'viewer.user.', true ); await usersRouter.handl...
cwe
CWE-863
JavaScript
ssize_t pcnet_receive(NetClientState *nc, const uint8_t *buf, size_t size_) { PCNetState *s = qemu_get_nic_opaque(nc); int is_padr = 0, is_bcast = 0, is_ladr = 0; uint8_t buf1[60]; int remaining; int crc_err = 0; int size = size_; if (CSR_DRX(s) || CSR_STOP(s) || CSR_SPND(s) || !size || ...
cwe
CWE-119
Unknown
handle_event_moddone(struct module_qstate* qstate, int id) { struct dns64_qstate* iq = (struct dns64_qstate*)qstate->minfo[id]; /* * In many cases we have nothing special to do. From most to least common: * * - An internal query. * - A query for a record type other than AAAA. * - CD ...
cwe
CWE-703
Unknown
/* * Functions to sequence FLUSH and FUA writes. * * Copyright (C) 2011 Max Planck Institute for Gravitational Physics * Copyright (C) 2011 Tejun Heo <tj@kernel.org> * * This file is released under the GPLv2. * * REQ_{FLUSH|FUA} requests are decomposed to sequences consisted of three * optional steps - PREFL...
cwe
CWE-264
C/C++
bool PrintRenderFrameHelper::FinalizePrintReadyDocument() { DCHECK(!is_print_ready_metafile_sent_); print_preview_context_.FinalizePrintReadyDocument(); PdfMetafileSkia* metafile = print_preview_context_.metafile(); PrintHostMsg_DidPreviewDocument_Params preview_params; if (!CopyMetafileDataToSharedMem(*...
cwe
CWE-787
C/C++
static __u8 *nci_extract_rf_params_nfcb_passive_poll(struct nci_dev *ndev, struct rf_tech_specific_params_nfcb_poll *nfcb_poll, __u8 *data) { nfcb_poll->sensb_res_len = *data++; pr_debug("sensb_res_len %d\n", nfcb_poll->sensb_res_len); memcpy(nfcb_poll->sensb_res, data, nfcb_poll->sensb_res_len); da...
cwe
CWE-119
C/C++
static int readContigStripsIntoBuffer (TIFF* in, uint8* buf) { uint8* bufp = buf; int32 bytes_read = 0; uint32 strip, nstrips = TIFFNumberOfStrips(in); uint32 stripsize = TIFFStripSize(in); uint32 rows = 0; uint32 rps = TIFFGetFieldDefaulted(in, TIFFTAG_ROWSPERSTRIP, &...
cwe
CWE-119
Unknown
var mxClient={VERSION:"20.2.8",IS_IE:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE"),IS_IE11:null!=navigator.userAgent&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_EM:"spellcheck"in document.createElement("textarea")&&8==docum...
cwe
CWE-78
JavaScript
static void adjust_branches(struct bpf_prog *prog, int pos, int delta) { struct bpf_insn *insn = prog->insnsi; int insn_cnt = prog->len; int i; for (i = 0; i < insn_cnt; i++, insn++) { if (BPF_CLASS(insn->code) != BPF_JMP || BPF_OP(insn->code) == BPF_CALL || BPF_OP(insn->code) == BPF_EXIT) continu...
cwe
CWE-200
Unknown
do_uncompress( compress_filter_context_t *zfx, z_stream *zs, IOBUF a, size_t *ret_len ) { int zrc; int rc=0; size_t n; int nread, count; int refill = !zs->avail_in; if( DBG_FILTER ) log_debug("begin inflate: avail_in=%u, avail_out=%u, inbuf=%u\n", (unsigned)zs->avail_in, (unsigned)zs...
cwe
CWE-20
Unknown
static int hns_gmac_get_sset_count(int stringset) { if (stringset == ETH_SS_STATS) return ARRAY_SIZE(g_gmac_stats_string); return 0; }
cwe
CWE-119
Unknown
int verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr_storage *address, int mode) { int size, ct, err; if (m->msg_namelen) { if (mode == VERIFY_READ) { void __user *namep; namep = (void __user __force *) m->msg_name; err = move_addr_to_kernel(namep, m->msg_namelen, address); if ...
cwe
CWE-20
C/C++
/* * Cantata * * Copyright (c) 2011-2018 Craig Drummond <craig.p.drummond@gmail.com> * * ---- * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (a...
cwe
CWE-22
C/C++
protected DocumentReference resolveTemplate(String template) { if (StringUtils.isNotBlank(template)) { DocumentReference templateReference = this.currentmixedReferenceResolver.resolve(template); // Make sure the current user have access to the template document before copying it ...
cwe
CWE-862
Java
psutil_net_if_stats(PyObject *self, PyObject *args) { int i; DWORD dwSize = 0; DWORD dwRetVal = 0; MIB_IFTABLE *pIfTable; MIB_IFROW *pIfRow; PIP_ADAPTER_ADDRESSES pAddresses = NULL; PIP_ADAPTER_ADDRESSES pCurrAddresses = NULL; char descr[MAX_PATH]; int ifname_found; PyObject *py...
cwe
CWE-415
Unknown
unset_and_free_gvalue (gpointer val) { g_value_unset (val); g_free (val); }
cwe
CWE-264
C/C++
import base64 import hashlib import hmac import logging from django import http from django.conf import settings from django.core.files.storage import default_storage from django.views import generic logger = logging.getLogger("s3file") class S3MockView(generic.View): def post(self, request): success_ac...
cwe
CWE-22
Python
@app.route('/<page_name>/edit') def render_page_edit(page_name): query = db.query("select page_content.content from page, page_content where page.id = page_content.page_id and page.page_name = '%s' order by page_content.id desc limit 1" % page_name) wiki_page = query.namedresult() if len(wiki_page) > 0: ...
cwe
CWE-89
Python
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
cwe
CWE-401
C/C++
static int multipart_buffer_headers(multipart_buffer *self, zend_llist *header TSRMLS_DC) { char *line; mime_header_entry prev_entry = {0}, entry; int prev_len, cur_len; /* didn't find boundary, abort */ if (!find_boundary(self, self->boundary TSRMLS_CC)) { return 0; } /* get lines of text, or CRLF_CRLF */ ...
cwe
CWE-399
C/C++
iasecc_select_file(struct sc_card *card, const struct sc_path *path, struct sc_file **file_out) { struct sc_context *ctx = card->ctx; struct sc_path lpath; int cache_valid = card->cache.valid, df_from_cache = 0; int rv, ii; LOG_FUNC_CALLED(ctx); memcpy(&lpath, path, sizeof(struct sc_path)); if (file_out) *...
cwe
CWE-674
C/C++
vbf_stp_error(struct worker *wrk, struct busyobj *bo) { ssize_t l, ll, o; double now; uint8_t *ptr; struct vsb *synth_body; CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC); CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC); CHECK_OBJ_NOTNULL(bo->fetch_objcore, OBJCORE_MAGIC); AN(bo->fetch_objcore->flags & OC_F_BUSY); assert(bo->dire...
cwe
CWE-787
Unknown
x[C].apply(this,arguments);null!=G&&B.push(G)}b.sidebar.showEntries(0<B.length?B.join(";"):"",A.checked);b.hideDialog()});g.className="geBtn gePrimaryBtn";f=document.createElement("div");f.style.marginTop="26px";f.style.textAlign="right"}b.editor.cancelFirst?(f.appendChild(n),f.appendChild(g)):(f.appendChild(g),f.appen...
cwe
CWE-94
JavaScript
unsigned int GetUVarBE(int nPos, int nSize, bool *pbSuccess) { //*pbSuccess = true; if ( nPos < 0 || nPos + nSize > m_nLen ) { *pbSuccess = false; return 0; } unsigned int nRes = 0; for ( int nIndex = 0; nIn...
cwe
CWE-787
C/C++
IDNSpoofChecker::IDNSpoofChecker() { UErrorCode status = U_ZERO_ERROR; checker_ = uspoof_open(&status); if (U_FAILURE(status)) { checker_ = nullptr; return; } uspoof_setRestrictionLevel(checker_, USPOOF_HIGHLY_RESTRICTIVE); SetAllowedUnicodeSet(&status); int32_t checks = uspoof_getChecks(check...
cwe
CWE-20
C/C++
void credssp_encode_ts_credentials(rdpCredssp* credssp) { wStream* s; int length; length = credssp_skip_ts_credentials(credssp); sspi_SecBufferAlloc(&credssp->ts_credentials, length); s = Stream_New(credssp->ts_credentials.pvBuffer, length); credssp_write_ts_credentials(credssp, s); Stream_Free(s, FALSE); }
cwe
CWE-476
Unknown
snmp_engine_get(snmp_header_t *header, snmp_varbind_t *varbinds, uint32_t varbinds_length) { snmp_mib_resource_t *resource; uint32_t i; for(i = 0; i < varbinds_length; i++) { resource = snmp_mib_find(varbinds[i].oid); if(!resource) { switch(header->version) { case SNMP_VERSION_1: head...
cwe
CWE-125
C/C++
package com.salesmanager.shop.store.controller.product.facade; import java.util.List; import com.salesmanager.core.model.merchant.MerchantStore; import com.salesmanager.core.model.reference.language.Language; import com.salesmanager.shop.model.catalog.product.attribute.optionset.PersistableProductOptionSet; import co...
cwe
CWE-639
Java
package tap import ( "errors" logger "github.com/TykTechnologies/tyk-identity-broker/log" "net/http" ) var log = logger.Get() type HttpError struct{ Message string Code int Error error } func AddProfile(profile Profile, AuthConfigStore AuthRegisterBackend, flush func(backend AuthRegisterBackend) error) *HttpE...
cwe
CWE-287
Go
libxlLoggerOpenFile(libxlLogger *logger, int id, const char *name, const char *domain_config) { g_autofree char *path = NULL; FILE *logFile = NULL; g_autofree char *domidstr = NULL; path = g_strdup_printf("%s/%s.log", logger->logDir, name); ...
cwe
CWE-667
Unknown
find_extend_vma(struct mm_struct *mm, unsigned long addr) { struct vm_area_struct *vma; unsigned long start; addr &= PAGE_MASK; vma = find_vma(mm, addr); if (!vma) return NULL; if (vma->vm_start <= addr) return vma; if (!(vma->vm_flags & VM_GROWSDOWN)) return NULL; start = vma->vm_start; if (expand...
cwe
CWE-667
C/C++
function $(e){switch(e.tag){case 5:return H(e.type);case 16:return H("Lazy");case 13:return H("Suspense");case 19:return H("SuspenseList");case 0:case 2:case 15:return e=V(e.type,!1);case 11:return e=V(e.type.render,!1);case 22:return e=V(e.type._render,!1);case 1:return e=V(e.type,!0);default:return""}}
cwe
CWE-79
JavaScript
/** * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse....
cwe
CWE-611
Java
import json import logging from decimal import Decimal from typing import Dict, Optional import graphene from django.conf import settings from django.core.serializers.json import DjangoJSONEncoder from django.db import transaction from ..account.models import User from ..checkout.models import Checkout from ..order.m...
cwe
CWE-203
Python
/* Copyright 2016 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
cwe
CWE-369
Python
pango_log2vis_get_embedding_levels (const gchar *text, int length, PangoDirection *pbase_dir) { glong n_chars, i; guint8 *embedding_levels_list; const gchar *p; FriBidiParType fribidi_base_dir; FriBidiCharType *bidi_types; #ifdef USE_FRIBIDI_EX_API FriBidiBracketType *bracket_...
cwe
CWE-787
C/C++
static void iowarrior_disconnect(struct usb_interface *interface) { struct iowarrior *dev; int minor; dev = usb_get_intfdata(interface); mutex_lock(&iowarrior_open_disc_lock); usb_set_intfdata(interface, NULL); /* prevent device read, write and ioctl */ dev->present = 0; minor = dev->minor; mutex_unlock(&iow...
cwe
CWE-416
C/C++
data: {config_calibre_dir: $("#config_calibre_dir").val()}, success: function success(data) { if ( data.change ) { if ( data.valid ) { confirmDialog( "db_submit", "GeneralChangeModal", ...
cwe
CWE-352
Python
setTimeout(function(){Ia.style.display="none"},4E3)}function z(){null!=X&&(X.style.fontWeight="normal",X.style.textDecoration="none",p=X,X=null)}function L(fa,ca,ba,ja,ia,ma,qa){if(-1<fa.className.indexOf("geTempDlgRadioBtnActive"))return!1;fa.className+=" geTempDlgRadioBtnActive";Q.querySelector(".geTempDlgRadioBtn[da...
cwe
CWE-20
JavaScript
int mi_repair(MI_CHECK *param, register MI_INFO *info, char * name, int rep_quick) { int error,got_error; ha_rows start_records,new_header_length; my_off_t del; File new_file; MYISAM_SHARE *share=info->s; char llbuff[22],llbuff2[22]; SORT_INFO sort_info; MI_SORT_PARAM sort_param; DBUG_ENTER("mi...
cwe
CWE-362
Unknown
// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This file contains the Go wrapper for the constant-time, 64-bit assembly // implementation of P256. The optimizations performed here are described in // deta...
cwe
CWE-682
Go
MagickExport Image *AcquireImage(const ImageInfo *image_info, ExceptionInfo *exception) { const char *option; Image *image; MagickStatusType flags; /* Allocate image structure. */ (void) LogMagickEvent(TraceEvent,GetMagickModule(),"..."); image=(Image *) AcquireCriticalMemory(sizeof(*...
cwe
CWE-665
C/C++
var itemClicked = function(evt) { if (evt == null || mxEvent.getSource(evt).nodeName != 'INPUT') { preview.style.textAlign = 'center'; preview.style.padding = '0px'; preview.style.color = ''; preview.innerHTML = ''; if (entry.desc != null) ...
cwe
CWE-94
JavaScript
function(){return"draw.io"!=this.getServiceName()||/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname)};EditorUi.prototype.addChromelessToolbarItems=function(c){if(null!=urlParams.tags){this.tagsDialog=this.tagsComponent=null;var e=c(mxUtils.bind(this,function(k){null==th...
cwe
CWE-20
JavaScript
void Jp2Image::encodeJp2Header(const DataBuf& boxBuf,DataBuf& outBuf) { DataBuf output(boxBuf.size_ + iccProfile_.size_ + 100); // allocate sufficient space long outlen = sizeof(Jp2BoxHeader) ; // now many bytes have we written to output? long inlen = sizeof(Jp2BoxHeader) ; // how many...
cwe
CWE-125
C/C++
package server import ( "encoding/json" "fmt" "io" "net/http" "net/url" "strconv" "strings" "time" "github.com/usememos/memos/api" "github.com/usememos/memos/common" metric "github.com/usememos/memos/plugin/metrics" "github.com/labstack/echo/v4" ) const ( // The max file size is 32MB. maxFileSize = (3...
cwe
CWE-79
Go
static ssize_t last_change_ms_show(struct device *dev, struct device_attribute *attr, char *buf) { struct wakeup_source *ws = dev_get_drvdata(dev); return sprintf(buf, "%lld\n", ktime_to_ms(ws->last_time)); }
cwe
CWE-787
Unknown
def redirect_back_or_default(default, options={}) back_url = params[:back_url].to_s if back_url.present? begin uri = URI.parse(back_url) # do not redirect user to another host or to the login or register page if (uri.relative? || (uri.host == request.host)) && !uri.path.match(%r{/(...
cwe
CWE-20
Ruby
/* 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-754
C/C++
list_t *create_list(void) { list_t *list = malloc(sizeof(list_t)); list->size = 0; list->head = NULL; list->tail = NULL; return list; }
cwe
CWE-476
C/C++
oa=F.actions.get("resetView");Q=F.actions.get("fullscreen");var Ba=F.actions.get("undo"),Ea=F.actions.get("redo"),Ka=C("",Ba.funct,null,mxResources.get("undo")+" ("+Ba.shortcut+")",Ba,Editor.undoImage),Fa=C("",Ea.funct,null,mxResources.get("redo")+" ("+Ea.shortcut+")",Ea,Editor.redoImage),Ha=C("",Q.funct,null,mxResourc...
cwe
CWE-94
JavaScript
*/ static void php_wddx_pop_element(void *user_data, const XML_Char *name) { st_entry *ent1, *ent2; wddx_stack *stack = (wddx_stack *)user_data; HashTable *target_hash; zend_class_entry *pce; zval obj; /* OBJECTS_FIXME */ if (stack->top == 0) { return; } if (!strcmp((char *)name, EL_STRING) || ...
cwe
CWE-476
C/C++
/* radare - LGPL - Copyright 2009-2021 - pancake */ #include <r_core.h> #include "ht_pp.h" /*! * Number of sub-commands to show as options when displaying the help of a * command. When a command has more options than MAX_CHILDREN_SHOW, `?` is shown * instead. * * Example with MAX_CHILDREN_SHOW=3: * w -> wa * ...
cwe
CWE-125
C/C++
Error ImageLoaderTGA::load_image(Ref<Image> p_image, FileAccess *f, bool p_force_linear, float p_scale) { Vector<uint8_t> src_image; int src_image_len = f->get_len(); ERR_FAIL_COND_V(src_image_len == 0, ERR_FILE_CORRUPT); ERR_FAIL_COND_V(src_image_len < (int)sizeof(tga_header_s), ERR_FILE_CORRUPT); src_image.resiz...
cwe
CWE-787
Unknown
static ssize_t driver_override_store(struct device *_dev, struct device_attribute *attr, const char *buf, size_t count) { struct amba_device *dev = to_amba_device(_dev); char *driver_override, *old = dev->driver_override, *cp; /* We need to keep extra room for a newline */ if (count >= (PAGE_SIZE...
cwe
CWE-415
Unknown
function screenshare() { const tokenValidation = AuthTokenValidation.findOne({ connectionId: this.connection.id }); if (!tokenValidation || tokenValidation.validationStatus !== ValidationStates.VALIDATED) { Logger.warn(`Publishing Screenshare was requested by unauth connection ${this.connection.id}`); retu...
cwe
CWE-918
JavaScript
xps_init_truetype_font(xps_context_t *ctx, xps_font_t *font) { int code = 0; font->font = (void*) gs_alloc_struct(ctx->memory, gs_font_type42, &st_gs_font_type42, "xps_font type42"); if (!font->font) return gs_throw(gs_error_VMerror, "out of memory"); /* no shortage of things to initialize */ ...
cwe
CWE-119
C/C++