code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
QPDF_Array::getNItems() const { return this->items.size(); }
cwe
CWE-787
Unknown
function Q(S){E.style.background="transparent";E.innerHTML="";var Y=document.createElement("div");Y.className="odPreviewStatus";mxUtils.write(Y,S);E.appendChild(Y);N.stop()}
cwe
CWE-94
JavaScript
tar_directory_for_file (GsfInfileTar *dir, const char *name, gboolean last) { const char *s = name; while (1) { const char *s0 = s; char *dirname; /* Find a directory component, if any. */ while (1) { if (*s == 0) { if (last && s != s0) break; else return dir; } /* This is delibe...
cwe
CWE-476
C/C++
function fillDiagramsList(diagrams, isTemplate, asList, searchImportCats, internalCall) { function setSubmitBtnLbl() { toggleButtons(isTemplate); }; if (!internalCall) { diagramsTiles.innerHTML = ''; swapActiveItem(); curDiagList = diagrams; curSearchImportCats = searchImportCats; } ...
cwe
CWE-94
JavaScript
/* 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-190
Python
TPMI_RH_NV_AUTH_Unmarshal(TPMI_RH_NV_AUTH *target, BYTE **buffer, INT32 *size) { TPM_RC rc = TPM_RC_SUCCESS; if (rc == TPM_RC_SUCCESS) { rc = TPM_HANDLE_Unmarshal(target, buffer, size); } if (rc == TPM_RC_SUCCESS) { switch (*target) { case TPM_RH_OWNER: case TPM_RH_PLATFORM: break; ...
cwe
CWE-787
Unknown
/* 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-369
Python
inline TfLiteTensor* GetMutableInput(const TfLiteContext* context, const TfLiteNode* node, int index) { if (context->tensors != nullptr) { return &context->tensors[node->inputs->data[index]]; } else { return context->GetTensor(context, node->inputs->data[index]); } }
cwe
CWE-787
C/C++
static int kvm_guest_time_update(struct kvm_vcpu *v) { unsigned long flags, this_tsc_khz; struct kvm_vcpu_arch *vcpu = &v->arch; struct kvm_arch *ka = &v->kvm->arch; void *shared_kaddr; s64 kernel_ns, max_kernel_ns; u64 tsc_timestamp, host_tsc; struct pvclock_vcpu_time_info *guest_hv_clock; u8 pvclock_flags; b...
cwe
CWE-399
C/C++
static void copyStereo8( short *dst, const int *const *src, unsigned nSamples, unsigned /* nChannels */) { for (unsigned i = 0; i < nSamples; ++i) { *dst++ = src[0][i] << 8; *dst++ = src[1][i] << 8; } }
cwe
CWE-119
C/C++
static int do_remount(struct path *path, int flags, int mnt_flags, void *data) { int err; struct super_block *sb = path->mnt->mnt_sb; struct mount *mnt = real_mount(path->mnt); if (!check_mnt(mnt)) return -EINVAL; if (path->dentry != path->mnt->mnt_root) return -EINVAL; err = security_sb_remount(sb...
cwe
CWE-264
C/C++
// mkerrors.sh -m64 // Code generated by the command above; see README.md. DO NOT EDIT. // +build amd64,freebsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -m64 _const.go package unix import "syscall" const ( AF_APPLETALK = 0x10 AF_ARP = 0x23 AF...
cwe
CWE-287
Go
int udpv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) { struct ipv6_txoptions opt_space; struct udp_sock *up = udp_sk(sk); struct inet_sock *inet = inet_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk); DECLARE_SOCKADDR(struct sockaddr_in6 *, sin6, msg->msg_name); struct in6_addr *daddr, *final_p, final;...
cwe
CWE-264
C/C++
int OmniboxViewViews::OnDrop(const ui::OSExchangeData& data) { if (HasTextBeingDragged()) return ui::DragDropTypes::DRAG_NONE; if (data.HasURL(ui::OSExchangeData::CONVERT_FILENAMES)) { GURL url; base::string16 title; if (data.GetURLAndTitle( ui::OSExchangeData::CONVERT_FILENAMES, &url, ...
cwe
CWE-79
C/C++
// This file is part of MinIO Console Server // Copyright (c) 2021 MinIO, Inc. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option...
cwe
CWE-306
Go
def post(self): """This method handles the POST requests to add agents to the Cloud Verifier. Currently, only agents resources are available for POSTing, i.e. /agents. All other POST uri's will return errors. agents requests require a json block sent in the body """ session = ge...
cwe
CWE-20
Python
optional<ARN> ARN::parse(const string& s, bool wildcards) { static const char str_wild[] = "arn:([^:]*):([^:]*):([^:]*):([^:]*):([^:]*)"; static const regex rx_wild(str_wild, sizeof(str_wild) - 1, ECMAScript | optimize); static const char str_no_wild[] = "arn:([^:*]*):([^:*]*):([^:*]*):([^:*]*...
cwe
CWE-617
C/C++
merge (position_set const *s1, position_set const *s2, position_set *m) { int i = 0, j = 0; REALLOC_IF_NECESSARY(m->elems, m->alloc, s1->nelem + s2->nelem); m->nelem = 0; while (i < s1->nelem && j < s2->nelem) if (s1->elems[i].index > s2->elems[j].index) m->elems[m->nelem++] = s1->elems[i++]; els...
cwe
CWE-189
Unknown
static Image *ReadDOTImage(const ImageInfo *image_info,ExceptionInfo *exception) { char command[MagickPathExtent]; const char *option; graph_t *graph; Image *image; ImageInfo *read_info; MagickBooleanType status; /* Open image file. */ assert(image_info != (const Imag...
cwe
CWE-401
C/C++
function updateLinkColor() { var div = document.createElement('div'); div.style.width = '100%'; div.style.height = '100%'; div.style.boxSizing = 'border-box'; if (linkColor != null && linkColor != mxConstants.NONE) { div.style.border = '1px solid black'; div.style.backgroundColor = linkColo...
cwe
CWE-94
JavaScript
/* * Swagger Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator p...
cwe
CWE-200
Java
""" .. module: security_monkey.sso.views :platform: Unix :copyright: (c) 2015 by Netflix Inc., see AUTHORS for more :license: Apache, see LICENSE for more details. .. moduleauthor:: Patrick Kelley <patrick@netflix.com> """ import jwt import base64 import requests from flask import Blueprint, current_app, r...
cwe
CWE-601
Python
package com.salesmanager.core.business.services.order; import java.io.ByteArrayOutputStream; import java.math.BigDecimal; import java.math.RoundingMode; import java.time.Instant; import java.time.LocalDate; import java.time.ZoneId; import java.time.ZonedDateTime; import java.util.ArrayList; import java.util.Date; impo...
cwe
CWE-79
Java
static void initializeHolderIfNeeded(ScriptState* scriptState, v8::Local<v8::Object> classObject, v8::Local<v8::Value> holder) { RELEASE_ASSERT(!holder.IsEmpty()); RELEASE_ASSERT(holder->IsObject()); v8::Local<v8::Object> holderObject = v8::Local<v8::Object>::Cast(holder); v8::Isolate* isolate = scriptS...
cwe
CWE-79
C/C++
free_command (void *vp, int *error) { struct command *command = vp; struct buffer *buffer = command->slice.buffer; if (buffer != NULL) { if (--buffer->refs == 0) { free (buffer->data); free (buffer); } } free (command); return 1; /* auto-retires the command */ }
cwe
CWE-252
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
def copy(self, src_data, src_path, dst_data, dst_path, job_id=None): credentials = '' if src_data is None: # Local src = src_path else: credentials += self._formatCredentials(src_data, name='src') src = 'src:{}'.format(src_path) if dst_data is None: ...
cwe
CWE-78
Python
null;u=null!=u?u.getElementsByTagName("parsererror"):null;null!=u&&0<u.length&&(J=E||mxResources.get("invalidChars"),E=u[0].getElementsByTagName("div"),0<E.length&&(J=mxUtils.getTextContent(E[0])));return null!=J?mxUtils.trim(J):J};Editor.addRetryToError=function(u,E){null!=u&&(u=null!=u.error?u.error:u,null==u.retry&&...
cwe
CWE-20
JavaScript
tTcpIpPacketParsingResult ParaNdis_ReviewIPPacket(PVOID buffer, ULONG size, LPCSTR caller) { tTcpIpPacketParsingResult res = QualifyIpPacket((IPHeader *) buffer, size); PrintOutParsingResult(res, 1, caller); return res; }
cwe
CWE-20
C/C++
private JsonNode yamlStreamToJson(InputStream yamlStream) { Yaml reader = new Yaml(); ObjectMapper mapper = new ObjectMapper(); return mapper.valueToTree(reader.load(yamlStream)); }
cwe
CWE-502
Java
/* 32-bit ELF support for ARM Copyright (C) 1998-2020 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. 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 ...
cwe
CWE-476
C/C++
/*====================================================================* - Copyright (C) 2001 Leptonica. All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source c...
cwe
CWE-119
C/C++
// Code generated by go-swagger; DO NOT EDIT. // This file is part of MinIO Console Server // Copyright (c) 2021 MinIO, Inc. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either ...
cwe
CWE-306
Go
mcs_parse_domain_params(STREAM s) { int length; ber_parse_header(s, MCS_TAG_DOMAIN_PARAMS, &length); in_uint8s(s, length); return s_check(s); }
cwe
CWE-125
C/C++
$(selectedFiles).each(function(i,elem){ var newtr = $('<tr data-dir="'+dir+'" data-filename="'+elem.name+'">' +'<td class="filename">'+elem.name+'</td><td class="size">'+humanFileSize(elem.size)+'</td>' +'</tr>'); tbody.append(newtr); if (elem.type === 'dir') { newtr.find('td.filename').attr('style...
cwe
CWE-79
JavaScript
function factory (type, config, load, typed) { var register = load(require('./compile')).register; var compile = load(require('./compile')).compile; var Node = load(require('./Node')); /** * @constructor ObjectNode * @extends {Node} * Holds an object with keys/values * @param {Object.<string, Node>...
cwe
CWE-88
JavaScript
void bitmap_cache_free(rdpBitmapCache* bitmapCache) { int i, j; rdpBitmap* bitmap; if (bitmapCache) { for (i = 0; i < (int)bitmapCache->maxCells; i++) { for (j = 0; j < (int)bitmapCache->cells[i].number + 1; j++) { bitmap = bitmapCache->cells[i].entries[j]; Bitmap_Free(bitmapCache->context, bitma...
cwe
CWE-125
Unknown
void Jsi_ValueArrayShift(Jsi_Interp *interp, Jsi_Value *v) { if (v->vt != JSI_VT_OBJECT) { Jsi_LogBug("Jsi_ValueArrayShift, target is not object"); return; } Jsi_Obj *o = v->d.obj; if (o->isarrlist) { uint i; if (!o->arrCnt) return; if (o->arr[0]) ...
cwe
CWE-190
C/C++
/* SPDX-FileCopyrightText: 1997 Markus Wuebben <markus.wuebben@kde.org> SPDX-FileCopyrightText: 2009 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.net SPDX-FileCopyrightText: 2009 Andras Mantia <andras@kdab.net> SPDX-FileCopyrightText: 2010 Torgny Nyblom <nyblom@kde.org> SPDX-FileCopyrightText...
cwe
CWE-319
C/C++
static void ifb_setup(struct net_device *dev) { /* Initialize the device structure. */ dev->destructor = free_netdev; dev->netdev_ops = &ifb_netdev_ops; /* Fill in device structure with ethernet-generic values. */ ether_setup(dev); dev->tx_queue_len = TX_Q_LIMIT; dev->features |= IFB_FEATURES; dev->vlan_featu...
cwe
CWE-264
Unknown
static int mode_sense_page(SCSIDiskState *s, int page, uint8_t **p_outbuf, int page_control) { static const int mode_sense_valid[0x3f] = { [MODE_PAGE_HD_GEOMETRY] = (1 << TYPE_DISK), [MODE_PAGE_FLEXIBLE_DISK_GEOMETRY] = (1 << TYPE_DISK), [MODE_PAGE_CACHI...
cwe
CWE-193
C/C++
static Image *ReadMVGImage(const ImageInfo *image_info,ExceptionInfo *exception) { #define BoundingBox "viewbox" DrawInfo *draw_info; Image *image; MagickBooleanType status; /* Open image. */ assert(image_info != (const ImageInfo *) NULL); assert(image_info->signature == MagickSignatu...
cwe
CWE-120
C/C++
static Image *ReadMPCImage(const ImageInfo *image_info,ExceptionInfo *exception) { char cache_filename[MagickPathExtent], id[MagickPathExtent], keyword[MagickPathExtent], *options; const unsigned char *p; GeometryInfo geometry_info; Image *image; int c; LinkedListInfo ...
cwe
CWE-770
Unknown
static cache_accel_t *read_cache_accel(RBuffer *cache_buf, cache_hdr_t *hdr, cache_map_t *maps) { if (!cache_buf || !hdr || !hdr->accelerateInfoSize || !hdr->accelerateInfoAddr) { return NULL; } ut64 offset = va2pa (hdr->accelerateInfoAddr, hdr->mappingCount, maps, cache_buf, 0, NULL, NULL); if (!offset) { ret...
cwe
CWE-122
C/C++
/** * Module dependencies. */ var transports = require('./transports'); var Emitter = require('component-emitter'); var debug = require('debug')('engine.io-client:socket'); var index = require('indexof'); var parser = require('engine.io-parser'); var parseuri = require('parseuri'); var parsejson = require('parsejson...
cwe
CWE-295
JavaScript
CollationCreate(const char *collname, Oid collnamespace, Oid collowner, char collprovider, bool collisdeterministic, int32 collencoding, const char *collcollate, const char *collctype, const char *collversion, bool if_not_exists, bool quiet) { Relation rel; TupleDesc tupDesc; HeapTupl...
cwe
CWE-94
Unknown
public function updatePreferences(Codendi_Request $request) { $request->valid(new Valid_String('cancel')); if (!$request->exist('cancel')) { $job_id = $request->get($this->widget_id . '_job_id'); $sql = "UPDATE plugin_hudson_widget SET job_id=" . $job_id . " WHERE owner_id = ...
cwe
CWE-89
PHP
_forceinline void Unpack::CopyString(uint Length,uint Distance) { size_t SrcPtr=UnpPtr-Distance; if (SrcPtr<MaxWinSize-MAX_LZ_MATCH && UnpPtr<MaxWinSize-MAX_LZ_MATCH) { // If we are not close to end of window, we do not need to waste time // to "& MaxWinMask" pointer protection. byte *Src=Window+SrcP...
cwe
CWE-787
C/C++
function m(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}
cwe
CWE-1333
JavaScript
/* 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-787
C/C++
def pref_set(key, value): if get_user() is None: return "Authentication required", 401 get_preferences()[key] = (None if value == 'null' else value) return Response(json.dumps({'key': key, 'success': ''})), 201
cwe
CWE-79
Python
/* 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-476
C/C++
import Formatters from '../Formatters' import DateTime from '../../utils/DateTime' import Utils from './Utils' /** * ApexCharts Tooltip.Labels Class to draw texts on the tooltip. * * @module Tooltip.Labels **/ export default class Labels { constructor(tooltipContext) { this.w = tooltipContext.w this.ctx...
cwe
CWE-79
JavaScript
module.exports = Extract; var Parse = require('./parse'); var Writer = require('fstream').Writer; var util = require('util'); var path = require('path'); util.inherits(Extract, Parse); function Extract (opts) { if (!(this instanceof Extract)) return new Extract(opts); var self = this; Parse.call(self,opt...
cwe
CWE-22
JavaScript
CmdResult HandleLocal(LocalUser* user, const Params& parameters) CXX11_OVERRIDE { size_t origin = parameters.size() > 1 ? 1 : 0; if (parameters[origin].empty()) { user->WriteNumeric(ERR_NOORIGIN, "No origin specified"); return CMD_FAILURE; } ClientProtocol::Messages::Pong pong(parameters[0], origin ? ...
cwe
CWE-732
C/C++
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
cwe
CWE-119
C/C++
/* * utils for libavcodec * Copyright (c) 2001 Fabrice Bellard * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at> * * This file is part of FFmpeg. * * FFmpeg 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...
cwe
CWE-787
C/C++
addPlugin(name, instance) { const lowerName = name.toLowerCase(); if (this.hasPlugin(lowerName)) { throw new Error(`A plugin called "${name}" is already registered.`); } if (typeof instance !== 'function' && instance instanceof PluginBase === false) { throw new ...
cwe
CWE-1321
JavaScript
vqp_print(netdissect_options *ndo, register const u_char *pptr, register u_int len) { const struct vqp_common_header_t *vqp_common_header; const struct vqp_obj_tlv_t *vqp_obj_tlv; const u_char *tptr; uint16_t vqp_obj_len; uint32_t vqp_obj_type; int tlen; uint8_t nitems; tptr=pptr; ...
cwe
CWE-125
C/C++
/* * Copyright (c) 2004-2021, University of Oslo * All rights reserved. * * 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 cond...
cwe
CWE-918
Java
api.update = async function(req, res) { const { commentForm } = req.body; const pageId = commentForm.page_id; const comment = commentForm.comment; const isMarkdown = commentForm.is_markdown; const commentId = commentForm.comment_id; const author = commentForm.author; if (comment === '') { ...
cwe
CWE-639
JavaScript
/** * @module lifion-verify-deps */ 'use strict'; const { blue, bold, green, red } = require('chalk'); const path = require('path'); const semver = require('semver'); const { exec } = require('child_process'); const { promisify } = require('util'); const execAsync = promisify(exec); async function getLatestVersio...
cwe
CWE-78
JavaScript
void DOMStorageContextWrapper::Shutdown() { DCHECK(context_.get()); mojo_task_runner_->PostTask( FROM_HERE, base::BindOnce(&LocalStorageContextMojo::ShutdownAndDelete, base::Unretained(mojo_state_))); mojo_state_ = nullptr; if (mojo_session_state_) { mojo_task_runner_...
cwe
CWE-415
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
# -*- 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
/*- * Copyright (c) 2004-2013 Tim Kientzle * Copyright (c) 2011-2012,2014 Michihiro NAKAJIMA * Copyright (c) 2013 Konrad Kleine * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redi...
cwe
CWE-20
C/C++
int tls1_check_chain(SSL *s, X509 *x, EVP_PKEY *pk, STACK_OF(X509) *chain, int idx) { int i; int rv = 0; int check_flags = 0, strict_mode; CERT_PKEY *cpk = NULL; CERT *c = s->cert; uint32_t *pvalid; unsigned int suiteb_flags = tls1_suiteb(s); /* idx == -1 means check...
cwe
CWE-476
Unknown
reverse_nat_packet(struct dp_packet *pkt, const struct conn *conn) { char *tail = dp_packet_tail(pkt); uint8_t pad = dp_packet_l2_pad_size(pkt); struct conn_key inner_key; const char *inner_l4 = NULL; uint16_t orig_l3_ofs = pkt->l3_ofs; uint16_t orig_l4_ofs = pkt->l4_ofs; if (conn->key.dl_t...
cwe
CWE-400
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 GetU16BE (int nPos, bool *pbSuccess) { //*pbSuccess = true; if ( nPos < 0 || nPos + 1 >= m_nLen) { *pbSuccess = false; return 0; } int nRes = m_sFile[ nPos ]; nRes = (nRes << 8) + m_sFile[ nPos ...
cwe
CWE-787
C/C++
/* * GPAC - Multimedia Framework C SDK * * Authors: Jean Le Feuvre * Copyright (c) Telecom ParisTech 2000-2021 * All rights reserved * * This file is part of GPAC / ISOBMFF reader filter * * GPAC is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser Genera...
cwe
CWE-835
C/C++
static s32 i2c_smbus_xfer_emulated(struct i2c_adapter *adapter, u16 addr, unsigned short flags, char read_write, u8 command, int size, union i2c_smbus_data *data) { /* So we need to generate a series of msgs. In the case of writing, we need to use only one message; when reading, we need two. We...
cwe
CWE-787
C/C++
def sign_up_page(): if request.method == 'POST': username = request.form['username'] password = request.form['password'] hashed_password = pwd_context.encrypt(password) email = request.form['email'] id = 1 with dbapi2.connect(current_app.config['dsn']) as connection: cursor = connectio...
cwe
CWE-89
Python
static int raw_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, size_t len, int noblock, int flags, int *addr_len) { struct inet_sock *inet = inet_sk(sk); size_t copied = 0; int err = -EOPNOTSUPP; struct sockaddr_in *sin = (struct sockaddr_in *)msg->msg_name; struct sk_buff *skb; if (fla...
cwe
CWE-20
Unknown
long vhost_dev_ioctl(struct vhost_dev *d, unsigned int ioctl, void __user *argp) { struct file *eventfp, *filep = NULL; struct eventfd_ctx *ctx = NULL; u64 p; long r; int i, fd; /* If you are not the owner, you can become one */ if (ioctl == VHOST_SET_OWNER) { r = vhost_dev_set_owner(d); goto done; } /* ...
cwe
CWE-399
C/C++
setup_seccomp (GPtrArray *argv_array, GArray *fd_array, const char *arch, gboolean multiarch, gboolean devel, GError **error) { __attribute__((cleanup (cleanup_seccomp))) scmp_filter_ctx seccomp = NULL; /**** BEGIN NOTE ON COD...
cwe
CWE-20
C/C++
/* $Id: upnpredirect.c,v 1.95 2018/07/06 12:05:48 nanard Exp $ */ /* vim: tabstop=4 shiftwidth=4 noexpandtab * MiniUPnP project * http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/ * (c) 2006-2018 Thomas Bernard * This software is subject to the conditions detailed * in the LICENCE file provided within th...
cwe
CWE-476
C/C++
static void do_runtime(HttpRequest req, HttpResponse res) { int pid = exist_daemon(); char buf[STRLEN]; do_head(res, "_runtime", "Runtime", 1000); StringBuffer_append(res->outputbuffer, "<h2>Monit runtime status</h2>"); StringBuffer_append(res->output...
cwe
CWE-352
C/C++
struct r_bin_pe_addr_t *PE_(check_mingw)(RBinPEObj *pe) { struct r_bin_pe_addr_t* entry; bool sw = false; ut8 b[1024]; size_t n = 0; if (!pe || !pe->b) { return 0LL; } entry = PE_(r_bin_pe_get_entrypoint) (pe); ZERO_FILL (b); if (r_buf_read_at (pe->b, entry->paddr, b, sizeof (b)) < 0) { pe_printf ("Warning...
cwe
CWE-400
C/C++
int fcntl_dirnotify(int fd, struct file *filp, unsigned long arg) { struct dnotify_struct *dn; struct dnotify_struct *odn; struct dnotify_struct **prev; struct inode *inode; fl_owner_t id = current->files; int error = 0; if ((arg & ~DN_MULTISHOT) == 0) { dnotify_flush(filp, id); return 0; } if (!dir_notif...
cwe
CWE-362
Unknown
pkcs11dh_fromdns(dst_key_t *key, isc_buffer_t *data) { pk11_object_t *dh = NULL; isc_region_t r; uint16_t plen, glen, plen_, glen_, publen; CK_BYTE *prime = NULL, *base = NULL, *pub = NULL; CK_ATTRIBUTE *attr; int special = 0; isc_result_t result; isc_buffer_remainingregion(data, &r); if (r.length == 0) { r...
cwe
CWE-617
Unknown
package com.salesmanager.shop.admin.model.permission; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonPrope...
cwe
CWE-639
Java
/* * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/l...
cwe
CWE-120
C/C++
/* * Copyright (c) 2004-2021, University of Oslo * All rights reserved. * * 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 cond...
cwe
CWE-89
Java
_WM_ParseNewMus(uint8_t *mus_data, uint32_t mus_size) { uint8_t mus_hdr[] = { 'M', 'U', 'S', 0x1A }; uint32_t mus_song_ofs = 0; uint32_t mus_song_len = 0; uint16_t mus_ch_cnt1 = 0; uint16_t mus_ch_cnt2 = 0; uint16_t mus_no_instr = 0; uint32_t mus_data_ofs = 0; uint16_t * mus_mid_instr = ...
cwe
CWE-125
C/C++
static int acl_modify(struct ldb_module *module, struct ldb_request *req) { int ret; struct ldb_context *ldb = ldb_module_get_ctx(module); const struct dsdb_schema *schema; unsigned int i; const struct dsdb_class *objectclass; struct ldb_result *acl_res; struct security_descriptor *sd; struct dom_sid *sid = NUL...
cwe
CWE-20
Unknown
print_trans(netdissect_options *ndo, const u_char *words, const u_char *data1, const u_char *buf, const u_char *maxbuf) { u_int bcc; const char *f1, *f2, *f3, *f4; const u_char *data, *param; const u_char *w = words + 1; int datalen, paramlen; if (request) { ND_TCHECK2(w[12 * 2], 2...
cwe
CWE-125
C/C++
TfLiteStatus Prepare(KernelType kernel_type, TfLiteContext* context, TfLiteNode* node) { auto* params = reinterpret_cast<TfLiteConvParams*>(node->builtin_data); OpData* data = reinterpret_cast<OpData*>(node->user_data); bool has_bias = node->inputs->size == 3; // Check number of inputs/out...
cwe
CWE-787
C/C++
/* * Copyright 2022 Thoughtworks, Inc. * * 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 agr...
cwe
CWE-532
Java
/* * Copyright (C) 2004-2018 ZNC, see the NOTICE file for details. * * 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 requi...
cwe
CWE-20
C/C++
/** * Copyright (c) 2006-2020, JGraph Ltd * Copyright (c) 2006-2020, draw.io AG */ var StorageDialog = function(editorUi, fn, rowLimit) { rowLimit = (rowLimit != null) ? rowLimit : 2; var div = document.createElement('div'); div.style.textAlign = 'center'; div.style.whiteSpace = 'nowrap'; div.style.paddingTo...
cwe
CWE-78
JavaScript
function getDeviceID($useRandomString = true) { $ip = md5(getRealIpAddr()); if (empty($_SERVER['HTTP_USER_AGENT'])) { $device = "unknowDevice-{$ip}"; $device .= '-' . intval(User::getId()); return $device; } if (empty($useRandomString)) { $device = 'ypt-' . get_browser_n...
cwe
CWE-79
PHP
/* * Nextcloud Android client application * * @author Tobias Kaminsky * Copyright (C) 2017 Tobias Kaminsky * Copyright (C) 2017 Nextcloud GmbH. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Softw...
cwe
CWE-212
Java
Finder::check() { QPDFTokenizer tokenizer; QPDFTokenizer::Token t = tokenizer.readToken(is, "finder", true); qpdf_offset_t offset = this->is->tell(); bool result = (t == QPDFTokenizer::Token(QPDFTokenizer::tt_word, str)); this->is->seek(offset - this->str.length(), SEEK_SET); return result; }
cwe
CWE-787
Unknown
compute_Perms_value_V5_clear(std::string const& encryption_key, QPDF::EncryptionData const& data, unsigned char k[16]) { // From algorithm 3.10 from the PDF 1.7 extension level 3 unsigned long long extended_perms = 0xffffffff00000000LL | data.getP(); ...
cwe
CWE-787
Unknown
func (p *BinaryProtocol) readStringBody(size int32) (value string, err error) { if size < 0 { return "", nil } if uint64(size) > p.trans.RemainingBytes() { return "", invalidDataLength } var buf []byte if int(size) <= len(p.buffer) { buf = p.buffer[0:size] } else { buf = make([]byte, size) } _, e := io...
cwe
CWE-770
Go
/* * GPAC - Multimedia Framework C SDK * * Authors: Jean Le Feuvre * Copyright (c) Telecom ParisTech 2000-2021 * All rights reserved * * This file is part of GPAC / mp4box application * * GPAC is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General P...
cwe
CWE-476
C/C++
static Image *ReadOneJNGImage(MngInfo *mng_info, const ImageInfo *image_info, ExceptionInfo *exception) { Image *alpha_image, *color_image, *image, *jng_image; ImageInfo *alpha_image_info, *color_image_info; MagickBooleanType logging; int unique_filenames; ssize_t y...
cwe
CWE-20
Unknown
ipmi_fru_print(struct ipmi_intf * intf, struct sdr_record_fru_locator * fru) { char desc[17]; uint8_t bridged_request = 0; uint32_t save_addr; uint32_t save_channel; int rc = 0; if (!fru) return __ipmi_fru_print(intf, 0); /* Logical FRU Device * dev_type == 0x10 * modifier * 0x00 = IPMI FRU Inventory...
cwe
CWE-120
Unknown
public function edit(Request $request, $id) { return $this->view('product::admin.product.edit', [ 'content_id'=>$id ]); }
cwe
CWE-79
PHP