code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
int for_each_problem_in_dir(const char *path, uid_t caller_uid, int (*callback)(struct dump_dir *dd, void *arg), void *arg) { DIR *dp = opendir(path); if (!dp) { /* We don't want to yell if, say, $XDG_CACHE_DIR/abrt/spool doesn'...
cwe
CWE-20
Unknown
package api type Resource struct { ID int `json:"id"` // Standard fields CreatorID int `json:"creatorId"` CreatedTs int64 `json:"createdTs"` UpdatedTs int64 `json:"updatedTs"` // Domain specific fields Filename string `json:"filename"` Blob []byte `json:"-"` Type string `json:"type"` Size int...
cwe
CWE-287
Go
// Copyright 2010 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. // Package rand implements a cryptographically secure // random number generator. package rand import "io" // Reader is a global, shared instance of a cryptog...
cwe
CWE-835
Go
static function FromJSON($sJson) { if (is_array($sJson)) { $aJson = $sJson; } else { $aJson = json_decode($sJson, true); } /** @var \Combodo\iTop\Portal\Form\ObjectFormManager $oFormManager */ $oFormManager = parent::FromJSON($sJson); // Retrieving object to edit if (!isset($aJson['formobje...
cwe
CWE-94
PHP
/* Copyright (C) 2000,2002,2004,2005 Silicon Graphics, Inc. All Rights Reserved. Portions Copyright 2007-2010 Sun Microsystems, Inc. All rights reserved. Portions Copyright 2008-2021 David Anderson. All rights reserved. Portions Copyright 2010-2012 SN Systems Ltd. All rights reserved. This program is free so...
cwe
CWE-125
C/C++
public static function get_param($key = NULL) { $info = [ 'stype' => htmlentities(self::$search_type), 'stext' => htmlentities(self::$search_text), 'method' => htmlentities(self::$search_method), 'datelimit' => self::$search_date_limit, ...
cwe
CWE-352
PHP
# -*- coding: utf-8 -*- # This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web) # Copyright (C) 2019 OzzieIsaacs, pwr # # 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-863
JavaScript
add_job(cupsd_client_t *con, /* I - Client connection */ cupsd_printer_t *printer, /* I - Destination printer */ mime_type_t *filetype) /* I - First print file type, if any */ { http_status_t status; /* Policy status */ ipp_attribute_t *attr, /* Current attribute */ *auth_info; /* auth-info attribute ...
cwe
CWE-20
C/C++
this.db.each("SELECT * FROM tb_events WHERE uid = '" + uid + "';", function(err, row) { event.uid = uid; obj.keyval_parse(event, row.key, row.value, row.payload); if (typeof event.times === 'string') { event.times = event.times.split(',').map(time=>+time) } }, function(err,...
cwe
CWE-89
JavaScript
void DoRealForwardFFT(OpKernelContext* ctx, uint64* fft_shape, const Tensor& in, Tensor* out) { // Create the axes (which are always trailing). const auto axes = Eigen::ArrayXi::LinSpaced(FFTRank, 1, FFTRank); auto device = ctx->eigen_device<CPUDevice>(); auto input = Tensor(in)....
cwe
CWE-703
C/C++
function attachedPublicKey( contactDetailsModel, keyCache, keysModel, autoPinPrimaryKeys, sendPreferences, publicKeyStore, AttachmentLoader, contactEmails, Contact, networkActivityTracker ) { /** * Extact and clean the new email * Format: * - XXXX <xxx@xxxx...
cwe
CWE-400
JavaScript
/* ** Generic functions which are not dependent on ApexCharts */ class Utils { static bind(fn, me) { return function() { return fn.apply(me, arguments) } } static isObject(item) { return ( item && typeof item === 'object' && !Array.isArray(item) && item != null ) } static list...
cwe
CWE-79
JavaScript
package com.salesmanager.core.model.catalog.product.availability; import java.util.Date; import java.util.HashSet; import java.util.Set; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Embedded; import javax.persistence.Entity; import javax.persistence.FetchType; import...
cwe
CWE-79
Java
xmlBufferGrow(xmlBufferPtr buf, unsigned int len) { int size; xmlChar *newbuf; if (buf == NULL) return(-1); if (buf->alloc == XML_BUFFER_ALLOC_IMMUTABLE) return(0); if (len + buf->use < buf->size) return(0); /* * Windows has a BIG problem on realloc timing, so we try to double * the...
cwe
CWE-190
Unknown
package org.keycloak.vault; import org.jboss.logging.Logger; import javax.annotation.Nonnull; import java.io.IOException; import java.lang.invoke.MethodHandles; import java.nio.MappedByteBuffer; import java.nio.channels.FileChannel; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.StandardO...
cwe
CWE-287
Java
void processRequest(struct reqelem * req) { ssize_t n; unsigned int l, m; unsigned char buf[2048]; const unsigned char * p; enum request_type type; struct device * d = devlist; unsigned char rbuf[RESPONSE_BUFFER_SIZE]; unsigned char * rp; unsigned char nrep = 0; time_t t; struct service * newserv = NULL; st...
cwe
CWE-125
C/C++
imap_auth_res_t imap_auth_cram_md5 (IMAP_DATA* idata, const char* method) { char ibuf[LONG_STRING*2], obuf[LONG_STRING]; unsigned char hmac_response[MD5_DIGEST_LEN]; int len; int rc; if (!mutt_bit_isset (idata->capabilities, ACRAM_MD5)) return IMAP_AUTH_UNAVAIL; mutt_message _("Authenticating (CRAM-MD...
cwe
CWE-120
Unknown
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { auto* params = reinterpret_cast<TfLiteConcatenationParams*>(node->builtin_data); int axis = params->axis; TfLiteTensor* output = GetOutput(context, node, 0); if (axis < 0) axis += output->dims->size; // TODO(ahentz): Creating 'all_inputs' belo...
cwe
CWE-125
C/C++
static int futex_unlock_pi(u32 __user *uaddr, unsigned int flags) { struct futex_hash_bucket *hb; struct futex_q *this, *next; union futex_key key = FUTEX_KEY_INIT; u32 uval, vpid = task_pid_vnr(current); int ret; retry: if (get_user(uval, uaddr)) return -EFAULT; /* * We release only a lock we actually own:...
cwe
CWE-269
Unknown
package com.salesmanager.shop.store.controller.product.facade; import org.springframework.web.multipart.MultipartFile; import com.salesmanager.core.model.merchant.MerchantStore; import com.salesmanager.core.model.reference.language.Language; import com.salesmanager.shop.model.catalog.product.attribute.PersistableProd...
cwe
CWE-639
Java
int ppp_register_net_channel(struct net *net, struct ppp_channel *chan) { struct channel *pch; struct ppp_net *pn; pch = kzalloc(sizeof(struct channel), GFP_KERNEL); if (!pch) return -ENOMEM; pn = ppp_pernet(net); pch->ppp = NULL; pch->chan = chan; pch->chan_net = net; chan->ppp = pch; init_ppp_file...
cwe
CWE-416
C/C++
/* eslint-disable no-unused-vars */ import { callHook } from '../init/lifecycle'; import { getParentPath, stringifyQuery } from '../router/util'; import { noop } from '../util/core'; import { getAndActive } from '../event/sidebar'; import { get } from './ajax'; function loadNested(path, qs, file, next, vm, first) { ...
cwe
CWE-79
JavaScript
package command import ( "time" "github.com/zitadel/zitadel/internal/eventstore" "github.com/zitadel/zitadel/internal/domain" "github.com/zitadel/zitadel/internal/repository/user" ) type HumanRefreshTokenWriteModel struct { eventstore.WriteModel TokenID string RefreshToken string UserState domai...
cwe
CWE-613
Go
int cli_scanpe(cli_ctx *ctx) { uint16_t e_magic; /* DOS signature ("MZ") */ uint16_t nsections; uint32_t e_lfanew; /* address of new exe header */ uint32_t ep, vep; /* entry point (raw, virtual) */ uint8_t polipos = 0; time_t timestamp; struct pe_image_file_hdr file_hdr; union { struct pe_image_optional_hd...
cwe
CWE-119
Unknown
void TIFF_MetaHandler::ProcessXMP() { this->processedXMP = true; // Make sure we only come through here once. bool found; bool readOnly = ((this->parent->openFlags & kXMPFiles_OpenForUpdate) == 0); if ( readOnly ) { this->psirMgr = new PSIR_MemoryReader(); this->iptcMgr = new IPTC_Reader(); } else { thi...
cwe
CWE-125
Unknown
public <T> List<T> search(String filter, Object[] filterArgs, Mapper<T> mapper, int maxResult) { List<T> results = new ArrayList<>(); DirContext dirContext = getDirContext(ldapConfiguration, ldapConfiguration.getManagerDn(), ldapConfiguration.getPassword()); try { List<SearchResult>...
cwe
CWE-74
Java
bool ExtensionViewGuest::NavigateGuest(const std::string& src, bool force_navigation) { GURL url = extension_url_.Resolve(src); bool url_not_allowed = (url != GURL(url::kAboutBlankURL)) && (url.GetOrigin() != extension_url_.GetOrigin()); if (!url.is_valid() || url_n...
cwe
CWE-284
C/C++
'use strict'; // @ts-check // ================================================================================== // utils.js // ---------------------------------------------------------------------------------- // Description: System Information - library // for Node.js // Copyright: (c) 2014 - 202...
cwe
CWE-78
JavaScript
void preprocessNodes(std::vector<Proxy> &nodes, extra_settings &ext) { std::for_each(nodes.begin(), nodes.end(), [&ext](Proxy &x) { if(ext.remove_emoji) x.Remark = trim(removeEmoji(x.Remark)); nodeRename(x, ext.rename_array, ext); if(ext.add_emoji) x.Remark = ad...
cwe
CWE-434
C/C++
libxlDomainDeathThread(void *opaque) { struct libxlEventHandlerThreadInfo *death_info = opaque; virDomainObj *vm = death_info->vm; libxl_event *ev = death_info->event; libxlDriverPrivate *driver = death_info->driver; virObjectEvent *dom_event = NULL; g_autoptr(libxlDriverConfig) cfg = libxlDrive...
cwe
CWE-703
Unknown
input.keypress(function(event) { if(event.keyCode == 13) { event.preventDefault(); event.stopPropagation(); var li=$(this).parent(); $(this).remove(); li.text('+ '+settings.createText); li.before(createItem(this)); var select=button.parent().next(); select.a...
cwe
CWE-79
JavaScript
int jffs2_set_acl(struct inode *inode, struct posix_acl *acl, int type) { int rc, xprefix; switch (type) { case ACL_TYPE_ACCESS: xprefix = JFFS2_XPREFIX_ACL_ACCESS; if (acl) { umode_t mode = inode->i_mode; rc = posix_acl_equiv_mode(acl, &mode); if (rc < 0) return rc; if (inode->i_mode != mode) {...
cwe
CWE-285
C/C++
static ssize_t rebind_store(struct device_driver *dev, const char *buf, size_t count) { int ret; int len; struct bus_id_priv *bid; /* buf length should be less that BUSID_SIZE */ len = strnlen(buf, BUSID_SIZE); if (!(len < BUSID_SIZE)) return -EINVAL; bid = get_busid_priv(buf); if (!bid) return -ENO...
cwe
CWE-362
Unknown
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) { TF_LITE_ENSURE_EQ(context, NumInputs(node), 3); TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1); const TfLiteTensor* input = GetInput(context, node, kInputTensor); const TfLiteTensor* begin = GetInput(context, node, kBeginTensor); const TfLiteT...
cwe
CWE-125
C/C++
pgp_enumerate_blob(sc_card_t *card, pgp_blob_t *blob) { const u8 *in; int r; if (blob->files != NULL) return SC_SUCCESS; if ((r = pgp_read_blob(card, blob)) < 0) return r; in = blob->data; while ((int) blob->len > (in - blob->data)) { unsigned int cla, tag, tmptag; size_t len; const u8 *data = in...
cwe
CWE-125
C/C++
def get_mod_taken_together_with(code): ''' Retrieves the list of modules taken together with the specified module code in the same semester. Returns a table of lists (up to 10 top results). Each list contains (specified code, module code of mod taken together, aySem, number of stude...
cwe
CWE-89
Python
func setCapabilities(spec *specs.Spec, keepCaps ...string) error { currentCaps, err := capability.NewPid2(0) if err != nil { return errors.Wrapf(err, "error reading capabilities of current process") } if err := currentCaps.Load(); err != nil { return errors.Wrapf(err, "error loading capabilities") } caps, err...
cwe
CWE-276
Go
static int crypto_blkcipher_report(struct sk_buff *skb, struct crypto_alg *alg) { struct crypto_report_blkcipher rblkcipher; snprintf(rblkcipher.type, CRYPTO_MAX_ALG_NAME, "%s", "blkcipher"); snprintf(rblkcipher.geniv, CRYPTO_MAX_ALG_NAME, "%s", alg->cra_blkcipher.geniv ?: "<default>"); rblkcipher.blocksize = ...
cwe
CWE-310
C/C++
import re from django.utils.html import format_html from django.utils.safestring import mark_safe from docutils.core import publish_parts from markdown import markdown from mdx_gfm import GithubFlavoredMarkdownExtension def metadata_fields(metadata_version): """Return meta-data about the meta-data :)""" if...
cwe
CWE-79
Python
private function generateTempFileData() { return [ 'name' => md5(mt_rand()), 'tmp_name' => tempnam(sys_get_temp_dir(), ''), 'type' => 'image/jpeg', 'size' => mt_rand(1000, 10000), 'error' => '0', ]; }
cwe
CWE-330
PHP
static ssize_t _hostsock_sendmsg( oe_fd_t* sock_, const struct oe_msghdr* msg, int flags) { ssize_t ret = -1; sock_t* sock = _cast_sock(sock_); void* buf = NULL; size_t buf_size = 0; oe_errno = 0; /* Check the parameters. */ if (!sock || !msg || (msg->msg_iovlen && !msg->msg_io...
cwe
CWE-200
Unknown
xps_begin_opacity(xps_document *doc, const fz_matrix *ctm, const fz_rect *area, char *base_uri, xps_resource *dict, char *opacity_att, fz_xml *opacity_mask_tag) { float opacity; if (!opacity_att && !opacity_mask_tag) return; opacity = 1; if (opacity_att) opacity = fz_atof(opacity_att); if (opacity_mask_ta...
cwe
CWE-119
C/C++
Status renameCollectionForApplyOps(OperationContext* opCtx, const std::string& dbName, const BSONElement& ui, const BSONObj& cmd, const repl::OpTime& renameOpTime) { const aut...
cwe
CWE-20
C/C++
build_model(XML_Parser parser) { DTD *const dtd = parser->m_dtd; /* save one level of indirection */ XML_Content *ret; XML_Content *cpos; XML_Char *str; /* Detect and prevent integer overflow. * The preprocessor guard addresses the "always false" warning * from -Wtype-limits on platforms where * siz...
cwe
CWE-400
Unknown
/* NetHack 3.6 unixmain.c $NHDT-Date: 1570408210 2019/10/07 00:30:10 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.70 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2011. */ /* NetHack may be freely redistributed. See license for details. */ /* mai...
cwe
CWE-120
C/C++
static int send_sub_rect_solid(VncState *vs, int x, int y, int w, int h) { vnc_framebuffer_update(vs, x, y, w, h, vs->tight.type); vnc_tight_start(vs); vnc_raw_send_framebuffer_update(vs, x, y, w, h); vnc_tight_stop(vs); return send_solid_rect(vs); }
cwe
CWE-401
Unknown
TfLiteStatus ResizeOutputTensor(TfLiteContext* context, SpaceToBatchNDContext* op_context) { TfLiteIntArray* input_size = op_context->input->dims; const int32* block_shape = GetTensorData<int32>(op_context->block_shape); const int32* paddings_data = GetTensorData<int32>(op_context-...
cwe
CWE-369
C/C++
static int flv_write_packet(AVFormatContext *s, AVPacket *pkt) { AVIOContext *pb = s->pb; AVCodecParameters *par = s->streams[pkt->stream_index]->codecpar; FLVContext *flv = s->priv_data; FLVStreamContext *sc = s->streams[pkt->stream_index]->priv_data; unsigned ts; int size = pkt->size...
cwe
CWE-617
Unknown
evbuffer_drain(struct evbuffer *buf, size_t len) { struct evbuffer_chain *chain, *next; size_t remaining, old_len; int result = 0; EVBUFFER_LOCK(buf); old_len = buf->total_len; if (old_len == 0) goto done; if (buf->freeze_start) { result = -1; goto done; } if (len >= old_len && !HAS_PINNED_R(buf)) { ...
cwe
CWE-189
Unknown
func main() { semver := fmt.Sprintf("%s+%s", version, commitID) // Always set default timeout on HTTP client. http.DefaultClient.Timeout = 1500 * time.Millisecond tmpLogger := server.NewJSONLogger(os.Stdout, zapcore.InfoLevel, server.JSONFormat) if len(os.Args) > 1 { switch os.Args[1] { case "--version": ...
cwe
CWE-613
Go
static int do_last(struct nameidata *nd, struct file *file, const struct open_flags *op) { struct dentry *dir = nd->path.dentry; int open_flag = op->open_flag; bool will_truncate = (open_flag & O_TRUNC) != 0; bool got_write = false; int acc_mode = op->acc_mode; unsigned seq; struct inode *inode; struct pat...
cwe
CWE-416
Unknown
proto_read_ulong_buffer (p11_rpc_message *msg, CK_ULONG_PTR *buffer, CK_ULONG *n_buffer) { uint32_t length; assert (msg != NULL); assert (buffer != NULL); assert (n_buffer != NULL); assert (msg->input != NULL); /* Check that we're supposed to be reading this at ...
cwe
CWE-190
Unknown
static int af9005_identify_state(struct usb_device *udev, struct dvb_usb_device_properties *props, struct dvb_usb_device_description **desc, int *cold) { int ret; u8 reply, *buf; buf = kmalloc(FW_BULKOUT_SIZE + 2, GFP_KERNEL); if (!buf) return -ENOMEM; ret = af9005_boot_packet(udev, FW_CONFIG, &...
cwe
CWE-401
C/C++
static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd) { ALSSpecificConfig *sconf = &ctx->sconf; AVCodecContext *avctx = ctx->avctx; GetBitContext *gb = &ctx->gb; unsigned int k; unsigned int s[8]; unsigned int sx[8]; unsigned int sub_blocks, log2_sub_blocks, sb_lengt...
cwe
CWE-787
Unknown
/*! Copyright (c) REBUILD <https://getrebuild.com/> and/or its owners. All rights reserved. rebuild is dual-licensed under commercial and open source licenses (GPLv3). See LICENSE and COMMERCIAL in the project root for license information. */ /* eslint-disable no-unused-vars */ /* !!! KEEP IT ES5 COMPATIBLE !!! */ //...
cwe
CWE-89
Java
long uv__idna_toascii(const char* s, const char* se, char* d, char* de) { const char* si; const char* st; unsigned c; char* ds; int rc; ds = d; for (si = s; si < se; /* empty */) { st = si; c = uv__utf8_decode1(&si, se); if (c != '.') if (c != 0x3002) /* 。 */ if (c != 0xFF0E)...
cwe
CWE-125
C/C++
validGlxScreen(ClientPtr client, int screen, __GLXscreen **pGlxScreen, int *err) { /* ** Check if screen exists. */ if (screen >= screenInfo.numScreens) { client->errorValue = screen; *err = BadValue; return FALSE; } *pGlxScreen = glxGetScreen(screenInfo.screens[screen]); return TR...
cwe
CWE-20
C/C++
valuePop(xmlXPathParserContextPtr ctxt) { xmlXPathObjectPtr ret; if ((ctxt == NULL) || (ctxt->valueNr <= 0)) return (NULL); ctxt->valueNr--; if (ctxt->valueNr > 0) ctxt->value = ctxt->valueTab[ctxt->valueNr - 1]; else ctxt->value = NULL; ret = ctxt->valueTab[ctxt->valueN...
cwe
CWE-415
Unknown
static int encrypt(struct blkcipher_desc *desc, struct scatterlist *dst, struct scatterlist *src, unsigned int nbytes) { struct blkcipher_walk walk; struct crypto_blkcipher *tfm = desc->tfm; struct salsa20_ctx *ctx = crypto_blkcipher_ctx(tfm); int err; blkcipher_walk_init(&walk, dst, src, nbytes); err ...
cwe
CWE-20
Unknown
const addReplyToEvent = (event: any) => { event.reply = (...args: any[]) => { event.sender.sendToFrame(event.frameId, ...args); }; };
cwe
CWE-668
C/C++
bool DISOpticalFlowImpl::ocl_calc(InputArray I0, InputArray I1, InputOutputArray flow) { UMat I0Mat = I0.getUMat(); UMat I1Mat = I1.getUMat(); bool use_input_flow = false; if (flow.sameSize(I0) && flow.depth() == CV_32F && flow.channels() == 2) use_input_flow = true; else flow.create...
cwe
CWE-369
C/C++
} elseif (!is_numeric($item) && ($item != '')) { return false; } } } else { return false; } } else {
cwe
CWE-787
PHP
/* * Copyright (C) Igor Sysoev * Copyright (C) NGINX, Inc. */ #include <njs_main.h> #define njs_array_func(type) \ ((type << 1) | NJS_ARRAY_FUNC) #define njs_array_arg(type) \ ((type << 1) | NJS_ARRAY_AR...
cwe
CWE-120
C/C++
search_impl(i_ctx_t *i_ctx_p, bool forward) { os_ptr op = osp; os_ptr op1 = op - 1; uint size = r_size(op); uint count; byte *pat; byte *ptr; byte ch; int incr = forward ? 1 : -1; check_read_type(*op1, t_string); check_read_type(*op, t_string); if (size > r_size(op1)) { /* c...
cwe
CWE-191
C/C++
Chapters::Edition::Edition() { }
cwe
CWE-119
C/C++
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function (obj) { return typeof obj; }; } else { _typeof = function (obj) { ...
cwe
CWE-1321
JavaScript
static MagickBooleanType WriteBMPImage(const ImageInfo *image_info,Image *image) { BMPInfo bmp_info; BMPSubtype bmp_subtype; const char *option; const StringInfo *profile; MagickBooleanType have_color_info, status; MemoryInfo *pixel_info; MagickOffsetType scene; re...
cwe
CWE-401
C/C++
static int dmg_open(BlockDriverState *bs, QDict *options, int flags, Error **errp) { BDRVDMGState *s = bs->opaque; uint64_t info_begin, info_end, last_in_offset, last_out_offset; uint32_t count, tmp; uint32_t max_compressed_size = 1, max_sectors_per_chunk = 1, i; int64_t offset; ...
cwe
CWE-119
Unknown
int vrend_renderer_transfer_iov(const struct vrend_transfer_info *info, int transfer_mode) { struct vrend_resource *res; struct vrend_context *ctx; struct iovec *iov; int num_iovs; if (!info->box) return EINVAL; ctx = vrend_lookup_renderer_ctx(info->ctx_id); ...
cwe
CWE-787
Unknown
/* -*- C++ -*- * File: libraw_cxx.cpp * Copyright 2008-2017 LibRaw LLC (info@libraw.org) * Created: Sat Mar 8 , 2008 * * LibRaw C++ interface (implementation) 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 ...
cwe
CWE-193
C/C++
virNodeDeviceGetMdevTypesCaps(const char *sysfspath, virMediatedDeviceTypePtr **mdev_types, size_t *nmdev_types) { virMediatedDeviceTypePtr *types = NULL; size_t ntypes = 0; size_t i; /* this could be a refresh, so clear out the old data */ ...
cwe
CWE-119
C/C++
static int tcp_v6_do_rcv(struct sock *sk, struct sk_buff *skb) { struct ipv6_pinfo *np = inet6_sk(sk); struct tcp_sock *tp; struct sk_buff *opt_skb = NULL; /* Imagine: socket is IPv6. IPv4 packet arrives, goes to IPv4 receive handler and backlogged. From backlog it always goes here. Kerboom... Fortunat...
cwe
CWE-284
C/C++
public Operation.OperationResult executeFixedCostOperation( final MessageFrame frame, final EVM evm) { Bytes shiftAmount = frame.popStackItem(); final Bytes value = leftPad(frame.popStackItem()); final boolean negativeNumber = value.get(0) < 0; if (shiftAmount.size() > 4 && (shiftAmount = shiftAm...
cwe
CWE-681
Java
static Image *ReadVICARImage(const ImageInfo *image_info, ExceptionInfo *exception) { char keyword[MaxTextExtent], value[MaxTextExtent]; Image *image; int c; MagickBooleanType status, value_expected; QuantumInfo *quantum_info; QuantumType quantum_type; register Pixe...
cwe
CWE-120
C/C++
struct nfs_client *nfs4_alloc_client(const struct nfs_client_initdata *cl_init) { int err; struct nfs_client *clp = nfs_alloc_client(cl_init); if (IS_ERR(clp)) return clp; err = nfs_get_cb_ident_idr(clp, cl_init->minorversion); if (err) goto error; if (cl_init->minorversion > NFS4_MAX_MINOR_VERSION) { err...
cwe
CWE-703
Unknown
public function getUsersByJSON() { $modelname = $this->basemodel_name; $results = 25; // default get 25 $startIndex = 0; // default start at 0 $sort = null; // default don't sort $dir = 'asc'; // default sort dir is asc $sort_dir = SORT_ASC; // How many records t...
cwe
CWE-89
PHP
bittok2str_internal(register const struct tok *lp, register const char *fmt, register u_int v, const char *sep) { static char buf[256]; /* our stringbuffer */ int buflen=0; register u_int rotbit; /* this is the bit we rotate through all bitpositions */ register u_int tokval; ...
cwe
CWE-119
C/C++
ensure_credentials_sync (GoaProvider *provider, GoaObject *object, gint *out_expires_in, GCancellable *cancellable, GError **error) { GVariant *credentials; GoaAccount *account; GoaHttpClient ...
cwe
CWE-310
Unknown
static struct ip *ip_reass(Slirp *slirp, struct ip *ip, struct ipq *fp) { register struct mbuf *m = dtom(slirp, ip); register struct ipasfrag *q; int hlen = ip->ip_hl << 2; int i, next; DEBUG_CALL("ip_reass"); DEBUG_ARG("ip = %p", ip); DEBUG_ARG("fp = %p", fp); DEBUG_ARG("m = %p", m); ...
cwe
CWE-787
C/C++
/* eslint eqeqeq: 0 */ /* eslint no-use-before-define: 0 */ /** * Baobab Helpers * =============== * * Miscellaneous helper functions. */ import {Monkey, MonkeyDefinition} from './monkey'; import type from './type'; const hasOwnProp = {}.hasOwnProperty; /** * Function returning the index of the first element of...
cwe
CWE-1321
JavaScript
mxUtils.extend(Ka,mxActor);Ka.prototype.dx=20;Ka.prototype.dy=20;Ka.prototype.redrawPath=function(c,l,x,p,v){l=Math.max(0,Math.min(p,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));x=Math.max(0,Math.min(v,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",this....
cwe
CWE-20
JavaScript
gdm_session_worker_uninitialize_pam (GdmSessionWorker *worker, int status) { g_debug ("GdmSessionWorker: uninitializing PAM"); if (worker->priv->pam_handle == NULL) return; gdm_session_worker_get_username (worker, NULL); ...
cwe
CWE-362
Unknown
static void php_imagepolygon(INTERNAL_FUNCTION_PARAMETERS, int filled) { zval *IM, *POINTS; long NPOINTS, COL; zval **var = NULL; gdImagePtr im; gdPointPtr points; int npoints, col, nelem, i; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rall", &IM, &POINTS, &NPOINTS, &COL) == FAILURE) { return; } ...
cwe
CWE-189
C/C++
pdf_read_old_xref(fz_context *ctx, pdf_document *doc, pdf_lexbuf *buf) { fz_stream *file = doc->file; int64_t ofs; int len; char *s; size_t n; pdf_token tok; int64_t i; int c; int xref_len = pdf_xref_size_from_old_trailer(ctx, doc, buf); pdf_xref_entry *table; int carried; fz_skip_space(ctx, doc->file); ...
cwe
CWE-119
C/C++
password: c.getFieldValue(m, 'password'), autoLogin: shouldAutoLogin(m) }; const isCaptchaValid = setCaptchaParams(m, params, fields); if (!isCaptchaValid) { return showMissingCaptcha(m, id); } if (databaseConnectionRequiresUsername(m)) { if (signUpHideUsernameField(m)) { ...
cwe
CWE-79
JavaScript
/* * 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
/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\...
cwe
CWE-287
C/C++
status_t BnOMX::onTransact( uint32_t code, const Parcel &data, Parcel *reply, uint32_t flags) { switch (code) { case LIVES_LOCALLY: { CHECK_OMX_INTERFACE(IOMX, data, reply); node_id node = (node_id)data.readInt32(); pid_t pid = (pid_t)data.readInt32(); reply->writeInt32(livesLoc...
cwe
CWE-119
C/C++
/* 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-369
Python
static BROTLI_INLINE uint32_t GetInsertExtra(uint16_t inscode) { return kInsExtra[inscode]; }
cwe
CWE-120
Unknown
module.exports = function serialize(obj, options) { options || (options = {}); // Backwards-compatibility for `space` as the second argument. if (typeof options === 'number' || typeof options === 'string') { options = {space: options}; } var functions = []; var regexps = []; var ...
cwe
CWE-502
JavaScript
############################################################################## # # Copyright (c) 2004 Zope Foundation and Contributors. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS I...
cwe
CWE-200
Python
int URI_FUNC(ComposeQueryEngine)(URI_CHAR * dest, const URI_TYPE(QueryList) * queryList, int maxChars, int * charsWritten, int * charsRequired, UriBool spaceToPlus, UriBool normalizeBreaks) { UriBool firstItem = URI_TRUE; int ampersandLen = 0; /* increased to 1 from second item on */ URI_CHAR * write = dest; ...
cwe
CWE-787
C/C++
static int read_entry( git_index_entry **out, size_t *out_size, git_index *index, const void *buffer, size_t buffer_size, const char *last) { size_t path_length, entry_size; const char *path_ptr; struct entry_short source; git_index_entry entry = {{0}}; bool compressed = index->version >= INDEX_VERSION_NUMBE...
cwe
CWE-190
C/C++
menuItemTemplate: function (item) { return `<a>${item.string}</a>`; },
cwe
CWE-79
JavaScript
xmlParseBalancedChunkMemoryRecover(xmlDocPtr doc, xmlSAXHandlerPtr sax, void *user_data, int depth, const xmlChar *string, xmlNodePtr *lst, int recover) { xmlParserCtxtPtr ctxt; xmlDocPtr newDoc; xmlSAXHandlerPtr oldsax = NULL; xmlNodePtr content, newRoot; int size; int ret = 0; i...
cwe
CWE-401
C/C++
function initUi() { if (firstInitUi) { firstInitUi = false; mxEvent.addListener(div, 'scroll', function(evt) { if (div.scrollTop + div.clientHeight >= div.scrollHeight) { addTemplates(); mxEvent.consume(evt); } }); } if (customCatCount > 0) { var titleCss = 'font-w...
cwe
CWE-94
JavaScript
package docker import ( "bytes" "context" "crypto/rand" "encoding/json" "fmt" "io" "io/ioutil" "net/http" "net/url" "os" "path/filepath" "strings" "github.com/containers/image/v5/docker/reference" "github.com/containers/image/v5/manifest" "github.com/containers/image/v5/pkg/blobinfocache/none" "github...
cwe
CWE-400
Go
void AV1_RewriteESDescriptorEx(GF_MPEGVisualSampleEntryBox *av1, GF_MediaBox *mdia) { GF_BitRateBox *btrt = gf_isom_sample_entry_get_bitrate((GF_SampleEntryBox *)av1, GF_FALSE); if (av1->emul_esd) gf_odf_desc_del((GF_Descriptor *)av1->emul_esd); av1->emul_esd = gf_odf_desc_esd_new(2); av1->emul_esd->decoderConfig-...
cwe
CWE-476
C/C++
static smart_ptr<DFA> ast_to_dfa(const spec_t &spec, Output &output) { OutputBlock &block = output.block(); const opt_t *opts = block.opts; const loc_t &loc = block.loc; Msg &msg = output.msg; const std::vector<ASTRule> &rules = spec.rules; const std::string &cond = spec.name, na...
cwe
CWE-787
Unknown