code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
static int keyring_search_iterator(const void *object, void *iterator_data) { struct keyring_search_context *ctx = iterator_data; const struct key *key = keyring_ptr_to_key(object); unsigned long kflags = key->flags; kenter("{%d}", key->serial); /* ignore keys not of this type */ if (key->type != ctx->index_key...
cwe
CWE-20
C/C++
const cb = require('cb'); const url = require('url'); const urlJoin = require('url-join'); const { TokenSet } = require('openid-client'); const clone = require('clone'); const { strict: assert } = require('assert'); const debug = require('./debug')('context'); const { get: getClient } = require('./client'); const { en...
cwe
CWE-601
JavaScript
import json import logging import os import pathlib import re from typing import Dict, Mapping, NoReturn, Optional, Sequence from vault_cli import client, exceptions logger = logging.getLogger(__name__) _replaced_by_underscore = re.compile(r"[/\- ]") _allowed_named = re.compile(r"[A-Z0-9_]+") def _normalize(name: ...
cwe
CWE-94
Python
/* Copyright 2022 The Fluid Authors. 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 writing, softw...
cwe
CWE-863
Go
void pcre_dump_cache(const std::string& filename) { s_pcreCache.dump(filename); }
cwe
CWE-22
C/C++
static void ov518_mode_init_regs(struct sd *sd) { struct gspca_dev *gspca_dev = (struct gspca_dev *)sd; int hsegs, vsegs, packet_size; struct usb_host_interface *alt; struct usb_interface *intf; intf = usb_ifnum_to_if(sd->gspca_dev.dev, sd->gspca_dev.iface); alt = usb_altnum_to_altsetting(intf, sd->gspca_dev.alt...
cwe
CWE-476
C/C++
Status OpLevelCostEstimator::PredictCropAndResize(const OpContext& op_context, NodeCosts* node_costs) const { bool found_unknown_shapes = false; const auto method = op_context.op_info.attr().find("method"); bool use_bilinear_interp; if (method == op_context.op_...
cwe
CWE-190
C/C++
QPDFWriter::setEncryptionParametersInternal( int V, int R, int key_len, long P, std::string const& O, std::string const& U, std::string const& OE, std::string const& UE, std::string const& Perms, std::string const& id1, std::string const& user_password, std::string const& encryption_key) { this-...
cwe
CWE-787
Unknown
private static boolean unzip(InputStream in, VFSContainer targetDir, Identity identity, boolean versioning) { VFSRepositoryService vfsRepositoryService = CoreSpringFactory.getImpl(VFSRepositoryService.class); try(ZipInputStream oZip = new ZipInputStream(in)) { // unzip files ZipEntry oEntr = oZip.getNex...
cwe
CWE-22
Java
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
cwe
CWE-787
C/C++
static void ConvertLoopSequence(ModSample &smp, STPLoopList &loopList) { if(!smp.HasSampleData() || loopList.size() < 2) return; ModSample newSmp = smp; newSmp.nLength = 0; newSmp.pSample = nullptr; size_t numLoops = loopList.size(); for(size_t i = 0; i < numLoops; i++) { STPLoopInfo &info = loopList[...
cwe
CWE-125
C/C++
nwfilterConnectNumOfNWFilters(virConnectPtr conn) { if (virConnectNumOfNWFiltersEnsureACL(conn) < 0) return -1; return virNWFilterObjListNumOfNWFilters(driver->nwfilters, conn, virConnectNumOfNWFiltersCheckACL); }
cwe
CWE-667
C/C++
########################################################################## # # pgAdmin 4 - PostgreSQL Tools # # Copyright (C) 2013 - 2023, The pgAdmin Development Team # This software is released under the PostgreSQL Licence # ########################################################################## """A blueprint mo...
cwe
CWE-22
Python
relay_websocket_decode_frame (const unsigned char *buffer, unsigned long long buffer_length, unsigned char *decoded, unsigned long long *decoded_length) { unsigned long long i, index_buffer, length_frame_size, length_frame; ...
cwe
CWE-125
Unknown
function hn(e){return typeof e=="function"}
cwe
CWE-352
JavaScript
static void init_sasl_conn(conn *c) { assert(c); /* should something else be returned? */ if (!settings.sasl) return; if (!c->sasl_conn) { int result=sasl_server_new("memcached", NULL, my_sasl_hostname[0] ? my_sasl_ho...
cwe
CWE-287
Unknown
package com.salesmanager.shop.admin.controller.orders; import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.salesmanager.core.business.services.order.OrderService; import com.salesmanager.core.business.services.system.ModuleConfigurationService; import com.salesmanager.core.business.utils.ProductPriceUti...
cwe
CWE-639
Java
archive_strncat_l(struct archive_string *as, const void *_p, size_t n, struct archive_string_conv *sc) { const void *s; size_t length; int i, r = 0, r2; /* We must allocate memory even if there is no data for conversion * or copy. This simulates archive_string_append behavior. */ if (_p == NULL || n == 0) {...
cwe
CWE-476
Unknown
_PUBLIC_ size_t strlen_m_ext_handle(struct smb_iconv_handle *ic, const char *s, charset_t src_charset, charset_t dst_charset) { size_t count = 0; #ifdef DEVELOPER switch (dst_charset) { case CH_DOS: case CH_UNIX: smb_panic("cannot call strlen_m_ext() with a variable dest charset (must be UTF16* or UTF8)"...
cwe
CWE-200
Unknown
extern int x11_set_xauth(char *xauthority, char *cookie, char *host, uint16_t display) { int i=0, status; char *result; char **xauth_argv; xauth_argv = xmalloc(sizeof(char *) * 10); xauth_argv[i++] = xstrdup("xauth"); xauth_argv[i++] = xstrdup("-v"); xauth_argv[i++] = xstrdup("-f"); xauth_argv[i++] = xstrd...
cwe
CWE-362
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
static void nsc_encode_argb_to_aycocg(NSC_CONTEXT* context, const BYTE* data, UINT32 scanline) { UINT16 x; UINT16 y; UINT16 rw; BYTE ccl; const BYTE* src; BYTE* yplane = NULL; BYTE* coplane = NULL; BYTE* cgplane = NULL; BYTE* aplane = NULL; INT16 r_val; INT16 g_val; ...
cwe
CWE-787
C/C++
static void ext4_clamp_want_extra_isize(struct super_block *sb) { struct ext4_sb_info *sbi = EXT4_SB(sb); struct ext4_super_block *es = sbi->s_es; /* determine the minimum size of new large inodes, if present */ if (sbi->s_inode_size > EXT4_GOOD_OLD_INODE_SIZE && sbi->s_want_extra_isize == 0) { sbi->s_want_...
cwe
CWE-401
Unknown
].class.schemaFields.sort((a, b) => (a.name > b.name ? 1 : -1)), __typename: result.data[fieldName].class.__typename, }, __typename: result.data[fieldName].__typename, })); expect(classes).toEqual([ { clientMutationId: 'cm...
cwe
CWE-863
JavaScript
Comments.publishArticle = function(req, res, callback) { var markdown = req.body.markdown, title = req.body.title, url = req.body.url, commentID = req.body.id, tags = req.body.tags, uid = req.user ? req.user.uid : 0, cid = JSON.parse(req.body.cid); if (cid === -1) { var hostUrls = (meta.config...
cwe
CWE-352
JavaScript
def self.read_record(yaml_data) RecordReader.convert_values_to_string(YAML.load(yaml_data)) end
cwe
CWE-502
Ruby
static int genl_family_rcv_msg(struct genl_family *family, struct sk_buff *skb, struct nlmsghdr *nlh) { const struct genl_ops *ops; struct net *net = sock_net(skb->sk); struct genl_info info; struct genlmsghdr *hdr = nlmsg_data(nlh); struct nlattr **attrbuf; int hdrlen, err; /* this family d...
cwe
CWE-264
Unknown
/* * Copyright 2016 Red Hat, Inc. and/or its affiliates * and other contributors as indicated by the @author tags. * * 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.apach...
cwe
CWE-287
Java
XSetIconName ( register Display *dpy, Window w, _Xconst char *icon_name) { return XChangeProperty(dpy, w, XA_WM_ICON_NAME, XA_STRING, 8, PropModeReplace, (_Xconst unsigned char *)icon_name, icon_name ? (int) strlen(icon_name) : 0); }
cwe
CWE-120
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-682
Python
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-119
C/C++
static Image *ReadVIPSImage(const ImageInfo *image_info, ExceptionInfo *exception) { char buffer[MagickPathExtent], *metadata; Image *image; MagickBooleanType status; ssize_t n; unsigned int channels, marker; VIPSBandFormat format; VIPSCoding coding; VIPSType...
cwe
CWE-772
C/C++
MOBI_RET mobi_parse_huff(MOBIHuffCdic *huffcdic, const MOBIPdbRecord *record) { MOBIBuffer *buf = mobi_buffer_init_null(record->data, record->size); if (buf == NULL) { debug_print("%s\n", "Memory allocation failed"); return MOBI_MALLOC_FAILED; } char huff_magic[5]; mobi_buffer_getstr...
cwe
CWE-125
Unknown
xfs_attr_calc_size( struct xfs_inode *ip, int namelen, int valuelen, int *local) { struct xfs_mount *mp = ip->i_mount; int size; int nblks; /* * Determine space new attribute will use, and if it would be * "local" or "remote" (note: local != inline). */ size = xfs_attr_leaf_newentsize(namele...
cwe
CWE-19
Unknown
status_t MPEG4Source::read( MediaBuffer **out, const ReadOptions *options) { Mutex::Autolock autoLock(mLock); CHECK(mStarted); if (mFirstMoofOffset > 0) { return fragmentedRead(out, options); } *out = NULL; int64_t targetSampleTimeUs = -1; int64_t seekTimeUs; ReadOptions::SeekMode mode; if (options &...
cwe
CWE-119
C/C++
""" Runtime will load the XBlock class from here. """ from .apps import LTIConsumerApp from .lti_xblock import LtiConsumerXBlock __version__ = '7.2.1'
cwe
CWE-862
Python
public function showImage(string $path) { $path = storage_path('uploads/images/' . $path); if (!file_exists($path)) { throw (new NotFoundException(trans('errors.image_not_found'))) ->setSubtitle(trans('errors.image_not_found_subtitle')) ->setDetails(trans(...
cwe
CWE-22
PHP
static int spi_gpio_probe(struct platform_device *pdev) { int status; struct spi_master *master; struct spi_gpio *spi_gpio; struct device *dev = &pdev->dev; struct spi_bitbang *bb; const struct of_device_id *of_id; of_id = of_match_device(spi_gpio_dt_ids, &pdev->dev); master = spi_alloc_master(dev, s...
cwe
CWE-401
C/C++
# -*- 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-770
Python
protected function _fclose($fp, $path='') { @fclose($fp); if ($path) { @unlink($this->getTempFile($path)); } }
cwe
CWE-89
JavaScript
TfLiteStatus ResizeOutput(TfLiteContext* context, TfLiteNode* node) { const TfLiteTensor* input = GetInput(context, node, kInputTensor); TfLiteTensor* output = GetOutput(context, node, kOutputTensor); const TfLiteTensor* multipliers = GetInput(context, node, kInputMultipliers); const int num_dimensions = NumDi...
cwe
CWE-787
Unknown
/* * 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
/* * Cantata * * Copyright (c) 2011-2018 Craig Drummond <craig.p.drummond@gmail.com> * * ---- * * 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 * (a...
cwe
CWE-20
C/C++
bool IsValidSymbolicLink(const FilePath& file_path, GDataCache::CacheSubDirectoryType sub_dir_type, const std::vector<FilePath>& cache_paths, std::string* reason) { DCHECK(sub_dir_type == GDataCache::CACHE_TYPE_PINNED || sub_dir_type ...
cwe
CWE-119
C/C++
/* * The MIT License * * Copyright (c) 2010 The Broad Institute * * 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...
cwe
CWE-668
Java
name_parse(u8 *packet, int length, int *idx, char *name_out, int name_out_len) { int name_end = -1; int j = *idx; int ptr_count = 0; #define GET32(x) do { if (j + 4 > length) goto err; memcpy(&t32_, packet + j, 4); j += 4; x = ntohl(t32_); } while (0) #define GET16(x) do { if (j + 2 > length) goto err; memcpy(&t_, p...
cwe
CWE-125
C/C++
/* gd_bmp.c Bitmap format support for libgd * Written 2007, Scott MacVicar --------------------------------------------------------------------------- Todo: Bitfield encoding ---------------------------------------------------------------------------- */ /** * File: BMP IO * * Read and write BMP images...
cwe
CWE-125
C/C++
static Image *ReadIPLImage(const ImageInfo *image_info,ExceptionInfo *exception) { /* Declare variables. */ Image *image; MagickBooleanType status; register PixelPacket *q; unsigned char magick[12], *pixels; ssize_t count; ssize_t y; size_t t_count=0; size_t length; IPLInfo ipl_info; Q...
cwe
CWE-120
C/C++
int vp78_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt, int is_vp7) { VP8Context *s = avctx->priv_data; int ret, i, referenced, num_jobs; enum AVDiscard skip_thresh; VP8Frame *av_uninit(curframe), *prev_frame; if (is_vp7) ret = vp7_dec...
cwe
CWE-119
Unknown
var mxClient={VERSION:"18.0.3",IS_IE:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE"),IS_IE11:null!=navigator.userAgent&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_EM:"spellcheck"in document.createElement("textarea")&&8==docum...
cwe
CWE-79
JavaScript
/** * 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-91
Java
_gnutls_server_select_suite(gnutls_session_t session, uint8_t * data, unsigned int datalen) { int ret; unsigned int i, j, cipher_suites_size; size_t pk_algos_size; uint8_t cipher_suites[MAX_CIPHERSUITE_SIZE]; int retval; gnutls_pk_algorithm_t pk_algos[MAX_ALGOS]; /* will hold the pk algorithms * su...
cwe
CWE-310
C/C++
/* * VFIO PCI interrupt handling * * Copyright (C) 2012 Red Hat, Inc. All rights reserved. * Author: Alex Williamson <alex.williamson@redhat.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the F...
cwe
CWE-190
C/C++
static unsigned long get_seg_limit(struct pt_regs *regs, int seg_reg_idx) { struct desc_struct *desc; unsigned long limit; short sel; sel = get_segment_selector(regs, seg_reg_idx); if (sel < 0) return 0; if (user_64bit_mode(regs) || v8086_mode(regs)) return -1L; if (!sel) return 0; desc = get_desc(sel...
cwe
CWE-416
Unknown
var express = require('express'); var bodyParser = require('body-parser'); var cookieParser = require('cookie-parser'); var app = express(); var jade = require('jade'); var cache = require('memory-cache'); var mysql = require('mysql'); var marked = require('marked'); var wait =require('wait.for'); var fs = require("fs"...
cwe
CWE-89
JavaScript
public function admin_delete($id = null) { if (!$this->request->is('post') && !$this->request->is('delete')) { throw new MethodNotAllowedException(__('Action not allowed, post or delete request expected.')); } if (!$this->_isAdmin()) { throw new Exception('Administrat...
cwe
CWE-269
PHP
grepfile (char const *file, struct stats *stats) { int desc; int count; int status; filename = (file ? file : label ? label : _("(standard input)")); if (! file) desc = STDIN_FILENO; else if (devices == SKIP_DEVICES) { /* Don't open yet, since that might have side effects on a device. */ ...
cwe
CWE-189
Unknown
{% load i18n %} {% load inventree_extras %} {% load status_codes %} /* globals attachSelect, closeModal, constructField, constructFormBody, getFormFieldValue, global_settings, handleFormErrors, imageHoverIcon, inventreeDelete, inventreeGet, inventreePut, launchModalForm,...
cwe
CWE-1236
Python
pkcs11rsa_fetch(dst_key_t *key, const char *engine, const char *label, dst_key_t *pub) { CK_RV rv; CK_OBJECT_CLASS keyClass = CKO_PRIVATE_KEY; CK_KEY_TYPE keyType = CKK_RSA; CK_ATTRIBUTE searchTemplate[] = { { CKA_CLASS, &keyClass, (CK_ULONG) sizeof(keyClass) }, { CKA_KEY_TYPE, &keyType, (CK_ULONG) sizeof(ke...
cwe
CWE-617
Unknown
static int replmd_name_modify(struct replmd_replicated_request *ar, struct ldb_request *req, struct ldb_dn *dn) { struct ldb_message *msg; const char *rdn_name; const struct ldb_val *rdn_val; const struct dsdb_attribute *rdn_attr; int ret; msg = ldb_msg_new(req); if (msg == NULL) { goto failed; } m...
cwe
CWE-200
Unknown
async def on_send_leave_request( self, origin: str, content: JsonDict, room_id: str
cwe
CWE-79
Python
/* * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. */ /* * Licensed to Elasticsearch under one or more contributor * license agreements. See the NOTICE file distribute...
cwe
CWE-200
Java
/* Pango * pango-emoji.c: Emoji handling * * Copyright (C) 2017 Google, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your opti...
cwe
CWE-119
C/C++
static Image *ReadOneMNGImage(MngInfo* mng_info, const ImageInfo *image_info, ExceptionInfo *exception) { char page_geometry[MagickPathExtent]; Image *image; MagickBooleanType logging; volatile int first_mng_object, object_id, term_chunk_found, skip_to_iend; volatile ssize...
cwe
CWE-125
C/C++
static void core_anal_bytes(RCore *core, const ut8 *buf, int len, int nops, int fmt) { int stacksize = r_config_get_i (core->config, "esil.stack.depth"); bool iotrap = r_config_get_i (core->config, "esil.iotrap"); bool romem = r_config_get_i (core->config, "esil.romem"); bool stats = r_config_get_i (core->config, "...
cwe
CWE-787
Unknown
/* 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-787
Python
GF_RTPHinter *gf_hinter_track_new(GF_ISOFile *file, u32 TrackNum, u32 Path_MTU, u32 max_ptime, u32 default_rtp_rate, u32 flags, u8 PayloadID, Bool copy_media, u32 InterleaveGroupID, u8 InterleaveGroupPriority, GF_Err *e) { GF_SLConfig my_sl; u32 des...
cwe
CWE-787
Unknown
//= require ./panel //= require ./collection_view //= require ../mixins/action_support //= require ./menu_scroll_view // Only to be used in Flame.MenuView. Represent menu items with normal JS objects as creation of one Ember object took // 3.5 ms on fast IE8 machine. Flame.MenuItem = function MenuItem(opts) { for ...
cwe
CWE-79
JavaScript
wb_prep(netdissect_options *ndo, const struct pkt_prep *prep, u_int len) { int n; const struct pgstate *ps; const u_char *ep = ndo->ndo_snapend; ND_PRINT((ndo, " wb-prep:")); if (len < sizeof(*prep)) { return (-1); } n = EXTRACT_32BITS(&prep->pp_n); ps = (const struct pgstate *)(prep + 1); wh...
cwe
CWE-125
C/C++
#include <mruby.h> #include <mruby/array.h> #include <mruby/class.h> #include <mruby/proc.h> #define fiber_ptr(o) ((struct RFiber*)mrb_ptr(o)) #define FIBER_STACK_INIT_SIZE 64 #define FIBER_CI_INIT_SIZE 8 #define CI_ACC_RESUMED -3 /* * call-seq: * Fiber.new{...} -> obj * * Creates a fiber, whose execution ...
cwe
CWE-125
C/C++
function P(ma,ya){ja.innerHTML="";if(0<ma.length){var Ba=document.createElement("table"); Ba.setAttribute("cellpadding","2");Ba.style.boxSizing="border-box";Ba.style.tableLayout="fixed";Ba.style.width="100%";var Ha=document.createElement("tbody");if(null!=ma&&0<ma.length)for(var sa=0;sa<ma.length;sa++)(function(Ga){var...
cwe
CWE-94
JavaScript
bool PPB_ImageData_Impl::Init(PP_ImageDataFormat format, int width, int height, bool init_to_zero) { if (!IsImageDataFormatSupported(format)) return false; // Only support this one format for now. if (width <= 0 || height <= 0) return false; ...
cwe
CWE-190
C/C++
/** @file * A brief file description @section license License 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 ...
cwe
CWE-444
C/C++
void CuePoint::TrackPosition::Parse(IMkvReader* pReader, long long start_, long long size_) { const long long stop = start_ + size_; long long pos = start_; m_track = -1; m_pos = -1; m_block = 1; // default while (pos < stop) { long len; const long long ...
cwe
CWE-20
C/C++
static MagickBooleanType WritePTIFImage(const ImageInfo *image_info, Image *image,ExceptionInfo *exception) { Image *images, *next, *pyramid_image; ImageInfo *write_info; MagickBooleanType status; PointInfo resolution; size_t columns, rows; /* Create pyramid-encode...
cwe
CWE-119
Unknown
I18NCustomBindings::I18NCustomBindings(ScriptContext* context) : ObjectBackedNativeHandler(context) { RouteFunction( "GetL10nMessage", base::Bind(&I18NCustomBindings::GetL10nMessage, base::Unretained(this))); RouteFunction("GetL10nUILanguage", base::Bind(&I18NCustomBindings::GetL...
cwe
CWE-254
C/C++
static u64 __skb_get_nlattr_nest(u64 ctx, u64 A, u64 X, u64 r4, u64 r5) { struct sk_buff *skb = (struct sk_buff *)(long) ctx; struct nlattr *nla; if (skb_is_nonlinear(skb)) return 0; if (A > skb->len - sizeof(struct nlattr)) return 0; nla = (struct nlattr *) &skb->data[A]; if (nla->nla_len > A - skb->len) ...
cwe
CWE-190
C/C++
fetch: function () { var data = Dep.prototype.fetch.call(this); data.translatedOptions = {}; (data[this.name] || []).forEach(function (value) { data.translatedOptions[value] = this.$el.find('input[data-name="translatedValue"][data-value="'+value+'"]').val() || value; ...
cwe
CWE-79
JavaScript
/** * Set given `path` * * @param {Object} obj * @param {String} path * @param {Mixed} val * @return {Object} * @api public */ exports.set = function (obj, path, val) { var segs = path.split('.'); var attr = segs.pop(); var src = obj; for (var i = 0; i < segs.length; i++) { var seg = segs[i]; ...
cwe
CWE-20
JavaScript
package oidc import ( "encoding/hex" "encoding/json" "fmt" "html" "html/template" "net" "net/http" "net/url" "os" "path" "strings" "time" gooidc "github.com/coreos/go-oidc" "github.com/golang-jwt/jwt/v4" log "github.com/sirupsen/logrus" "golang.org/x/oauth2" "github.com/argoproj/argo-cd/v2/common" ...
cwe
CWE-330
Go
int ip_forward(struct sk_buff *skb) { u32 mtu; struct iphdr *iph; /* Our header */ struct rtable *rt; /* Route we use */ struct ip_options *opt = &(IPCB(skb)->opt); /* that should never happen */ if (skb->pkt_type != PACKET_HOST) goto drop; if (skb_warn_if_lro(skb)) goto drop; if (!xfrm4_policy_check(NUL...
cwe
CWE-17
Unknown
/* * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * * 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-122
C/C++
mxCellRenderer.prototype.destroy=function(u){D.apply(this,arguments);null!=u.secondLabel&&(u.secondLabel.destroy(),u.secondLabel=null)};mxCellRenderer.prototype.getShapesForState=function(u){return[u.shape,u.text,u.secondLabel,u.control]};var G=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValid...
cwe
CWE-20
JavaScript
/* * Handle firewalling * Linux ethernet bridge * * Authors: * Lennert Buytenhek <buytenh@gnu.org> * Bart De Schuymer <bdschuym@pandora.be> * * 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 Foun...
cwe
CWE-399
C/C++
#include "server/connection_handler_impl.h" #include "envoy/event/dispatcher.h" #include "envoy/event/timer.h" #include "envoy/network/filter.h" #include "envoy/stats/scope.h" #include "envoy/stats/timespan.h" #include "common/network/connection_impl.h" #include "common/network/utility.h" #include "common/stats/times...
cwe
CWE-835
C/C++
static Image *ReadTIFFImage(const ImageInfo *image_info, ExceptionInfo *exception) { #define ThrowTIFFException(severity,message) \ { \ if (pixel_info != (MemoryInfo *) NULL) \ pixel_info=RelinquishVirtualMemory(pixel_info); \ if (quantum_info != (QuantumInfo *) NULL) \ quantum_info=DestroyQuantumInfo(qua...
cwe
CWE-787
C/C++
mbfl_filt_conv_big5_wchar(int c, mbfl_convert_filter *filter) { int k; int c1, w, c2; switch (filter->status) { case 0: if (filter->from->no_encoding == mbfl_no_encoding_cp950) { c1 = 0x80; } else { c1 = 0xa0; } if (c >= 0 && c <= 0x80) { /* latin */ CK((*filter->output_function)(c, filter->data)...
cwe
CWE-125
C/C++
static int decode_getacl(struct xdr_stream *xdr, struct rpc_rqst *req, size_t *acl_len) { __be32 *savep; uint32_t attrlen, bitmap[3] = {0}; struct kvec *iov = req->rq_rcv_buf.head; int status; *acl_len = 0; if ((status = decode_op_hdr(xdr, OP_GETATTR)) != 0) goto out; if ((status = decode_attr_bitmap(xdr...
cwe
CWE-703
Unknown
int qcow2_alloc_clusters_at(BlockDriverState *bs, uint64_t offset, int nb_clusters) { BDRVQcowState *s = bs->opaque; uint64_t cluster_index; uint64_t old_free_cluster_index; uint64_t i; int refcount, ret; assert(nb_clusters >= 0); if (nb_clusters == 0) { return 0; } /* ...
cwe
CWE-190
Unknown
void HistoryController::UpdateForCommit(RenderFrameImpl* frame, const WebHistoryItem& item, WebHistoryCommitType commit_type, bool navigation_within_page) { switch (commit_type) { case blink::W...
cwe
CWE-254
C/C++
/** * The contents of this file are subject to the license and copyright * detailed in the LICENSE and NOTICE files at the root of the source * tree and available online at * * http://www.dspace.org/license/ */ package org.dspace.app.webui.servlet; import org.apache.commons.lang.StringUtils; import org.apache.lo...
cwe
CWE-79
Java
int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) { struct bonding *bond = netdev_priv(bond_dev); const struct net_device_ops *slave_ops = slave_dev->netdev_ops; struct slave *new_slave = NULL; struct netdev_hw_addr *ha; struct sockaddr addr; int link_reporting; int res = 0; if (!bond...
cwe
CWE-703
Unknown
void rose_start_t3timer(struct sock *sk) { struct rose_sock *rose = rose_sk(sk); del_timer(&rose->timer); rose->timer.function = rose_timer_expiry; rose->timer.expires = jiffies + rose->t3; add_timer(&rose->timer); }
cwe
CWE-416
Unknown
/* * Copyright (C) 2003, 2004, 2005 Joe Walnes. * Copyright (C) 2006, 2007, 2008, 2010, 2011, 2012, 2013, 2018 XStream Committers. * All rights reserved. * * The software in this package is published under the terms of the BSD * style license a copy of which has been included with this distribution in * the LICE...
cwe
CWE-400
Java
gnutls_pcert_deinit (gnutls_pcert_st *pcert) { gnutls_pubkey_deinit(pcert->pubkey); pcert->pubkey = NULL; gnutls_free(pcert->cert.data); pcert->cert.data = NULL; }
cwe
CWE-399
Unknown
void CIRCNetwork::SetEncoding(const CString& s) { m_sEncoding = s; if (GetIRCSock()) { GetIRCSock()->SetEncoding(s); } }
cwe
CWE-20
C/C++
void SoftAMR::onQueueFilled(OMX_U32 /* portIndex */) { List<BufferInfo *> &inQueue = getPortQueue(0); List<BufferInfo *> &outQueue = getPortQueue(1); if (mSignalledError || mOutputPortSettingsChange != NONE) { return; } while (!inQueue.empty() && !outQueue.empty()) { BufferInfo *inInfo = *inQueue.begi...
cwe
CWE-264
Unknown
static apr_byte_t oidc_validate_post_logout_url(request_rec *r, const char *url, char **err_str, char **err_desc) { apr_uri_t uri; const char *c_host = NULL; if (apr_uri_parse(r->pool, url, &uri) != APR_SUCCESS) { *err_str = apr_pstrdup(r->pool, "Malformed URL"); *err_desc = apr_psprintf(r->pool, "Logout URL ...
cwe
CWE-601
C/C++
/* 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-125
Python
var http = require('http'); var fs = require('fs'); fs.exists = fs.exists || require('path').exists; var SERVER_PORT = 8080; var FILE_TYPE_GZIP = 1; var FILE_EXT_GZIP = '.gz'; var FILE_EXT_CSS = '.css'; var FILE_EXT_JS = '.js'; // GZIP text/plain required to get Chrome XHR to decompress file. var MIME_TYPE_GZIP = ...
cwe
CWE-22
JavaScript