code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
function le(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(a(92));if(Array.isArray(n)){if(!(1>=n.length))throw Error(a(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:K(n)}}
cwe
CWE-79
JavaScript
function In(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=Ln(t);t.gutterBackground=O("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPo...
cwe
CWE-79
JavaScript
dse_bind(Slapi_PBlock *pb) /* JCM There should only be one exit point from this function! */ { ber_tag_t method; /* The bind method */ struct berval *cred; /* The bind credentials */ Slapi_Value **bvals; struct dse *pdse; Slapi_Attr *attr; Slapi_DN *sdn = NULL; Slapi_Entry *ec = NULL; ...
cwe
CWE-200
C/C++
/* p_lx_elf.cpp -- This file is part of the UPX executable compressor. Copyright (C) 1996-2020 Markus Franz Xaver Johannes Oberhumer Copyright (C) 1996-2020 Laszlo Molnar Copyright (C) 2000-2020 John F. Reiser All Rights Reserved. UPX and the UCL library are free software; you can redistribute them...
cwe
CWE-369
C/C++
function readSync (cache, integrity, opts = {}) { const { size } = opts return withContentSriSync(cache, integrity, (cpath, sri) => { const data = fs.readFileSync(cpath) if (typeof size === 'number' && size !== data.length) { throw sizeError(size, data.length) } if (ssri.checkData(data, sri))...
cwe
CWE-200
JavaScript
def archive_directory(top_dir, subdir, tmpdir): """ .. function:: archive_directory(top_dir, subdir, tmpdir) Given a sub-directory name under the root directory to be archived, archive the contents of the sub-directory to a temporary directory. Then return the full path to the temporary directory. ...
cwe
CWE-22
Python
dfamust (struct dfa *d) { must *musts; must *mp; char *result; int ri; int i; int exact; token t; static must must0; struct dfamust *dm; static char empty_string[] = ""; result = empty_string; exact = 0; MALLOC (musts, d->tindex + 1); mp = musts; for (i = 0; i <= d->tindex; ++i) mp[i]...
cwe
CWE-189
Unknown
_mdLink(str) { const re = RE.mdLink || (RE.mdLink = XRegExp('\\[ ([a-zA-Z][^\\]]+) \\] \\( ([^)]+) \\)', 'gx')); return XRegExp.replace(str, re, (all, text, href) => { const scheme = href.match(/^\s*(\w+):/) || ['', '']; if (scheme[1] && ['http', 'https', 'mailto'].indexOf(scheme[1]) == -1) return a...
cwe
CWE-79
JavaScript
func padBuffer(buffer []byte, blockSize int) []byte { missing := blockSize - (len(buffer) % blockSize) ret, out := resize(buffer, len(buffer)+missing) padding := bytes.Repeat([]byte{byte(missing)}, missing) copy(out, padding) return ret }
cwe
CWE-190
Go
static int __load_segment_descriptor(struct x86_emulate_ctxt *ctxt, u16 selector, int seg, u8 cpl, enum x86_transfer_type transfer, struct desc_struct *desc) { struct desc_struct seg_desc, old_desc; u8 dpl, rpl; unsigned err_vec = GP_VECTOR; u32 err_code = 0; bool null_selector = !(selec...
cwe
CWE-284
Unknown
static int raw_cmd_copyout(int cmd, void __user *param, struct floppy_raw_cmd *ptr) { int ret; while (ptr) { ret = copy_to_user(param, ptr, sizeof(*ptr)); if (ret) return -EFAULT; param += sizeof(struct floppy_raw_cmd); if ((ptr->flags & FD_RAW_READ) && ptr->buffer_length) { if (ptr->length >= 0 ...
cwe
CWE-200
C/C++
size_t IOBuf::goodExtBufferSize(std::size_t minCapacity) { // Determine how much space we should allocate. We'll store the SharedInfo // for the external buffer just after the buffer itself. (We store it just // after the buffer rather than just before so that the code can still just // use free(buf_) to free...
cwe
CWE-787
Unknown
/* bson.c */ /* Copyright 2009, 2010 10gen 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 b...
cwe
CWE-190
C/C++
static void get_nb10(ut8* dbg_data, SCV_NB10_HEADER* res) { const int nb10sz = 16; memcpy (res, dbg_data, nb10sz); res->file_name = (ut8*) strdup ((const char*) dbg_data + nb10sz); }
cwe
CWE-125
Unknown
func GetIssues(uid, rid, pid, mid int64, page int, isClosed bool, labelIds, sortType string) ([]Issue, error) { sess := x.Limit(20, (page-1)*20) if rid > 0 { sess.Where("repo_id=?", rid).And("is_closed=?", isClosed) } else { sess.Where("is_closed=?", isClosed) } if uid > 0 { sess.And("assignee_id=?", uid) ...
cwe
CWE-89
Go
def also_add(name, also): db = db_connect() cursor = db.cursor() try: cursor.execute(''' INSERT INTO isalso(name,also) VALUES('{}','{}') '''.format(name, also)) db.commit() logger.debug('added to isalso name {} with value {}'.format( name, also)) ...
cwe
CWE-89
Python
import os import zipfile import tarfile from flask import request, current_app as ca from flask_restx import Resource import tempfile import multipart import requests from mindsdb.utilities import log from mindsdb.api.http.utils import http_error from mindsdb.api.http.namespaces.configs.files import ns_conf from mind...
cwe
CWE-22
Python
public void archive(OLATResourceable ores, File exportDirectory) { ObjectOutputStream out = null; try { File file = new File(exportDirectory, "chat.xml"); Writer writer = new FileWriter(file); out = logXStream.createObjectOutputStream(writer); int counter = 0; List<InstantMessage> messages; do...
cwe
CWE-91
Java
static int asn1_item_embed_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_EXTERN_FUNCS *ef; const ASN1_AUX *aux = ...
cwe
CWE-400
Unknown
/* MacGeiger WIFI AP detector Copyright (C) 2014 rofl0r 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 (at your option) any later version....
cwe
CWE-74
C/C++
package com.salesmanager.shop.admin.controller.content; import com.salesmanager.core.business.services.content.ContentService; import com.salesmanager.core.business.services.reference.language.LanguageService; import com.salesmanager.core.model.content.Content; import com.salesmanager.core.model.content.ContentDescrip...
cwe
CWE-79
Java
HexOutStream::writeBuffer() { U8* pos = start; while (pos != ptr) { out_stream.check(2); U8* optr = out_stream.getptr(); U8* oend = out_stream.getend(); int length = min(ptr-pos, (oend-optr)/2); for (int i=0; i<length; i++) { optr[i*2] = intToHex((pos[i] >> 4) & 0xf); optr[i*2+1] = ...
cwe
CWE-787
C/C++
postMessage(message) { webidl.assertBranded(this, BroadcastChannelPrototype); const prefix = "Failed to execute 'postMessage' on 'BroadcastChannel'"; webidl.requiredArguments(arguments.length, 1, { prefix }); if (this[_closed]) { throw new DOMException("Already closed", "InvalidStateEr...
cwe
CWE-362
JavaScript
static void utee_param_to_param(struct tee_ta_param *p, struct utee_params *up) { size_t n; uint32_t types = up->types; p->types = types; for (n = 0; n < TEE_NUM_PARAMS; n++) { uintptr_t a = up->vals[n * 2]; size_t b = up->vals[n * 2 + 1]; switch (TEE_PARAM_TYPE_GET(types, n)) { case TEE_PARAM_TYP...
cwe
CWE-20
C/C++
const bootbox = require('bootbox'); require('../services/Requisitions'); const RequisitionNode = require('../model/RequisitionNode'); const RequisitionMetaDataEntry = require('../model/RequisitionMetaDataEntry'); /** * @author Alejandro Galue <agalue@opennms.org> * @copyright 2014 The OpenNMS Group, Inc. */ (functi...
cwe
CWE-79
Java
public function testGetDropdownValue($params, $expected, $session_params = []) { $this->login(); $bkp_params = []; //set session params if any if (count($session_params)) { foreach ($session_params as $param => $value) { if (isset($_SESSION[$param])) { $bkp_p...
cwe
CWE-639
PHP
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
static int find_high_bit(unsigned int x) { int i; for(i=31;i>=0;i--) { if(x&(1<<i)) return i; } return 0; }
cwe
CWE-682
C/C++
static int _hostsock_getsockname( oe_fd_t* sock_, struct oe_sockaddr* addr, oe_socklen_t* addrlen) { int ret = -1; sock_t* sock = _cast_sock(sock_); oe_socklen_t addrlen_in = 0; oe_errno = 0; if (!sock) OE_RAISE_ERRNO(OE_EINVAL); if (addrlen) addrlen_in = *addrlen;...
cwe
CWE-200
Unknown
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
TiledInputFile::TiledInputFile (const Header &header, OPENEXR_IMF_INTERNAL_NAMESPACE::IStream *is, int version, int numThreads) : _data (new Data (numThreads)) { _data->_deleteStream=false; _data->_streamData = n...
cwe
CWE-125
Unknown
# Copyright 2018-2021 Streamlit 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 agreed to in wr...
cwe
CWE-79
Python
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-863
JavaScript
/* * GPAC - Multimedia Framework C SDK * * Authors: Jean Le Feuvre * Copyright (c) Telecom ParisTech 2000-2021 * All rights reserved * * This file is part of GPAC / ISO Media File Format sub-project * * GPAC is free software; you can redistribute it and/or modify * it under the terms of the GNU L...
cwe
CWE-476
C/C++
TPM2B_ECC_PARAMETER_Marshal(TPM2B_ECC_PARAMETER *source, BYTE **buffer, INT32 *size) { UINT16 written = 0; written += TPM2B_Marshal(&source->b, buffer, size); return written; }
cwe
CWE-787
Unknown
_gcry_ecc_ecdsa_sign (gcry_mpi_t input, ECC_secret_key *skey, gcry_mpi_t r, gcry_mpi_t s, int flags, int hashalgo) { gpg_err_code_t rc = 0; int extraloops = 0; gcry_mpi_t k, dr, sum, k_1, x; mpi_point_struct I; gcry_mpi_t hash; const void *abuf; unsigned int abi...
cwe
CWE-203
Unknown
static pj_status_t get_name(int rec_counter, const pj_uint8_t *pkt, const pj_uint8_t *start, const pj_uint8_t *max, pj_str_t *name) { const pj_uint8_t *p; pj_status_t status; /* Limit the number of recursion */ if (rec_counter > 10) { /* Too many name recursion */ return PJLIB_UTIL_EDN...
cwe
CWE-787
Unknown
/* radare - LGPL - Copyright 2019-2022 - GustavoLCR */ #include "ne.h" #define NE_BUG 0 static char *__get_target_os(r_bin_ne_obj_t *bin) { switch (bin->ne_header->targOS) { case 1: return "OS/2"; case 2: return "Windows"; case 3: return "European MS-DOS 4.x"; case 4: return "Windows 386"; case 5: ret...
cwe
CWE-125
C/C++
MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info) { #define RenderImageTag "Render/Image" AffineMatrix affine, current; char key[2*MaxTextExtent], keyword[MaxTextExtent], geometry[MaxTextExtent], name[MaxTextExtent], *next_token, pattern[MaxTextExten...
cwe
CWE-119
Unknown
PHP_FUNCTION(imagesetstyle) { zval *IM, *styles; gdImagePtr im; int * stylearr; int index; HashPosition pos; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ra", &IM, &styles) == FAILURE) { return; } ZEND_FETCH_RESOURCE(im, gdImagePtr, &IM, -1, "Image", le_gd); /* copy the style values in the style...
cwe
CWE-189
Unknown
const got = require('@/utils/got'); const cheerio = require('cheerio'); const { parseDate } = require('@/utils/parse-date'); module.exports = async (ctx) => { const { domain = 'news', tag } = ctx.params; const baseUrl = `https://${domain}.gamme.com.tw`; const pageUrl = `${baseUrl}/tag/${tag}`; const {...
cwe
CWE-918
JavaScript
def urlize_quoted_links(text, trim_url_limit=None, nofollow=True, autoescape=True): """ Converts any URLs in text into clickable links. Works on http://, https://, www. links, and also on links ending in one of the original seven gTLDs (.com, .edu, .gov, .int, .mil, .net, and .org). Links can have ...
cwe
CWE-79
Python
int xt_compat_check_entry_offsets(const void *base, unsigned int target_offset, unsigned int next_offset) { const struct compat_xt_entry_target *t; const char *e = base; if (target_offset + sizeof(*t) > next_offset) return -EINVAL; t = (void *)(e + target_offset); if (t->u.target_size < si...
cwe
CWE-264
C/C++
DU_getStringDOElement(DcmItem *obj, DcmTagKey t, char *s, size_t bufsize) { DcmByteString *elem; DcmStack stack; OFCondition ec = EC_Normal; char* aString; ec = obj->search(t, stack); elem = (DcmByteString*) stack.top(); if (ec == EC_Normal && elem != NULL) { if (elem->getLength() =...
cwe
CWE-787
C/C++
static int link_pipe(struct pipe_inode_info *ipipe, struct pipe_inode_info *opipe, size_t len, unsigned int flags) { struct pipe_buffer *ibuf, *obuf; int ret = 0, i = 0, nbuf; /* * Potential ABBA deadlock, work around it by ordering lock * grabbing by pipe info address. Otherwise two different pro...
cwe
CWE-416
C/C++
static char *ps_files_path_create(char *buf, size_t buflen, ps_files *data, const char *key) { { size_t len; const char *p; char c; int ret = 1; for (p = key; (c = *p); p++) { /* valid characters are a..z,A..Z,0..9 */ if (!((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') ...
cwe
CWE-264
C/C++
/* * Copyright (C) the libgit2 contributors. All rights reserved. * * This file is part of libgit2, distributed under the GNU GPL v2 with * a Linking Exception. For full terms see the included COPYING file. */ #include "common.h" #include "git2/types.h" #include "git2/errors.h" #include "git2/refs.h" #include "g...
cwe
CWE-476
C/C++
void ExtensionTtsController::Stop() { if (current_utterance_ && !current_utterance_->extension_id().empty()) { current_utterance_->profile()->GetExtensionEventRouter()-> DispatchEventToExtension( current_utterance_->extension_id(), events::kOnStop, "[]", cur...
cwe
CWE-20
C/C++
setup_seccomp (FlatpakBwrap *bwrap, const char *arch, gulong allowed_personality, FlatpakRunFlags run_flags, GError **error) { gboolean multiarch = (run_flags & FLATPAK_RUN_FLAG_MULTIARCH) != 0; gboolean devel = (run_flags & FLATPAK_R...
cwe
CWE-20
C/C++
static void usbtest_disconnect(struct usb_interface *intf) { struct usbtest_dev *dev = usb_get_intfdata(intf); usb_set_intfdata(intf, NULL); dev_dbg(&intf->dev, "disconnect\n"); kfree(dev); }
cwe
CWE-401
Unknown
zfs_fuid_create_cred(zfsvfs_t *zfsvfs, zfs_fuid_type_t type, cred_t *cr, zfs_fuid_info_t **fuidp) { uid_t id; VERIFY(type == ZFS_OWNER || type == ZFS_GROUP); id = (type == ZFS_OWNER) ? crgetuid(cr) : crgetgid(cr); if (IS_EPHEMERAL(id)) return ((type == ZFS_OWNER) ? UID_NOBODY : GID_NOBODY); return ((uin...
cwe
CWE-732
Unknown
def tid_to_tid_num(self, tid): ''' Returns tid_num, given tid. ''' q = "SELECT rowid FROM tids WHERE tid = '" + tid + "'" self.query(q) return self.c.fetchone()[0]
cwe
CWE-89
Python
function addMenu(id, small, img) { var menu = ui.menus.get(id); var elt = menuObj.addMenu(mxResources.get(id), mxUtils.bind(this, function() { // Allows extensions of menu.functid menu.funct.apply(this, arguments); }), before); elt.className = (urlParams['sketch'] == '1') ? 'geToo...
cwe
CWE-94
JavaScript
package webhook import ( "bytes" "crypto/hmac" "crypto/sha256" "encoding/hex" "encoding/json" "errors" "fmt" "net/http" "time" log "github.com/gophish/gophish/logger" ) const ( // DefaultTimeoutSeconds is the number of seconds before a timeout occurs // when sending a webhook DefaultTimeoutSeconds = 10...
cwe
CWE-918
Go
md_analyze_line(MD_CTX* ctx, OFF beg, OFF* p_end, const MD_LINE_ANALYSIS* pivot_line, MD_LINE_ANALYSIS* line) { unsigned total_indent = 0; int n_parents = 0; int n_brothers = 0; int n_children = 0; MD_CONTAINER container = { 0 }; int prev_line_has_list_loosening_effect = ctx->las...
cwe
CWE-125
C/C++
repodata_schema2id(Repodata *data, Id *schema, int create) { int h, len, i; Id *sp, cid; Id *schematahash; if (!*schema) return 0; /* XXX: allow empty schema? */ if ((schematahash = data->schematahash) == 0) { data->schematahash = schematahash = solv_calloc(256, sizeof(Id)); for (i = 1; i...
cwe
CWE-125
C/C++
/* nbdkit * Copyright (C) 2013-2019 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the f...
cwe
CWE-406
C/C++
evbuffer_expand_fast_(struct evbuffer *buf, size_t datlen, int n) { struct evbuffer_chain *chain = buf->last, *tmp, *next; size_t avail; int used; ASSERT_EVBUFFER_LOCKED(buf); EVUTIL_ASSERT(n >= 2); if (chain == NULL || (chain->flags & EVBUFFER_IMMUTABLE)) { /* There is no last chunk, or we can't touch the la...
cwe
CWE-189
Unknown
var tag = function tag(tagName, attrsMap, content) { var safeTagName = htmlEscape(tagName); var attrsHTML = !is.array(attrsMap) ? attrs(attrsMap) : attrsMap.reduce(function (html, map) { return html + attrs(map); }, ''); return '<' + safeTagName + attrsHTML + (isSelfClosing(safeTagName) ? ' />' ...
cwe
CWE-79
JavaScript
void Compute(OpKernelContext* context) override { const Tensor& prefix = context->input(0); const Tensor& tensor_names = context->input(1); const Tensor& shape_and_slices = context->input(2); OP_REQUIRES(context, tensor_names.NumElements() == dtypes_.size(), errors::InvalidArgument("Got ...
cwe
CWE-369
C/C++
static int l2cap_connect_create_rsp(struct l2cap_conn *conn, struct l2cap_cmd_hdr *cmd, u16 cmd_len, u8 *data) { struct l2cap_conn_rsp *rsp = (struct l2cap_conn_rsp *) data; u16 scid, dcid, result, status; struct l2cap_chan *chan; u8 req[128]; int err; if (cmd_len < sizeof(*rsp)) return -EPROTO...
cwe
CWE-787
Unknown
var T=document.createElement("tbody"),P=(new Date).toDateString();null!=b.currentPage&&null!=b.pages&&(g=mxUtils.indexOf(b.pages,b.currentPage));for(q=e.length-1;0<=q;q--){var Q=function(S){var Y=new Date(S.modifiedDate),ba=null;if(0<=Y.getTime()){var da=function(ja){x.stop();v.innerHTML="";var ea=mxUtils.parseXml(ja),...
cwe
CWE-94
JavaScript
function selectRelativeTime() { var quantityField = new Ext.form.TextField({ fieldLabel: 'Show the past', width: 90, allowBlank: false, regex: /\d+/, regexText: 'Please enter a number', value: TimeRange.relativeStartQuantity }); var unitField = new Ext.form.ComboBox({ fieldLabel: '', ...
cwe
CWE-79
JavaScript
evutil_parse_sockaddr_port(const char *ip_as_string, struct sockaddr *out, int *outlen) { int port; char buf[128]; const char *cp, *addr_part, *port_part; int is_ipv6; /* recognized formats are: * [ipv6]:port * ipv6 * [ipv6] * ipv4:port * ipv4 */ cp = strchr(ip_as_string, ':'); if (*ip_as_string == ...
cwe
CWE-787
C/C++
function updateOption (that) { try { var thisId = jQuery('#fb-field-id').val(); var thisOptionid = that.attr('optionid'); var thisOptionValue = that.val(); var thisType = jQuery('#fb-new-type').val(); // Update preview if (thisType === "radio") { jQuery('#fb-radio-' + thisId + '-' + thisOptionid...
cwe
CWE-79
JavaScript
/* * 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-269
Java
png_read_init_3(png_structpp ptr_ptr, png_const_charp user_png_ver, png_size_t png_struct_size) { #ifdef PNG_SETJMP_SUPPORTED jmp_buf tmp_jmp; /* to save current jump buffer */ #endif int i = 0; png_structp png_ptr=*ptr_ptr; if (png_ptr == NULL) return; do { if (user_png_ver[i] ...
cwe
CWE-120
C/C++
ScopedRequest(PepperDeviceEnumerationHostHelper* owner, const Delegate::EnumerateDevicesCallback& callback) : owner_(owner), callback_(callback), requested_(false), request_id_(0), sync_call_(false) { if (!owner_->document_url_.is_valid()) return; req...
cwe
CWE-399
C/C++
void ClipboardMessageFilter::OnWriteObjectsAsync( const ui::Clipboard::ObjectMap& objects) { scoped_ptr<ui::Clipboard::ObjectMap> sanitized_objects( new ui::Clipboard::ObjectMap(objects)); sanitized_objects->erase(ui::Clipboard::CBF_SMBITMAP); #if defined(OS_WIN) BrowserThread::PostTask( Brow...
cwe
CWE-20
C/C++
static UINT gdi_CacheToSurface(RdpgfxClientContext* context, const RDPGFX_CACHE_TO_SURFACE_PDU* cacheToSurface) { UINT status = ERROR_INTERNAL_ERROR; UINT16 index; RDPGFX_POINT16* destPt; gdiGfxSurface* surface; gdiGfxCacheEntry* cacheEntry; RECTANGLE_16 invalidRect; rdpGdi* gdi = ...
cwe
CWE-190
Unknown
""" Snippet ---8<---. pymdownx.snippet Inject snippets MIT license. Copyright (c) 2017 Isaac Muse <isaacmuse@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, incl...
cwe
CWE-22
Python
var callback2 = function(docList, errorMsg, searchImportCats) { i0 = 0; spinner.stop(); templates = docList; searchImportCats = searchImportCats || {}; var importListsCount = 0; for (var cat in searchImportCats) { importListsCount += searchImportCats[cat].length; } ...
cwe
CWE-94
JavaScript
static int packet_getname(struct socket *sock, struct sockaddr *uaddr, int *uaddr_len, int peer) { struct net_device *dev; struct sock *sk = sock->sk; struct packet_sock *po = pkt_sk(sk); DECLARE_SOCKADDR(struct sockaddr_ll *, sll, uaddr); if (peer) return -EOPNOTSUPP; sll->sll_family = AF_PACKET; sll->...
cwe
CWE-909
Unknown
computedMember: function(left, right) { return left + '[' + right + ']'; },
cwe
CWE-74
JavaScript
/** * <a href="http://www.openolat.org"> * OpenOLAT - Online Learning and Training</a><br> * <p> * Licensed under the Apache License, Version 2.0 (the "License"); <br> * you may not use this file except in compliance with the License.<br> * You may obtain a copy of the License at the * <a href="http://www.apache...
cwe
CWE-23
Java
fn exit_document(&mut self, ctx: &mut ValidatorContext<'a, S>, _: &'a Document<S>) { assert!(self.current_fragment.is_none()); let mut detector = CycleDetector { visited: HashSet::new(), spreads: &self.spreads, path_indices: HashMap::new(), errors: Vec::n...
cwe
CWE-674
Rust
_TIFFmalloc(tsize_t s) { return (malloc((size_t) s)); }
cwe
CWE-369
Unknown
/* * See the NOTICE file distributed with this work for additional * information regarding copyright ownership. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * th...
cwe
CWE-79
Java
// SPDX-License-Identifier: GPL-2.0 /* * This is a maximally equidistributed combined Tausworthe generator * based on code from GNU Scientific Library 1.5 (30 Jun 2004) * * lfsr113 version: * * x_n = (s1_n ^ s2_n ^ s3_n ^ s4_n) * * s1_{n+1} = (((s1_n & 4294967294) << 18) ^ (((s1_n << 6) ^ s1_n) >> 13)) * s2_{...
cwe
CWE-200
C/C++
/* * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. * * Author: zccrs <zccrs@live.com> * * Maintainer: zccrs <zhangjide@deepin.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 Foun...
cwe
CWE-59
C/C++
GC_API GC_ATTR_MALLOC void * GC_CALL GC_debug_malloc(size_t lb, GC_EXTRA_PARAMS) { void * result; /* Note that according to malloc() specification, if size is 0 then */ /* malloc() returns either NULL, or a unique pointer value that can */ /* later b...
cwe
CWE-119
Unknown
/* libcomps - C alternative to yum.comps library * Copyright (C) 2013 Jindrich Luza * * 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 * any later versio...
cwe
CWE-416
C/C++
static inline void process_get_command(conn *c, token_t *tokens, size_t ntokens, bool return_cas) { char *key; size_t nkey; int i = 0; item *it; token_t *key_token = &tokens[KEY_TOKEN]; char *suffix; assert(c != NULL); do { while(key_token->length != 0) { key = key...
cwe
CWE-190
C/C++
/* * Copyright (c) 2009-2012, Salvatore Sanfilippo <antirez at gmail dot com> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above co...
cwe
CWE-190
C/C++
#!/usr/bin/env python # # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import sys from typing import List, Optional from uuid import UUID from onefuzztypes.enums import ( OS, Architecture, ContainerType, ErrorCode, NodeState, ScalesetState, Ta...
cwe
CWE-863
Python
@staticmethod def estimate_size(task_id, taken_dirs, taken_files): report = AnalysisController.get_report(task_id) report = report["analysis"] path = report["info"]["analysis_path"] size_total = 0 for directory in taken_dirs: destination = "%s/%s" % (path, direc...
cwe
CWE-22
Python
#!/usr/bin/env python # # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import argparse import json from typing import List, Optional from uuid import UUID from azure.common.client_factory import get_client_from_cli_profile from azure.cosmosdb.table.tableservice import TableService from azure...
cwe
CWE-285
Python
function layout_navbar() { $t_logo_url = config_get('logo_url'); echo '<div id="navbar" class="navbar navbar-default navbar-collapse navbar-fixed-top noprint">'; echo '<div id="navbar-container" class="navbar-container">'; echo '<button id="menu-toggler" type="button" class="navbar-toggle menu-toggler pull-left h...
cwe
CWE-79
PHP
var T=document.createElement("tbody"),P=(new Date).toDateString();null!=b.currentPage&&null!=b.pages&&(g=mxUtils.indexOf(b.pages,b.currentPage));for(q=e.length-1;0<=q;q--){var Q=function(S){var Y=new Date(S.modifiedDate),ba=null;if(0<=Y.getTime()){var da=function(ja){x.stop();v.innerHTML="";var ea=mxUtils.parseXml(ja),...
cwe
CWE-94
JavaScript
import difflib from bs4 import BeautifulSoup from django.utils.encoding import force_str from django.utils.html import escape, format_html, format_html_join from django.utils.safestring import mark_safe from django.utils.text import capfirst from django.utils.translation import ugettext_lazy as _ from wagtail.core im...
cwe
CWE-79
Python
int dmarc_process() { int sr, origin; /* used in SPF section */ int dmarc_spf_result = 0; /* stores spf into dmarc conn ctx */ pdkim_signature *sig = NULL; BOOL has_dmarc_record = TRUE; u_char **ruf; /* forensic report addressees, if called for */ /* ACLs have "control=dmarc_disabl...
cwe
CWE-20
C/C++
ProcPseudoramiXGetScreenSize(ClientPtr client) { REQUEST(xPanoramiXGetScreenSizeReq); WindowPtr pWin; xPanoramiXGetScreenSizeReply rep; register int rc; TRACE; if (stuff->screen >= pseudoramiXNumScreens) return BadMatch; REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq); rc ...
cwe
CWE-20
C/C++
dwg_encode_add_object (Dwg_Object *restrict obj, Bit_Chain *restrict dat, unsigned long address) { int error = 0; unsigned long oldpos; unsigned long end_address = address + obj->size; oldpos = bit_position (dat); assert (address); dat->byte = address; dat->bit = 0; LOG_INFO ("O...
cwe
CWE-703
Unknown
/* * Copyright (C) 2009 - 2020 Bonitasoft S.A. * Bonitasoft, 32 rue Gustave Eiffel - 38000 Grenoble * 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.0 of the License, or * ...
cwe
CWE-611
Java
int ZlibOutStream::overrun(int itemSize, int nItems) { #ifdef ZLIBOUT_DEBUG vlog.debug("overrun"); #endif if (itemSize > bufSize) throw Exception("ZlibOutStream overrun: max itemSize exceeded"); checkCompressionLevel(); while (end - ptr < itemSize) { zs->next_in = start; zs->avail_in = ptr - star...
cwe
CWE-787
C/C++
static int dccp_packet(struct nf_conn *ct, const struct sk_buff *skb, unsigned int dataoff, enum ip_conntrack_info ctinfo, u_int8_t pf, unsigned int hooknum, unsigned int *timeouts) { struct net *net = nf_ct_net(ct); enum ip_conntrack_dir dir = CTINFO2DIR(ctinfo); struct dccp_hdr _dh, *dh;...
cwe
CWE-20
C/C++
xmlParseComment(xmlParserCtxtPtr ctxt) { xmlChar *buf = NULL; int size = XML_PARSER_BUFFER_SIZE; int len = 0; xmlParserInputState state; const xmlChar *in; int nbchar = 0, ccol; int inputid; /* * Check that there is a comment right here. */ if ((RAW != '<') || (NXT(1) != '...
cwe
CWE-119
C/C++
static void ath6kl_usb_free_urb_to_pipe(struct ath6kl_usb_pipe *pipe, struct ath6kl_urb_context *urb_context) { unsigned long flags; spin_lock_irqsave(&pipe->ar_usb->cs_lock, flags); pipe->urb_cnt++; list_add(&urb_context->link, &pipe->urb_list_head); spin_unlock_irqrestore(&pipe->ar_usb->cs_lock, flags); }
cwe
CWE-476
Unknown
static void command_port_read_callback(struct urb *urb) { struct usb_serial_port *command_port = urb->context; struct whiteheat_command_private *command_info; int status = urb->status; unsigned char *data = urb->transfer_buffer; int result; command_info = usb_get_serial_port_data(command_port); if (!command_inf...
cwe
CWE-119
C/C++
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
cwe
CWE-119
C/C++