code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
ASC_destroyAssociation(T_ASC_Association ** association) { OFCondition cond = EC_Normal; /* don't worry if already destroyed */ if (association == NULL) return EC_Normal; if (*association == NULL) return EC_Normal; if ((*association)->DULassociation != NULL) { ASC_dropAssociation(*associat...
cwe
CWE-401
C/C++
/** @file Clipsal CMR113 cent-a-meter power meter. Copyright (C) 2021 Michael Neuling <mikey@neuling.org> 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 ...
cwe
CWE-787
C/C++
void Messageheader::Parser::checkHeaderspace(unsigned chars) const { if (headerdataPtr + chars >= header.rawdata + sizeof(header.rawdata)) throw HttpError(HTTP_REQUEST_ENTITY_TOO_LARGE, "header too large"); }
cwe
CWE-200
Unknown
jas_image_t *bmp_decode(jas_stream_t *in, char *optstr) { jas_image_t *image; bmp_hdr_t hdr; bmp_info_t *info; uint_fast16_t cmptno; jas_image_cmptparm_t cmptparms[3]; jas_image_cmptparm_t *cmptparm; uint_fast16_t numcmpts; long n; image = 0; info = 0; if (optstr) { jas_eprintf("warning: ignoring ...
cwe
CWE-190
C/C++
void cipso_v4_req_delattr(struct request_sock *req) { struct ip_options *opt; struct inet_request_sock *req_inet; req_inet = inet_rsk(req); opt = req_inet->opt; if (opt == NULL || opt->cipso == 0) return; cipso_v4_delopt(&req_inet->opt); }
cwe
CWE-362
Unknown
// lessc_helper.js // // helper functions for lessc var lessc_helper = { //Stylize a string stylize : function(str, style) { var styles = { 'reset' : [0, 0], 'bold' : [1, 22], 'inverse' : [7, 27], 'underline' : [4, 24], 'y...
cwe
CWE-74
Java
CmdResult Handle (const std::vector<std::string>& parameters, User *user) { /* Only allow AUTHENTICATE on unregistered clients */ if (user->registered != REG_ALL) { if (!cap.ext.get(user)) return CMD_FAILURE; SaslAuthenticator *sasl = authExt.get(user); if (!sasl) authExt.set(user, new SaslAuth...
cwe
CWE-284
Unknown
static int get_rx_bufs(struct vhost_virtqueue *vq, struct vring_used_elem *heads, int datalen, unsigned *iovcount, struct vhost_log *log, unsigned *log_num, unsigned int quota) { unsigned int out, in; int seg = 0; int headcount = 0; unsigned d; int r, nlogs = 0...
cwe
CWE-20
C/C++
QPDF::calculateLinearizationData(std::map<int, int> const& object_stream_data) { // This function calculates the ordering of objects, divides them // into the appropriate parts, and computes some values for the // linearization parameter dictionary and hint tables. The file // must be optimized (via ca...
cwe
CWE-787
Unknown
void join(pid_t pid, int argc, char **argv, int index) { EUID_ASSERT(); pid_t parent = pid; // in case the pid is that of a firejail process, use the pid of the first child process pid = switch_to_child(pid); // exit if no permission to join the sandbox check_join_permission(pid); extract_x11_display(parent);...
cwe
CWE-94
Unknown
static void _php_do_opendir(INTERNAL_FUNCTION_PARAMETERS, int createobject) { char *dirname; int dir_len; zval *zcontext = NULL; php_stream_context *context = NULL; php_stream *dirp; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|r", &dirname, &dir_len, &zcontext) == FAILURE) { RETURN_NULL(); } con...
cwe
CWE-19
Unknown
static void regulator_ena_gpio_free(struct regulator_dev *rdev) { struct regulator_enable_gpio *pin, *n; if (!rdev->ena_pin) return; /* Free the GPIO only in case of no use */ list_for_each_entry_safe(pin, n, &regulator_ena_gpio_list, list) { if (pin->gpiod == rdev->ena_pin->gpiod) { if (pin->request_count...
cwe
CWE-416
Unknown
# -*- coding: utf-8 -*- import os import re import shutil import time from pyload import PKGDIR from ... import exc_logger # CONFIG_VERSION __version__ = 2 class ConfigParser: """ holds and manage the configuration. current dict layout: { section : { option : { value: ...
cwe
CWE-20
Python
function ame_ajax_set_excludestatus( page_id, status_id ) { var ame_sack = new sack( ajaxurl ); ame_sack.execute = 1; ame_sack.method = 'POST'; ame_sack.setVar( "action", "ame_toggle_excludestatus" ); ame_sack.setVar( "pageid", page_id ); ame_sack.setVar( "statusid", status_id ); ame_sack.onError = function() { ...
cwe
CWE-352
JavaScript
static int verify_cb(int preverify_ok, X509_STORE_CTX *x509_ctx) { pj_ssl_sock_t *ssock; SSL *ossl_ssl; int err; /* Get SSL instance */ ossl_ssl = X509_STORE_CTX_get_ex_data(x509_ctx, SSL_get_ex_data_X509_STORE_CTX_idx()); pj_assert(ossl_ssl); /* Get SSL socket instance */ sso...
cwe
CWE-362
C/C++
DictionaryValue* ExtensionTabUtil::CreateTabValue( const WebContents* contents, TabStripModel* tab_strip, int tab_index, IncludePrivacySensitiveFields include_privacy_sensitive_fields) { if (!tab_strip) ExtensionTabUtil::GetTabStripModel(contents, &tab_strip, &tab_index); DictionaryValue* ...
cwe
CWE-264
C/C++
def set_certs(params, request, session) if not allowed_for_local_cluster(session, Permissions::FULL) return 403, 'Permission denied' end ssl_cert = (params['ssl_cert'] || '').strip ssl_key = (params['ssl_key'] || '').strip if ssl_cert.empty? and !ssl_key.empty? return [400, 'cannot save ssl certifica...
cwe
CWE-384
Ruby
urlParams.pages||1<U.pages.length||Editor.pagesVisible)?"inline-block":"none"};var S=function(){ra.innerHTML="";if(null!=U.currentPage){mxUtils.write(ra,U.currentPage.getName());var ua=null!=U.pages?U.pages.length:1,ya=U.getPageIndex(U.currentPage);ya=null!=ya?ya+1:1;var Na=U.currentPage.getId();ra.setAttribute("title"...
cwe
CWE-94
JavaScript
void comps_rtree_unite(COMPS_RTree *rt1, COMPS_RTree *rt2) { COMPS_HSList *tmplist, *tmp_subnodes; COMPS_HSListItem *it; struct Pair { COMPS_HSList * subnodes; char * key; char added; } *pair, *parent_pair; pair = malloc(sizeof(struct Pair)); pair->subnodes = rt2->...
cwe
CWE-416
C/C++
static int nbd_negotiate_read(QIOChannel *ioc, void *buffer, size_t size) { ssize_t ret; guint watch; assert(qemu_in_coroutine()); /* Negotiation are always in main loop. */ watch = qio_channel_add_watch(ioc, G_IO_IN, nbd_negotiate_...
cwe
CWE-617
C/C++
pci_lintr_route(struct pci_vdev *dev) { struct businfo *bi; struct intxinfo *ii; if (dev->lintr.pin == 0) return; bi = pci_businfo[dev->bus]; assert(bi != NULL); ii = &bi->slotinfo[dev->slot].si_intpins[dev->lintr.pin - 1]; /* * Attempt to allocate an I/O APIC pin for this intpin if one * is not yet ass...
cwe
CWE-617
C/C++
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ /* * lsquic_hash.c */ #include <assert.h> #include <stdint.h> #include <stdlib.h> #include <string.h> #include <sys/queue.h> #ifdef WIN32 #include <vc_compat.h> #endif #include "lsquic_hash.h" #include "lsquic_xxhash.h" TAILQ_HEAD(hels_head,...
cwe
CWE-476
C/C++
static int do_insn_fetch(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops, unsigned long eip, void *dest, unsigned size) { int rc = 0; eip += ctxt->cs_base; while (size--) { rc = do_fetch_insn_byte(ctxt, ops, eip++, dest++); if (rc) return rc; } return 0; }
cwe
CWE-20
C/C++
PlainPasswd::PlainPasswd(int len) : CharArray(len) { }
cwe
CWE-122
C/C++
/* * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. */ /* * Licensed to Elasticsearch under one or more contributor * license agreements. See the NOTICE file distribute...
cwe
CWE-200
Java
CKEDITOR.htmlDataProcessor = function( editor ) { var dataFilter, htmlFilter, that = this; this.editor = editor; /** * Data filter used when processing input by {@link #toHtml}. * * @property {CKEDITOR.htmlParser.filter} */ this.dataFilter = dataFilter = new CKEDITOR.htmlParser.filter(); /**...
cwe
CWE-79
JavaScript
static VALUE cState_array_nl_set(VALUE self, VALUE array_nl) { unsigned long len; GET_STATE(self); Check_Type(array_nl, T_STRING); len = RSTRING_LEN(array_nl); if (len == 0) { if (state->array_nl) { ruby_xfree(state->array_nl); state->array_nl = NULL; } } ...
cwe
CWE-787
Unknown
SPL_METHOD(SplDoublyLinkedList, offsetSet) { zval *zindex, *value; spl_dllist_object *intern; if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &zindex, &value) == FAILURE) { return; } intern = Z_SPLDLLIST_P(getThis()); if (Z_TYPE_P(zindex) == IS_NULL) { /* $obj[] = ... */ spl_ptr_lli...
cwe
CWE-415
C/C++
bool CModules::GetModInfo(CModInfo& ModInfo, const CString& sModule, CString& sRetMsg) { CString sModPath, sTmp; bool bSuccess; bool bHandled = false; GLOBALMODULECALL(OnGetModInfo(ModInfo, sModule, bSuccess, sRetMsg), &bHandled); if (bHandled) return ...
cwe
CWE-20
Unknown
/* **** GENERATED CODE **** This code has been generated by resources/buildConfigDefinitions.js Do not edit manually, but update Options/index.js */ var parsers = require('./parsers'); module.exports.SchemaOptions = { afterMigration: { env: 'PARSE_SERVER_SCHEMA_AFTER_MIGRATION', help: 'Execute a callback aft...
cwe
CWE-290
JavaScript
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { const TfLiteTensor* input = GetInput(context, node, kInputTensor); TfLiteTensor* output = GetOutput(context, node, kOutputTensor); const TfLiteTensor* multipliers = GetInput(context, node, kInputMultipliers); if (IsDynamicTensor(output)) { TF_LI...
cwe
CWE-125
C/C++
/* * Phusion Passenger - https://www.phusionpassenger.com/ * Copyright (c) 2018 Phusion Holding B.V. * * "Passenger", "Phusion Passenger" and "Union Station" are registered * trademarks of Phusion Holding B.V. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this softw...
cwe
CWE-264
C/C++
/* * NETLINK Kernel-user communication protocol. * * Authors: Alan Cox <alan@lxorguk.ukuu.org.uk> * Alexey Kuznetsov <kuznet@ms2.inr.ac.ru> * Patrick McHardy <kaber@trash.net> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public...
cwe
CWE-415
C/C++
// Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite (interfaces: AuthorizeRequester) // Package internal is a generated GoMock package. package internal import ( url "net/url" reflect "reflect" time "time" gomock "github.com/golang/mock/gomock" fosite "github.com/ory/fosite" ) // MockA...
cwe
CWE-345
Go
/* A Bison parser, made by GNU Bison 3.2.4. */ /* Bison implementation for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2015, 2018 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as publis...
cwe
CWE-415
C/C++
static void cryptinfo_node_start(void *sax_cbck, const char *node_name, const char *name_space, const GF_XMLAttribute *attributes, u32 nb_attributes) { GF_XMLAttribute *att; GF_TrackCryptInfo *tkc; u32 i; GF_CryptInfo *info = (GF_CryptInfo *)sax_cbck; if (!strcmp(node_name, "OMATextHeader")) { info->in_text_hea...
cwe
CWE-787
Unknown
function O(ua,ya,Na){var Fa=U.menus.get(ua),Ra=R.addMenu(mxResources.get(ua),mxUtils.bind(this,function(){Fa.funct.apply(this,arguments)}),P);Ra.className="1"==urlParams.sketch?"geToolbarButton":"geMenuItem";Ra.style.display="inline-block";Ra.style.boxSizing="border-box";Ra.style.top="6px";Ra.style.marginRight="6px";Ra...
cwe
CWE-94
JavaScript
static struct sk_buff *macsec_decrypt(struct sk_buff *skb, struct net_device *dev, struct macsec_rx_sa *rx_sa, sci_t sci, struct macsec_secy *secy) { int ret; struct scatterlist *sg; unsigned char *iv; struct aead_request *req; struct macsec_eth_header *hdr; u16 icv_len = s...
cwe
CWE-119
Unknown
/* * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg is distributed...
cwe
CWE-125
C/C++
glue(cirrus_bitblt_rop_fwd_, ROP_NAME)(CirrusVGAState *s, uint8_t *dst,const uint8_t *src, int dstpitch,int srcpitch, int bltwidth,int bltheight) { int x,y; dstpitch -= bltwidth; srcpitch -= bltwidth; for (y = 0; y < ...
cwe
CWE-787
Unknown
/* * Copyright (C) 2015 Canonical Ltd * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WA...
cwe
CWE-59
Go
/* * 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-680
C/C++
static int hid_debug_events_release(struct inode *inode, struct file *file) { struct hid_debug_list *list = file->private_data; unsigned long flags; spin_lock_irqsave(&list->hdev->debug_list_lock, flags); list_del(&list->node); spin_unlock_irqrestore(&list->hdev->debug_list_lock, flags); kfree(list->hid_debug_bu...
cwe
CWE-835
Unknown
static int snd_pcm_oss_sync(struct snd_pcm_oss_file *pcm_oss_file) { int err = 0; unsigned int saved_f_flags; struct snd_pcm_substream *substream; struct snd_pcm_runtime *runtime; snd_pcm_format_t format; unsigned long width; size_t size; substream = pcm_oss_file->streams[SNDRV_PCM_STREAM_PLAYBACK]; if (subst...
cwe
CWE-362
Unknown
function error(message) { throw peg$buildException(message, null, peg$reportedPos); }
cwe
CWE-1321
JavaScript
/* * Copyright 2017-2019 original authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
cwe
CWE-400
Java
!0);V.init()}))})})}));d.actions.put("liveImage",new Action("Live image...",function(){var n=d.getCurrentFile();null!=n&&d.spinner.spin(document.body,mxResources.get("loading"))&&d.getPublicUrl(d.getCurrentFile(),function(y){d.spinner.stop();null!=y?(y=new EmbedDialog(d,'<img src="'+(n.constructor!=DriveFile?y:"https:/...
cwe
CWE-20
JavaScript
void DDGifSlurp(GifInfo *info, bool decode, bool exitAfterFrame) { GifRecordType RecordType; GifByteType *ExtData; int ExtFunction; GifFileType *gifFilePtr; gifFilePtr = info->gifFilePtr; uint_fast32_t lastAllocatedGCBIndex = 0; do { if (DGifGetRecordType(gifFilePtr, &RecordType) == GIF_ERROR) { break; } ...
cwe
CWE-415
C/C++
/* radare - LGPL - Copyright 2010-2018 - pancake */ #include <stdio.h> #include <string.h> #include <ctype.h> #include <stdlib.h> #include <r_util.h> #include "armass16_const.h" // TODO: only lo registers accessible in thumb arm typedef struct { ut64 off; ut32 o; char op[128]; char opstr[128]; char *a[16]; /* o...
cwe
CWE-125
C/C++
char* skipSpaces( char* ptr, int min_indent, int max_comment_indent ) { for(;;) { while( *ptr == ' ' ) ptr++; if( *ptr == '#' ) { if( ptr - fs->bufferStart() > max_comment_indent ) return ptr; *pt...
cwe
CWE-476
Unknown
# Performs extraction of data that matches extraction rules. # This is automatically invoked by core.module code if extraction has been # enabled by the user; other modules need not reference this module directly. import os import re import stat import shlex import tempfile import subprocess import binwalk.core.common...
cwe
CWE-61
Python
function cn(e){var t=e.transaction,n=e.entry,r=e.event,i=e.timeOrigin,o=e.eventEnd,a=e.description,s=o?n[o]:n[r+"End"],l=n[r+"Start"];l&&s&&dn(t,{op:"browser",description:null!=a?a:r,startTimestamp:i+(0,Gt.XL)(l),endTimestamp:i+(0,Gt.XL)(s)})}
cwe
CWE-79
JavaScript
negotiate_handshake_newstyle_options (struct connection *conn) { struct new_option new_option; size_t nr_options; uint64_t version; uint32_t option; uint32_t optlen; char data[MAX_OPTION_LENGTH+1]; struct new_handshake_finish handshake_finish; const char *optname; for (nr_options = 0; nr_options < MA...
cwe
CWE-406
Unknown
/* Copyright 2008-2017 LibRaw LLC (info@libraw.org) LibRaw is free software; you can redistribute it and/or modify it under the terms of the one of two licenses as you choose: 1. GNU LESSER GENERAL PUBLIC LICENSE version 2.1 (See file LICENSE.LGPL provided in LibRaw distribution archive for details). 2. COMMON...
cwe
CWE-787
C/C++
int ext4_orphan_add(handle_t *handle, struct inode *inode) { struct super_block *sb = inode->i_sb; struct ext4_iloc iloc; int err = 0, rc; if (!ext4_handle_valid(handle)) return 0; mutex_lock(&EXT4_SB(sb)->s_orphan_lock); if (!list_empty(&EXT4_I(inode)->i_orphan)) goto out_unlock; /* * Orphan handling i...
cwe
CWE-20
C/C++
function(A,z,L,M,n){q.apply(this,arguments);m()};t.resizeCell=function(){mxGraph.prototype.resizeCell.apply(this,arguments);m()};t.connectionHandler.addListener(mxEvent.CONNECT,function(){m()})}var v=mxUtils.button(mxResources.get("close"),function(){b.confirm(mxResources.get("areYouSure"),function(){null!=u.parentNode...
cwe
CWE-20
JavaScript
xps_load_sfnt_name(xps_font_t *font, char *namep) { byte *namedata; int offset, length; /*int format;*/ int count, stringoffset; int found; int i, k; found = 0; strcpy(namep, "Unknown"); offset = xps_find_sfnt_table(font, "name", &length); if (offset < 0 || length < 6) {...
cwe
CWE-119
C/C++
/* * Wire * Copyright (C) 2016 Wire Swiss GmbH * * 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. * * This program is dis...
cwe
CWE-134
C/C++
package profile import ( "bufio" "bytes" "context" "crypto" "crypto/hmac" "crypto/rand" "crypto/rsa" "crypto/sha256" "crypto/sha512" "crypto/subtle" "crypto/tls" "crypto/x509" "encoding/base64" "encoding/json" "encoding/pem" "fmt" "io" "io/ioutil" mathrand "math/rand" "net" "net/http" "net/url" ...
cwe
CWE-269
Go
static void InsertRow(Image *image,ssize_t depth,unsigned char *p,ssize_t y, ExceptionInfo *exception) { size_t bit; ssize_t x; register Quantum *q; Quantum index; index=0; switch (depth) { case 1: /* Convert bitmap scanline. */ { q=QueueAuthenticPixels(image,0,y,image->columns,1,e...
cwe
CWE-787
C/C++
// Copyright 2016 The OPA Authors. All rights reserved. // Use of this source code is governed by an Apache2 // license that can be found in the LICENSE file. package ast import ( "fmt" "io" "sort" "strconv" "strings" "github.com/open-policy-agent/opa/ast/location" "github.com/open-policy-agent/opa/internal/...
cwe
CWE-20
Go
queryfree (struct dns_transmit *d) { if (!d->query) return; alloc_free (d->query); d->query = 0; }
cwe
CWE-362
Unknown
htmlParsePubidLiteral(htmlParserCtxtPtr ctxt) { const xmlChar *q; xmlChar *ret = NULL; /* * Name ::= (Letter | '_') (NameChar)* */ if (CUR == '"') { NEXT; q = CUR_PTR; while (IS_PUBIDCHAR_CH(CUR)) NEXT; if (CUR != '"') { htmlParseErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED, ...
cwe
CWE-416
C/C++
getScanlineChunkOffsetTableSize(const Header& header) { const Box2i &dataWindow = header.dataWindow(); vector<size_t> bytesPerLine; size_t maxBytesPerLine = bytesPerLineTable (header, bytesPerLine); Compressor* compressor = newCompressor(header.compressi...
cwe
CWE-125
Unknown
/* +----------------------------------------------------------------------+ | HipHop for PHP | +----------------------------------------------------------------------+ | Copyright (c) 2010-present Facebook, Inc. (http://www.facebook.com) | | Copyrigh...
cwe
CWE-20
C/C++
/* * Copyright (c) 2019-2021 GeyserMC. http://geysermc.org * * 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, including without limitation the rights * to use, copy,...
cwe
CWE-287
Java
/* mqtt_client.c * * Copyright (C) 2006-2021 wolfSSL Inc. * * This file is part of wolfMQTT. * * wolfMQTT 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...
cwe
CWE-787
C/C++
J&&E(Editor.svgBrokenImage.src)});else{var N=new Image;this.crossOriginImages&&(N.crossOrigin="anonymous");N.onload=function(){window.clearTimeout(T);if(J)try{var Q=document.createElement("canvas"),R=Q.getContext("2d");Q.height=N.height;Q.width=N.width;R.drawImage(N,0,0);E(Q.toDataURL())}catch(Y){E(Editor.svgBrokenImag...
cwe
CWE-20
JavaScript
} elseif (isset($graph['data_query_name'])) { if (isset($prev_data_query_name)) { if ($prev_data_query_name != $graph['data_query_name']) { $print = true; $prev_data_query_name = $graph['data_query_name']; } else { $print = false; } } else { $print = true; $prev_data...
cwe
CWE-79
PHP
#include <linux/kernel.h> #include <linux/skbuff.h> #include <linux/export.h> #include <linux/ip.h> #include <linux/ipv6.h> #include <linux/if_vlan.h> #include <net/ip.h> #include <net/ipv6.h> #include <linux/igmp.h> #include <linux/icmp.h> #include <linux/sctp.h> #include <linux/dccp.h> #include <linux/if_tunnel.h> #i...
cwe
CWE-665
C/C++
static int bpf_convert_filter(struct sock_filter *prog, int len, struct bpf_prog *new_prog, int *new_len) { int new_flen = 0, pass = 0, target, i, stack_off; struct bpf_insn *new_insn, *first_insn = NULL; struct sock_filter *fp; int *addrs = NULL; u8 bpf_src; BUILD_BUG_ON(BPF_MEMWORDS * sizeof(u32) > MA...
cwe
CWE-120
C/C++
package com.salesmanager.shop.admin.controller.tax; import com.salesmanager.core.business.services.catalog.product.ProductService; import com.salesmanager.core.business.services.tax.TaxClassService; import com.salesmanager.core.business.utils.ajax.AjaxPageableResponse; import com.salesmanager.core.business.utils.ajax....
cwe
CWE-639
Java
static int vorbis_header(AVFormatContext *s, int idx) { struct ogg *ogg = s->priv_data; AVStream *st = s->streams[idx]; struct ogg_stream *os = ogg->streams + idx; struct oggvorbis_private *priv; int pkt_type = os->buf[os->pstart]; if (!os->private) { os->private = av_mallocz(sizeof(...
cwe
CWE-703
Unknown
window.wp=window.wp||{},function(a,b,c){b.updates={},b.updates.ajaxNonce=window._wpUpdatesSettings.ajax_nonce,b.updates.l10n=window._wpUpdatesSettings.l10n,b.updates.shouldRequestFilesystemCredentials=null,b.updates.filesystemCredentials={ftp:{host:null,username:null,password:null,connectionType:null},ssh:{publicKey:nu...
cwe
CWE-352
JavaScript
public InternetAddress requestResetPassword(UserReference user) throws ResetPasswordException { if (this.authorizationManager.hasAccess(Right.PROGRAM)) { ResetPasswordRequestResponse resetPasswordRequestResponse = this.resetPasswordManager.requestResetPassword(user); ...
cwe
CWE-200
Java
static int hidpp_ff_init(struct hidpp_device *hidpp, u8 feature_index) { struct hid_device *hid = hidpp->hid_dev; struct hid_input *hidinput = list_entry(hid->inputs.next, struct hid_input, list); struct input_dev *dev = hidinput->input; const struct usb_device_descriptor *udesc = &(hid_to_usb_dev(hid)->descriptor)...
cwe
CWE-787
C/C++
/* 32-bit ELF support for ARM Copyright (C) 1998-2020 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. 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 ...
cwe
CWE-476
C/C++
# # Copyright (c) 2010 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have received a copy of...
cwe
CWE-264
Python
void NetworkHandler::ClearBrowserCache( std::unique_ptr<ClearBrowserCacheCallback> callback) { if (!process_) { callback->sendFailure(Response::InternalError()); return; } content::BrowsingDataRemover* remover = content::BrowserContext::GetBrowsingDataRemover( process_->GetBrowser...
cwe
CWE-20
C/C++
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")); var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray")); var _defineProperty2 = _interopR...
cwe
CWE-20
JavaScript
autoar_extractor_do_sanitize_pathname (AutoarExtractor *self, const char *pathname_bytes) { GFile *extracted_filename; gboolean valid_filename; g_autofree char *sanitized_pathname; g_autofree char *utf8_pathname; utf8_pathname = autoar_common_get_utf8_pathname (pat...
cwe
CWE-22
Unknown
__ext4_set_acl(handle_t *handle, struct inode *inode, int type, struct posix_acl *acl) { int name_index; void *value = NULL; size_t size = 0; int error; switch (type) { case ACL_TYPE_ACCESS: name_index = EXT4_XATTR_INDEX_POSIX_ACL_ACCESS; if (acl) { error = posix_acl_equiv_mode(acl, &inode->i_mode);...
cwe
CWE-285
Unknown
// Copyright 2017 The OPA Authors. All rights reserved. // Use of this source code is governed by an Apache2 // license that can be found in the LICENSE file. // Package format implements formatting of Rego source files. package format import ( "bytes" "fmt" "regexp" "sort" "github.com/open-policy-agent/opa/as...
cwe
CWE-682
Go
int _XF86LoadQueryLocaleFont( Display *dpy, _Xconst char *name, XFontStruct **xfp, Font *fidp) { int l; const char *charset, *p; char buf[256]; XFontStruct *fs; XLCd lcd; if (!name) return 0; l = (int) strlen(name); if (l < 2 || name[l - 1] != '*' || name[l - 2] != '-') re...
cwe
CWE-120
Unknown
fstring_find_literal(const char **str, const char *end, int raw, PyObject **literal, int recurse_lvl, struct compiling *c, const node *n) { /* Get any literal string. It ends when we hit an un-doubled left brace (which isn't part of a unicode name escape such as ...
cwe
CWE-125
C/C++
const router = require('express').Router const request = require('request') const { URL } = require('url') const validator = require('validator') const { startDownUpload } = require('../helpers/upload') const { getURLMeta, getRedirectEvaluator, getProtectedHttpAgent } = require('../helpers/request') const logger = req...
cwe
CWE-863
JavaScript
package models import ( "crypto/tls" "errors" "net/mail" "os" "strconv" "strings" "time" "github.com/gophish/gomail" log "github.com/gophish/gophish/logger" "github.com/gophish/gophish/mailer" "github.com/jinzhu/gorm" ) // Dialer is a wrapper around a standard gomail.Dialer in order // to implement the ma...
cwe
CWE-918
Go
VERSION = (0, 9, '3a3') __version__ = '.'.join(map(str, VERSION)) version = lambda: __version__
cwe
CWE-74
Python
static inline double LevelPixel(const double black_point, const double white_point,const double gamma,const double pixel) { double level_pixel, scale; scale=PerceptibleReciprocal(white_point-black_point); level_pixel=QuantumRange*gamma_pow(scale*((double) pixel-black_point), 1.0/gamma); return(le...
cwe
CWE-369
Unknown
/* * GPAC - Multimedia Framework C SDK * * Authors: Jean Le Feuvre, Romain Bouqueau, Cyril Concolato * Copyright (c) Telecom ParisTech 2000-2021 * All rights reserved * * This file is part of GPAC / Media Tools sub-project * * GPAC is free software; you can redistribute it and/or modify * it unde...
cwe
CWE-415
C/C++
bool NormalPageArena::expandObject(HeapObjectHeader* header, size_t newSize) { ASSERT(header->checkHeader()); if (header->payloadSize() >= newSize) return true; size_t allocationSize = ThreadHeap::allocationSizeFromSize(newSize); ASSERT(allocationSize > header->size()); size_t expandSize = allocationSi...
cwe
CWE-787
C/C++
package verify import ( "errors" "fmt" "time" ) var ( ErrMissingKey = errors.New("tuf: missing key") ErrNoSignatures = errors.New("tuf: data has no signatures") ErrInvalid = errors.New("tuf: signature verification failed") ErrWrongMethod = errors.New("tuf: invalid signat...
cwe
CWE-354
Go
void PrintPreviewHandler::HandleGetPreview(const ListValue* args) { DCHECK_EQ(3U, args->GetSize()); scoped_ptr<DictionaryValue> settings(GetSettingsDictionary(args)); if (!settings.get()) return; int request_id = -1; if (!settings->GetInteger(printing::kPreviewRequestID, &request_id)) return; Print...
cwe
CWE-200
C/C++
static void cirrus_bitblt_fill_nop(CirrusVGAState *s, uint8_t *dst, int dstpitch, int bltwidth,int bltheight) { }
cwe
CWE-119
Unknown
static UINT32 nsc_rle_encode(BYTE* in, BYTE* out, UINT32 originalSize) { UINT32 left; UINT32 runlength = 1; UINT32 planeSize = 0; left = originalSize; /** * We quit the loop if the running compressed size is larger than the original. * In such cases data will be sent uncompressed. */ while (left > 4 && ...
cwe
CWE-787
C/C++
/************************************************************************ * This file is part of EspoCRM. * * EspoCRM - Open Source CRM application. * Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko * Website: https://www.espocrm.com * * EspoCRM is free software: you can redistribute i...
cwe
CWE-79
JavaScript
mon_rwxa_t MonCapGrant::get_allowed(CephContext *cct, int daemon_type, EntityName name, const std::string& s, const std::string& c, const map<string,string>& c_args) const { if (profile.length()) { expand_profile(daemon_type, name); mon_rwxa_t a; for (list<MonCapGrant>::con...
cwe
CWE-285
Unknown
find_start_brace(void) // XXX { pos_T cursor_save; pos_T *trypos; pos_T *pos; static pos_T pos_copy; cursor_save = curwin->w_cursor; while ((trypos = findmatchlimit(NULL, '{', FM_BLOCKSTOP, 0)) != NULL) { pos_copy = *trypos; // copy pos_T, next findmatch will change it trypos = &pos_c...
cwe
CWE-787
C/C++
/* radare - LGPL - Copyright 2008-2022 - nibble, pancake, thestr4ng3r */ #include <r_anal.h> #include <r_core.h> static bool item_matches_filter(RAnalMetaItem *item, RAnalMetaType type, R_NULLABLE const RSpace *space) { return (type == R_META_TYPE_ANY || item->type == type) && (!space || item->space == space); } ty...
cwe
CWE-74
C/C++
/* * Copyright (c) 2011-2015 The original author or authors * ------------------------------------------------------ * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * and Apache License v2.0 which accompanies this distr...
cwe
CWE-287
Java