code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
fep_client_open (const char *address) { FepClient *client; struct sockaddr_un sun; ssize_t sun_len; int retval; if (!address) address = getenv ("LIBFEP_CONTROL_SOCK"); if (!address) return NULL; if (strlen (address) + 1 >= sizeof(sun.sun_path)) { fep_log (FEP_LOG_LEVEL_WARNING, ...
cwe
CWE-264
Unknown
renderCoTable(struct table *tbl, int maxlimit) { struct readbuffer obuf; struct html_feed_environ h_env; struct environment envs[MAX_ENV_LEVEL]; struct table *t; int i, col, row; int indent, maxwidth; if (cotable_level >= MAX_COTABLE_LEVEL) return; /* workaround to prevent infinite recursi...
cwe
CWE-835
C/C++
crypto_bob3( struct exten *ep, /* extension pointer */ struct value *vp /* value pointer */ ) { DSA *dsa; /* MV parameters */ DSA *sdsa; /* DSA signature context fake */ BN_CTX *bctx; /* BIGNUM context */ EVP_MD_CTX ctx; /* signature context */ tstamp_t tstamp; /* NTP timestamp */ BIGNUM *r, *k, *u; u_cha...
cwe
CWE-20
Unknown
exsltDynMapFunction(xmlXPathParserContextPtr ctxt, int nargs) { xmlChar *str = NULL; xmlNodeSetPtr nodeset = NULL; xsltTransformContextPtr tctxt; xmlXPathCompExprPtr comp = NULL; xmlXPathObjectPtr ret = NULL; xmlDocPtr oldDoc, container = NULL; xmlNodePtr oldNode; int oldContextSize; ...
cwe
CWE-119
C/C++
static ssize_t aio_write(struct kiocb *req, const struct iocb *iocb, bool vectored, bool compat) { struct iovec inline_vecs[UIO_FASTIOV], *iovec = inline_vecs; struct iov_iter iter; struct file *file; ssize_t ret; ret = aio_prep_rw(req, iocb); if (ret) return ret; file = req->ki_filp; ret = -EBADF; if ...
cwe
CWE-416
Unknown
export_desktop_file (const char *app, const char *branch, const char *arch, GKeyFile *metadata, const char * const *previous_ids, int parent_fd, ...
cwe
CWE-94
C/C++
static BOOL gdi_Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap, const BYTE* pSrcData, UINT32 DstWidth, UINT32 DstHeight, UINT32 bpp, UINT32 length, BOOL compressed, UINT32 codecId) { UINT32 SrcSize = lengt...
cwe
CWE-190
Unknown
var sanitize_html = function (html, allow_css) { /** * sanitize HTML * if allow_css is true (default: false), CSS is sanitized as well. * otherwise, CSS elements and attributes are simply removed. */ var html4 = caja.html4; if (allow_css) { // all...
cwe
CWE-79
JavaScript
add_link_ref( struct link_ref **references, const uint8_t *name, size_t name_size) { struct link_ref *ref = calloc(1, sizeof(struct link_ref)); if (!ref) return NULL; ref->id = hash_link_ref(name, name_size); ref->next = references[ref->id % REF_TABLE_SIZE]; references[ref->id % REF_TABLE_SIZE] = ref; retu...
cwe
CWE-400
C/C++
export function initSidebar(): void { const errorCountEl = document.getElementById("error-count"); if (errorCountEl instanceof HTMLLIElement) { errorCount.subscribe((errorCount_val) => { errorCountEl.classList.toggle("hidden", errorCount_val === 0); const span = errorCountEl.querySelector("span"); ...
cwe
CWE-79
JavaScript
public static AsciiString of(AsciiString name) { final AsciiString lowerCased = name.toLowerCase(); final AsciiString cached = map.get(lowerCased); return cached != null ? cached : lowerCased; }
cwe
CWE-74
Java
static Image *ReadMIFFImage(const ImageInfo *image_info, ExceptionInfo *exception) { #define BZipMaxExtent(x) ((x)+((x)/100)+600) #define LZMAMaxExtent(x) ((x)+((x)/3)+128) #define ThrowMIFFException(exception,message) \ { \ if (quantum_info != (QuantumInfo *) NULL) \ quantum_info=DestroyQuantumInfo(quantum_i...
cwe
CWE-772
C/C++
static int l2tp_ip6_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, size_t len, int noblock, int flags, int *addr_len) { struct ipv6_pinfo *np = inet6_sk(sk); struct sockaddr_l2tpip6 *lsa = (struct sockaddr_l2tpip6 *)msg->msg_name; size_t copied = 0; int err = -EOPNOTSUPP; struct sk_...
cwe
CWE-20
Unknown
evdev_log_msg_ratelimit(struct evdev_device *device, struct ratelimit *ratelimit, enum libinput_log_priority priority, const char *format, ...) { va_list args; char buf[1024]; enum ratelimit_state state; if (!is_logged(evdev_libinput_context(device), priority)) return; state = ratelimit_test(ratel...
cwe
CWE-134
Unknown
function override(...rawArgs) { if (rawArgs.length < 1 || typeof rawArgs[0] !== 'object') return false; if (rawArgs.length < 2) return rawArgs[0]; const target = rawArgs[0]; const args = Array.prototype.slice.call(rawArgs, 1); let val, src; args.forEach(obj => { if (typeof obj !== 'object') return; ...
cwe
CWE-1321
JavaScript
submit_request(CMD_Request *request, CMD_Reply *reply, int *reply_auth_ok) { unsigned long tx_sequence; socklen_t where_from_len; union sockaddr_in46 where_from; int bad_length, bad_sender, bad_sequence, bad_header; int select_status; int recvfrom_status; int read_length; int expected_length; int comm...
cwe
CWE-189
Unknown
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { const TfLitePackParams* data = reinterpret_cast<TfLitePackParams*>(node->builtin_data); TfLiteTensor* output = GetOutput(context, node, kOutputTensor); switch (output->type) { case kTfLiteFloat32: { return PackImpl<float>(context, node...
cwe
CWE-125
C/C++
int qrtr_endpoint_post(struct qrtr_endpoint *ep, const void *data, size_t len) { struct qrtr_node *node = ep->node; const struct qrtr_hdr_v1 *v1; const struct qrtr_hdr_v2 *v2; struct qrtr_sock *ipc; struct sk_buff *skb; struct qrtr_cb *cb; size_t size; unsigned int ver; size_t hdrlen; if (len == 0 || len & 3...
cwe
CWE-125
C/C++
static int sgi_clock_get(clockid_t clockid, struct timespec *tp) { u64 nsec; nsec = rtc_time() * sgi_clock_period + sgi_clock_offset.tv_nsec; tp->tv_sec = div_long_long_rem(nsec, NSEC_PER_SEC, &tp->tv_nsec) + sgi_clock_offset.tv_sec; return 0; };
cwe
CWE-189
C/C++
def add_translationname(self, trname): """Add new translation by item name for an item.""" if self.connection: for item in self.find_item_name([trname[0], '0']): self.cursor.execute('insert into itemtranslation (itemid, itemlanguageid, translation) values ("%s", "%s", "%s")' ...
cwe
CWE-89
Python
NO_INLINE JsVar *jspeStatementFor() { JSP_ASSERT_MATCH(LEX_R_FOR); JSP_MATCH('('); bool wasInLoop = (execInfo.execute&EXEC_IN_LOOP)!=0; execInfo.execute |= EXEC_FOR_INIT; // initialisation JsVar *forStatement = 0; // we could have 'for (;;)' - so don't munch up our semicolon if that's all we have if (le...
cwe
CWE-125
Unknown
/** @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-193
C/C++
buildRawBurnTx(burnAmount: BigNumber, config: configBuildRawBurnTx, type = 0x01) { let sendMsg: SlpTransactionDetails; if(config.slpBurnOpReturn) { sendMsg = this.parseSlpOutputScript(config.slpBurnOpReturn); if(!sendMsg.sendOutputs) throw Error("OP_RETURN contai...
cwe
CWE-20
JavaScript
Expr *sqlite3CreateColumnExpr(sqlite3 *db, SrcList *pSrc, int iSrc, int iCol){ Expr *p = sqlite3ExprAlloc(db, TK_COLUMN, 0, 0); if( p ){ struct SrcList_item *pItem = &pSrc->a[iSrc]; p->y.pTab = pItem->pTab; p->iTable = pItem->iCursor; if( p->y.pTab->iPKey==iCol ){ p->iColumn = -1; }else{ ...
cwe
CWE-754
C/C++
function insertCategory(name, description, rankID, numAchievments, connection) { var strQuery = "INSERT INTO category VALUES('"+name+"', '" + description + "', '" + rankID+"', '"+numAchievments+ "', 'NULL')"; connection.query( strQuery, function(err, rows) {if(err) { throw err; }else{ if(debug) {...
cwe
CWE-89
JavaScript
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { const TfLiteTensor* start = GetInput(context, node, kStartTensor); const TfLiteTensor* limit = GetInput(context, node, kLimitTensor); const TfLiteTensor* delta = GetInput(context, node, kDeltaTensor); TfLiteTensor* output = GetOutput(context, node, ...
cwe
CWE-787
C/C++
INLINE UWORD8 impeg2d_bit_stream_get_bit(stream_t *ps_stream) { UWORD32 u4_bit,u4_offset,u4_temp; UWORD32 u4_curr_bit; u4_offset = ps_stream->u4_offset; u4_curr_bit = u4_offset & 0x1F; u4_bit = ps_stream->u4_buf; /* Move the current bit read from...
cwe
CWE-200
C/C++
int hw_atl_utils_fw_rpc_wait(struct aq_hw_s *self, struct hw_atl_utils_fw_rpc **rpc) { struct aq_hw_atl_utils_fw_rpc_tid_s sw; struct aq_hw_atl_utils_fw_rpc_tid_s fw; int err = 0; do { sw.val = aq_hw_read_reg(self, HW_ATL_RPC_CONTROL_ADR); self->rpc_tid = sw.tid; err = readx_poll_timeout_atomic(hw_...
cwe
CWE-787
C/C++
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { const TfLiteTensor* input = GetInput(context, node, kInputTensor); TfLiteTensor* output = GetOutput(context, node, kOutputTensor); // TODO(b/143912164): instead of hardcode the epsilon here, we should read it // from tensorflow, i.e., adding a param...
cwe
CWE-125
C/C++
LONG ValidateSignature(HWND hDlg, const char* path) { LONG r; WINTRUST_DATA trust_data = { 0 }; WINTRUST_FILE_INFO trust_file = { 0 }; GUID guid_generic_verify = // WINTRUST_ACTION_GENERIC_VERIFY_V2 { 0xaac56b, 0xcd44, 0x11d0,{ 0x8c, 0xc2, 0x0, 0xc0, 0x4f, 0xc2, 0x95, 0xee } }; char *signature_name; size_t i; ...
cwe
CWE-94
Unknown
static int generate_key(DH *dh) { int ok = 0; int generate_new_key = 0; unsigned l; BN_CTX *ctx; BN_MONT_CTX *mont = NULL; BIGNUM *pub_key = NULL, *priv_key = NULL; ctx = BN_CTX_new(); if (ctx == NULL) goto err; if (dh->priv_key == NULL) { priv_key = BN_new(); ...
cwe
CWE-320
Unknown
(v.style.display="none");q.appendChild(v);b.editor.cancelFirst?(q.appendChild(k),q.appendChild(g),q.appendChild(m)):(q.appendChild(g),q.appendChild(m),q.appendChild(k));t.appendChild(q);this.container=t},CropImageDialog=function(b,f,l,d){function u(){var B=z.checked,F=L.checked,G=v.geometry,N=e.width,J=e.height,E=(300-...
cwe
CWE-20
JavaScript
l2tp_q931_cc_print(netdissect_options *ndo, const u_char *dat, u_int length) { print_16bits_val(ndo, (const uint16_t *)dat); ND_PRINT((ndo, ", %02x", dat[2])); if (length > 3) { ND_PRINT((ndo, " ")); print_string(ndo, dat+3, length-3); } }
cwe
CWE-125
C/C++
raptor_libxml_resolveEntity(void* user_data, const xmlChar *publicId, const xmlChar *systemId) { raptor_sax2* sax2 = (raptor_sax2*)user_data; return libxml2_resolveEntity(sax2->xc, publicId, systemId); }
cwe
CWE-611
C/C++
ssize_t qemu_sendv_packet_async(NetClientState *sender, const struct iovec *iov, int iovcnt, NetPacketSent *sent_cb) { NetQueue *queue; int ret; if (sender->link_down || !sender->peer) { return iov_size(iov, iovcnt); } /* Let ...
cwe
CWE-190
Unknown
def generate(bits, randfunc, progress_func=None): """Randomly generate a fresh, new ElGamal key. :Parameters: bits : int Key length, or size (in bits) of the modulus *p*. Recommended value is 2048. randfunc : callable Random number generation function; it sho...
cwe
CWE-310
Python
status_t OMXNodeInstance::prepareForAdaptivePlayback( OMX_U32 portIndex, OMX_BOOL enable, OMX_U32 maxFrameWidth, OMX_U32 maxFrameHeight) { Mutex::Autolock autolock(mLock); CLOG_CONFIG(prepareForAdaptivePlayback, "%s:%u en=%d max=%ux%u", portString(portIndex), portIndex, enable,...
cwe
CWE-200
C/C++
void color_apply_icc_profile(opj_image_t *image) { cmsHPROFILE in_prof, out_prof; cmsHTRANSFORM transform; cmsColorSpaceSignature in_space, out_space; cmsUInt32Number intent, in_type, out_type; int *r, *g, *b; size_t nr_samples, i, max, max_w, max_h; int prec, ok = 0; OPJ_COLOR_SPACE new...
cwe
CWE-119
C/C++
// SPDX-License-Identifier: GPL-2.0 /* * dbgp.c -- EHCI Debug Port device gadget * * Copyright (C) 2010 Stephane Duverger * * Released under the GPLv2. */ /* verbose messages */ #include <linux/kernel.h> #include <linux/device.h> #include <linux/module.h> #include <linux/usb/ch9.h> #include <linux/usb/gadget.h> ...
cwe
CWE-787
C/C++
/* * Copyright © 2017-2018 Aeneas Rekkas <aeneas+oss@aeneas.io> * * 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...
cwe
CWE-287
Go
void fs_rebuild_etc(void) { int have_dhcp = 1; if (cfg.dns1 == NULL && !any_dhcp()) have_dhcp = 0; if (arg_debug) printf("rebuilding /etc directory\n"); if (mkdir(RUN_DNS_ETC, 0755)) errExit("mkdir"); selinux_relabel_path(RUN_DNS_ETC, "/etc"); fs_logger("tmpfs /etc"); DIR *dir = opendir("/etc"); if (!di...
cwe
CWE-94
Unknown
/* Copyright (c) 2014. The YARA Authors. All Rights Reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the followi...
cwe
CWE-416
C/C++
static inline const unsigned char *ReadResourceLong(const unsigned char *p, unsigned int *quantum) { *quantum=(size_t) (*p++ << 24); *quantum|=(size_t) (*p++ << 16); *quantum|=(size_t) (*p++ << 8); *quantum|=(size_t) (*p++ << 0); return(p); }
cwe
CWE-190
C/C++
static TfLiteRegistration DelegateRegistration() { TfLiteRegistration reg = {nullptr, nullptr, nullptr, nullptr}; reg.prepare = [](TfLiteContext* context, TfLiteNode* node) { // If tensors are resized, the runtime should propagate shapes // automatically if correct flag is set. Ensure values are co...
cwe
CWE-125
C/C++
/* * Error resilience / concealment * * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at> * * 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...
cwe
CWE-20
C/C++
int blk_mq_init_sched(struct request_queue *q, struct elevator_type *e) { struct blk_mq_hw_ctx *hctx; struct elevator_queue *eq; unsigned int i; int ret; if (!e) { q->elevator = NULL; q->nr_requests = q->tag_set->queue_depth; return 0; } /* * Default to double of smaller one between hw queue_depth and ...
cwe
CWE-416
Unknown
void create_empty_dir_as_root(const char *dir, mode_t mode) { assert(dir); mode &= 07777; struct stat s; if (stat(dir, &s)) { if (arg_debug) printf("Creating empty %s directory\n", dir); /* coverity[toctou] */ // don't fail if directory already exists. This can be the case in a race // condition, when t...
cwe
CWE-94
Unknown
GC_API GC_ATTR_MALLOC void * GC_CALL GC_finalized_malloc(size_t lb, const struct GC_finalizer_closure *fclos) { word *op; GC_ASSERT(done_init); op = GC_malloc_kind(lb + sizeof(word), GC_finalized_kind); if (EXPECT(NULL == op, FALSE)) return NULL; *op = (word)...
cwe
CWE-119
Unknown
unsigned char *ssl_add_serverhello_tlsext(SSL *s, unsigned char *buf, unsigned char *limit) { int extdatalen=0; unsigned char *orig = buf; unsigned char *ret = buf; #ifndef OPENSSL_NO_NEXTPROTONEG int next_proto_neg_seen; #endif /* don't add extensions for SSLv3, unless doing secure renegotiation */ if (s->vers...
cwe
CWE-20
Unknown
getftp (struct url *u, struct url *original_url, wgint passed_expected_bytes, wgint *qtyread, wgint restval, ccon *con, int count, wgint *last_expected_bytes, FILE *warc_tmp) { int csock, dtsock, local_sock, res; uerr_t err = RETROK; /* appease the compiler */ FILE *fp = NULL; c...
cwe
CWE-200
Unknown
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { OpContext op_context(context, node); OpData* op_data = reinterpret_cast<OpData*>(node->user_data); const TfLiteTensor* lhs = GetInput(context, node, kInputLHSTensor); const TfLiteTensor* rhs = GetInput(context, node, kInputRHSTensor); TfLiteTensor*...
cwe
CWE-125
C/C++
import json from z3c.form.interfaces import IFieldWidget import z3c.form.interfaces from z3c.form.widget import FieldWidget from zope.component import getUtility from zope.component.interfaces import ComponentLookupError from zope.i18n import translate from zope.interface import implementer, implements, Interface from...
cwe
CWE-74
Python
void net_tx_pkt_init(struct NetTxPkt **pkt, PCIDevice *pci_dev, uint32_t max_frags, bool has_virt_hdr) { struct NetTxPkt *p = g_malloc0(sizeof *p); p->pci_dev = pci_dev; p->vec = g_malloc((sizeof *p->vec) * (max_frags + NET_TX_PKT_PL_START_FRAG)); p->raw = g_malloc((sizeof *p->raw) * ...
cwe
CWE-190
Unknown
!function(a,b){if(a){var c=function(){b(a.lazySizes),a.removeEventListener("lazyunveilread",c,!0)};b=b.bind(null,a,a.document),"object"==typeof module&&module.exports?b(require("lazysizes")):a.lazySizes?c():a.addEventListener("lazyunveilread",c,!0)}}("undefined"!=typeof window?window:0,function(a,b,c){"use strict";func...
cwe
CWE-79
JavaScript
GC_API GC_ATTR_MALLOC void * GC_CALL GC_malloc_many(size_t lb) { void *result; GC_generic_malloc_many(ROUNDUP_GRANULE_SIZE(lb + EXTRA_BYTES), NORMAL, &result); return result; }
cwe
CWE-119
Unknown
static void rtc_irq_eoi_tracking_reset(struct kvm_ioapic *ioapic) { ioapic->rtc_status.pending_eoi = 0; bitmap_zero(ioapic->rtc_status.dest_map.map, KVM_MAX_VCPUS); }
cwe
CWE-125
C/C++
long join_session_keyring(const char *name) { const struct cred *old; struct cred *new; struct key *keyring; long ret, serial; new = prepare_creds(); if (!new) return -ENOMEM; old = current_cred(); /* if no name is provided, install an anonymous keyring */ if (!name) { ret = install_session_keyring_to_cr...
cwe
CWE-703
C/C++
wolfssl_connect_step1(struct Curl_easy *data, struct connectdata *conn, int sockindex) { char *ciphers; struct ssl_connect_data *connssl = &conn->ssl[sockindex]; struct ssl_backend_data *backend = connssl->backend; SSL_METHOD* req_method = NULL; curl_socket_t sockfd = conn->sock[sockindex...
cwe
CWE-290
Unknown
/* * Copyright (c) 2009-2012, Salvatore Sanfilippo <antirez at gmail dot com> * Copyright (c) 2009-2012, Pieter Noordhuis <pcnoordhuis 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 condition...
cwe
CWE-680
C/C++
/* * Copyright (c) 2016, The OpenThread Authors. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright * notice, this ...
cwe
CWE-787
C/C++
mp_join_print(netdissect_options *ndo, const u_char *opt, u_int opt_len, u_char flags) { const struct mp_join *mpj = (const struct mp_join *) opt; if (!(opt_len == 12 && flags & TH_SYN) && !(opt_len == 16 && (flags & (TH_SYN | TH_ACK)) == (TH_SYN | TH_ACK)) && !(op...
cwe
CWE-125
Unknown
void TestJlCompress::extractDir_data() { QTest::addColumn<QString>("zipName"); QTest::addColumn<QStringList>("fileNames"); QTest::newRow("simple") << "jlextdir.zip" << ( QStringList() << "test0.txt" << "testdir1/test1.txt" << "testdir2/test2.txt" << "testdir2/subdir/test2sub.txt"); ...
cwe
CWE-22
C/C++
void ScaleYUVToRGB32(const uint8* y_buf, const uint8* u_buf, const uint8* v_buf, uint8* rgb_buf, int source_width, int source_height, int width, int height, ...
cwe
CWE-125
C/C++
void Compute(OpKernelContext* context) override { const Tensor& data = context->input(0); const Tensor& segment_ids = context->input(1); const Tensor& num_segments = context->input(2); if (!UnsortedSegmentReductionDoValidation(this, context, data, segment_ids, ...
cwe
CWE-681
C/C++
// Copyright (C) 2015 University of Dundee & Open Microscopy Environment. // All rights reserved. // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as // published by the Free Software Foundation, either version 3 of the ...
cwe
CWE-79
Python
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
cwe
CWE-284
C/C++
RecoveryConflictInterrupt(ProcSignalReason reason) { int save_errno = errno; /* * Don't joggle the elbow of proc_exit */ if (!proc_exit_inprogress) { RecoveryConflictReason = reason; switch (reason) { case PROCSIG_RECOVERY_CONFLICT_STARTUP_DEADLOCK: /* * If we aren't waiting for a lock we ...
cwe
CWE-89
Unknown
load_deployed_metadata (FlatpakTransaction *self, FlatpakDecomposed *ref, char **out_commit, char **out_remote) { FlatpakTransactionPrivate *priv = flatpak_transaction_get_instance_private (self); g_autoptr(GFile) deploy_dir = NULL; g_autoptr(GFile) metadata_file = NULL; g_autofree char *metadata_contents = NUL...
cwe
CWE-269
C/C++
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ //===----------------------------------------------------------------------===// /// \file /// ES5.1 15.4 Initialize the Array co...
cwe
CWE-416
C/C++
Randoms() { random = new Random(); Date date = new Date(); random.setSeed(date.getTime()); }
cwe
CWE-327
Java
void IRC_Analyzer::DeliverStream(int length, const u_char* line, bool orig) { tcp::TCP_ApplicationAnalyzer::DeliverStream(length, line, orig); if ( starttls ) { ForwardStream(length, line, orig); return; } // check line size if ( length > 512 ) { Weird("irc_line_size_exceeded"); return; } strin...
cwe
CWE-20
Unknown
mm_sshpam_init_ctx(Authctxt *authctxt) { Buffer m; int success; debug3("%s", __func__); buffer_init(&m); buffer_put_cstring(&m, authctxt->user); mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_PAM_INIT_CTX, &m); debug3("%s: waiting for MONITOR_ANS_PAM_INIT_CTX", __func__); mm_request_receive_expect(pmonitor->m...
cwe
CWE-200
Unknown
/* * kvm eventfd support - use eventfd objects to signal various KVM events * * Copyright 2009 Novell. All Rights Reserved. * Copyright 2010 Red Hat, Inc. and/or its affiliates. * * Author: * Gregory Haskins <ghaskins@novell.com> * * This file is free software; you can redistribute it and/or modify * it unde...
cwe
CWE-617
C/C++
import random import secrets import string from django.contrib.auth import get_user_model from django.core.validators import EmailValidator from django.conf import settings from django.db import transaction from django.utils.decorators import method_decorator from django.views.decorators.debug import sensitive_post_pa...
cwe
CWE-287
Python
/* * Copyright (C) 2016 Richard Hughes <richard@hughsie.com> * * SPDX-License-Identifier: LGPL-2.1+ */ #define G_LOG_DOMAIN "FuPlugin" #include "config.h" #include <errno.h> #include <fwupd.h> #include <glib/gstdio.h> #include <gmodule.h> #include <string.h> #include <unistd.h> #include "fu-bytes.h" #include "f...
cwe
CWE-552
C/C++
/* * rdppm.c * * This file was part of the Independent JPEG Group's software: * Copyright (C) 1991-1997, Thomas G. Lane. * Modified 2009 by Bill Allombert, Guido Vollbeding. * libjpeg-turbo Modifications: * Copyright (C) 2015-2017, 2020, D. R. Commander. * For conditions of distribution and use, see the accompa...
cwe
CWE-787
C/C++
/** * BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ * * Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). * * This program is free software; you can redistribute it and/or modify it under the * terms of the GNU Lesser General Public License as published ...
cwe
CWE-918
Java
static int tt_s2_4600_frontend_attach(struct dvb_usb_adapter *adap) { struct dvb_usb_device *d = adap->dev; struct dw2102_state *state = d->priv; u8 obuf[3] = { 0xe, 0x80, 0 }; u8 ibuf[] = { 0 }; struct i2c_adapter *i2c_adapter; struct i2c_client *client; struct i2c_board_info board_info; struct m88ds3103_platf...
cwe
CWE-476
Unknown
QPDFOutlineObjectHelper::getCount() { int count = 0; if (this->oh.hasKey("/Count")) { count = this->oh.getKey("/Count").getIntValue(); } return count; }
cwe
CWE-787
Unknown
GraphViewer.prototype.updateTitle = function(title) { title = title || ''; if (this.showTitleAsTooltip && this.graph != null && this.graph.container != null) { this.graph.container.setAttribute('title', title); } if (this.filename != null) { this.filename.innerHTML = ''; mxUtils.write(this.filename, ...
cwe
CWE-94
JavaScript
null,null,function(P){console.log(P)},600,null,null,null,null,null,F):(v(H,void 0),n(H))}function L(P){function Q(S){E.style.background="transparent";E.innerHTML="";var Y=document.createElement("div");Y.className="odPreviewStatus";mxUtils.write(Y,S);E.appendChild(Y);N.stop()}if(null!=E)if(E.style.background="transparen...
cwe
CWE-94
JavaScript
static Image *ReadMATImage(const ImageInfo *image_info,ExceptionInfo *exception) { Image *image, *image2=NULL, *rotated_image; PixelPacket *q; unsigned int status; MATHeader MATLAB_HDR; size_t size; size_t CellType; QuantumInfo *quantum_info; ImageInfo *clone_info; int i; ssize_t ldblk; unsign...
cwe
CWE-772
Unknown
pspdf_prepare_outpages() { int c, i, j; /* Looping vars */ int nup; /* Current number-up value */ page_t *page; /* Current page */ outpage_t *outpage; /* Current output page */ // Allocate an output page array... outpages = (outpage_t *)malloc(sizeof(outpage_t) * num_pages); memset(outpages, -1, si...
cwe
CWE-787
C/C++
void FormatConverter<T>::InitSparseToDenseConverter( std::vector<int> shape, std::vector<int> traversal_order, std::vector<TfLiteDimensionType> format, std::vector<int> dense_size, std::vector<std::vector<int>> segments, std::vector<std::vector<int>> indices, std::vector<int> block_map) { dense_shape_...
cwe
CWE-125
C/C++
libxlLoggerFree(libxlLogger *logger) { xentoollog_logger *xtl_logger = (xentoollog_logger*)logger; if (logger->defaultLogFile) VIR_FORCE_FCLOSE(logger->defaultLogFile); g_clear_pointer(&logger->files, g_hash_table_unref); xtl_logger_destroy(xtl_logger); }
cwe
CWE-667
Unknown
/****************************************************************************** * pdf.c * * pdfresurrect - PDF history extraction tool * * Copyright (C) 2008-2010, 2012-2013, 2017-19, Matt Davis (enferex). * * Special thanks to all of the contributors: See AUTHORS. * * Special thanks to 757labs (757 crew), t...
cwe
CWE-787
C/C++
size_t compile_tree(struct filter_op **fop) { int i = 1; struct filter_op *array = NULL; struct unfold_elm *ue; BUG_IF(tree_root == NULL); fprintf(stdout, " Unfolding the meta-tree "); fflush(stdout); /* start the recursion on the tree */ unfold_blk(&tree_root); fprintf(stdou...
cwe
CWE-125
C/C++
function prepareInputForUpdate($input) { if (isset($input["passwd"])) { if (empty($input["passwd"])) { unset($input["passwd"]); } else { $input["passwd"] = Toolbox::encrypt(stripslashes($input["passwd"]), GLPIKEY); } } if (isset($input["_blank_passw...
cwe
CWE-798
PHP
/* 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 a...
cwe
CWE-131
Python
public AuthorizationCodeRequestUrl newAuthorizationUrl() { return new AuthorizationCodeRequestUrl(authorizationServerEncodedUrl, clientId).setScopes( scopes); }
cwe
CWE-863
Java
removeSync: function (from) { this._supportExecSync(); try { var cmd = ''; var stats = fs.lstatSync(from); if (this._win32) { // windows if (stats.isDirectory()) { cmd = 'rd /s /q "' + from + '"'; } else if (stats.isFile()) { cmd = 'del /f "' + from ...
cwe
CWE-77
JavaScript
import decimal import math from vyper import ast as vy_ast from vyper.address_space import DATA, IMMUTABLES, MEMORY, STORAGE from vyper.codegen import external_call, self_call from vyper.codegen.core import ( LOAD, bytes_data_ptr, clamp_basetype, ensure_in_memory, get_dyn_array_count, get_eleme...
cwe
CWE-697
Python
bgp_nlri_parse_vpnv4 (struct peer *peer, struct attr *attr, struct bgp_nlri *packet) { u_char *pnt; u_char *lim; struct prefix p; int psize; int prefixlen; u_int16_t type; struct rd_as rd_as; struct rd_ip rd_ip; struct prefix_rd prd; u_char *tagpnt; /* Check peer status. */ if (peer->s...
cwe
CWE-119
C/C++
package api import ( "bytes" "crypto/tls" "encoding/json" "errors" "fmt" "net/http" "strings" "github.com/PuerkitoBio/goquery" log "github.com/gophish/gophish/logger" "github.com/gophish/gophish/models" "github.com/gophish/gophish/util" "github.com/jordan-wright/email" ) type cloneRequest struct { URL ...
cwe
CWE-918
Go
def resource_unclone(params, request, session) if not allowed_for_local_cluster(session, Permissions::WRITE) return 403, 'Permission denied' end unless params[:resource_id] return [400, 'resource_id has to be specified.'] end _, stderr, retval = run_cmd( session, PCS, 'resource', 'unclone', para...
cwe
CWE-384
Ruby
static void delete_file(e2fsck_t ctx, ext2_ino_t ino, struct dup_inode *dp, char* block_buf) { ext2_filsys fs = ctx->fs; struct process_block_struct pb; struct problem_context pctx; unsigned int count; clear_problem_context(&pctx); pctx.ino = pb.ino = ino; pb.dup_blocks = 0; pb.ctx = ctx; pctx.str = "dele...
cwe
CWE-787
Unknown
public function __viewIndex() { $this->setPageType('table'); $this->setTitle(__('%1$s &ndash; %2$s', array(__('Pages'), __('Symphony')))); $nesting = Symphony::Configuration()->get('pages_table_nest_children', 'symphony') == 'yes'; if ($nesting && isset($_GET['parent']) && is_numer...
cwe
CWE-79
PHP
PJ_DEF(pj_status_t) pjsip_ua_unregister_dlg( pjsip_user_agent *ua, pjsip_dialog *dlg ) { struct dlg_set *dlg_set; pjsip_dialog *d; /* Sanity-check arguments. */ PJ_ASSERT_RETURN(ua && dlg, PJ_EINVAL); /* Check that dialog has been registered. */ PJ_ASSERT_RETURN(dlg->dlg_set, PJ_EINV...
cwe
CWE-416
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 not u...
cwe
CWE-755
C/C++
keyfetch_done(isc_task_t *task, isc_event_t *event) { isc_result_t result, eresult; dns_fetchevent_t *devent; dns_keyfetch_t *kfetch; dns_zone_t *zone; isc_mem_t *mctx = NULL; dns_keytable_t *secroots = NULL; dns_dbversion_t *ver = NULL; dns_diff_t diff; bool alldone = false; bool commit = false; dns_name_t ...
cwe
CWE-327
C/C++