code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
/** * Licensed to The Apereo Foundation under one or more contributor license * agreements. See the NOTICE file distributed with this work for additional * information regarding copyright ownership. * * * The Apereo Foundation licenses this file to you under the Educational * Community License, Version 2.0 (the ...
cwe
CWE-327
Java
/* * fs/ioprio.c * * Copyright (C) 2004 Jens Axboe <axboe@kernel.dk> * * Helper functions for setting/querying io priorities of processes. The * system calls closely mimmick getpriority/setpriority, see the man page for * those. The prio argument is a composite of prio class and prio data, where * the data argu...
cwe
CWE-416
C/C++
MagickExport void RegisterStaticModules(void) { size_t extent; ssize_t i; extent=sizeof(MagickModules)/sizeof(MagickModules[0]); for (i=0; i < (ssize_t) extent; i++) { if (MagickModules[i].registered == MagickFalse) { if (IsRightsAuthorized(ModulePolicyDomain,AllPolicyRights, ...
cwe
CWE-200
Unknown
parse() { // 获取数据 const info = antSword['ipcRenderer'].sendSync('shell-findOne', this.manager.opt['_id']); const conf = info['database'] || {}; // 刷新UI // 1.清空数据 this.tree.deleteChildItems(0); // 2.添加数据 let items = []; for (let _ in conf) { items.push({ id: `conn::${_}`...
cwe
CWE-79
JavaScript
"""Stock database model definitions.""" from __future__ import annotations import os from datetime import datetime, timedelta from decimal import Decimal, InvalidOperation from django.contrib.auth.models import User from django.core.exceptions import FieldError, ValidationError from django.core.validators import Min...
cwe
CWE-400
Python
void jpc_qmfb_split_colres(jpc_fix_t *a, int numrows, int numcols, int stride, int parity) { int bufsize = JPC_CEILDIVPOW2(numrows, 1); jpc_fix_t splitbuf[QMFB_SPLITBUFSIZE * JPC_QMFB_COLGRPSIZE]; jpc_fix_t *buf = splitbuf; jpc_fix_t *srcptr; jpc_fix_t *dstptr; register jpc_fix_t *srcptr2; register jpc_fix_t ...
cwe
CWE-189
Unknown
static void MSLStartElement(void *context,const xmlChar *tag, const xmlChar **attributes) { AffineMatrix affine, current; ChannelType channel; char key[MaxTextExtent], *value; const char *attribute, *keyword; double angle; DrawInfo *draw_info; ExceptionInfo ...
cwe
CWE-20
Unknown
public CBC() { super(new CBCBlockCipher(new AESFastEngine()), 128); }
cwe
CWE-310
Java
static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception) { #define ThrowDCMException(exception,message) \ { \ if (info.scale != (Quantum *) NULL) \ info.scale=(Quantum *) RelinquishMagickMemory(info.scale); \ if (data != (unsigned char *) NULL) \ data=(unsigned char *) RelinquishMagi...
cwe
CWE-20
C/C++
CURLcode Curl_auth_create_plain_message(struct Curl_easy *data, const char *userp, const char *passwdp, char **outptr, size_t *outlen) { CURLcode result; char *plainauth; size_t ulen; size_t p...
cwe
CWE-119
C/C++
qedi_dbg_info(struct qedi_dbg_ctx *qedi, const char *func, u32 line, u32 level, const char *fmt, ...) { va_list va; struct va_format vaf; char nfunc[32]; memset(nfunc, 0, sizeof(nfunc)); memcpy(nfunc, func, sizeof(nfunc) - 1); va_start(va, fmt); vaf.fmt = fmt; vaf.va = &va; if (!(qedi_dbg_log & leve...
cwe
CWE-125
C/C++
/* * 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
def getCommentsByPostid(self,postid,userid): sqlText="select (select Count(*) from comment_like where comments.commentid = comment_like.commentid) as like,(select Count(*) from comment_like where comments.commentid = comment_like.commentid and comment_like.userid=%d) as flag,commentid,name,comment from users,co...
cwe
CWE-89
Python
/* jshint unused: false */ /* global Noty, Blob, window, atob, Joi, sigma, $, tippy, document, _, arangoHelper, frontendConfig, sessionStorage, localStorage, XMLHttpRequest */ (function () { 'use strict'; var isCoordinator = null; window.isCoordinator = function (callback) { if (isCoordinator === null) { ...
cwe
CWE-918
C/C++
function systemEndpoints(app) { if (!app) return; app.get("/ping", (_, response) => { response.status(200).json({ online: true }); }); app.get("/migrate", async (_, response) => { await validateTablePragmas(true); response.sendStatus(200); }); app.get("/env-dump", async (_, response) => { ...
cwe
CWE-305
JavaScript
find_link_ref(struct link_ref **references, uint8_t *name, size_t length) { unsigned int hash = hash_link_ref(name, length); struct link_ref *ref = NULL; ref = references[hash % REF_TABLE_SIZE]; while (ref != NULL) { if (ref->id == hash) return ref; ref = ref->next; } return NULL; }
cwe
CWE-327
C/C++
void snd_pcm_detach_substream(struct snd_pcm_substream *substream) { struct snd_pcm_runtime *runtime; if (PCM_RUNTIME_CHECK(substream)) return; runtime = substream->runtime; if (runtime->private_free != NULL) runtime->private_free(runtime); free_pages_exact(runtime->status, PAGE_ALIGN(sizeof(struct s...
cwe
CWE-125
Unknown
// 话题(帖子)相关js功能 (function(){ emojify.setConfig({ // emojify_tag_type : 'span', only_crawl_id : null, img_dir : SG.EMOJI_DOMAIN, ignored_tags : { //忽略以下几种标签内的emoji识别 'SCRIPT' : 1, 'TEXTAREA': 1, 'A' : 1, 'PRE' : 1, 'CODE' : 1 } }); SG.Topics = function(){} SG....
cwe
CWE-79
Go
import asyncio import re from datetime import timedelta from typing import Any, Dict, List, Mapping, NamedTuple, Optional, Tuple, Union import arrow import dateutil.parser import discord.errors import regex from async_rediscache import RedisCache from dateutil.relativedelta import relativedelta from discord import Col...
cwe
CWE-20
Python
flatpak_pull_from_bundle (OstreeRepo *repo, GFile *file, const char *remote, const char *ref, gboolean require_gpg_signature, GCancellable *cancellable, ...
cwe
CWE-269
C/C++
/* * L2TPv3 IP encapsulation support for IPv6 * * Copyright (c) 2012 Katalix Systems Ltd * * 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 ...
cwe
CWE-200
C/C++
/* * pkcs15-sc-hsm.c : Initialize PKCS#15 emulation * * Copyright (C) 2012 Andreas Schwier, CardContact, Minden, Germany * * This 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 *...
cwe
CWE-119
C/C++
// mkerrors.sh // Code generated by the command above; see README.md. DO NOT EDIT. // +build arm,openbsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- _const.go package unix import "syscall" const ( AF_APPLETALK = 0x10 AF_BLUETOOTH = 0x20 AF_CCITT...
cwe
CWE-287
Go
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { TfLiteTensor* output = GetOutput(context, node, kOutputTensor); switch (output->type) { case kTfLiteFloat32: { return ReverseSequenceHelper<float>(context, node); } case kTfLiteUInt8: { return ReverseSequenceHelper<uint8_t>(conte...
cwe
CWE-787
C/C++
/* * * (C) 2013-17 - ntop.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 3 of the License, or * (at your option) any later version. * * This program is distribu...
cwe
CWE-476
C/C++
function b(a){var b={};return r.filterNode(b,a)}
cwe
CWE-1321
JavaScript
if(!self.define){const e=e=>{"require"!==e&&(e+=".js");let r=Promise.resolve();return i[e]||(r=new Promise((async r=>{if("document"in self){const i=document.createElement("script");i.src=e,document.head.appendChild(i),i.onload=r}else importScripts(e),r()}))),r.then((()=>{if(!i[e])throw new Error(`Module ${e} didn’t reg...
cwe
CWE-284
Java
flatpak_run_add_environment_args (FlatpakBwrap *bwrap, const char *app_info_path, FlatpakRunFlags flags, const char *app_id, FlatpakContext *context, ...
cwe
CWE-74
Unknown
static inline void ModulateHCL(const double percent_hue, const double percent_chroma,const double percent_luma,double *red, double *green,double *blue) { double hue, luma, chroma; /* Increase or decrease color luma, chroma, or hue. */ ConvertRGBToHCL(*red,*green,*blue,&hue,&chroma,&luma); ...
cwe
CWE-835
Unknown
//////////////////////////////////////////////////////////////////////////// // **** WAVPACK **** // // Hybrid Lossless Wavefile Compressor // // Copyright (c) 1998 - 2016 David Bryant. // // ...
cwe
CWE-787
C/C++
/* 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-354
C/C++
parse_range(char *str, size_t file_sz, int *nranges) { static struct range ranges[MAX_RANGES]; int i = 0; char *p, *q; /* Extract range unit */ if ((p = strchr(str, '=')) == NULL) return (NULL); *p++ = '\0'; /* Check if it's a bytes range spec */ if (strcmp(str, "bytes") != 0) return (NULL...
cwe
CWE-770
C/C++
GF_Err gf_isom_box_parse_ex(GF_Box **outBox, GF_BitStream *bs, u32 parent_type, Bool is_root_box) { u32 type, uuid_type, hdr_size; u64 size, start, payload_start, end; char uuid[16]; GF_Err e; GF_Box *newBox; Bool skip_logs = gf_bs_get_cookie(bs) ? GF_TRUE : GF_FALSE; Bool is_special = GF_TRUE; if ((bs == NULL...
cwe
CWE-476
C/C++
# -*- coding: utf-8 -*- from django.conf import settings from django.contrib.auth import login as django_login from django.contrib.auth import logout as django_logout from django.core.exceptions import ObjectDoesNotExist from django.utils.decorators import method_decorator from django.utils.translation import ugettext_...
cwe
CWE-522
Python
/* Copyright (C) 2013, 2015, Alexey Botchkov and SkySQL Ab 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; version 2 of the License. This program is distributed in the hope that it will ...
cwe
CWE-404
C/C++
public static function sessionDataDecode(&$var, $checkIs = null) { if (self::$base64encodeSessionData) { $data = @unserialize(@base64_decode($var)); } else { $data = $var; } $chk = true; if ($checkIs) { switch ($checkIs) { case 'array': $chk = is_array($data); break; case 'string': ...
cwe
CWE-89
JavaScript
/* * apply.c * * Copyright (C) Linus Torvalds, 2005 * * This applies patches on top of some (arbitrary) version of the SCM. * */ #include "cache.h" #include "config.h" #include "object-store.h" #include "blob.h" #include "delta.h" #include "diff.h" #include "dir.h" #include "xdiff-interface.h" #include "ll-merg...
cwe
CWE-22
C/C++
static inline void free_ep_req(struct usb_ep *ep, struct usb_request *req) { kfree(req->buf); usb_ep_free_request(ep, req); }
cwe
CWE-415
Unknown
function mt(e){return N()(e).call(e,(function(e){return void 0!==e}))}
cwe
CWE-200
JavaScript
TfLiteStatus EvalHashtableImport(TfLiteContext* context, TfLiteNode* node) { const TfLiteTensor* input_resource_id_tensor = GetInput(context, node, kInputResourceIdTensor); const int resource_id = input_resource_id_tensor->data.i32[0]; const TfLiteTensor* key_tensor = GetInput(context, node, kKeyTensor); ...
cwe
CWE-125
C/C++
bool UnpackOriginPermissions(const std::vector<std::string>& origins_input, const PermissionSet& required_permissions, const PermissionSet& optional_permissions, bool allow_file_access, UnpackPermissionSe...
cwe
CWE-79
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
static Image *ReadFPXImage(const ImageInfo *image_info,ExceptionInfo *exception) { FPXColorspace colorspace; FPXImageComponentDesc *alpha_component, *blue_component, *green_component, *red_component; FPXImageDesc fpx_info; FPXImageHandle *flashpix; FPXStatus fpx_status; ...
cwe
CWE-120
C/C++
int del_match_busid(char *busid) { int idx; int ret = -1; spin_lock(&busid_table_lock); idx = get_busid_idx(busid); if (idx < 0) goto out; /* found */ ret = 0; if (busid_table[idx].status == STUB_BUSID_OTHER) memset(busid_table[idx].name, 0, BUSID_SIZE); if ((busid_table[idx].status != STUB_BUSID_OTHER...
cwe
CWE-362
Unknown
jSuites.toolbar = (function(el, options) { var obj = {}; obj.options = {}; // Default configuration var defaults = { app: null, container: false, badge: false, title: false, responsive: false, items: [], } // Loop through our object for (var ...
cwe
CWE-79
JavaScript
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
cwe
CWE-119
C/C++
current_quote( oparg_T *oap, long count, int include, // TRUE == include quote char int quotechar) // Quote character { char_u *line = ml_get_curline(); int col_end; int col_start = curwin->w_cursor.col; int inclusive = FALSE; int vis_empty = TRUE; // Visual selection <= 1 char...
cwe
CWE-787
C/C++
static thp_job_t *_thp_job_create(thp_fun fun_p, void *arg) { thp_job_t *tj = malloc(sizeof(thp_job_t)); tj->fun = fun_p; tj->fun_param = arg; return tj; }
cwe
CWE-476
C/C++
!function(){if("undefined"!=typeof Prism&&"undefined"!=typeof document){var v=/(?:^|\s)command-line(?:\s|$)/,g="command-line-prompt",p="".startsWith?function(e,t){return e.startsWith(t)}:function(e,t){return 0===e.indexOf(t)},d="".endsWith?function(e,t){return e.endsWith(t)}:function(e,t){var n=e.length;return e.substr...
cwe
CWE-79
JavaScript
static int tsc210x_load(QEMUFile *f, void *opaque, int version_id) { TSC210xState *s = (TSC210xState *) opaque; int64_t now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); int i; s->x = qemu_get_be16(f); s->y = qemu_get_be16(f); s->pressure = qemu_get_byte(f); s->state = qemu_get_byte(f); s->...
cwe
CWE-119
Unknown
void FrameLoader::ReplaceDocumentWhileExecutingJavaScriptURL( const String& source, Document* owner_document) { Document* document = frame_->GetDocument(); if (!document_loader_ || document->PageDismissalEventBeingDispatched() != Document::kNoDismissal) return; UseCounter::Count(*document, WebF...
cwe
CWE-285
C/C++
static int virtio_net_load(QEMUFile *f, void *opaque, int version_id) { VirtIONet *n = opaque; VirtIODevice *vdev = VIRTIO_DEVICE(n); int ret, i, link_down; if (version_id < 2 || version_id > VIRTIO_NET_VM_VERSION) return -EINVAL; ret = virtio_load(vdev, f); if (ret) { return r...
cwe
CWE-119
Unknown
void *hashtable_iter_at(hashtable_t *hashtable, const char *key) { pair_t *pair; size_t hash; bucket_t *bucket; hash = hash_str(key); bucket = &hashtable->buckets[hash % num_buckets(hashtable)]; pair = hashtable_find_pair(hashtable, bucket, key, hash); if(!pair) return NULL; r...
cwe
CWE-310
Unknown
TfLiteStatus NonMaxSuppressionMultiClass(TfLiteContext* context, TfLiteNode* node, OpData* op_data) { // Get the input tensors const TfLiteTensor* input_box_encodings = GetInput(context, node, kInputTensorBoxEncodings); const TfLiteTensor* input_class_predictions = ...
cwe
CWE-787
C/C++
static int crypto_ccm_auth(struct aead_request *req, struct scatterlist *plain, unsigned int cryptlen) { struct crypto_ccm_req_priv_ctx *pctx = crypto_ccm_reqctx(req); struct crypto_aead *aead = crypto_aead_reqtfm(req); struct crypto_ccm_ctx *ctx = crypto_aead_ctx(aead); AHASH_REQUEST_ON_STACK(ahreq, ctx->mac...
cwe
CWE-119
C/C++
TfLiteRegistration CancelOpRegistration() { TfLiteRegistration reg = {nullptr, nullptr, nullptr, nullptr}; // Set output size to the input size in CancelOp::Prepare(). Code exists to // have a framework in Prepare. The input and output tensors are not used. reg.prepare = [](TfLiteContext* context, TfLi...
cwe
CWE-787
C/C++
static int mincore_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end, struct mm_walk *walk) { spinlock_t *ptl; struct vm_area_struct *vma = walk->vma; pte_t *ptep; unsigned char *vec = walk->private; int nr = (end - addr) >> PAGE_SHIFT; ptl = pmd_trans_huge_lock(pmd, vma); if (ptl) { memset(vec, ...
cwe
CWE-200
Unknown
static int send_solid_rect(VncState *vs) { size_t bytes; tight_pack24(vs, vs->tight.tight.buffer, 1, &vs->tight.tight.offset); bytes = 3; } else { bytes = vs->clientds.pf.bytes_per_pixel; }
cwe
CWE-787
C/C++
import qrcode import qrcode.image.svg from django.conf import settings from django.contrib.auth import REDIRECT_FIELD_NAME from django.contrib.auth.views import SuccessURLAllowedHostsMixin from django.http import HttpResponse from django.shortcuts import resolve_url from django.urls import reverse from django.utils.dec...
cwe
CWE-863
Python
'use strict' const clones = require('clones') const hasWindow = (typeof window !== 'undefined') exports.hasWindow = hasWindow const hasGlobal = (typeof global !== 'undefined') exports.hasGlobal = hasGlobal const NON_IDENTIFIER = /^\d|-|^(break|case|catch|continue|debugger|default|delete|do|else|finally|for|function...
cwe
CWE-94
JavaScript
int blk_rq_map_user_iov(struct request_queue *q, struct request *rq, struct rq_map_data *map_data, const struct iov_iter *iter, gfp_t gfp_mask) { bool copy = false; unsigned long align = q->dma_pad_mask | queue_dma_alignment(q); struct bio *bio = NULL; struct iov_iter i; int ret; if (map_data) copy ...
cwe
CWE-416
C/C++
parse_netscreen_packet(FILE_T fh, struct wtap_pkthdr *phdr, Buffer* buf, char *line, int *err, gchar **err_info) { int sec; int dsec; char cap_int[NETSCREEN_MAX_INT_NAME_LENGTH]; char direction[2]; guint pkt_len; char cap_src[13]; char cap_dst[13]; guint8 *pd; gchar *p; int n, i = 0; ...
cwe
CWE-20
C/C++
#ifndef JSI_LITE_ONLY #ifndef JSI_AMALGAMATION #include "jsiInt.h" #endif /* TODO: handle delete */ #define ChkRegexp(_this, funcPtr, dest) \ if (_this->vt == JSI_VT_OBJECT && _this->d.obj->ot == JSI_OT_FUNCTION && \ _this->d.obj->__proto__ == interp->RegExp_prototype->d.obj->__proto__ ) { \ skip =...
cwe
CWE-120
C/C++
""" Copyright 2006-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-434
Python
static bool anal_fcn_data (RCore *core, const char *input) { RAnalFunction *fcn = r_anal_get_fcn_in (core->anal, core->offset, -1); ut32 fcn_size = r_anal_function_size_from_entry (fcn); if (fcn) { int i; bool gap = false; ut64 gap_addr = UT64_MAX; char *bitmap = calloc (1, fcn_size); if (bitmap) { RAna...
cwe
CWE-703
C/C++
void Compute(OpKernelContext* context) override { const Tensor* reverse_index_map_t; const Tensor* grad_values_t; OP_REQUIRES_OK(context, context->input("reverse_index_map", &reverse_index_map_t)); OP_REQUIRES_OK(context, context->input("grad_values", &grad_values_t)); const CPUD...
cwe
CWE-617
C/C++
xmlDictComputeBigQKey(const xmlChar *prefix, int plen, const xmlChar *name, int len) { uint32_t hash; int i; hash = 0; for (i = 0;i < plen; i++) { hash += prefix[i]; hash += (hash << 10); hash ^= (hash >> 6); } hash += ':'; hash += (hash << 10); hash ^= ...
cwe
CWE-399
Unknown
static int do_last(struct nameidata *nd, struct file *file, const struct open_flags *op) { struct dentry *dir = nd->path.dentry; int open_flag = op->open_flag; bool will_truncate = (open_flag & O_TRUNC) != 0; bool got_write = false; int acc_mode = op->acc_mode; unsigned seq; struct inode *inode; struct pat...
cwe
CWE-284
Unknown
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { auto* params = reinterpret_cast<TfLiteSubParams*>(node->builtin_data); OpData* data = reinterpret_cast<OpData*>(node->user_data); const TfLiteTensor* input1 = GetInput(context, node, kInputTensor1); const TfLiteTensor* input2 = GetInput(context, nod...
cwe
CWE-787
C/C++
# -*- coding: utf-8 -*- # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _ from datetime import timedelta from frappe.desk.form import assign_to from frappe.utils.jinja import ...
cwe
CWE-79
Python
package native import ( "bytes" "fmt" "text/template" types "github.com/go-vela/types/yaml" "github.com/Masterminds/sprig" yaml "gopkg.in/yaml.v2" ) // Render combines the template with the step in the yaml pipeline. func Render(tmpl string, s *types.Step) (types.StepSlice, error) { buffer := new(bytes.Buff...
cwe
CWE-78
Go
magic_setparam(struct magic_set *ms, int param, const void *val) { switch (param) { case MAGIC_PARAM_INDIR_MAX: ms->indir_max = *(const size_t *)val; return 0; case MAGIC_PARAM_NAME_MAX: ms->name_max = *(const size_t *)val; return 0; case MAGIC_PARAM_ELF_PHNUM_MAX: ms->elf_phnum_max = *(const size_t *)val...
cwe
CWE-399
C/C++
int touch_file(const char *path, bool parents, usec_t stamp, uid_t uid, gid_t gid, mode_t mode) { _cleanup_close_ int fd; int r; assert(path); if (parents) mkdir_parents(path, 0755); fd = open(path, O_WRONLY|O_CREAT|O_CLOEXEC|O_NOCTTY, mode > 0 ? mode : 0644...
cwe
CWE-264
C/C++
// // PDF stream functions for PDFio. // // Copyright © 2021-2023 by Michael R Sweet. // // Licensed under Apache License v2.0. See the file "LICENSE" for more // information. // // // Include necessary headers... // #include "pdfio-private.h" // // Local functions... // static unsigned char stream_paeth(unsigned...
cwe
CWE-770
C/C++
// SPDX-FileCopyrightText: 2021 Florian Märkl <info@florianmaerkl.de> // SPDX-FileCopyrightText: 2021 keegan // SPDX-FileCopyrightText: 2020-2021 Francesco Tamagni <mrmacete@protonmail.ch> // SPDX-FileCopyrightText: 2018 pancake <pancake@nopcode.org> // SPDX-License-Identifier: LGPL-3.0-only #include "dyldcache.h" #i...
cwe
CWE-787
C/C++
static int do_ipv6_setsockopt(struct sock *sk, int level, int optname, char __user *optval, unsigned int optlen) { struct ipv6_pinfo *np = inet6_sk(sk); struct net *net = sock_net(sk); int val, valbool; int retv = -ENOPROTOOPT; bool needs_rtnl = setsockopt_needs_rtnl(optname); if (!optval) val = 0; else...
cwe
CWE-284
Unknown
Pl_LZWDecoder::sendNextCode() { int high = this->byte_pos; int med = (this->byte_pos + 1) % 3; int low = (this->byte_pos + 2) % 3; int bits_from_high = 8 - this->bit_pos; int bits_from_med = this->code_size - bits_from_high; int bits_from_low = 0; if (bits_from_med > 8) { bits_from_low...
cwe
CWE-787
Unknown
async function updateUser (req, res, next) { try { const requesterShortName = req.ctx.org const requesterUsername = req.ctx.user const username = req.ctx.params.username const shortName = req.ctx.params.shortname const newUser = new User() let newOrgShortName let changesRequirePrivilegedRo...
cwe
CWE-863
JavaScript
lldp_private_8023_print(netdissect_options *ndo, const u_char *tptr, u_int tlv_len) { int subtype, hexdump = FALSE; if (tlv_len < 4) { return hexdump; } subtype = *(tptr+3); ND_PRINT((ndo, "\n\t %s Subtype (%u)", tok2str(lldp_8023_subtype_values, "unknow...
cwe
CWE-125
C/C++
# -*- coding: utf-8 -*- ############################################################################## # 2011 E2OpenPlugins # # # # This file is open source software; you can redistribute...
cwe
CWE-22
Python
static s32 gf_media_vvc_read_vps_bs_internal(GF_BitStream *bs, VVCState *vvc, Bool stop_at_vps_ext) { u32 i, j; s32 vps_id; VVC_VPS *vps; Bool vps_default_ptl_dpb_hrd_max_tid_flag=0; //nalu header already parsed vps_id = gf_bs_read_int_log(bs, 4, "vps_id"); if (vps_id >= 16) return -1; if (!vps_id) { GF_LOG(...
cwe
CWE-190
C/C++
static int filter_frame(AVFilterLink *inlink, AVFrame *frame) { AVFilterContext *ctx = inlink->dst; FieldOrderContext *s = ctx->priv; AVFilterLink *outlink = ctx->outputs[0]; int h, plane, line_step, line_size, line; uint8_t *data; if (!frame->interlaced_frame || frame-...
cwe
CWE-787
Unknown
void SparseBitSet::initFromRanges(const uint32_t* ranges, size_t nRanges) { if (nRanges == 0) { mMaxVal = 0; mIndices.reset(); mBitmaps.reset(); return; } mMaxVal = ranges[nRanges * 2 - 1]; size_t indexSize = (mMaxVal + kPageMask) >> kLogValuesPerPage; mIndices.reset(new uint32_t[ind...
cwe
CWE-20
C/C++
void ServerConnectionImpl::onUrl(const char* data, size_t length) { if (active_request_.has_value()) { active_request_.value().request_url_.append(data, length); } }
cwe
CWE-770
Unknown
/* * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. * Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org> * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following condition...
cwe
CWE-78
C/C++
R_API RBinJavaAttrInfo *r_bin_java_local_variable_type_table_attr_new(RBinJavaObj *bin, ut8 *buffer, ut64 sz, ut64 buf_offset) { RBinJavaLocalVariableTypeAttribute *lvattr; ut64 offset = 6; ut32 i = 0; RBinJavaAttrInfo *attr = r_bin_java_default_attr_new (bin, buffer, sz, 0); if (!attr) { return NULL; } attr->...
cwe
CWE-119
Unknown
function K(t){return f(t)==="[object WebAssembly.Module]"}
cwe
CWE-1333
JavaScript
static void build_l4proto_tcp(const struct nf_conntrack *ct, struct nethdr *n) { ct_build_group(ct, ATTR_GRP_ORIG_PORT, n, NTA_PORT, sizeof(struct nfct_attr_grp_port)); if (!nfct_attr_is_set(ct, ATTR_TCP_STATE)) return; ct_build_u8(ct, ATTR_TCP_STATE, n, NTA_TCP_STATE); if (CONFIG(sync).tcp_window_...
cwe
CWE-17
C/C++
QPDFPageObjectHelper::getAnnotations(std::string const& only_subtype) { std::vector<QPDFAnnotationObjectHelper> result; QPDFObjectHandle annots = this->oh.getKey("/Annots"); if (annots.isArray()) { size_t nannots = annots.getArrayNItems(); for (size_t i = 0; i < nannots; ++i) { ...
cwe
CWE-787
Unknown
ipv6_dup_options(struct sock *sk, struct ipv6_txoptions *opt) { struct ipv6_txoptions *opt2; opt2 = sock_kmalloc(sk, opt->tot_len, GFP_ATOMIC); if (opt2) { long dif = (char *)opt2 - (char *)opt; memcpy(opt2, opt, opt->tot_len); if (opt2->hopopt) *((char **)&opt2->hopopt) += dif; if (opt2->dst0opt) *((...
cwe
CWE-416
C/C++
keepalived_main(int argc, char **argv) { bool report_stopped = true; struct utsname uname_buf; char *end; int exit_code = KEEPALIVED_EXIT_OK; /* Ensure time_now is set. We then don't have to check anywhere * else if it is set. */ set_time_now(); /* Save command line options in case need to log them later */ ...
cwe
CWE-200
Unknown
readconf_main(void) { int sep = 0; struct stat statbuf; uschar *s, *filename; uschar *list = config_main_filelist; /* Loop through the possible file names */ while((filename = string_nextinlist(&list, &sep, big_buffer, big_buffer_size)) != NULL) { /* Cut out all the fancy processing unless specifically wan...
cwe
CWE-264
C/C++
int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, version, stream_size) z_streamp strm; int level; int method; int windowBits; int memLevel; int strategy; const char *version; int stream_size; { deflate_state *s; int wrap = 1; ...
cwe
CWE-284
Unknown
/* Copyright 2020 The Kubernetes 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, softwar...
cwe
CWE-20
Java
void MediaElementAudioSourceNode::OnCurrentSrcChanged(const KURL& current_src) { GetMediaElementAudioSourceHandler().OnCurrentSrcChanged(current_src); }
cwe
CWE-20
C/C++
static int ssl3_get_record(SSL *s) { int ssl_major,ssl_minor,al; int enc_err,n,i,ret= -1; SSL3_RECORD *rr; SSL_SESSION *sess; unsigned char *p; unsigned char md[EVP_MAX_MD_SIZE]; short version; unsigned mac_size; int clear=0; size_t extra; rr= &(s->s3->rrec); sess=s->session; if (s->options & SSL_OP_MIC...
cwe
CWE-310
Unknown
/* 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
/* liblouis Braille Translation and Back-Translation Library Based on the Linux screenreader BRLTTY, copyright (C) 1999-2006 by The BRLTTY Team Copyright (C) 2004, 2005, 2006 ViewPlus Technologies, Inc. www.viewplus.com Copyright (C) 2004, 2005, 2006 JJB Software, Inc. www.jjb-software.com Copyright (C...
cwe
CWE-787
C/C++
struct ipv6_txoptions *ipv6_update_options(struct sock *sk, struct ipv6_txoptions *opt) { if (inet_sk(sk)->is_icsk) { if (opt && !((1 << sk->sk_state) & (TCPF_LISTEN | TCPF_CLOSE)) && inet_sk(sk)->inet_daddr != LOOPBACK4_IPV6) { struct inet_connection_sock *icsk = inet_csk(sk); icsk->icsk_e...
cwe
CWE-284
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-354
C/C++