code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
static void ctcp_msg_dcc_send(IRC_SERVER_REC *server, const char *data, const char *nick, const char *addr, const char *target, CHAT_DCC_REC *chat) { GET_DCC_REC *dcc; SEND_DCC_REC *temp_dcc; IPADDR ip; char *address, **params, *fname; int paramcount, fileparams; int port, len, quoted = FALSE; ...
cwe
CWE-416
Unknown
package com.salesmanager.shop.admin.controller.products; import com.salesmanager.core.business.services.catalog.category.CategoryService; import com.salesmanager.core.business.services.catalog.product.ProductService; import com.salesmanager.core.business.utils.ajax.AjaxPageableResponse; import com.salesmanager.core.bu...
cwe
CWE-79
Java
bool CCLayerTreeHost::initialize() { TRACE_EVENT("CCLayerTreeHost::initialize", this, 0); if (m_settings.enableCompositorThread) { m_settings.acceleratePainting = false; m_settings.showFPSCounter = false; m_settings.showPlatformLayerTree = false; m_proxy = CCThreadProxy::create(...
cwe
CWE-119
C/C++
function localSettings() { const tokenValidation = AuthTokenValidation.findOne({ connectionId: this.connection.id }); if (!tokenValidation || tokenValidation.validationStatus !== ValidationStates.VALIDATED) { Logger.warn(`Publishing LocalSettings was requested by unauth connection ${this.connection.id}`); ...
cwe
CWE-918
JavaScript
static inline int audit_del_rule(struct audit_entry *entry, struct list_head *list) { struct audit_entry *e; struct audit_field *inode_f = entry->rule.inode_f; struct audit_watch *watch, *tmp_watch = entry->rule.watch; struct audit_tree *tree = entry->rule.tree; LIST_HEAD(inotify_list); int h, ret = 0; #ifd...
cwe
CWE-362
Unknown
// Code generated by MockGen. DO NOT EDIT. // Source: github.com/ory/fosite (interfaces: TokenEndpointHandler) // Package internal is a generated GoMock package. package internal import ( context "context" reflect "reflect" gomock "github.com/golang/mock/gomock" fosite "github.com/ory/fosite" ) // MockTokenEnd...
cwe
CWE-345
Go
def requestStarted(self, job): """Handle a request for a qute: scheme. This method must be reimplemented by all custom URL scheme handlers. The request is asynchronous and does not need to be handled right away. Args: job: QWebEngineUrlRequestJob """ url = j...
cwe
CWE-352
Python
sc_oberthur_read_file(struct sc_pkcs15_card *p15card, const char *in_path, unsigned char **out, size_t *out_len, int verify_pin) { struct sc_context *ctx = p15card->card->ctx; struct sc_card *card = p15card->card; struct sc_file *file = NULL; struct sc_path path; size_t sz; int rv; LOG_FUNC_CALLED(ctx); if...
cwe
CWE-787
C/C++
void CoordinatorImpl::FinalizeGlobalMemoryDumpIfAllManagersReplied() { TRACE_EVENT0(base::trace_event::MemoryDumpManager::kTraceCategory, "GlobalMemoryDump.Computation"); DCHECK(!queued_memory_dump_requests_.empty()); QueuedRequest* request = &queued_memory_dump_requests_.front(); if (!request->...
cwe
CWE-787
C/C++
ossl_cipher_set_key(VALUE self, VALUE key) { EVP_CIPHER_CTX *ctx; int key_len; StringValue(key); GetCipher(self, ctx); key_len = EVP_CIPHER_CTX_key_length(ctx); if (RSTRING_LEN(key) != key_len) ossl_raise(rb_eArgError, "key must be %d bytes", key_len); if (EVP_CipherInit_ex(ctx, NULL, NU...
cwe
CWE-703
Unknown
void do_change_user(int afdt_fd) { std::string uname; lwp_read(afdt_fd, uname); if (!uname.length()) return; auto buf = PasswdBuffer{}; struct passwd *pw; if (getpwnam_r(uname.c_str(), &buf.ent, buf.data.get(), buf.size, &pw)) { // TODO(alexeyt) should we log something and/or fail to start? return;...
cwe
CWE-22
C/C++
package com.databasir.core.infrastructure.driver; import com.databasir.core.domain.DomainErrors; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.commons.io.IOUtils; import org.springframework.beans.factory.annotation.Value; import org.springframework.http.HttpMethod; import o...
cwe
CWE-20
Java
static void sdp_copy_raw_data(tCONN_CB* p_ccb, bool offset) { unsigned int cpy_len, rem_len; uint32_t list_len; uint8_t* p; uint8_t type; #if (SDP_DEBUG_RAW == TRUE) uint8_t num_array[SDP_MAX_LIST_BYTE_COUNT]; uint32_t i; for (i = 0; i < p_ccb->list_len; i++) { snprintf((char*)&num_array[i * 2], sizeof(num...
cwe
CWE-787
C/C++
EditorUi.prototype.convertDataUri=function(c){if("data:"==c.substring(0,5)){var e=c.indexOf(";");0<e&&(c=c.substring(0,e)+c.substring(c.indexOf(",",e+1)))}return c};EditorUi.prototype.isRemoteFileFormat=function(c,e){return/("contentType":\s*"application\/gliffy\+json")/.test(c)};EditorUi.prototype.isLucidChartData=fun...
cwe
CWE-20
JavaScript
struct resource_pool *dce100_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(); retur...
cwe
CWE-401
C/C++
/*! 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.service.dataimport; import cn.devezhao.commons.ex...
cwe
CWE-89
Java
QPDF::outputLengthNextN( int in_object, int n, std::map<int, qpdf_offset_t> const& lengths, std::map<int, int> const& obj_renumber) { // Figure out the length of a series of n consecutive objects in // the output file starting with whatever object in_object from // the input file mapped to. ...
cwe
CWE-787
Unknown
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe import json, datetime from frappe import _, scrub import frappe.desk.query_report from frappe.utils import cint, cstr from frappe.model.document import Document from...
cwe
CWE-79
Python
static Image *ReadJP2Image(const ImageInfo *image_info,ExceptionInfo *exception) { const char *option; Image *image; int jp2_status; MagickBooleanType status; opj_codec_t *jp2_codec; opj_codestream_index_t *codestream_index = (opj_codestream_index_t *) NULL; opj_dparameters_t...
cwe
CWE-20
C/C++
/* date-and-time.js (c) KNOWLEDGECODE | MIT */ (function(q){var d={},t={},r={},m="en",v={MMMM:"January February March April May June July August September October November December".split(" "),MMM:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),dddd:"Sunday Monday Tuesday Wednesday Thursday Friday Saturda...
cwe
CWE-400
JavaScript
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ /* * md5_server.c -- Read one or more streams from the client and return * MD5 sum of the payload. */ #include <assert.h> #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/queue.h> #i...
cwe
CWE-476
C/C++
function TeamViewModel(data) { this.Id = data.Id; this.Name = data.Name; this.Checked = false; }
cwe
CWE-79
JavaScript
/* * 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 n...
cwe
CWE-521
Java
private static function init() { \DPL\Config::init(); if ( !isset( self::$createdLinks ) ) { self::$createdLinks = [ 'resetLinks' => false, 'resetTemplates' => false, 'resetCategories' => false, 'resetImages' => false, 'resetdone' => false, 'elimdone' => false ]; } }
cwe
CWE-400
PHP
/* * Copyright © 2014-2019 Red Hat, Inc * Copyright © 2017 Endless Mobile, Inc. * * 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 by the Free Software Foundation; either * version 2.1 of the License, or (at your o...
cwe
CWE-276
C/C++
void Compute(OpKernelContext* context) override { const Tensor& diagonal = context->input(0); // MatrixDiag and MatrixDiagV2 both use this OpKernel. MatrixDiag only has // one input, so we have to check the number of inputs before reading // additional parameters in MatrixDiagV2. int32 lower_diag_i...
cwe
CWE-190
Unknown
/* * Copyright (C) 2022 neocotic * * 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, modify, merge, publish, d...
cwe
CWE-94
JavaScript
/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\...
cwe
CWE-415
C/C++
ngx_http_lua_adjust_subrequest(ngx_http_request_t *sr, ngx_uint_t method, int always_forward_body, ngx_http_request_body_t *body, unsigned vars_action, ngx_array_t *extra_vars) { ngx_http_request_t *r; ngx_int_t rc; ngx_http_core_main_conf_t *cmcf; size_t ...
cwe
CWE-444
C/C++
int MemIo::seek(int64 offset, Position pos ) { int64 newIdx = 0; switch (pos) { case BasicIo::cur: newIdx = p_->idx_ + offset; break; case BasicIo::beg: newIdx = offset; break; case BasicIo::end: ...
cwe
CWE-125
Unknown
static void encode_share_access(struct xdr_stream *xdr, int open_flags) { __be32 *p; RESERVE_SPACE(8); switch (open_flags & (FMODE_READ|FMODE_WRITE)) { case FMODE_READ: WRITE32(NFS4_SHARE_ACCESS_READ); break; case FMODE_WRITE: WRITE32(NFS4_SHARE_ACCESS_WRITE); break; case FMODE_READ|FMODE_W...
cwe
CWE-703
Unknown
PJ_DEF(int) pj_scan_get_char( pj_scanner *scanner ) { int chr = *scanner->curptr; if (!chr) { pj_scan_syntax_err(scanner); return 0; } ++scanner->curptr; if (PJ_SCAN_IS_PROBABLY_SPACE(*scanner->curptr) && scanner->skip_ws) { pj_scan_skip_whitespace(scanner); } return chr; }
cwe
CWE-125
Unknown
static int parse_import_ptr(struct MACH0_(obj_t)* bin, struct reloc_t *reloc, int idx) { int i, j, sym, wordsize; ut32 stype; wordsize = MACH0_(get_bits)(bin) / 8; if (idx < 0 || idx >= bin->nsymtab) { return 0; } if ((bin->symtab[idx].n_desc & REFERENCE_TYPE) == REFERENCE_FLAG_UNDEFINED_LAZY) { stype = S_LAZ...
cwe
CWE-125
C/C++
func performV1APIRouting(e *echo.Echo) { prefix := *appFlags.APIPrefix if viper.IsSet("http_settings.api_prefix") { prefix = viper.GetString("http_settings.api_prefix") } // accessible web services will fall in this group acc := e.Group(prefix + "/api/v3") switch config.Setting.MAIN_SETTINGS.DefaultAuth { ...
cwe
CWE-798
Go
static void sasl_start(IRC_SERVER_REC *server, const char *data, const char *from) { IRC_SERVER_CONNECT_REC *conn; conn = server->connrec; switch (conn->sasl_mechanism) { case SASL_MECHANISM_PLAIN: irc_send_cmd_now(server, "AUTHENTICATE PLAIN"); break; case SASL_MECHANISM_EXTERNAL: irc_send_cmd_now(s...
cwe
CWE-416
Unknown
fn should_stream_web_content() { // given let (server, fetch) = serve_with_fetch("token"); // when let response = request(server, "\ GET / HTTP/1.1\r\n\ Host: EHQPPSBE5DM78X3GECX2YBVGC5S6JX3S5SMPY.web.web3.site\r\n\ Connection: close\r\n\ \r\n\ " ); // then response.assert_status("HTTP/1.1 200 ...
cwe
CWE-346
Rust
tgetpass(const char *prompt, int timeout, int flags, struct sudo_conv_callback *callback) { struct sigaction sa, savealrm, saveint, savehup, savequit, saveterm; struct sigaction savetstp, savettin, savettou; char *pass; static const char *askpass; static char buf[SUDO_CONV_REPL_MAX + 1]; int...
cwe
CWE-787
Unknown
static int vf_load_font(DviParams *params, DviFont *font) { FILE *p; Uchar *macros; int msize; int mlen; Int32 checksum; long alpha, beta, z; int op; int i; int nchars; int loc, hic; DviFontRef *last; macros = NULL; msize = mlen = 0; p = font->in; if(fuget1(p) != 247 || fuget1(p) != 202) goto badvf...
cwe
CWE-20
Unknown
PS_SERIALIZER_DECODE_FUNC(php_binary) /* {{{ */ { const char *p; char *name; const char *endptr = val + vallen; zval *current; int namelen; int has_value; php_unserialize_data_t var_hash; PHP_VAR_UNSERIALIZE_INIT(var_hash); for (p = val; p < endptr; ) { zval **tmp; namelen = ((unsigned char)(*p)) & (~PS_...
cwe
CWE-399
Unknown
from django.contrib import admin import import_export.widgets as widgets from import_export.admin import ImportExportModelAdmin from import_export.fields import Field from import_export.resources import ModelResource import part.models as models from company.models import SupplierPart from stock.models import StockLo...
cwe
CWE-79
Python
int print_deleg_lookup(RES* ssl, struct worker* worker, uint8_t* nm, size_t nmlen, int ATTR_UNUSED(nmlabs)) { /* deep links into the iterator module */ struct delegpt* dp; struct dns_msg* msg; struct regional* region = worker->scratchpad; char b[260]; struct query_info qinfo; struct iter_hints_stub* stub; regi...
cwe
CWE-613
Unknown
Graph.prototype.resizeParentStacks=function(a,b,f,d){if(null!=this.layoutManager&&null!=b&&b.constructor==mxStackLayout&&!b.resizeLast){this.model.beginUpdate();try{for(var g=b.horizontal;null!=a&&null!=b&&b.constructor==mxStackLayout&&b.horizontal==g&&!b.resizeLast;){var e=this.getCellGeometry(a),k=this.view.getState(...
cwe
CWE-94
JavaScript
function sharingGroupPopulateOrganisations() { $('input[id=SharingGroupOrganisations]').val(JSON.stringify(organisations)); $('.orgRow').remove(); var id = 0; var html = ''; organisations.forEach(function(org) { html = '<tr id="orgRow' + id + '" class="orgRow">'; html += '<td class="short">' + org.type + '&nbs...
cwe
CWE-79
JavaScript
main(int argc, char **argv) { const char *safepath = "/bin:/sbin:/usr/bin:/usr/sbin:" "/usr/local/bin:/usr/local/sbin"; const char *confpath = NULL; char *shargv[] = { NULL, NULL }; char *sh; const char *cmd; char cmdline[LINE_MAX]; #ifdef __OpenBSD__ char mypwbuf[_PW_BUF_LEN], targpwbuf[_PW_BUF_LEN]; #else...
cwe
CWE-200
Unknown
getftp (struct url *u, 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; char *respline, *tms; const char *user...
cwe
CWE-200
Unknown
did_set_string_option ( int opt_idx, /* index in options[] table */ char_u **varp, /* pointer to the option variable */ int new_value_alloced, /* new value was allocated */ char_u *oldval, /* previous value of the option ...
cwe
CWE-20
Unknown
/** * Module dependencies */ var util = require('util'); var url = require('url'); var _ = require('@sailshq/lodash'); var semver = require('semver'); var parseSdkMetadata = require('./parse-sdk-metadata'); var ERRORPACK = require('./errors'); var proxyaddr = require('proxy-addr'); /** * @required {Object} app *...
cwe
CWE-20
JavaScript
static struct sock *pep_sock_accept(struct sock *sk, int flags, int *errp, bool kern) { struct pep_sock *pn = pep_sk(sk), *newpn; struct sock *newsk = NULL; struct sk_buff *skb; struct pnpipehdr *hdr; struct sockaddr_pn dst, src; int err; u16 peer_type; u8 pipe_handle, enabled, n_sb; u8 aligned = 0; ...
cwe
CWE-200
C/C++
Fraction::Fraction(int32_t num,int32_t den) { int32_t g = gcd(num, den); // these strange tests are for catching the case that we divide -2147483648 by -1, // which would exceed the maximum positive value by one. if (num == std::numeric_limits<int32_t>::min() && g == -1) { num++; } if (den == std::nu...
cwe
CWE-703
C/C++
// Copyright 2014 The Gogs Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. //go:build pam // +build pam package pam import ( "errors" "github.com/msteinert/pam" ) // Supported is true when built with PAM var Supported = true /...
cwe
CWE-863
Go
# -*- coding: utf-8 -*- # rdiffweb, A web interface to rdiff-backup repositories # Copyright (C) 2012-2021 rdiffweb contributors # # 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 ...
cwe
CWE-613
Python
R_API RBinJavaAttrInfo *r_bin_java_constant_value_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) { attr->type = R_BIN_JAVA_ATTR_TYPE_CONST_VALUE_ATTR; attr->info.constant_value_attr...
cwe
CWE-125
C/C++
static RList *oneshotall_buffer(RBin *bin, RBuffer *b) { RList *list = r_list_newf (free); RBinXtrData *meta = get_the_meta (bin, b); r_list_append (list, meta); return list; }
cwe
CWE-125
Unknown
package com.dotmarketing.factories; //import com.dotmarketing.threads.DeliverNewsletterThread; import java.io.BufferedOutputStream; import java.io.File; import java.io.IOException; import java.io.StringWriter; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.Iterator; impo...
cwe
CWE-89
Java
static int ms_init_ff(struct hid_device *hdev) { struct hid_input *hidinput = list_entry(hdev->inputs.next, struct hid_input, list); struct input_dev *input_dev = hidinput->input; struct ms_data *ms = hid_get_drvdata(hdev); if (!(ms->quirks & MS_QUIRK_FF)) return 0; ms->hdev = hdev; INIT_WORK(&ms->ff_wo...
cwe
CWE-787
C/C++
import base64 import logging import pathlib import uuid from django.conf import settings from django.utils.functional import cached_property from storages.utils import safe_join from s3file.storages import storage logger = logging.getLogger("s3file") class S3FileInputMixin: """FileInput that uses JavaScript to...
cwe
CWE-22
Python
setText(content) { if (content instanceof Element) { this.frame.innerHTML = ''; this.frame.appendChild(content); } else { this.frame.innerHTML = content; // string containing text or HTML } }
cwe
CWE-79
JavaScript
package api // Visibility is the type of a visibility. type Visibility string const ( // Public is the PUBLIC visibility. Public Visibility = "PUBLIC" // Protected is the PROTECTED visibility. Protected Visibility = "PROTECTED" // Private is the PRIVATE visibility. Private Visibility = "PRIVATE" ) func (e Visi...
cwe
CWE-269
Go
void MimeHandlerViewContainer::OnReady() { if (!render_frame() || !is_embedded_) return; blink::WebLocalFrame* frame = render_frame()->GetWebFrame(); blink::WebAssociatedURLLoaderOptions options; DCHECK(!loader_); loader_.reset(frame->CreateAssociatedURLLoader(options)); blink::WebURLRequest request...
cwe
CWE-20
C/C++
SPL_METHOD(DirectoryIterator, getFilename) { spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); if (zend_parse_parameters_none() == FAILURE) { return; } RETURN_STRING(intern->u.dir.entry.d_name, 1); }
cwe
CWE-190
C/C++
mojom::AppPtr AppControllerImpl::CreateAppPtr(const apps::AppUpdate& update) { auto app = chromeos::kiosk_next_home::mojom::App::New(); app->app_id = update.AppId(); app->type = update.AppType(); app->display_name = update.Name(); app->readiness = update.Readiness(); if (app->type == apps::mojom::AppTyp...
cwe
CWE-416
C/C++
def copyFile(srcFile, destFile): if isPosix(): os.system('cp "%s" "%s"' % (srcFile, destFile)) else: ek.ek(shutil.copyfile, srcFile, destFile) try: ek.ek(shutil.copymode, srcFile, destFile) except OSError: pass
cwe
CWE-78
Python
static Image *ReadRAWImage(const ImageInfo *image_info,ExceptionInfo *exception) { Image *canvas_image, *image; MagickBooleanType status; MagickOffsetType scene; QuantumInfo *quantum_info; QuantumType quantum_type; size_t length; ssize_t count, y; unsigned char...
cwe
CWE-120
C/C++
buf_copy_options(buf_T *buf, int flags) { int should_copy = TRUE; char_u *save_p_isk = NULL; // init for GCC int dont_do_help; int did_isk = FALSE; /* * Skip this when the option defaults have not been set yet. Happens when * main() allocates the first buffer. */ if (p_cp...
cwe
CWE-787
C/C++
filter_close (struct backend *b, struct connection *conn) { struct backend_filter *f = container_of (b, struct backend_filter, backend); void *handle = connection_get_handle (conn, f->backend.i); debug ("%s: close", f->name); if (handle && f->filter.close) f->filter.close (handle); f->backend.next->clos...
cwe
CWE-406
Unknown
/************************************************************************ * edit.c * nodau console note taker * Copyright (C) Lisa Milne 2010-2013 <lisa@ltmnet.com> * * edit.c 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 Softwa...
cwe
CWE-74
C/C++
function updatePageName() { pageMenu.innerHTML = ''; if (ui.currentPage != null) { mxUtils.write(pageMenu, ui.currentPage.getName()); var n = (ui.pages != null) ? ui.pages.length : 1; var idx = ui.getPageIndex(ui.currentPage); idx = (idx != null) ? idx + 1 : 1; var id =...
cwe
CWE-94
JavaScript
_gnutls_ciphertext2compressed (gnutls_session_t session, opaque * compress_data, int compress_size, gnutls_datum_t ciphertext, uint8_t type) { uint8_t MAC[MAX_HASH_SIZE]; uint16_t c_length; uint8_t pad; int length; digest_hd_st td; uint16_t blocksize; int ret, i, pad_failed =...
cwe
CWE-189
Unknown
import { isTestSuiteActive } from "../../support/page_objects/projectConstants"; import { mainPage } from "../../support/page_objects/mainPage"; export const genTest = (apiType, dbType) => { if (!isTestSuiteActive(apiType, dbType)) return; describe(`${ dbType === "xcdb" ? "Meta - " : "" }${apiType...
cwe
CWE-400
JavaScript
package relay import ( "context" "fmt" "io" "sync" "sync/atomic" "time" pb "github.com/libp2p/go-libp2p/p2p/protocol/circuitv1/pb" "github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/util" "github.com/libp2p/go-libp2p-core/host" "github.com/libp2p/go-libp2p-core/network" "github.com/libp2p/go-libp2p-core/...
cwe
CWE-400
Go
function csrf_confirm_form() { global $forum_db, $forum_url, $lang_common, $forum_config, $base_url, $forum_start, $tpl_main, $forum_user, $forum_page, $forum_updates; // If we've disabled the CSRF check for this page, we have nothing to do here. if (defined('FORUM_DISABLE_CSRF_CONFIRM')) return; // User presse...
cwe
CWE-79
PHP
/* Generated by re2c 0.13.5 */ #line 1 "ext/standard/var_unserializer.re" /* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) ...
cwe
CWE-502
C/C++
function configure() { deskDomain = 'https://' + config.deskDomain + '.freshdesk.com'; deskApiKey = config.deskApiKey; deskTypes = config.deskTypes || deskTypes; deskStatus = config.deskStatus || deskStatus; deskStatusWidth = {}; // Precomputes text widths for custom ticket status var div = document....
cwe
CWE-94
JavaScript
/* Copyright 2016 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-476
C/C++
jas_image_t *jpg_decode(jas_stream_t *in, char *optstr) { struct jpeg_decompress_struct cinfo; struct jpeg_error_mgr jerr; FILE *input_file; jpg_dest_t dest_mgr_buf; jpg_dest_t *dest_mgr = &dest_mgr_buf; JDIMENSION num_scanlines; jas_image_t *image; int ret; jpg_dec_importopts_t opts; size_t size; if (jpg_d...
cwe
CWE-20
C/C++
long Cluster::Load(long long& pos, long& len) const { assert(m_pSegment); assert(m_pos >= m_element_start); if (m_timecode >= 0) // at least partially loaded return 0; assert(m_pos == m_element_start); assert(m_element_size < 0); IMkvReader* const pReader = m_pSegment->m_pReader; long long total, avai...
cwe
CWE-20
C/C++
data: function () { return _.extend({ relatedTypeString: this.translateEntityType(this.entityType) }, Dep.prototype.data.call(this)); }, init: function () { if (this.getUser().isAdmin()) { this.isRemovable = true; } ...
cwe
CWE-79
JavaScript
static ssize_t _hostfs_pread( oe_fd_t* desc, void* buf, size_t count, oe_off_t offset) { ssize_t ret = -1; file_t* file = _cast_file(desc); if (!file) OE_RAISE_ERRNO(OE_EINVAL); if (oe_syscall_pread_ocall(&ret, file->host_fd, buf, count, offset) != OE_OK) OE_RAI...
cwe
CWE-552
Unknown
/* Copyright 2017 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++
function bn(e){for(;e&&(e=e.$parent);)if(e._inactive)return!0;return!1}
cwe
CWE-284
JavaScript
/* +------------------------------------+ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * * InspIRCd: (C) 2002-2010 InspIRCd Development Team * See: http://wiki.inspircd.org/Credits * * This program is free but copyrighted software; see * the fil...
cwe
CWE-399
C/C++
ldp_tlv_print(netdissect_options *ndo, register const u_char *tptr, u_short msg_tlen) { struct ldp_tlv_header { uint8_t type[2]; uint8_t length[2]; }; const struct ldp_tlv_header *ldp_tlv_header; u_short tlv_type,tlv_len,tlv_tlen,af,ft_flags; u_char fec_t...
cwe
CWE-125
C/C++
static void managesieve_parser_save_arg(struct managesieve_parser *parser, const unsigned char *data, size_t size) { struct managesieve_arg *arg; char *str; arg = managesieve_arg_create(parser); switch (parser->cur_type) { case ARG_PARSE_ATOM: /* simply save the string */ arg->type = MANAGESIEVE_ARG_ATO...
cwe
CWE-787
C/C++
ex_open(exarg_T *eap) { regmatch_T regmatch; char_u *p; #ifdef FEAT_EVAL if (not_in_vim9(eap) == FAIL) return; #endif curwin->w_cursor.lnum = eap->line2; beginline(BL_SOL | BL_FIX); if (*eap->arg == '/') { // ":open /pattern/": put cursor in column found with pattern ++eap->arg; p = ski...
cwe
CWE-416
C/C++
get_visual_text( cmdarg_T *cap, char_u **pp, // return: start of selected text int *lenp) // return: length of selected text { if (VIsual_mode != 'V') unadjust_for_sel(); if (VIsual.lnum != curwin->w_cursor.lnum) { if (cap != NULL) clearopbeep(cap->oap); return FAIL; } i...
cwe
CWE-787
C/C++
/* * Dragonfly - Runtime dependency management library * Copyright (c) 2021 Joshua Sing <joshua@hypera.dev> * * 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, in...
cwe
CWE-611
Java
int agp_generic_insert_memory(struct agp_memory * mem, off_t pg_start, int type) { int num_entries; size_t i; off_t j; void *temp; struct agp_bridge_data *bridge; int mask_type; bridge = mem->bridge; if (!bridge) return -EINVAL; if (mem->page_count == 0) return 0; temp = bridge->current_size; switch ...
cwe
CWE-190
Unknown
flatpak_context_merge (FlatpakContext *context, FlatpakContext *other) { GHashTableIter iter; gpointer key, value; context->shares &= ~other->shares_valid; context->shares |= other->shares; context->shares_valid |= other->shares_valid; context->sockets &= ~other->sockets_valid; con...
cwe
CWE-22
C/C++
dfaexec (struct dfa *d, char const *begin, char *end, int allow_nl, int *count, int *backref) { int s, s1; /* Current state. */ unsigned char const *p; /* Current input character. */ int **trans, *t; /* Copy of d->trans so it can be optimized into a register. */ unsi...
cwe
CWE-189
Unknown
/* 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-754
C/C++
void nodeRename(Proxy &node, const RegexMatchConfigs &rename_array, extra_settings &ext) { std::string &remark = node.Remark, original_remark = node.Remark, returned_remark, real_rule; for(const RegexMatchConfig &x : rename_array) { if(!x.Script.empty()) { script_safe_runner(ext...
cwe
CWE-434
C/C++
function inspectFallback(val) { const domains = Object.keys(val); if (domains.length === 0) { return "{}"; } let result = "{\n"; Object.keys(val).forEach((domain, i) => { result += formatDomain(domain, val[domain]); if (i < domains.length - 1) { result += ","; } result += "\n"; });...
cwe
CWE-1321
JavaScript
ImagingSgiRleDecode(Imaging im, ImagingCodecState state, UINT8* buf, Py_ssize_t bytes) { UINT8 *ptr; SGISTATE *c; int err = 0; /* Get all data from File descriptor */ c = (SGISTATE*)state->context; _imaging_seek_pyFd(state->fd, 0L, SEEK_END); c->bufsize = _imaging_tell_pyFd(state->fd)...
cwe
CWE-787
Unknown
ddxProcessArgument(int argc, char **argv, int i) { #define CHECK_FOR_REQUIRED_ARGUMENT() \ if (((i + 1) >= argc) || (!argv[i + 1])) { \ ErrorF("Required argument to %s not specified\n", argv[i]); \ UseMsg(); \ FatalError("Required argument to %s not specified\n", argv[i]); \ } ...
cwe
CWE-863
C/C++
static int fts3SegReaderNext( Fts3Table *p, Fts3SegReader *pReader, int bIncr ){ int rc; /* Return code of various sub-routines */ char *pNext; /* Cursor variable */ int nPrefix; /* Number of bytes in term prefix */ int nSuffix; ...
cwe
CWE-908
Unknown
function(e){var f=e.split("/");return 1<f.length?{driveId:f[0],id:f[1]}:{id:e}};OneDriveClient.prototype.getItemURL=function(e,f){var c=e.split("/");return 1<c.length?(e=c[1],(f?"":this.baseUrl)+"/drives/"+c[0]+("root"==e?"/root":"/items/"+e)):(f?"":this.baseUrl)+"/me/drive/items/"+e};OneDriveClient.prototype.getLibrar...
cwe
CWE-20
JavaScript
def defaults @defaults ||= begin path = File.expand_path('../../partitions.json', __FILE__) defaults = if JSON::VERSION >= '2.4.0' JSON.load(File.read(path), freeze: true) else JSON.parse(File.read(path)) end defaults.merge('partitions' =...
cwe
CWE-502
Ruby
zzip_mem_disk_findfirst(ZZIP_MEM_DISK* dir) { return zzip_disk_findfirst(dir->disk); }
cwe
CWE-119
Unknown
/* radare - LGPL - Copyright 2008-2021 nibble, pancake, inisider */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <r_hash.h> #include <r_types.h> #include <r_util.h> #include "pe.h" #include <time.h> #include <ht_uu.h> #define PE_IMAGE_FILE_MACHINE_RPI2 452 #define MAX_METADATA_STRING_LENGTH 256...
cwe
CWE-400
C/C++
static RList *r_bin_wasm_get_element_entries (RBinWasmObj *bin, RBinWasmSection *sec) { RList *ret = NULL; RBinWasmElementEntry *ptr = NULL; if (!(ret = r_list_newf ((RListFree)free))) { return NULL; } ut8* buf = bin->buf->buf + (ut32)sec->payload_data; ut32 len = sec->payload_len; ut32 count = sec->count;...
cwe
CWE-125
C/C++