code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
function ame_ajax_toggle_imageset( setid ) { var ame_sack = new sack( ajaxurl ); ame_sack.execute = 1; ame_sack.method = 'POST'; ame_sack.setVar( "action", "ame_ajax_toggle_imageset" ); ame_sack.setVar( "setid", setid ); ame_sack.onError = function() { alert('Ajax error on toggling image set') }; ame_sack.runAJA...
cwe
CWE-352
JavaScript
package com.chaitin.xray.form; import com.chaitin.xray.utils.StringUtil; import com.intellij.uiDesigner.core.GridConstraints; import com.intellij.uiDesigner.core.GridLayoutManager; import org.yaml.snakeyaml.Yaml; import javax.swing.*; import java.awt.*; import java.nio.charset.StandardCharsets; import java.nio.file.F...
cwe
CWE-502
Java
var jwt = require('jsonwebtoken'); var UnauthorizedError = require('./errors/UnauthorizedError'); var unless = require('express-unless'); var async = require('async'); var set = require('lodash.set'); var DEFAULT_REVOKED_FUNCTION = function(_, __, cb) { return cb(null, false); }; function isFunction(object) { retur...
cwe
CWE-285
JavaScript
/* jshint strict: false */ // ////////////////////////////////////////////////////////////////////////////// // / @brief Foxx administration actions // / // / @file // / // / DISCLAIMER // / // / Copyright 2016 ArangoDB GmbH, Cologne, Germany // / // / Licensed under the Apache License, Version 2.0 (the "License") // ...
cwe
CWE-918
C/C++
struct _mdi *_WM_ParseNewXmi(uint8_t *xmi_data, uint32_t xmi_size) { struct _mdi *xmi_mdi = NULL; uint32_t xmi_tmpdata = 0; uint8_t xmi_formcnt = 0; uint32_t xmi_catlen = 0; uint32_t xmi_subformlen = 0; uint32_t i = 0; uint32_t j = 0; uint32_t xmi_evntlen = 0; uint32_t xmi_divisions...
cwe
CWE-125
C/C++
gdk_pixbuf__png_image_stop_load (gpointer context, GError **error) { LoadContext* lc = context; g_return_val_if_fail(lc != NULL, TRUE); /* FIXME this thing needs to report errors if * we have unused image data */ gdk_pixbuf_unref(lc->pixbuf); ...
cwe
CWE-20
Unknown
void ntlm_write_message_fields(wStream* s, NTLM_MESSAGE_FIELDS* fields) { if (fields->MaxLen < 1) fields->MaxLen = fields->Len; Stream_Write_UINT16(s, fields->Len); /* Len (2 bytes) */ Stream_Write_UINT16(s, fields->MaxLen); /* MaxLen (2 bytes) */ Stream_Write_UINT32(s, fields->BufferOffset); /* BufferOffset (4 ...
cwe
CWE-125
C/C++
flatpak_dir_pull (FlatpakDir *self, FlatpakRemoteState *state, const char *ref, const char *opt_rev, const char **subpaths, ...
cwe
CWE-269
C/C++
static int kwajd_read_headers(struct mspack_system *sys, struct mspack_file *fh, struct mskwajd_header *hdr) { unsigned char buf[16]; int i; /* read in the header */ if (sys->read(fh, &buf[0], kwajh_SIZEOF) != kwajh_SIZEOF) { return MSPACK_ERR_READ; } /* check for "KWAJ" sig...
cwe
CWE-787
Unknown
/* * 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-200
Java
int v9fs_device_realize_common(V9fsState *s, Error **errp) { V9fsVirtioState *v = container_of(s, V9fsVirtioState, state); int i, len; struct stat stat; FsDriverEntry *fse; V9fsPath path; int rc = 1; /* initialize pdu allocator */ QLIST_INIT(&s->free_list); QLIST_INIT(&s->active_lis...
cwe
CWE-401
C/C++
struct clock_source *dce80_clock_source_create( struct dc_context *ctx, struct dc_bios *bios, enum clock_source_id id, const struct dce110_clk_src_regs *regs, bool dp_clk_src) { struct dce110_clk_src *clk_src = kzalloc(sizeof(struct dce110_clk_src), GFP_KERNEL); if (!clk_src) return NULL; if (dce110_clk_s...
cwe
CWE-703
C/C++
ssize_t pcnet_receive(NetClientState *nc, const uint8_t *buf, size_t size_) { PCNetState *s = qemu_get_nic_opaque(nc); int is_padr = 0, is_bcast = 0, is_ladr = 0; uint8_t buf1[60]; int remaining; int crc_err = 0; int size = size_; if (CSR_DRX(s) || CSR_STOP(s) || CSR_SPND(s) || !size || ...
cwe
CWE-119
Unknown
package com.salesmanager.shop.admin.controller.products; import com.salesmanager.core.business.services.catalog.product.ProductService; import com.salesmanager.core.business.services.catalog.product.file.DigitalProductService; import com.salesmanager.core.business.utils.ajax.AjaxResponse; import com.salesmanager.core....
cwe
CWE-639
Java
const renderContent = (content: string | any) => { if (typeof content === 'string') { return renderHTML(content); } return content; };
cwe
CWE-79
JavaScript
static long __get_user_pages(struct task_struct *tsk, struct mm_struct *mm, unsigned long start, unsigned long nr_pages, unsigned int gup_flags, struct page **pages, struct vm_area_struct **vmas, int *locked) { long ret = 0, i = 0; struct vm_area_struct *vma = NULL; struct follow_page_context ctx = { NULL }; ...
cwe
CWE-362
Unknown
function catSpanFadeOut( postid, ame_cats ) { //jQuery("span#ame_category" + postid + ", a#thickboxlink" + postid).fadeOut('fast', function() { var loading = '<img border="0" alt="" src="' + ameAjaxL10n.imgUrl + 'loader.gif" align="absbottom" /> ' + ameAjaxL10n.pleaseWait; jQuery("span#ame_category" + postid).fade...
cwe
CWE-352
JavaScript
/************************************************************************ * This file is part of EspoCRM. * * EspoCRM - Open Source CRM application. * Copyright (C) 2014-2019 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko * Website: https://www.espocrm.com * * EspoCRM is free software: you can redistribute i...
cwe
CWE-79
JavaScript
function getResourceGroupID($groupdname) { list($type, $name) = explode('/', $groupdname); $query = "SELECT g.id " . "FROM resourcegroup g, " . "resourcetype t " . "WHERE g.name = '$name' AND " . "t.name = '$type' AND " . "g.resourcetypeid = t.id"; $qh = doQue...
cwe
CWE-20
PHP
llsec_key_alloc(const struct ieee802154_llsec_key *template) { const int authsizes[3] = { 4, 8, 16 }; struct mac802154_llsec_key *key; int i; key = kzalloc(sizeof(*key), GFP_KERNEL); if (!key) return NULL; kref_init(&key->ref); key->key = *template; BUILD_BUG_ON(ARRAY_SIZE(authsizes) != ARRAY_SIZE(key->tfm...
cwe
CWE-416
C/C++
function(I){mxEvent.isConsumed(I)||((mxEvent.isControlDown(I)||mxClient.IS_MAC&&mxEvent.isMetaDown(I))&&13==I.keyCode?(D.click(),mxEvent.consume(I)):27==I.keyCode&&(n.click(),mxEvent.consume(I)))}));D.focus();D.className="geCommentEditBtn gePrimaryBtn";Y.appendChild(D);F.insertBefore(Y,O);V.style.display="none";O.style...
cwe
CWE-94
JavaScript
func (mgr *MetricsManager) updateServer(cfg *Config) { if cfg.Options.MetricsAddr == mgr.addr && cfg.Options.MetricsBasicAuth == mgr.basicAuth && cfg.Options.InstallationID == mgr.installationID { return } mgr.addr = cfg.Options.MetricsAddr mgr.basicAuth = cfg.Options.MetricsBasicAuth mgr.installationID = c...
cwe
CWE-200
Go
/* * MMS protocol common definitions. * Copyright (c) 2006,2007 Ryan Martell * Copyright (c) 2007 Björn Axelsson * Copyright (c) 2010 Zhentan Feng <spyfeng at gmail dot com> * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesse...
cwe
CWE-125
C/C++
""" Copyright 2007-2009, Red Hat, Inc and Others Michael DeHaan <michael.dehaan AT gmail> 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 late...
cwe
CWE-94
Python
emailIconClassName: this.getMetadata().get(['clientDefs', 'Email', 'iconClass']) || '' }, Dep.prototype.data.call(this)); }, setup: function () { var data = this.model.get('data') || {}; this.emailId = data.emailId; this.emailName = data.emailName; ...
cwe
CWE-79
JavaScript
void ext4_xattr_destroy_cache(struct mb_cache *cache) { if (cache) mb_cache_destroy(cache); }
cwe
CWE-19
C/C++
void impeg2d_flush_ext_and_user_data(dec_state_t *ps_dec) { UWORD32 u4_start_code; stream_t *ps_stream; ps_stream = &ps_dec->s_bit_stream; u4_start_code = impeg2d_bit_stream_nxt(ps_stream,START_CODE_LEN); while(u4_start_code == EXTENSION_START_CODE || u4_start_code == USER_DATA_START_CODE) ...
cwe
CWE-254
C/C++
/* Configuration file parsing and CONFIG GET/SET commands implementation. * * Copyright (c) 2009-2012, Salvatore Sanfilippo <antirez 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 conditions ...
cwe
CWE-190
C/C++
HtmlOutputDev::HtmlOutputDev(Catalog *catalogA, const char *fileName, const char *title, const char *author, const char *keywords, const char *subject, const char *date, bool rawOrder, int firstPage, bool outline) { catalog = catalogA; fContentsFrame = nullptr; docTitle = new GooString(title); pages = nullpt...
cwe
CWE-824
C/C++
def wizard_submit(params, request, session) if not allowed_for_local_cluster(session, Permissions::WRITE) return 403, 'Permission denied' end wizard = PCSDWizard.getWizard(params["wizard"]) if wizard != nil return erb wizard.process_responses(params) else return "Error finding Wizard - #{params["w...
cwe
CWE-384
Ruby
int nfc_dep_link_up(struct nfc_dev *dev, int target_index, u8 comm_mode) { int rc = 0; u8 *gb; size_t gb_len; struct nfc_target *target; pr_debug("dev_name=%s comm %d\n", dev_name(&dev->dev), comm_mode); if (!dev->ops->dep_link_up) return -EOPNOTSUPP; device_lock(&dev->dev); if (!device_is_registered(&dev...
cwe
CWE-416
Unknown
/* * Timers abstract layer * Copyright (c) by Jaroslav Kysela <perex@perex.cz> * * * 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 you...
cwe
CWE-362
C/C++
static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * value_ptr, int value_len, char *offset_base, size_t IFDlength, size_t displacement TSRMLS_DC) { int de, i=0, section_index = SECTION_MAKERNOTE; int NumDirEntries, old_motorola_intel, offset_diff; const maker_note_type *maker_note; char *dir...
cwe
CWE-125
C/C++
main( int argc, char* argv[] ) { int old_ptsize, orig_ptsize, file; int first_glyph = 0; int XisSetup = 0; char* execname; int option; int file_loaded; grEvent event; execname = ft_basename( argv[0] ); while ( 1 ) { option = getopt( argc, ...
cwe
CWE-120
Unknown
void red_channel_pipes_add_type(RedChannel *channel, int pipe_item_type) { RingItem *link; RING_FOREACH(link, &channel->clients) { red_channel_client_pipe_add_type( SPICE_CONTAINEROF(link, RedChannelClient, channel_link), pipe_item_type); } }
cwe
CWE-399
C/C++
void ihevcd_parse_sei_payload(codec_t *ps_codec, UWORD32 u4_payload_type, UWORD32 u4_payload_size, WORD8 i1_nal_type) { parse_ctxt_t *ps_parse = &ps_codec->s_parse; bitstrm_t *ps_bitstrm = &ps_parse->s_bitstrm; WORD32 payloa...
cwe
CWE-190
C/C++
package auth const JwtSecret = "167f0db2-f83e-4baa-9736-d56064a5b415" /* our expire time */ var TokenExpiryTime = 1200 // token header const TokenHeader = "Auth-Token"
cwe
CWE-798
Go
eigrp_print(netdissect_options *ndo, register const u_char *pptr, register u_int len) { const struct eigrp_common_header *eigrp_com_header; const struct eigrp_tlv_header *eigrp_tlv_header; const u_char *tptr,*tlv_tptr; u_int tlen,eigrp_tlv_len,eigrp_tlv_type,tlv_tlen, byte_length, bit_length; uint8_...
cwe
CWE-125
C/C++
# Copyright 2014-2016 OpenMarket Ltd # # 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 w...
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-674
C/C++
SYSCALL_DEFINE1(inotify_init1, int, flags) { struct fsnotify_group *group; struct user_struct *user; int ret; /* Check the IN_* constants for consistency. */ BUILD_BUG_ON(IN_CLOEXEC != O_CLOEXEC); BUILD_BUG_ON(IN_NONBLOCK != O_NONBLOCK); if (flags & ~(IN_CLOEXEC | IN_NONBLOCK)) return -EINVAL; user = get_...
cwe
CWE-399
Unknown
def authenticate(*credentials, &block) raise ArgumentError, 'at least 2 arguments required' if credentials.size < 2 if credentials[0].blank? return authentication_response(return_value: false, failure: :invalid_login, &block) end if @sorcery_config.downcase_username_before_au...
cwe
CWE-307
Ruby
auth_check_idle (GSLockPlug *plug) { gboolean res; gboolean again; static guint loop_counter = 0; again = TRUE; res = do_auth_check (plug); if (res) { again = FALSE; g_idle_add ((GSourceFunc)quit_response_ok, NULL); } else...
cwe
CWE-362
Unknown
$GLOBALS['PMA_Config']->removeCookie('pmaPass-' . $key); if (isset($_COOKIE['pmaPass-' . $key])) { unset($_COOKIE['pmaPass-' . $key]); } } } else { $GLOBALS['PMA_Config']->removeCookie( 'pmaPa...
cwe
CWE-200
PHP
update_graph(data) { var that = this; that.network_loading(true, loadingText_creating); this.extended_event_uuid_mapping = data.extended_event_uuid_mapping; dataHandler.mapping_node_to_from_edges = {}; dataHandler.mapping_node_to_to_edges = {}; // New nodes will be auto...
cwe
CWE-79
JavaScript
t42_parse_font_matrix( T42_Face face, T42_Loader loader ) { T42_Parser parser = &loader->parser; FT_Matrix* matrix = &face->type1.font_matrix; FT_Vector* offset = &face->type1.font_offset; FT_Face root = (FT_Face)&face->root; FT_Fixed temp[6]; FT_Fix...
cwe
CWE-20
C/C++
parsegid(const char *s, gid_t *gid) { struct group *gr; const char *errstr; if ((gr = getgrnam(s)) != NULL) { *gid = gr->gr_gid; return 0; } #if !defined(__linux__) && !defined(__NetBSD__) *gid = strtonum(s, 0, GID_MAX, &errstr); #else sscanf(s, "%d", gid); #endif if (errstr) return -1; return 0; }
cwe
CWE-863
C/C++
static void perf_syscall_enter(void *ignore, struct pt_regs *regs, long id) { struct syscall_metadata *sys_data; struct syscall_trace_enter *rec; struct hlist_head *head; int syscall_nr; int rctx; int size; syscall_nr = trace_get_syscall_nr(current, regs); if (syscall_nr < 0) return; if (!test_bit(syscall_n...
cwe
CWE-264
Unknown
function Br(e){return B.List.isList(e)?e:I()(e)?Object(B.fromJS)(e):Object(B.List)()}
cwe
CWE-200
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-502
Java
static void bfq_idle_slice_timer_body(struct bfq_queue *bfqq) { struct bfq_data *bfqd = bfqq->bfqd; enum bfqq_expiration reason; unsigned long flags; spin_lock_irqsave(&bfqd->lock, flags); bfq_clear_bfqq_wait_request(bfqq); if (bfqq != bfqd->in_service_queue) { spin_unlock_irqrestore(&bfqd->lock, flags); re...
cwe
CWE-416
Unknown
def _formatCredentials(self, data, name): """ Credentials are of the form RCLONE_CONFIG_CURRENT_TYPE=s3 ^ ^ ^ ^ [mandatory ][name ][key][value] """ prefix = "RCLONE_CONFIG_{}".format(name.upper()) credentials = '' credenti...
cwe
CWE-78
Python
import functools import json import typing import typing as t from io import BytesIO from .._internal import _wsgi_decoding_dance from ..datastructures import CombinedMultiDict from ..datastructures import EnvironHeaders from ..datastructures import FileStorage from ..datastructures import ImmutableMultiDict from ..da...
cwe
CWE-770
Python
void get_checksum2(char *buf, int32 len, char *sum) { md_context m; switch (xfersum_type) { case CSUM_MD5: { uchar seedbuf[4]; md5_begin(&m); if (proper_seed_order) { if (checksum_seed) { SIVALu(seedbuf, 0, checksum_seed); md5_update(&m, seedbuf, 4); } md5_update(&m, (uchar *)buf, len); }...
cwe
CWE-354
C/C++
static Image *ReadMIFFImage(const ImageInfo *image_info, ExceptionInfo *exception) { #define BZipMaxExtent(x) ((x)+((x)/100)+600) #define LZMAMaxExtent(x) ((x)+((x)/3)+128) #define ThrowMIFFException(exception,message) \ { \ if (quantum_info != (QuantumInfo *) NULL) \ quantum_info=DestroyQuantumInfo(quantum_i...
cwe
CWE-401
Unknown
function ame_slug_edit( cat_id, posttype ) { var newslug = jQuery("input#ame_slug" + cat_id).prop('value'); var ame_sack = new sack( ajaxurl ); ame_sack.execute = 1; ame_sack.method = 'POST'; ame_sack.setVar( "action", "ame_slug_edit" ); ame_sack.setVar( "col_no", jQuery('.widefat thead tr th').length ); ame_sac...
cwe
CWE-352
JavaScript
ReadFromRFBServer(rfbClient* client, char *out, unsigned int n) { #undef DEBUG_READ_EXACT #ifdef DEBUG_READ_EXACT char* oout=out; unsigned int nn=n; rfbClientLog("ReadFromRFBServer %d bytes\n",n); #endif /* Handle attempts to write to NULL out buffer that might occur when an outside malloc() fails. For insta...
cwe
CWE-835
C/C++
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")); var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray")); var _defineProperty2 = _interopR...
cwe
CWE-1321
JavaScript
function _real_escape( $string ) { if ( $this->dbh ) { if ( $this->use_mysqli ) { return mysqli_real_escape_string( $this->dbh, $string ); } else { return mysql_real_escape_string( $string, $this->dbh ); } } $class = get_class( $this ); if ( function_exists( '__' ) ) { /* translators: %s: d...
cwe
CWE-89
PHP
public function getPath($key) { return $this->root.DIRECTORY_SEPARATOR.substr($key, 0, 2).DIRECTORY_SEPARATOR.substr($key, 2, 2).DIRECTORY_SEPARATOR.substr($key, 4, 2).DIRECTORY_SEPARATOR.substr($key, 6); }
cwe
CWE-89
JavaScript
lyd_new_output(struct lyd_node *parent, const struct lys_module *module, const char *name) { const struct lys_node *snode = NULL, *siblings; if ((!parent && !module) || !name) { LOGARG; return NULL; } siblings = lyd_new_find_schema(parent, module, 1); if (!siblings) { LOGAR...
cwe
CWE-119
Unknown
start: slide_start_cb(), slide: slide_cb(), stop: stop_cb(), }).data('channel-idx', i); }; for (i=channels.length-1; i>=0; i--) { var btnClass = channels[i].active?'pressed':''; if (OME.isDark(channels[i].color)) { ...
cwe
CWE-116
JavaScript
$("#free_space").text(FREE_SPACE.filesizeformat()); var progressbar = $( "#progressbar" ), progressLabel = $( ".progress-label" ); progressbar.progressbar({ value: 1, change: function() { progressLabel.text( progressbar.p...
cwe
CWE-116
Python
void PCRECache::dump(const std::string& filename) { std::ofstream out(filename.c_str()); switch (m_kind) { case CacheKind::Static: for (auto& it : *m_staticCache) { out << it.first->data() << "\n"; } break; case CacheKind::Lru: case CacheKind::Scalable: { std::vec...
cwe
CWE-22
C/C++
/* Copyright 2018 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-824
Python
async login(ctx) { const { body: { password }, } = ctx.request; const { password: storedPassword } = await strapi .store({ environment: '', type: 'plugin', name: 'documentation', key: 'config', }) .get(); const isValid = await strapi.plugins['use...
cwe
CWE-522
JavaScript
/* $Id: upnpreplyparse.c,v 1.19 2015/07/15 10:29:11 nanard Exp $ */ /* MiniUPnP project * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ * (c) 2006-2015 Thomas Bernard * This software is subject to the conditions detailed * in the LICENCE file provided within the distribution */ #include <stdlib.h> #in...
cwe
CWE-119
C/C++
// Copyright 2017 The go-ethereum Authors // This file is part of the go-ethereum library. // // The go-ethereum library 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 3 of the License...
cwe
CWE-20
Go
def authenticates_with_sorcery! @sorcery_config = Config.new extend ClassMethods # included here, before submodules, so they can be overriden by them. include InstanceMethods include TemporaryToken include_required_submodules! # This runs the options block set in the initializer o...
cwe
CWE-307
Ruby
public function rules() { return [ 'sku' => ['required'], 'name' => ['required', Rule::unique('products')->ignore($this->segment(3))], 'quantity' => ['required', 'integer', 'min:0'], 'price' => ['required', 'numeric', 'min:0'], 'sale_price' => ['nu...
cwe
CWE-434
PHP
/* 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-787
C/C++
fixExec2Error(int action, u_char * var_val, u_char var_val_type, size_t var_val_len, u_char * statP, oid * name, size_t name_len) { netsnmp_old_extend *exten = NULL; unsigned int idx; idx = name[name_len-1] -1; exten = &compatability_entries[ idx ]; ...
cwe
CWE-269
C/C++
/* * 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
public void stopReceivingPush() { Intent unregIntent = new Intent("com.google.android.c2dm.intent.UNREGISTER"); unregIntent.setPackage("com.google.android.gms"); unregIntent.putExtra("app", PendingIntent.getBroadcast(this, 0, new Intent(), 0)); startService(unregIntent); }
cwe
CWE-668
Java
ambsdtar_estimate( application_argument_t *argument) { char *incrname = NULL; GPtrArray *argv_ptr; char *cmd = NULL; int nullfd = -1; int pipefd = -1; FILE *dumpout = NULL; off_t size = -1; char line[32768]; char *errmsg = NULL; ch...
cwe
CWE-77
Unknown
const ps = require('path'); const fs = require('fs'); const interfaceDiffPath = ps.join(__dirname, '../../interface-diff.txt'); let reportContent = fs.readFileSync(interfaceDiffPath, 'utf8'); if (reportContent.includes('@')) { reportContent = reportContent.split('\n').slice(3).join('\n'); reportContent = `## ...
cwe
CWE-74
JavaScript
var HiddenTagsWindow = function(editorUi, x, y, w, h) { var graph = editorUi.editor.graph; var div = document.createElement('div'); div.style.overflow = 'hidden'; div.style.padding = '12px 8px 12px 8px'; div.style.height = 'auto'; var searchInput = document.createElement('input'); searchInput.setAttr...
cwe
CWE-94
JavaScript
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.services.catalog.product.relationship.ProductRelationshipService...
cwe
CWE-79
Java
/* $OpenBSD: ca.c,v 1.64 2020/07/15 14:45:15 tobhe Exp $ */ /* * Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice ...
cwe
CWE-287
C/C++
package org.airsonic.player.security; import org.airsonic.player.service.JWTSecurityService; import org.airsonic.player.service.SecurityService; import org.airsonic.player.service.SettingsService; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springfra...
cwe
CWE-326
Java
pk_transaction_obtain_authorization (PkTransaction *transaction, PkRoleEnum role, GError **error) { const gchar *action_id; const gchar *text; PkTransactionPrivate *priv = transaction->priv; _cleanup_free_ gchar *package_ids = NULL; _cleanup_object_unref_ PolkitDetails *details = NULL; _cleanup_...
cwe
CWE-287
Unknown
static int scsi_disk_check_mode_select(SCSIDiskState *s, int page, uint8_t *inbuf, int inlen) { uint8_t mode_current[SCSI_MAX_MODE_LEN]; uint8_t mode_changeable[SCSI_MAX_MODE_LEN]; uint8_t *p; int len, expected_len, changeable_len, i; /* The input buffer does ...
cwe
CWE-193
Unknown
schannel_connect_step3(struct Curl_easy *data, struct connectdata *conn, int sockindex) { CURLcode result = CURLE_OK; struct ssl_connect_data *connssl = &conn->ssl[sockindex]; SECURITY_STATUS sspi_status = SEC_E_OK; CERT_CONTEXT *ccert_context = NULL; #ifdef DEBUGBUILD const char * cons...
cwe
CWE-290
Unknown
package proxyutil import ( "net" "net/http" ) // PrepareProxyRequest prepares a request for being proxied. // Removes X-Forwarded-Host, X-Forwarded-Port, X-Forwarded-Proto headers. // Set X-Forwarded-For headers. func PrepareProxyRequest(req *http.Request) { req.Header.Del("X-Forwarded-Host") req.Header.Del("X-Fo...
cwe
CWE-200
Go
public function prepare( $query, $args ) { if ( is_null( $query ) ) return; // This is not meant to be foolproof -- but it will catch obviously incorrect usage. if ( strpos( $query, '%' ) === false ) { wp_load_translations_early(); _doing_it_wrong( 'wpdb::prepare', sprintf( __( 'The query argument of %s...
cwe
CWE-89
PHP
OMX_BUFFERHEADERTYPE *OMXNodeInstance::findBufferHeader(OMX::buffer_id buffer) { return (OMX_BUFFERHEADERTYPE *)buffer; }
cwe
CWE-119
C/C++
static int inet_sk_reselect_saddr(struct sock *sk) { struct inet_sock *inet = inet_sk(sk); __be32 old_saddr = inet->inet_saddr; __be32 daddr = inet->inet_daddr; struct flowi4 fl4; struct rtable *rt; __be32 new_saddr; if (inet->opt && inet->opt->srr) daddr = inet->opt->faddr; /* Query new route. */ rt = ip_...
cwe
CWE-362
Unknown
static inline void *host_from_stream_offset(QEMUFile *f, ram_addr_t offset, int flags) { static RAMBlock *block = NULL; char id[256]; uint8_t len; if (flags & RAM_SAVE_FLAG_CONTINUE) { if (!block) { ...
cwe
CWE-20
Unknown
function createCustomInputFile (obj, group, s, uploadLabel) { var fileUploadId = "ajax-upload-id-" + (new Date().getTime()); var form = $("<form method='" + s.method + "' action='" + s.url + "' enctype='" + s.enctype + "'></form>"); var fileInputStr = "<input type='file' id='" + fi...
cwe
CWE-79
JavaScript
#include "common/router/router.h" #include <chrono> #include <cstdint> #include <memory> #include <string> #include "envoy/event/dispatcher.h" #include "envoy/event/timer.h" #include "envoy/grpc/status.h" #include "envoy/http/conn_pool.h" #include "envoy/runtime/runtime.h" #include "envoy/upstream/cluster_manager.h" ...
cwe
CWE-400
C/C++
static unsigned long mmap_legacy_base(unsigned long rnd) { if (mmap_is_ia32()) return TASK_UNMAPPED_BASE; else return TASK_UNMAPPED_BASE + rnd; }
cwe
CWE-254
C/C++
static void call_console_drivers(unsigned start, unsigned end) { unsigned cur_index, start_print; static int msg_level = -1; BUG_ON(((int)(start - end)) > 0); cur_index = start; start_print = start; while (cur_index != end) { if (msg_level < 0 && ((end - cur_index) > 2)) { /* strip log prefix */ cur...
cwe
CWE-119
C/C++
v=Math.max(0,Math.min(c,mxUtils.getValue(this.state.style,"arrowSize",Za.prototype.arrowSize)));return new mxPoint(x.x+(1-v)*x.width,x.y+(1-p)*x.height/2)},function(x,p){this.state.style.arrowWidth=Math.max(0,Math.min(1,Math.abs(x.y+x.height/2-p.y)/x.height*2));this.state.style.arrowSize=Math.max(0,Math.min(c,(x.x+x.wi...
cwe
CWE-20
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
/** * <a href="http://www.openolat.org"> * OpenOLAT - Online Learning and Training</a><br> * <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 the * <a href="http://www.apache...
cwe
CWE-91
Java
void PM_io_parser<PMDEC>::read() { if ( !check_sep("Plane_map_2") ) CGAL_error_msg("PM_io_parser::read: no embedded_PM header."); if ( !(check_sep("vertices") && (in >> vn)) ) CGAL_error_msg("PM_io_parser::read: wrong node line."); if ( !(check_sep("halfedges") && (in >> en) && (en%2==0)) ) CGAL_error...
cwe
CWE-269
Unknown
static char *build_alias(char *alias, const char *device_name) { char *dest; /* ">bar/": rename to bar/device_name */ /* ">bar[/]baz": rename to bar[/]baz */ dest = strrchr(alias, '/'); if (dest) { /* ">bar/[baz]" ? */ *dest = '\0'; /* mkdir bar */ bb_make_directory(alias, 0755, FILEUTILS_RECUR); *dest = '/...
cwe
CWE-264
Unknown
#!/usr/bin/env python # -*- coding: utf-8 -*- # This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web) # Copyright (C) 2018-2019 shavitmichael, OzzieIsaacs # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as pu...
cwe
CWE-352
Python
kdc_process_for_user(kdc_realm_t *kdc_active_realm, krb5_pa_data *pa_data, krb5_keyblock *tgs_session, krb5_pa_s4u_x509_user **s4u_x509_user, const char **status) { krb5_error_code code; krb5_pa_for_user *...
cwe
CWE-617
C/C++
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) { OpData* data = static_cast<OpData*>(node->user_data); TF_LITE_ENSURE_EQ(context, NumInputs(node), 1); TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1); const TfLiteTensor* input = GetInput(context, node, 0); TfLiteTensor* output = GetOutput(cont...
cwe
CWE-787
C/C++