code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
static Cache GetImagePixelCache(Image *image,const MagickBooleanType clone, ExceptionInfo *exception) { CacheInfo *magick_restrict cache_info; MagickBooleanType destroy, status; static MagickSizeType cache_timelimit = MagickResourceInfinity, cpu_throttle = MagickResourceInfinity, cycle...
cwe
CWE-772
C/C++
function Ws(e){Us=e}
cwe
CWE-79
JavaScript
MONGO_EXPORT int bson_append_code_w_scope_n( bson *b, const char *name, const char *code, int len, const bson *scope ) { int sl, size; if ( !scope ) return BSON_ERROR; sl = len + 1; size = 4 + 4 + sl + bson_size( scope ); if ( bson_append_estart( b, BSON_CODEWSCOPE, name, size ) == BSON_ERR...
cwe
CWE-190
Unknown
ProcXFixesSetCursorName(ClientPtr client) { CursorPtr pCursor; char *tchar; REQUEST(xXFixesSetCursorNameReq); REQUEST(xXFixesSetCursorNameReq); Atom atom; REQUEST_AT_LEAST_SIZE(xXFixesSetCursorNameReq); VERIFY_CURSOR(pCursor, stuff->cursor, client, DixSetAttrAccess); tchar = (char...
cwe
CWE-20
C/C++
ssize_t ip_append_page(struct sock *sk, struct flowi4 *fl4, struct page *page, int offset, size_t size, int flags) { struct inet_sock *inet = inet_sk(sk); struct sk_buff *skb; struct rtable *rt; struct ip_options *opt = NULL; struct inet_cork *cork; int hh_len; int mtu; int len; int err; unsigned int...
cwe
CWE-362
Unknown
exif_data_load_data (ExifData *data, const unsigned char *d_orig, unsigned int ds) { unsigned int l; ExifLong offset; ExifShort n; const unsigned char *d = d_orig; unsigned int len, fullds; if (!data || !data->priv || !d || !ds) return; exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData", "...
cwe
CWE-787
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-601
Python
/* * Client routines for the CUPS scheduler. * * Copyright 2007-2015 by Apple Inc. * Copyright 1997-2007 by Easy Software Products, all rights reserved. * * This file contains Kerberos support code, copyright 2006 by * Jelmer Vernooij. * * These coded instructions, statements, and computer programs are the * ...
cwe
CWE-290
C/C++
"/images/"+ma+".svg";return!0}function M(fa,ca,ba,ja){function ia(na,Ja){null==qa?(na=/^https?:\/\//.test(na)&&!b.editor.isCorsEnabledForUrl(na)?PROXY_URL+"?url="+encodeURIComponent(na):TEMPLATE_PATH+"/"+na,mxUtils.get(na,mxUtils.bind(this,function(Ga){200<=Ga.getStatus()&&299>=Ga.getStatus()&&(qa=Ga.getText());Ja(qa)}...
cwe
CWE-20
JavaScript
// SPDX-License-Identifier: BSD-2-Clause /* * Copyright (c) 2014, STMicroelectronics International N.V. */ #include <util.h> #include <kernel/tee_common_otp.h> #include <kernel/tee_common.h> #include <tee_api_types.h> #include <kernel/tee_ta_manager.h> #include <utee_types.h> #include <tee/tee_svc.h> #include <tee/te...
cwe
CWE-787
C/C++
int bnxt_re_create_srq(struct ib_srq *ib_srq, struct ib_srq_init_attr *srq_init_attr, struct ib_udata *udata) { struct ib_pd *ib_pd = ib_srq->pd; struct bnxt_re_pd *pd = container_of(ib_pd, struct bnxt_re_pd, ib_pd); struct bnxt_re_dev *rdev = pd->rdev; struct bnxt_qplib_dev_attr *dev_attr = &rdev...
cwe
CWE-401
C/C++
/* * Linux Socket Filter - Kernel level socket filtering * * Based on the design of the Berkeley Packet Filter. The new * internal format has been designed by PLUMgrid: * * Copyright (c) 2011 - 2014 PLUMgrid, http://plumgrid.com * * Authors: * * Jay Schulist <jschlst@samba.org> * Alexei Starovoitov <ast@plum...
cwe
CWE-120
C/C++
redirect: `${url}/error?${new URLSearchParams({ error: error as string, })}`, } } try { const redirect = await emailSignin(email, options) return { redirect } } catch (error) { logger.error("SIGNIN_EMAIL_ERROR", { error: error as Error, providerId: ...
cwe
CWE-863
JavaScript
$args['name'][$i] = $this->sanitizeFileName($name, $opts); } } else { $args['name'] = $this->sanitizeFileName($args['name'], $opts); } } return true; }
cwe
CWE-89
JavaScript
void __init setup_arch(char **cmdline_p) { memblock_reserve(__pa_symbol(_text), (unsigned long)__bss_stop - (unsigned long)_text); early_reserve_initrd(); /* * At this point everything still needed from the boot loader * or BIOS or kernel text should be early reserved or marked not * RAM in e820. All oth...
cwe
CWE-264
C/C++
GDataDirectory::GDataDirectory(GDataDirectory* parent, GDataDirectoryService* directory_service) : GDataEntry(parent, directory_service) { file_info_.is_directory = true; }
cwe
CWE-399
C/C++
package io.swagger.client; import javax.ws.rs.client.Client; import javax.ws.rs.client.ClientBuilder; import javax.ws.rs.client.Entity; import javax.ws.rs.client.Invocation; import javax.ws.rs.client.WebTarget; import javax.ws.rs.core.Form; import javax.ws.rs.core.GenericType; import javax.ws.rs.core.MediaType; import...
cwe
CWE-732
Java
swabHorDiff32(TIFF* tif, uint8* cp0, tmsize_t cc) { uint32* wp = (uint32*) cp0; tmsize_t wc = cc / 4; horDiff32(tif, cp0, cc); TIFFSwabArrayOfLong(wp, wc); }
cwe
CWE-119
C/C++
static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg) { struct bcm_tarang_data *pTarang = filp->private_data; void __user *argp = (void __user *)arg; struct bcm_mini_adapter *Adapter = pTarang->Adapter; INT Status = STATUS_FAILURE; int timeout = 0; struct bcm_ioctl_buffer IoBuffer; int bytes; BCM_...
cwe
CWE-200
C/C++
static unsigned long long decodeLZ4S(FILE* finput, FILE* foutput) { unsigned long long filesize = 0; char* in_buff; char* out_buff, *out_start, *out_end; unsigned char descriptor[LZ4S_MAXHEADERSIZE]; size_t nbReadBytes; int decodedBytes=0; unsigned int maxBlockSize; size_t sizeCheck; ...
cwe
CWE-20
Unknown
var exec = require('child_process').exec; module.exports = function (iface, callback) { exec("ifconfig " + iface, function (err, out) { if (err) { callback(err, null); return; } var match = /[a-f0-9]{2}(:[a-f0-9]{2}){5}/.exec(out.toLowerCase()); if (!match) {...
cwe
CWE-77
Java
parseInt(u.getAttribute("height"))+6),E=u.getAttribute("viewBox"),null!=E&&0<E.length&&(E=E.split(" "),3<E.length&&(w=parseFloat(E[2])+6,h=parseFloat(E[3])+6,u.setAttribute("viewBox",E[0]+" "+E[1]+" "+w+" "+h))))));return Q};Graph.prototype.setShadowVisible=function(u,E){mxClient.IS_SVG&&!mxClient.IS_SF&&(E=null!=E?E:!...
cwe
CWE-20
JavaScript
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { auto* params = reinterpret_cast<TfLiteMulParams*>(node->builtin_data); OpData* data = reinterpret_cast<OpData*>(node->user_data); const TfLiteTensor* input1 = GetInput(context, node, kInputTensor1); const TfLiteTensor* input2 = GetInput(context, nod...
cwe
CWE-787
C/C++
VaapiVideoDecodeAccelerator::VaapiH264Accelerator::VaapiH264Accelerator( VaapiVideoDecodeAccelerator* vaapi_dec, VaapiWrapper* vaapi_wrapper) : vaapi_wrapper_(vaapi_wrapper), vaapi_dec_(vaapi_dec) { DCHECK(vaapi_wrapper_); DCHECK(vaapi_dec_); }
cwe
CWE-362
C/C++
function middleware (req, res) { let u = url.parse(req.url, true) let headers = {} for (let h of allowHeaders) { if (req.headers[h]) { headers[h] = req.headers[h] } } // GitHub uses user-agent sniffing for git/* and changes its behavior which is frustrating if (!headers['u...
cwe
CWE-918
JavaScript
rb_push_glob(VALUE str, int flags) /* '\0' is delimiter */ { long offset = 0; VALUE ary; GlobPathValue(str, TRUE); ary = rb_ary_new(); while (offset < RSTRING_LEN(str)) { char *p, *pend; int status; p = RSTRING_PTR(str) + offset; status = push_glob(ary, rb_enc_str_new(p, strlen(p), rb_enc_get(...
cwe
CWE-22
Unknown
static Image *ReadSCREENSHOTImage(const ImageInfo *image_info, ExceptionInfo *exception) { Image *image; assert(image_info->signature == MagickCoreSignature); if (image_info->debug != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s", image_info->filename); assert(exception !...
cwe
CWE-772
C/C++
void jpc_qmfb_split_colgrp(jpc_fix_t *a, int numrows, int stride, int parity) { int bufsize = JPC_CEILDIVPOW2(numrows, 1); jpc_fix_t splitbuf[QMFB_SPLITBUFSIZE * JPC_QMFB_COLGRPSIZE]; jpc_fix_t *buf = splitbuf; jpc_fix_t *srcptr; jpc_fix_t *dstptr; register jpc_fix_t *srcptr2; register jpc_fix_t *dstptr2; r...
cwe
CWE-122
C/C++
int dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) { int al,i,j,ret; unsigned int n; SSL3_RECORD *rr; void (*cb)(const SSL *ssl,int type2,int val)=NULL; if (s->s3->rbuf.buf == NULL) /* Not initialized yet */ if (!ssl3_setup_buffers(s)) return(-1); if ((type && (type != SSL3_RT_A...
cwe
CWE-787
Unknown
static int ehci_process_itd(EHCIState *ehci, EHCIitd *itd, uint32_t addr) { USBDevice *dev; USBEndpoint *ep; uint32_t i, len, pid, dir, devaddr, endp; uint32_t pg, off, ptr1, ptr2, max, mult; ehci->periodic_sched_active = PERIODIC_ACTIVE...
cwe
CWE-20
C/C++
p11_rpc_message_alloc_extra_array (p11_rpc_message *msg, size_t nmemb, size_t size) { if ((SIZE_MAX - sizeof (void *)) / nmemb < size) { errno = ENOMEM; return NULL; } return p11_rpc_message_alloc_extra (msg, nmemb * size); }
cwe
CWE-190
Unknown
/* Based on https://github.com/trevex/golem Licensed under the Apache License, Version 2.0 http://www.apache.org/licenses/LICENSE-2.0.html */ package main import ( "bytes" "encoding/gob" _ "expvar" "fmt" "io/ioutil" "log" "net/http" "runtime" "sync" "time" "github.com/gorilla/websocket" //_ "github.com/mk...
cwe
CWE-863
Go
/* * Copyright 2015 LINE Corporation * * LINE Corporation licenses this file to you 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: * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless r...
cwe
CWE-74
Java
static void cirrus_bitblt_cputovideo_next(CirrusVGAState * s) { int copy_count; uint8_t *end_ptr; if (s->cirrus_srccounter > 0) { if (s->cirrus_blt_mode & CIRRUS_BLTMODE_PATTERNCOPY) { cirrus_bitblt_common_patterncopy(s, false); the_end: s->cirrus_srccounter = 0; ...
cwe
CWE-119
Unknown
static int selinux_bprm_set_creds(struct linux_binprm *bprm) { const struct task_security_struct *old_tsec; struct task_security_struct *new_tsec; struct inode_security_struct *isec; struct common_audit_data ad; struct selinux_audit_data sad = {0,}; struct inode *inode = bprm->file->f_path.dentry->d_inode; int r...
cwe
CWE-264
Unknown
#!/usr/bin/env python # -*- coding: utf-8 -*- # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Django settings for OMERO.web project. # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Copyright (c) 2008-2016 University of ...
cwe
CWE-200
Python
get_8bit_row(j_compress_ptr cinfo, cjpeg_source_ptr sinfo) /* This version is for reading 8-bit colormap indexes */ { bmp_source_ptr source = (bmp_source_ptr)sinfo; register JSAMPARRAY colormap = source->colormap; JSAMPARRAY image_ptr; register int t; register JSAMPROW inptr, outptr; register JDIMENSION col...
cwe
CWE-125
Unknown
protected function execute(InputInterface $input, OutputInterface $output) { $io = new SymfonyStyle($input, $output); $io->title('Kimai installation running ...'); /** @var Application $application */ $application = $this->getApplication(); /** @var KernelInterface $kernel ...
cwe
CWE-1236
JavaScript
static int __poke_user(struct task_struct *child, addr_t addr, addr_t data) { struct user *dummy = NULL; addr_t offset; if (addr < (addr_t) &dummy->regs.acrs) { /* * psw and gprs are stored on the stack */ if (addr == (addr_t) &dummy->regs.psw.mask && #ifdef CONFIG_COMPAT data != PSW_MASK_MERGE(psw_...
cwe
CWE-399
Unknown
// SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 1992 obz under the linux copyright * * Dynamic diacritical handling - aeb@cwi.nl - Dec 1993 * Dynamic keymap and string allocation - aeb@cwi.nl - May 1994 * Restrict VT switching via ioctl() - grif@cs.ucr.edu - Dec 1995 * Some code moved for less code du...
cwe
CWE-125
C/C++
static int jpc_dec_process_sot(jpc_dec_t *dec, jpc_ms_t *ms) { jpc_dec_tile_t *tile; jpc_sot_t *sot = &ms->parms.sot; jas_image_cmptparm_t *compinfos; jas_image_cmptparm_t *compinfo; jpc_dec_cmpt_t *cmpt; int cmptno; if (dec->state == JPC_MH) { compinfos = jas_malloc(dec->numcomps * sizeof(jas_image_cmptparm...
cwe
CWE-189
Unknown
var productsTable = $('#products-table').DataTable({ 'order': [[1, 'asc']], 'columnDefs': [ { 'orderable': false, 'targets': 0 }, { 'searchable': false, "targets": 0 } ] }); $('#products-table tbody').removeClass("d-none"); productsTable.columns.adjust().draw(); $("#search").on("keyup", Delay(function() { var...
cwe
CWE-79
JavaScript
inline typename V::VariantType FBUnserializer<V>::unserializeThing() { size_t code = nextCode(); switch (code) { case FB_SERIALIZE_BYTE: case FB_SERIALIZE_I16: case FB_SERIALIZE_I32: case FB_SERIALIZE_I64: return V::fromInt64(unserializeInt64()); case FB_SERIALIZE_VARCHAR: case FB_SER...
cwe
CWE-674
C/C++
void DownloadUIAdapterDelegate::OpenItem(const OfflineItem& item, int64_t offline_id) { JNIEnv* env = AttachCurrentThread(); Java_OfflinePageDownloadBridge_openItem( env, ConvertUTF8ToJavaString(env, item.page_url.spec()), offline_id); }
cwe
CWE-264
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 ma...
cwe
CWE-20
C/C++
static Jsi_RC jsi_ArrayPushCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this, Jsi_Value **ret, Jsi_Func *funcPtr) { Jsi_Obj *obj; if (_this->vt != JSI_VT_OBJECT || !Jsi_ObjIsArray(interp, _this->d.obj)) { Jsi_ValueMakeNumber(interp, ret, 0); return JSI_OK; } obj = _this-...
cwe
CWE-190
C/C++
'use strict'; const datastore = require('@google-cloud/datastore')(); class Cache { async clearCache() { const query = datastore.createQuery('Page'); const data = await datastore.runQuery(query); const entities = data[0]; const entityKeys = entities.map((entity) => entity[datastore.KEY]); consol...
cwe
CWE-284
JavaScript
static OPJ_BOOL opj_pi_next_cprl(opj_pi_iterator_t * pi) { opj_pi_comp_t *comp = NULL; opj_pi_resolution_t *res = NULL; OPJ_UINT32 index = 0; if (!pi->first) { comp = &pi->comps[pi->compno]; goto LABEL_SKIP; } else { pi->first = 0; } for (pi->compno = pi->poc.compno...
cwe
CWE-369
C/C++
queue_unlock(struct futex_q *q, struct futex_hash_bucket *hb) { spin_unlock(&hb->lock); drop_futex_key_refs(&q->key); }
cwe
CWE-119
Unknown
static int hgcm_call_preprocess_linaddr( const struct vmmdev_hgcm_function_parameter *src_parm, void **bounce_buf_ret, size_t *extra) { void *buf, *bounce_buf; bool copy_in; u32 len; int ret; buf = (void *)src_parm->u.pointer.u.linear_addr; len = src_parm->u.pointer.size; copy_in = src_parm->type != VMMDEV_HG...
cwe
CWE-703
C/C++
import { isTestSuiteActive } from "../../support/page_objects/projectConstants"; import { mainPage } from "../../support/page_objects/mainPage"; let storedURL = ""; export const genTest = (apiType, dbType) => { if (!isTestSuiteActive(apiType, dbType)) return; describe(`${apiType.toUpperCase()} api - FORM vie...
cwe
CWE-918
JavaScript
rsvg_state_clone (RsvgState * dst, const RsvgState * src) { gint i; RsvgState *parent = dst->parent; rsvg_state_finalize (dst); *dst = *src; dst->parent = parent; dst->font_family = g_strdup (src->font_family); dst->lang = g_strdup (src->lang); rsvg_paint_server_ref (dst->fill); rs...
cwe
CWE-20
Unknown
This function decrypts the plaintext */ PHP_FUNCTION(mdecrypt_generic) { zval *mcryptind; char *data; int data_len; php_mcrypt *pm; char* data_s; int block_size, data_size; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &mcryptind, &data, &data_len) == FAILURE) { return; } ZEND_FETCH_RESOURCE...
cwe
CWE-190
Unknown
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { const TfLiteTensor* indices = GetInput(context, node, kIndices); const TfLiteTensor* updates = GetInput(context, node, kUpdates); const TfLiteTensor* shape = GetInput(context, node, kShape); TfLiteTensor* output = GetOutput(context, node, kOutputTens...
cwe
CWE-125
C/C++
mock func() expectErr error client fosite.Client }{ { description: "should fail - token was issued to another client", expectErr: fosite.ErrRevocationClientMismatch, client: &fosite.DefaultClient{ID: "bar"}, mock: func() { token = "foo" tokenType = fosite.RefreshToken ...
cwe
CWE-754
Go
static PHP_FUNCTION(gzopen) { char *filename; char *mode; int filename_len, mode_len; int flags = REPORT_ERRORS; php_stream *stream; long use_include_path = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", &filename, &filename_len, &mode, &mode_len, &use_include_path) == FAIL...
cwe
CWE-200
C/C++
vhost_user_check_and_alloc_queue_pair(struct virtio_net *dev, struct VhostUserMsg *msg) { uint16_t vring_idx; switch (msg->request.master) { case VHOST_USER_SET_VRING_KICK: case VHOST_USER_SET_VRING_CALL: case VHOST_USER_SET_VRING_ERR: vring_idx = msg->payload.u64 & VHOST_USER_VRING_IDX_MASK; break; case ...
cwe
CWE-190
Unknown
static void parse_content_range(URLContext *h, const char *p) { HTTPContext *s = h->priv_data; const char *slash; if (!strncmp(p, "bytes ", 6)) { p += 6; s->off = strtoll(p, NULL, 10); if ((slash = strchr(p, '/')) && strlen(slash) > 0) s->filesize = strtoll(slash + 1...
cwe
CWE-119
C/C++
'use strict'; process.profile = function (operation, start) { console.log('%s took %d milliseconds', operation, process.elapsedTimeSince(start)); }; process.elapsedTimeSince = function (start) { const diff = process.hrtime(start); return (diff[0] * 1e3) + (diff[1] / 1e6); }; const utils = require('../public/src/ut...
cwe
CWE-330
JavaScript
package io.swagger.client; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.nio.file.Files; import java.text.DateFormat; import java.tex...
cwe
CWE-732
Java
protected function getFullPath($path, $base) { $separator = $this->separator; $systemroot = $this->systemRoot; $base = (string)$base; if ($base[0] === $separator && substr($base, 0, strlen($systemroot)) !== $systemroot) { $base = $systemroot . substr($base, 1); }...
cwe
CWE-22
PHP
Http::FilterDataStatus Context::onResponseBody(int body_buffer_length, bool end_of_stream) { if (!wasm_->onResponseBody_) { return Http::FilterDataStatus::Continue; } switch (wasm_ ->onResponseBody_(this, id_, static_cast<uint32_t>(body_buffer_length), static_cast...
cwe
CWE-476
C/C++
push_decoder_state (DECODER_STATE ds) { if (ds->idx >= ds->stacksize) { fprintf (stderr, "ERROR: decoder stack overflow!\n"); abort (); } ds->stack[ds->idx++] = ds->cur; }
cwe
CWE-20
C/C++
// SPDX-License-Identifier: BSD-2-Clause /* * Copyright (c) 2016, Linaro Limited * Copyright (c) 2014, STMicroelectronics International N.V. */ #include <arm.h> #include <assert.h> #include <kernel/panic.h> #include <kernel/spinlock.h> #include <kernel/tee_common.h> #include <kernel/tee_misc.h> #include <kernel/tlb...
cwe
CWE-787
C/C++
package io.onedev.server.web.component.markdown; import static org.apache.wicket.ajax.attributes.CallbackParameter.explicit; import java.io.Serializable; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Hash...
cwe
CWE-502
Java
// SPDX-License-Identifier: GPL-2.0-only /* * linux/kernel/signal.c * * Copyright (C) 1991, 1992 Linus Torvalds * * 1997-11-02 Modified for POSIX.1b signals by Richard Henderson * * 2003-06-02 Jim Houston - Concurrent Computer Corp. * Changes to use preallocated sigqueue structures * to allow signals ...
cwe
CWE-190
C/C++
text: String.format(i18n._('User: {0}'), Tine.Tinebase.registry.get('currentAccount').accountDisplayName), menu: this.getUserActions(), menuAlign: 'tr-br', iconCls: Tine.Tinebase.registry.get('userAccountChanged') ? 'renderer_accountUserChangedIcon' : 'renderer_accountUserIcon' ...
cwe
CWE-79
JavaScript
static int handle_cmd(struct sk_buff *skb, struct genl_info *info) { struct sk_buff *rep_buf; struct nlmsghdr *rep_nlh; struct nlmsghdr *req_nlh = info->nlhdr; struct tipc_genlmsghdr *req_userhdr = info->userhdr; int hdr_space = nlmsg_total_size(GENL_HDRLEN + TIPC_GENL_HDRLEN); u16 cmd; if ((req_userhdr->cmd & ...
cwe
CWE-264
Unknown
if(m||p){var O=[],V=null,U=null,Y=null,n=function(ea){W.setAttribute("disabled","disabled");for(var ta=0;ta<O.length;ta++)O[ta].className=ta==ea?"geBtn gePrimaryBtn":"geBtn"};M=!0;z=document.createElement("div");z.style.whiteSpace="nowrap";z.style.height="30px";G.appendChild(z);B=mxUtils.button(mxResources.get("Templat...
cwe
CWE-94
JavaScript
server((req, res) => { const pathname = decodeURI(url.parse(req.url).pathname); res.setHeader('access-control-allow-origin', '*'); if (reload && pathname === '/livereload') return serveReload(res); if (!isRouteRequest(pathname)) return serveStaticFile(res, pathname); return serveRoute(res, pathname)...
cwe
CWE-22
JavaScript
'use strict' const path = require('path') const assert = require('assert') const logger = require('./logger') const log = logger.create('config') const helper = require('./helper') const constant = require('./constants') const _ = require('lodash') let COFFEE_SCRIPT_AVAILABLE = false let LIVE_SCRIPT_AVAILABLE = fal...
cwe
CWE-601
JavaScript
/* * Swagger Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator p...
cwe
CWE-732
Java
/*! 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. */ package com.rebuild.core.rbstore; import cn.devezhao.persist4j.Record; imp...
cwe
CWE-89
Java
/* * 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. */ #include "hermes/Support/BigIntSupport.h" #include "hermes/Support/OptValue.h" #include "llvh/ADT/APInt.h" #include "llvh/ADT/S...
cwe
CWE-416
C/C++
Status BuildInputArgIndex(const OpDef::ArgDef& arg_def, AttrSlice attr_values, const FunctionDef::ArgAttrs* arg_attrs, bool ints_on_device, int64_t resource_arg_unique_id) { bool is_type_list; DataTypeVector dtypes; TF_RETUR...
cwe
CWE-617
Unknown
bool cephx_verify_authorizer(CephContext *cct, KeyStore *keys, bufferlist::iterator& indata, CephXServiceTicketInfo& ticket_info, bufferlist& reply_bl) { __u8 authorizer_v; uint32_t service_id; uint64_t global_id; CryptoKey service_secret; // ticket blob CephXTicketBlob ticket; try { ...
cwe
CWE-284
Unknown
static long vma_compute_subtree_gap(struct vm_area_struct *vma) { unsigned long max, subtree_gap; max = vma->vm_start; if (vma->vm_prev) max -= vma->vm_prev->vm_end; if (vma->vm_rb.rb_left) { subtree_gap = rb_entry(vma->vm_rb.rb_left, struct vm_area_struct, vm_rb)->rb_subtree_gap; if (subtree_gap > max) ...
cwe
CWE-119
Unknown
import hashlib import logging import os.path import uuid from collections import defaultdict from datetime import date, timedelta from typing import List, Mapping, Optional, Tuple from django.core.files.base import File from django.db import models from django.utils import timezone from django.utils.translation import...
cwe
CWE-20
Python
error_t rawSocketSendEthPacket(Socket *socket, const SocketMsg *message, uint_t flags) { error_t error; #if (ETH_SUPPORT == ENABLED) size_t length; NetBuffer *buffer; NetInterface *interface; //Select the relevant network interface if(socket->interface != NULL) { interface = socket->inte...
cwe
CWE-20
C/C++
void *hashtable_get(hashtable_t *hashtable, const char *key) { pair_t *pair; size_t hash; bucket_t *bucket; hash = hash_str(key); bucket = &hashtable->buckets[hash % num_buckets(hashtable)]; pair = hashtable_find_pair(hashtable, bucket, key, hash); if(!pair) return NULL; retur...
cwe
CWE-310
Unknown
int BIO_vprintf(BIO *bio, const char *format, va_list args) { int ret; size_t retlen; char hugebuf[1024 * 2]; /* Was previously 10k, which is unreasonable * in small-stack environments, like threads * or DOS programs. */ char *hugebuf...
cwe
CWE-119
Unknown
static const char *vgacon_startup(void) { const char *display_desc = NULL; u16 saved1, saved2; volatile u16 *p; if (screen_info.orig_video_isVGA == VIDEO_TYPE_VLFB || screen_info.orig_video_isVGA == VIDEO_TYPE_EFI) { no_vga: #ifdef CONFIG_DUMMY_CONSOLE conswitchp = &dummy_con; return conswitchp->co...
cwe
CWE-125
Unknown
def file_list io # :nodoc: header = String.new read_until_dashes io do |line| header << line end YAML.load header end
cwe
CWE-502
Ruby
function readDocType(xmlData, i){ const entities = {}; if( xmlData[i + 3] === 'O' && xmlData[i + 4] === 'C' && xmlData[i + 5] === 'T' && xmlData[i + 6] === 'Y' && xmlData[i + 7] === 'P' && xmlData[i + 8] === 'E') { i = i+9; let angleBrack...
cwe
CWE-1333
JavaScript
void xgroupCommand(client *c) { const char *help[] = { "CREATE <key> <groupname> <id or $> -- Create a new consumer group.", "SETID <key> <groupname> <id or $> -- Set the current group ID.", "DELGROUP <key> <groupname> -- Remove the specified group.", "DELCONSUMER <key> <groupname> <consu...
cwe
CWE-704
C/C++
size_t olm_pk_decrypt( OlmPkDecryption * decryption, void const * ephemeral_key, size_t ephemeral_key_length, void const * mac, size_t mac_length, void * ciphertext, size_t ciphertext_length, void * plaintext, size_t max_plaintext_length ) { if (max_plaintext_length < olm_pk_max_plai...
cwe
CWE-787
C/C++
createRandomCursorExecutor(const CollectionPtr& coll, const boost::intrusive_ptr<ExpressionContext>& expCtx, long long sampleSize, long long numRecords, boost::optional<BucketUnpacker> bucketUnpacker) { Opera...
cwe
CWE-617
Unknown
/*****************************************************************************/ /* LibreDWG - free implementation of the DWG file format */ /* */ /* Copyright (C) 2009,2018-2019 Free Software Foundation, Inc. */ ...
cwe
CWE-787
C/C++
choose_volume(struct archive_read *a, struct iso9660 *iso9660) { struct file_info *file; int64_t skipsize; struct vd *vd; const void *block; char seenJoliet; vd = &(iso9660->primary); if (!iso9660->opt_support_joliet) iso9660->seenJoliet = 0; if (iso9660->seenJoliet && vd->location > iso9660->joliet.locati...
cwe
CWE-125
Unknown
#include "logger.h" #include <QDateTime> Logger* Logger::m_instance = 0; Logger::Logger() : lock(QReadWriteLock::Recursive) , msgCounter(0) , peerCounter(0) { } Logger::~Logger() {} Logger *Logger::instance() { return m_instance; } void Logger::initInstance() { if (!m_instance) m_insta...
cwe
CWE-79
C/C++
func validateWebhook(actor *db.User, l macaron.Locale, w *db.Webhook) (field, msg string, ok bool) { if !actor.IsAdmin { // 🚨 SECURITY: Local addresses must not be allowed by non-admins to prevent SSRF, // see https://github.com/gogs/gogs/issues/5366 for details. payloadURL, err := url.Parse(w.URL) if err != ...
cwe
CWE-918
Go
static void xfrm6_tunnel_spi_fini(void) { kmem_cache_destroy(xfrm6_tunnel_spi_kmem); }
cwe
CWE-362
C/C++
int ssl3_check_cert_and_algorithm(SSL *s) { int i, idx; long alg_k, alg_a; EVP_PKEY *pkey = NULL; SESS_CERT *sc; #ifndef OPENSSL_NO_RSA RSA *rsa; #endif #ifndef OPENSSL_NO_DH DH *dh; #endif alg_k = s->s3->tmp.new_cipher->algorithm_mkey; alg_a = s->s3->tmp.new_cipher->algorithm_auth; ...
cwe
CWE-310
Unknown
/** * Copyright (c) 2010-2020 Contributors to the openHAB project * * See the NOTICE file(s) distributed with this work for additional * information. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse....
cwe
CWE-611
Java
/** * OLAT - Online Learning and Training<br> * http://www.olat.org * <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 * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * Unl...
cwe
CWE-22
Java
ext2_xattr_get(struct inode *inode, int name_index, const char *name, void *buffer, size_t buffer_size) { struct buffer_head *bh = NULL; struct ext2_xattr_entry *entry; size_t name_len, size; char *end; int error; ea_idebug(inode, "name=%d.%s, buffer=%p, buffer_size=%ld", name_index, name, buffer, (l...
cwe
CWE-19
C/C++
/* * 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-190
C/C++
int Exiv2::http(Exiv2::Dictionary& request, Exiv2::Dictionary& response, std::string& errors) { if (!request.count("verb")) request["verb"] = "GET"; if (!request.count("header")) request["header"] = ""; if (!request.count("version")) request["version"] = "1.0"; if (!request.count...
cwe
CWE-476
C/C++
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) { TF_LITE_ENSURE_EQ(context, NumInputs(node), 2); TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1); const TfLiteTensor* lookup = GetInput(context, node, 0); TF_LITE_ENSURE_EQ(context, NumDimensions(lookup), 1); TF_LITE_ENSURE_EQ(context, lookup->t...
cwe
CWE-787
C/C++
static struct block_device *add_partition(struct gendisk *disk, int partno, sector_t start, sector_t len, int flags, struct partition_meta_info *info) { dev_t devt = MKDEV(0, 0); struct device *ddev = disk_to_dev(disk); struct device *pdev; struct block_device *bdev; const char *dname; int err; lockdep_...
cwe
CWE-416
Unknown