code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
tooltipBind: function(_elem, _html) { if (_html != '') { _elem.bind('mouseenter.tooltip', function(e) { if (_elem != current_elem) { //Prepare the tooltip prepare(_html); // Set the current element the mouse is over and // initialize the position variables current_elem...
cwe
CWE-79
JavaScript
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { const TfLiteTensor* input = GetInput(context, node, kInputTensor); TfLiteTensor* output = GetOutput(context, node, kOutputTensor); const int num_elements = NumElements(input); TF_LITE_ENSURE_EQ(context, num_elements, NumElements(output)); switch (i...
cwe
CWE-125
C/C++
static Image *ReadRLEImage(const ImageInfo *image_info,ExceptionInfo *exception) { #define SkipLinesOp 0x01 #define SetColorOp 0x02 #define SkipPixelsOp 0x03 #define ByteDataOp 0x05 #define RunDataOp 0x06 #define EOFOp 0x07 char magick[12]; Image *image; IndexPacket index; int op...
cwe
CWE-20
Unknown
def get_context_data(self, *args, **kwargs): data = super().get_context_data(*args, **kwargs) if self.request.GET.get('back', None) is not None: data['back_link'] = self.request.GET['back'] return data
cwe
CWE-79
Python
/* 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-754
C/C++
function ContentTypeParser (bodyLimit, onProtoPoisoning, onConstructorPoisoning) { this[kDefaultJsonParse] = getDefaultJsonParser(onProtoPoisoning, onConstructorPoisoning) this.customParsers = {} this.customParsers['application/json'] = new Parser(true, false, bodyLimit, this[kDefaultJsonParse]) this.customPars...
cwe
CWE-754
JavaScript
package config import ( "context" "net/http" "os" "sync" "github.com/pomerium/pomerium/internal/log" "github.com/pomerium/pomerium/internal/middleware" "github.com/pomerium/pomerium/internal/telemetry" "github.com/pomerium/pomerium/internal/telemetry/metrics" "github.com/rs/zerolog" ) // A MetricsManager m...
cwe
CWE-200
Go
GF_Err import_file(GF_ISOFile *dest, char *inName, u32 import_flags, GF_Fraction force_fps, u32 frames_per_sample, GF_FilterSession *fsess, char **mux_args_if_first_pass, u32 tk_idx) { u32 track_id, i, j, timescale, track, stype, profile, compat, level, new_timescale, rescale_num, rescale_den, svc_mode, txt_flags, spl...
cwe
CWE-787
Unknown
package com.salesmanager.shop.admin.controller.user; import com.salesmanager.core.business.services.reference.country.CountryService; import com.salesmanager.core.business.services.user.GroupService; import com.salesmanager.core.business.services.user.PermissionService; import com.salesmanager.core.business.utils.ajax...
cwe
CWE-639
Java
function resolveUrl(relative, base) { return !hasNativeURL ? /* istanbul ignore next */ url.resolve(base, relative) : (new URL(relative, base)).href; }
cwe
CWE-20
JavaScript
static void assemble_file(const char *fname, StrList **depend_ptr) { char *line; insn output_ins; int i; uint64_t prev_offset_changed; int64_t stall_count = 0; /* Make sure we make forward progress... */ switch (cmd_sb) { case 16: break; case 32: if (!iflag_cpu_level_ok(...
cwe
CWE-476
Unknown
function createHotSpot(hs) { // Make sure hot spot pitch and yaw are numbers hs.pitch = Number(hs.pitch) || 0; hs.yaw = Number(hs.yaw) || 0; var div = document.createElement('div'); div.className = 'pnlm-hotspot-base'; if (hs.cssClass) div.className += ' ' + hs.cssClass; else ...
cwe
CWE-79
JavaScript
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) { int num_inputs = NumInputs(node); TF_LITE_ENSURE(context, num_inputs >= 2); TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1); const TfLiteTensor* input1 = GetInput(context, node, kInputTensor1); TfLiteTensor* output = GetOutput(context, node, kO...
cwe
CWE-125
C/C++
jbig2_sd_count_referred(Jbig2Ctx *ctx, Jbig2Segment *segment) { int index; Jbig2Segment *rsegment; int n_dicts = 0; for (index = 0; index < segment->referred_to_segment_count; index++) { rsegment = jbig2_find_segment(ctx, segment->referred_to_segments[index]); if (rsegment && ((rs...
cwe
CWE-190
C/C++
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-787
C/C++
PJ_DEF(pj_status_t) pjmedia_rtcp_fb_parse_sli( const void *buf, pj_size_t length, unsigned *sli_cnt, pjmedia_rtcp_fb_sli sli[]) { pjmedia_rtcp_common *hdr = (pjmedia_rtcp_common*) buf; pj_uint8_t *p; unsigned cnt, i; PJ_ASSERT_RETURN(buf && sli_cnt && sli, PJ_EINVAL); PJ_ASSERT_...
cwe
CWE-125
C/C++
import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.PrintWriter; public class Error extends HttpServlet { /** * Calls doPost */ protected ...
cwe
CWE-89
Java
close_pcsc_reader_wrapped (int slot) { long err; reader_table_t slotp; size_t len; int i; unsigned char msgbuf[9]; slotp = reader_table + slot; if (slotp->pcsc.req_fd == -1 || slotp->pcsc.rsp_fd == -1 || slotp->pcsc.pid == (pid_t)(-1) ) { log_error ("close_pcsc_reader: pcsc-wrapper...
cwe
CWE-20
Unknown
upnp_redirect(const char * rhost, unsigned short eport, const char * iaddr, unsigned short iport, const char * protocol, const char * desc, unsigned int leaseduration) { int proto, r; char iaddr_old[32]; char rhost_old[32]; unsigned short iport_old; struct in_addr address;...
cwe
CWE-476
C/C++
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ /* * perf_server.c -- Implements the "perf" server, see * https://tools.ietf.org/html/draft-banks-quic-performance-00 */ #include <assert.h> #include <errno.h> #include <stdio.h> #include <inttypes.h> #include <stdlib.h> #include <string...
cwe
CWE-476
C/C++
def guest_only(view_func): # TODO: test! @wraps(view_func) def wrapper(request, *args, **kwargs): if request.user.is_authenticated: return redirect(request.GET.get('next', request.user.st.get_absolute_url())) return view_func(request, *args, **kwargs) return wrapper
cwe
CWE-601
Python
def is_case_sensitive(self): if self._case_sensitive is None: lock = self.unlock_path(self.base_folder, unlock_parent=False) path = os.tempnam(self.base_folder, '.caseTest_') os.mkdir(path) if os.path.exists(path.upper()): self._case_sensitive = Fa...
cwe
CWE-377
Python
R_API RBinJavaAttrInfo *r_bin_java_enclosing_methods_attr_new(RBinJavaObj *bin, ut8 *buffer, ut64 sz, ut64 buf_offset) { ut64 offset = 6; RBinJavaAttrInfo *attr = r_bin_java_default_attr_new (bin, buffer, sz, buf_offset); if (!attr || sz < 10) { free (attr); return NULL; } attr->type = R_BIN_JAVA_ATTR_TYPE_ENC...
cwe
CWE-119
Unknown
static int fuse_permission(struct inode *inode, int mask) { struct fuse_conn *fc = get_fuse_conn(inode); bool refreshed = false; int err = 0; if (!fuse_allow_current_process(fc)) return -EACCES; /* * If attributes are needed, refresh them before proceeding */ if (fc->default_permissions || ((mask & M...
cwe
CWE-459
Unknown
int ldb_kv_search(struct ldb_kv_context *ctx) { struct ldb_context *ldb; struct ldb_module *module = ctx->module; struct ldb_request *req = ctx->req; void *data = ldb_module_get_private(module); struct ldb_kv_private *ldb_kv = talloc_get_type(data, struct ldb_kv_private); int ret; ldb = ldb_module_get_ctx(...
cwe
CWE-20
Unknown
long video_ioctl2(struct file *file, unsigned int cmd, unsigned long arg) { char sbuf[128]; void *mbuf = NULL; void *parg = (void *)arg; long err = -EINVAL; bool has_array_args; size_t array_size = 0; void __user *user_ptr = NULL; void **kernel_ptr = NULL; /* Copy arguments into temp kernel buff...
cwe
CWE-399
C/C++
validate_commit_metadata (GVariant *commit_data, const char *ref, const char *required_metadata, gboolean require_xa_metadata, GError **error) { g_autoptr(GVariant) commit_metadata = NULL; const char *xa_me...
cwe
CWE-276
C/C++
public function getFileContent($file, $identifier) { $resource = sprintf('hg cat -r %s %s', ProcessExecutor::escape($identifier), ProcessExecutor::escape($file)); $this->process->execute($resource, $content, $this->repoDir); if (!trim($content)) { return null; } ...
cwe
CWE-20
PHP
def delete_access(request, pk): topic_private = TopicPrivate.objects.for_delete_or_404(pk, request.user) if request.method == 'POST': topic_private.delete() if request.user.pk == topic_private.user_id: return redirect(reverse("spirit:topic:private:index")) return redirect(...
cwe
CWE-601
Python
static void ssl_reset_sock_state(pj_ssl_sock_t *ssock) { ossl_sock_t *ossock = (ossl_sock_t *)ssock; /** * Avoid calling SSL_shutdown() if handshake wasn't completed. * OpenSSL 1.0.2f complains if SSL_shutdown() is called during an * SSL handshake, while previous versions always return 0. */...
cwe
CWE-362
Unknown
it 'returns a list of all private messages that has been archived' do UserArchivedMessage.archive!(user_2.id, private_message) GroupArchivedMessage.archive!(user_2.id, group_message) topics = TopicQuery.new(nil).list_private_messages_all_archive(user_2).topics expect(topics).to contain_exactly...
cwe
CWE-200
Ruby
/* Copyright 2020 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-20
C/C++
static void xhci_kick_epctx(XHCIEPContext *epctx, unsigned int streamid) { XHCIState *xhci = epctx->xhci; XHCIStreamContext *stctx; XHCITransfer *xfer; XHCIRing *ring; USBEndpoint *ep = NULL; uint64_t mfindex; int length; int i; trace_usb_xhci_ep_kick(epctx->slotid, epctx->epid, str...
cwe
CWE-835
Unknown
static int load_misc_binary(struct linux_binprm *bprm) { Node *fmt; struct file * interp_file = NULL; char iname[BINPRM_BUF_SIZE]; const char *iname_addr = iname; int retval; int fd_binary = -1; retval = -ENOEXEC; if (!enabled) goto _ret; /* to keep locking time low, we copy the interpreter string */ read...
cwe
CWE-200
Unknown
// SPDX-License-Identifier: GPL-2.0 /* Copyright(c) 2009-2012 Realtek Corporation.*/ #include "wifi.h" #include "core.h" #include "usb.h" #include "base.h" #include "ps.h" #include "rtl8192c/fw_common.h" #include <linux/export.h> #include <linux/module.h> MODULE_AUTHOR("lizhaoming <chaoming_li@realsil.com.cn>"); MOD...
cwe
CWE-401
C/C++
int ZEXPORT inflate(strm, flush) z_streamp strm; int flush; { struct inflate_state FAR *state; z_const unsigned char FAR *next; /* next input */ unsigned char FAR *put; /* next output */ unsigned have, left; /* available input and output */ unsigned long hold; /* bit buffer */ ...
cwe
CWE-787
C/C++
tabstop_set(char_u *var, int **array) { int valcount = 1; int t; char_u *cp; if (var[0] == NUL || (var[0] == '0' && var[1] == NUL)) { *array = NULL; return TRUE; } for (cp = var; *cp != NUL; ++cp) { if (cp == var || cp[-1] == ',') { char_u *end; if (strtol((char *)cp, (c...
cwe
CWE-122
C/C++
// pixiv fanbox, maybe blocked by upstream // params: // user?: fanbox domain name const got = require('@/utils/got'); const conv_item = require('./conv'); const get_header = require('./header'); module.exports = async (ctx) => { const user = ctx.params.user || 'official'; // if no user specified, just go to of...
cwe
CWE-918
JavaScript
txtwrite_process_cmap_text(gs_text_enum_t *pte) { textw_text_enum_t *const penum = (textw_text_enum_t *)pte; unsigned int rcode = 0; gs_text_enum_t scan = *(gs_text_enum_t *)pte; /* Composite font using a CMap */ for ( ; ; ) { gs_glyph glyph; int font_code, code; gs_font *su...
cwe
CWE-476
Unknown
// SPDX-License-Identifier: GPL-2.0 /* Copyright (c) 2018, Linaro Ltd */ #include <linux/miscdevice.h> #include <linux/module.h> #include <linux/poll.h> #include <linux/skbuff.h> #include <linux/uaccess.h> #include "qrtr.h" struct qrtr_tun { struct qrtr_endpoint ep; struct sk_buff_head queue; wait_queue_head_t r...
cwe
CWE-400
C/C++
//======================================================================== // // CharCodeToUnicode.cc // // Copyright 2001-2003 Glyph & Cog, LLC // //======================================================================== #include <aconf.h> #ifdef USE_GCC_PRAGMAS #pragma implementation #endif #include <stdio.h> #in...
cwe
CWE-120
C/C++
function start(config) { var host = conf.constant.host; if(config) conf.serv = config; function onRequest(request, response) { var frontUrl = ''; if(request.url === '/favicon.ico') return; for(var key in conf.serv) { if(request.headers.host.indexOf(key) !== -1) { host = conf.serv[key]; ...
cwe
CWE-22
JavaScript
function RegistrationSaveContactNameFields( $config, $values ) { if ( empty( $values['FIRST_NAME'] ) || empty( $values['LAST_NAME'] ) ) { return 0; } $person_id = DBSeqNextID( 'people_person_id_seq' ); $sql = "INSERT INTO PEOPLE "; $fields = 'PERSON_ID,LAST_NAME,FIRST_NAME,MIDDLE_NAME,'; $values_sql = "'...
cwe
CWE-89
PHP
/* * OpenClinica is distributed under the * GNU Lesser General Public License (GNU LGPL). * For details see: http://www.openclinica.org/license * copyright 2003-2005 Akaza Research */ package org.akaza.openclinica.control.submit; import org.akaza.openclinica.bean.core.Utils; import org.akaza.openclinica.bean.man...
cwe
CWE-22
Java
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { const TfLiteTensor* input = GetInput(context, node, kInputTensor); const TfLiteTensor* fft_length = GetInput(context, node, kFftLengthTensor); const int32_t* fft_length_data = GetTensorData<int32_t>(fft_length); TfLiteTensor* output = GetOutput(conte...
cwe
CWE-125
C/C++
static int finish(void) { int magic = BPF_PRELOAD_END; struct pid *tgid; loff_t pos = 0; ssize_t n; /* send the last magic to UMD. It will do a normal exit. */ n = kernel_write(umd_ops.info.pipe_to_umh, &magic, sizeof(magic), &pos); if (n != sizeof(magic)) return -EPIPE; tgid = umd_ops.info.tgid; wait_e...
cwe
CWE-401
Unknown
nfsd4_set_nfs4_acl(struct svc_rqst *rqstp, struct svc_fh *fhp, struct nfs4_acl *acl) { __be32 error; int host_error; struct dentry *dentry; struct inode *inode; struct posix_acl *pacl = NULL, *dpacl = NULL; unsigned int flags = 0; /* Get inode */ error = fh_verify(rqstp, fhp, 0, NFSD_MAY_SATTR); if (error) ...
cwe
CWE-284
C/C++
gdImagePtr gdImageCreateFromXpm (char *filename) { XpmInfo info; XpmImage image; int i, j, k, number; char buf[5]; gdImagePtr im = 0; int *pointer; int red = 0, green = 0, blue = 0; int *colors; int ret; ret = XpmReadFileToXpmImage(filename, &image, &info); if (ret != XpmSuccess) { return 0; } if (!(im...
cwe
CWE-476
Unknown
fifo_open(notify_fifo_t* fifo, int (*script_exit)(thread_t *), const char *type) { int ret; int sav_errno; if (fifo->name) { sav_errno = 0; if (!(ret = mkfifo(fifo->name, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH))) fifo->created_fifo = true; else { sav_errno = errno; if (sav_errno != EEXIST) log_m...
cwe
CWE-59
C/C++
static const URI_CHAR * URI_FUNC(ParseIPv6address2)( URI_TYPE(ParserState) * state, const URI_CHAR * first, const URI_CHAR * afterLast, UriMemoryManager * memory) { int zipperEver = 0; int quadsDone = 0; int digitCount = 0; unsigned char digitHistory[4]; int ip4OctetsDone = 0; unsigned char quadsAfterZippe...
cwe
CWE-125
Unknown
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
cwe
CWE-119
C/C++
/******************************************************************************* * This file is part of OpenNMS(R). * * Copyright (C) 2009-2014 The OpenNMS Group, Inc. * OpenNMS(R) is Copyright (C) 1999-2014 The OpenNMS Group, Inc. * * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. * * OpenNMS(...
cwe
CWE-79
Java
function peg$parsepartial() { var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; peg$silentFails++; s0 = peg$currPos; s1 = peg$parseld(); if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 62) { s2 = peg$c30; peg$currPos++; } else { s2 = ...
cwe
CWE-1321
JavaScript
void copyBytes(InStream* is, int length) { while (length > 0) { int n = check(1, length); is->readBytes(ptr, n); ptr += n; length -= n; } }
cwe
CWE-122
C/C++
struct resource_pool *dce120_create_resource_pool( uint8_t num_virtual_links, struct dc *dc) { struct dce110_resource_pool *pool = kzalloc(sizeof(struct dce110_resource_pool), GFP_KERNEL); if (!pool) return NULL; if (construct(num_virtual_links, dc, pool)) return &pool->base; BREAK_TO_DEBUGGER(); return...
cwe
CWE-401
C/C++
public function testDeleteCommentAction() { $client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN); $this->assertAccessIsGranted($client, '/admin/project/1/details'); $form = $client->getCrawler()->filter('form[name=project_comment_form]')->form(); $client->submit($form, [ ...
cwe
CWE-352
PHP
static int binder_thread_write(struct binder_proc *proc, struct binder_thread *thread, binder_uintptr_t binder_buffer, size_t size, binder_size_t *consumed) { uint32_t cmd; struct binder_context *context = proc->context; void __user *buffer = (void __user *)(uintptr_t)binder_buffer; void __user *ptr = buff...
cwe
CWE-416
Unknown
// SPDX-License-Identifier: GPL-2.0-only /* * Kernel-based Virtual Machine driver for Linux * * AMD SVM support * * Copyright (C) 2006 Qumranet, Inc. * Copyright 2010 Red Hat, Inc. and/or its affiliates. * * Authors: * Yaniv Kamay <yaniv@qumranet.com> * Avi Kivity <avi@qumranet.com> */ #define pr_fmt...
cwe
CWE-416
C/C++
int orangefs_set_acl(struct inode *inode, struct posix_acl *acl, int type) { struct orangefs_inode_s *orangefs_inode = ORANGEFS_I(inode); int error = 0; void *value = NULL; size_t size = 0; const char *name = NULL; switch (type) { case ACL_TYPE_ACCESS: name = XATTR_NAME_POSIX_ACL_ACCESS; if (acl) { umode...
cwe
CWE-285
C/C++
import {isIP} from 'node:net'; /** * @external URL * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/URL|URL} */ /** * @module utils/referrer * @private */ /** * @see {@link https://w3c.github.io/webappsec-referrer-policy/#strip-url|Referrer Policy §8.4. Strip url for use as a referrer} * @param...
cwe
CWE-400
JavaScript
$(function(){ if (OME === undefined) { window.OME = {}; } // Can be called from anywhere, E.g. center_plugin.thumbs OME.emptyWellBirdsEye = function() { $("#well_birds_eye").empty() .off("click"); }; OME.hideWellBirdsEye = function() { $("#tree_details").cs...
cwe
CWE-79
Python
parse_command_modifiers( exarg_T *eap, char **errormsg, cmdmod_T *cmod, int skip_only) { char_u *cmd_start = NULL; char_u *p; int starts_with_colon = FALSE; int vim9script = in_vim9script(); int has_visual_range = FALSE; CLEAR_POINTER(cmod); cmod->cmod_flags...
cwe
CWE-122
C/C++
(function() { // Adds Arrow shapes with control points Sidebar.prototype.addUml25Palette = function() { // Avoids having to bind all functions to "this" var sb = this; // Reusable cells var field = new mxCell('+ field: type', new mxGeometry(0, 0, 100, 26), 'text;strokeColor=none;fillColor=none;align=left;ve...
cwe
CWE-284
Java
do_exedit( exarg_T *eap, win_T *old_curwin) // curwin before doing a split or NULL { int n; int need_hide; int exmode_was = exmode_active; if ((eap->cmdidx != CMD_pedit && ERROR_IF_POPUP_WINDOW) || ERROR_IF_TERM_POPUP_WINDOW) return; /* * ":vi" command ends Ex mode. ...
cwe
CWE-787
Unknown
/* nbdkit * Copyright (C) 2013-2019 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the f...
cwe
CWE-617
C/C++
static int seticcspace(i_ctx_t * i_ctx_p, ref *r, int *stage, int *cont, int CIESubst) { os_ptr op = osp; ref ICCdict, *tempref, *altref=NULL, *nocie = NULL; int components, code; float range[8]; code = dict_find_string(systemdict, "NOCIE", &nocie); if (code > 0) { if (!r_has_type(n...
cwe
CWE-704
Unknown
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-200
Java
nfssvc_decode_readargs(struct svc_rqst *rqstp, __be32 *p, struct nfsd_readargs *args) { unsigned int len; int v; p = decode_fh(p, &args->fh); if (!p) return 0; args->offset = ntohl(*p++); len = args->count = ntohl(*p++); p++; /* totalcount - unused */ len = min_t(unsigned int, len, NFSSVC_MA...
cwe
CWE-404
C/C++
def getPlayer(player): db.execute("SELECT * FROM players WHERE Name = '%s' COLLATE NOCASE" % player) playerstats = dict(db.fetchone()) return playerstats
cwe
CWE-89
Python
PHPAPI PHP_FUNCTION(fread) { zval *arg1; long len; php_stream *stream; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &arg1, &len) == FAILURE) { RETURN_FALSE; } PHP_STREAM_TO_ZVAL(stream, &arg1); if (len <= 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than...
cwe
CWE-190
C/C++
/* FTP engine * * Copyright (c) 2014-2019 Joachim Nilsson <troglobit@gmail.com> * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTW...
cwe
CWE-120
C/C++
// imagew-gif.c // Part of ImageWorsener, Copyright (c) 2011 by Jason Summers. // For more information, see the readme.txt file. // This is a self-contained GIF image decoder. // It supports a single image only, so it does not support animated GIFs, // or any GIF where the main image is constructed from multiple sub-i...
cwe
CWE-369
C/C++
static ssize_t bat_socket_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) { struct socket_client *socket_client = file->private_data; struct socket_packet *socket_packet; size_t packet_len; int error; if ((file->f_flags & O_NONBLOCK) && (socket_client->queue_len == 0)) return -EA...
cwe
CWE-119
C/C++
pci_emul_mem_handler(struct vmctx *ctx, int vcpu, int dir, uint64_t addr, int size, uint64_t *val, void *arg1, long arg2) { struct pci_vdev *pdi = arg1; struct pci_vdev_ops *ops = pdi->dev_ops; uint64_t offset; int bidx = (int) arg2; assert(bidx <= PCI_BARMAX); assert(pdi->bar[bidx].type == PCIBAR_MEM32 |...
cwe
CWE-703
Unknown
const got = require('@/utils/got'); const cheerio = require('cheerio'); module.exports = async (ctx) => { let { type, host } = ctx.params; type = type === 'all' ? '' : type; host = host ? host : 'gitlab.com'; const typename = { trending: 'Trending', starred: 'Most stars', all: '...
cwe
CWE-918
JavaScript
package org.platformlambda.automation.models; public class WsInfo { public String appName, authService, userService; public WsInfo(String appName, String authService, String userService) { this.appName = appName; this.authService = authService; this.userService = userService; } }
cwe
CWE-611
Java
func (err ErrInvalidCloneAddr) Error() string { return fmt.Sprintf("invalid clone address [is_url_error: %v, is_invalid_path: %v, is_permission_denied: %v]", err.IsURLError, err.IsInvalidPath, err.IsPermissionDenied) }
cwe
CWE-918
Go
// Copyright 2014 Unknown // // Licensed under the Apache License, Version 2.0 (the "License"): you may // not use this file except in compliance with the License. You may obtain // a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writ...
cwe
CWE-22
Go
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible 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 lat...
cwe
CWE-74
Python
handle_spawn (PortalFlatpak *object, GDBusMethodInvocation *invocation, GUnixFDList *fd_list, const gchar *arg_cwd_path, const gchar *const *arg_argv, GVariant *arg_fds, GVariant ...
cwe
CWE-74
C/C++
/**************************************************************************** ** libebml : parse EBML files, see http://embl.sourceforge.net/ ** ** <file/class description> ** ** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it ...
cwe
CWE-125
C/C++
protected function itemLocked($hash) { if (!elFinder::$commonTempPath) { return false; } $lock = elFinder::$commonTempPath . DIRECTORY_SEPARATOR . $hash . '.lock'; if (file_exists($lock)) { if (filemtime($lock) + $this->itemLockExpire < time()) { ...
cwe
CWE-22
PHP
void __init acpi_initrd_override(void *data, size_t size) { int sig, no, table_nr = 0, total_offset = 0; long offset = 0; struct acpi_table_header *table; char cpio_path[32] = "kernel/firmware/acpi/"; struct cpio_data file; if (data == NULL || size == 0) return; for (no = 0; no < ACPI_OVERRIDE_TABLES; no++) ...
cwe
CWE-264
C/C++
void utf16_to_utf8(const char16_t* src, size_t src_len, char* dst) { if (src == NULL || src_len == 0 || dst == NULL) { return; } const char16_t* cur_utf16 = src; const char16_t* const end_utf16 = src + src_len; char *cur = dst; while (cur_utf16 < end_utf16) { char32_t utf32; if((*cur_utf16 & 0xFC...
cwe
CWE-264
C/C++
plpython_validator(PG_FUNCTION_ARGS) { Oid funcoid = PG_GETARG_OID(0); HeapTuple tuple; Form_pg_proc procStruct; bool is_trigger; if (!check_function_bodies) { PG_RETURN_VOID(); } /* Get the new function's pg_proc entry */ tuple = SearchSysCache1(PROCOID, ObjectIdGetDatum(funcoid)); if (!HeapTupleIsVal...
cwe
CWE-264
Unknown
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ /* * lsquic_attq.c -- Advisory Tick Time Queue * * This is a collection of connections kept in a binary heap, the top * element having the minimum advsory time. To speed up removal, each * element has an index it has in the heap array. The...
cwe
CWE-476
C/C++
/* JSON_parser.c */ /* 2005-12-30 */ /* Copyright (c) 2005 JSON.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, mod...
cwe
CWE-125
C/C++
def _checknetloc(netloc): if not netloc or netloc.isascii(): return # looking for characters like \u2100 that expand to 'a/c' # IDNA uses NFKC equivalence, so normalize for this check import unicodedata n = netloc.rpartition('@')[2] # ignore anything to the left of '@' n = n.replace(':',...
cwe
CWE-522
Python
#!/usr/bin/python -tt # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that ...
cwe
CWE-59
Python
SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3, unsigned long, arg4, unsigned long, arg5) { struct task_struct *me = current; unsigned char comm[sizeof(me->comm)]; long error; error = security_task_prctl(option, arg2, arg3, arg4, arg5); if (error != -ENOSYS) return error; error...
cwe
CWE-264
Unknown
def self.register_user_defined_tag_type(config_source) config = YAML.load(config_source) check_validity_of_config(config) TagType.register(registered_tag_name = config['tag_name'].to_sym, config['tag'], config['iteration_tag'], confi...
cwe
CWE-502
Ruby
this.init=function(){function G(H){if(null!=H){var R=H.getAttribute("background");if(null==R||""==R||R==mxConstants.NONE)R=Editor.isDarkMode()?"transparent":"#ffffff";A.style.backgroundColor=R;(new mxCodec(H.ownerDocument)).decode(H,L.getModel());L.maxFitScale=1;L.fit(8);L.center()}return H}function N(H){null!=H&&(H=G(...
cwe
CWE-94
JavaScript
/* Parser generator */ /* For a description, see the comments at end of this file */ #include "Python.h" #include "pgenheaders.h" #include "token.h" #include "node.h" #include "grammar.h" #include "metagrammar.h" #include "pgen.h" extern int Py_DebugFlag; extern int Py_IgnoreEnvironmentFlag; /* needed by Py_GETENV *...
cwe
CWE-125
Python
function t(){e=!0;if(0==c.length)E.innerHTML=mxUtils.htmlEntities(mxResources.get("noPlugins"));else{E.innerHTML= "";for(var x=0;x<c.length;x++){var z=document.createElement("span");z.style.whiteSpace="nowrap";var y=document.createElement("span");y.className="geSprite geSprite-delete";y.style.position="relative";y.styl...
cwe
CWE-94
JavaScript
cdf_read_short_sector(const cdf_stream_t *sst, void *buf, size_t offs, size_t len, const cdf_header_t *h, cdf_secid_t id) { assert((size_t)CDF_SHORT_SEC_SIZE(h) == len); (void)memcpy(((char *)buf) + offs, ((const char *)sst->sst_tab) + CDF_SHORT_SEC_POS(h, id), len); return len; }
cwe
CWE-119
C/C++
int TLSInStream::pos() { return offset + ptr - start; }
cwe
CWE-787
C/C++
/* MDIO Bus interface * * Author: Andy Fleming * * Copyright (c) 2004 Freescale Semiconductor, Inc. * * 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 Licens...
cwe
CWE-416
C/C++
/* * See the NOTICE file distributed with this work for additional * information regarding copyright ownership. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * th...
cwe
CWE-668
Java
win_close(win_T *win, int free_buf) { win_T *wp; int other_buffer = FALSE; int close_curwin = FALSE; int dir; int help_window = FALSE; tabpage_T *prev_curtab = curtab; frame_T *win_frame = win->w_frame->fr_parent; #ifdef FEAT_DIFF int had_diffmode = win->w_p_diff; #endif #ifdef ME...
cwe
CWE-787
Unknown
writeDataError(instanceData *pData, cJSON **pReplyRoot, uchar *reqmsg) { char *rendered = NULL; cJSON *errRoot; cJSON *req; cJSON *replyRoot = *pReplyRoot; size_t toWrite; ssize_t wrRet; char errStr[1024]; DEFiRet; if(pData->errorFile == NULL) { DBGPRINTF("omelasticsearch: no local error logger defined - " ...
cwe
CWE-399
C/C++