code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
xmlAddID(xmlValidCtxtPtr ctxt, xmlDocPtr doc, const xmlChar *value, xmlAttrPtr attr) { xmlIDPtr ret; xmlIDTablePtr table; if (doc == NULL) { return(NULL); } if (value == NULL) { return(NULL); } if (attr == NULL) { return(NULL); } /* * Create the ID table if needed....
cwe
CWE-416
Unknown
int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, const ASN1_ITEM *it, int tag, int aclass, char opt, ASN1_TLC *ctx) { const ASN1_TEMPLATE *tt, *errtt = NULL; const ASN1_COMPAT_FUNCS *cf; const ASN1_EXTERN_FUNCS *ef; const ASN1_AUX *aux...
cwe
CWE-17
Unknown
def host_passes(self, host_state, filter_properties): context = filter_properties['context'] scheduler_hints = filter_properties.get('scheduler_hints') or {} me = host_state.host affinity_uuids = scheduler_hints.get('different_host', []) if isinstance(affinity_uuids, basestring)...
cwe
CWE-20
Python
DWORD WtsSessionProcessDelegate::Core::GetExitCode() { DCHECK(main_task_runner_->BelongsToCurrentThread()); DWORD exit_code = CONTROL_C_EXIT; if (worker_process_.IsValid()) { if (!::GetExitCodeProcess(worker_process_, &exit_code)) { LOG_GETLASTERROR(INFO) << "Failed to query the exit code...
cwe
CWE-399
C/C++
static int flakey_ioctl(struct dm_target *ti, unsigned int cmd, unsigned long arg) { struct flakey_c *fc = ti->private; return __blkdev_driver_ioctl(fc->dev->bdev, fc->dev->mode, cmd, arg); }
cwe
CWE-264
C/C++
void ExtensionsGuestViewMessageFilter::MimeHandlerViewGuestCreatedCallback( int element_instance_id, int embedder_render_process_id, int embedder_render_frame_id, int32_t plugin_frame_routing_id, const gfx::Size& element_size, mime_handler::BeforeUnloadControlPtrInfo before_unload_control, b...
cwe
CWE-362
C/C++
static void rpza_decode_stream(RpzaContext *s) { int width = s->avctx->width; int stride = s->frame->linesize[0] / 2; int row_inc = stride - 4; int chunk_size; uint16_t colorA = 0, colorB; uint16_t color4[4]; uint16_t ta, tb; uint16_t *pixels = (uint16_t *)s->frame->data[0]; int row...
cwe
CWE-787
Unknown
transformCreateStmt(CreateStmt *stmt, const char *queryString) { ParseState *pstate; CreateStmtContext cxt; List *result; List *save_alist; ListCell *elements; Oid namespaceid; Oid existing_relid; ParseCallbackState pcbstate; bool is_foreign_table = IsA(stmt, CreateForeignTableStmt); /* * We m...
cwe
CWE-94
Unknown
libvirt_vmessage(xentoollog_logger *logger_in, xentoollog_level level, int errnoval, const char *context, const char *format, va_list args) { xentoollog_logger_libvirt *lg = (xentoollog_logger_libvirt *)logger_in; FILE *logFile...
cwe
CWE-703
Unknown
import logging import requests from flask import redirect, url_for, Blueprint, flash, request, session from flask_oauthlib.client import OAuth from redash import models, settings from redash.authentication import ( create_and_login_user, logout_and_redirect_to_index, get_next_path, ) from redash.authentica...
cwe
CWE-352
Python
jetp3852_print_page(gx_device_printer *pdev, gp_file *prn_stream) { #define DATA_SIZE (LINE_SIZE * 8) unsigned int cnt_2prn; unsigned int count,tempcnt; unsigned char vtp,cntc1,cntc2; int line_size_color_plane; byte data[DATA_SIZE]; byte plane_data[LINE_SIZE * 3]; /* Set initial condition...
cwe
CWE-120
C/C++
# # Copyright (C) 2009-2020 the sqlparse authors and contributors # <see AUTHORS file> # # This module is part of python-sqlparse and is released under # the BSD License: https://opensource.org/licenses/BSD-3-Clause import re from sqlparse import sql, tokens as T from sqlparse.utils import split_unquoted_newlines c...
cwe
CWE-400
Python
package io.swagger.codegen.languages; import java.io.File; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.ListIterator; import java.util.Map; import java.util.regex.Pattern; import io.swagger.codegen.languages.features.No...
cwe
CWE-732
Java
void HTMLFormElement::ScheduleFormSubmission(FormSubmission* submission) { DCHECK(submission->Method() == FormSubmission::kPostMethod || submission->Method() == FormSubmission::kGetMethod); DCHECK(submission->Data()); DCHECK(submission->Form()); if (submission->Action().IsEmpty()) return; if (Get...
cwe
CWE-190
C/C++
long VideoTrack::Seek( long long time_ns, const BlockEntry*& pResult) const { const long status = GetFirst(pResult); if (status < 0) //buffer underflow, etc return status; assert(pResult); if (pResult->EOS()) return 0; const Cluster* pCluster = pResult->GetCluster(); ...
cwe
CWE-119
C/C++
html: function (element, attrs, content) { return '<div align="' + (attrs.defaultattr || 'left') + '">' + content + '</div>'; },
cwe
CWE-79
JavaScript
int X509_aux_print(BIO *out, X509 *x, int indent) { char oidstr[80], first; STACK_OF(ASN1_OBJECT) *trust, *reject; const unsigned char *alias, *keyid; int keyidlen; int i; if (X509_trusted(x) == 0) return 1; trust = X509_get0_trust_objects(x); reject = X509_get0_reject_objects(x)...
cwe
CWE-125
Unknown
static int snd_usb_create_streams(struct snd_usb_audio *chip, int ctrlif) { struct usb_device *dev = chip->dev; struct usb_host_interface *host_iface; struct usb_interface_descriptor *altsd; void *control_header; int i, protocol; /* find audiocontrol interface */ host_iface = &usb_ifnum_to_if(dev, ctrlif)...
cwe
CWE-125
C/C++
NO_INLINE JsVar *__jspeAssignmentExpression(JsVar *lhs) { if (lex->tk=='=' || lex->tk==LEX_PLUSEQUAL || lex->tk==LEX_MINUSEQUAL || lex->tk==LEX_MULEQUAL || lex->tk==LEX_DIVEQUAL || lex->tk==LEX_MODEQUAL || lex->tk==LEX_ANDEQUAL || lex->tk==LEX_OREQUAL || lex->tk==LEX_XOREQUAL || lex->tk==LEX_RSHIFTE...
cwe
CWE-125
Unknown
static struct clk ** __init sunxi_divs_clk_setup(struct device_node *node, const struct divs_data *data) { struct clk_onecell_data *clk_data; const char *parent; const char *clk_name; struct clk **clks, *pclk; struct clk_hw *gate_hw, *rate_hw; const struct clk_ops *rate_ops; struct clk_gate *gate = NULL; ...
cwe
CWE-476
C/C++
long Segment::DoLoadClusterUnknownSize( long long& pos, long& len) { assert(m_pos < 0); assert(m_pUnknownSize); #if 0 assert(m_pUnknownSize->GetElementSize() < 0); //TODO: verify this const long long element_start = m_pUnknownSize->m_element_start; pos = -m_pos; assert(pos > element_...
cwe
CWE-119
C/C++
lldp_decode(struct lldpd *cfg, char *frame, int s, struct lldpd_hardware *hardware, struct lldpd_chassis **newchassis, struct lldpd_port **newport) { struct lldpd_chassis *chassis; struct lldpd_port *port; char lldpaddr[ETHER_ADDR_LEN]; const char dot1[] = LLDP_TLV_ORG_DOT1; const char dot3[] = LLDP_TLV_OR...
cwe
CWE-400
C/C++
from __future__ import absolute_import import cgi import email.utils import json import logging import mimetypes import os import platform import re import shutil import sys from pip._vendor import requests, urllib3 from pip._vendor.cachecontrol import CacheControlAdapter from pip._vendor.cachecontrol.caches import F...
cwe
CWE-22
Python
xmlXPtrNewRangeNodePoint(xmlNodePtr start, xmlXPathObjectPtr end) { xmlXPathObjectPtr ret; if (start == NULL) return(NULL); if (end == NULL) return(NULL); if (start->type != XPATH_POINT) return(NULL); if (end->type != XPATH_POINT) return(NULL); ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xm...
cwe
CWE-119
Unknown
package api import ( "context" "encoding/json" "errors" "fmt" "io" "io/ioutil" "net/http" "net/url" "os" "path" "path/filepath" "sort" "strings" "sync" "github.com/grafana/grafana-plugin-sdk-go/backend" "github.com/grafana/grafana/pkg/api/dtos" "github.com/grafana/grafana/pkg/api/response" "github.c...
cwe
CWE-522
Go
tBTA_AV_EVT bta_av_proc_meta_cmd(tAVRC_RESPONSE* p_rc_rsp, tBTA_AV_RC_MSG* p_msg, uint8_t* p_ctype) { tBTA_AV_EVT evt = BTA_AV_META_MSG_EVT; uint8_t u8, pdu, *p; uint16_t u16; tAVRC_MSG_VENDOR* p_vendor = &p_msg->msg.vendor; pdu = *(p_vendor->p_vendor_data); p_rc_rsp->pdu = p...
cwe
CWE-125
C/C++
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
cwe
CWE-119
C/C++
/* * Copyright (c) 2006-2020, JGraph Ltd * * This provides an indirection to make sure the mxClient.js * loads before the dependent classes below are loaded. This * is used for development mode where the JS is in separate * files and the mxClient.js loads other files. */ if (!mxIsElectron && location.protocol !...
cwe
CWE-79
JavaScript
static int jpc_calcssmant(jpc_fix_t stepsize) { int n; int e; int m; n = jpc_firstone(stepsize); e = n - JPC_FIX_FRACBITS; if (n >= 11) { m = (stepsize >> (n - 11)) & 0x7ff; } else { m = (stepsize & ((1 << n) - 1)) << (11 - n); } return m; }
cwe
CWE-617
Unknown
bool asn1_write_BOOLEAN_context(struct asn1_data *data, bool v, int context) { asn1_push_tag(data, ASN1_CONTEXT_SIMPLE(context)); asn1_write_uint8(data, v ? 0xFF : 0); asn1_pop_tag(data); return !data->has_error; }
cwe
CWE-399
Unknown
bool CModules::LoadModule(const CString& sModule, const CString& sArgs, CModInfo::EModuleType eType, CUser* pUser, CIRCNetwork* pNetwork, CString& sRetMsg) { sRetMsg = ""; if (FindModule(sModule) != nullptr) { sRetMsg = t_f("Module {1} already loaded....
cwe
CWE-264
Unknown
const queryString = require('query-string'); const fetch = require("node-fetch"); /** * this utility class implement ETSY (some) methods documented here: * https://www.etsy.com/developers/documentation > API Reference **/ class EtsyClient { static debug = process.env.ETSY_DEBUG && process.env.ETSY_DEBUG === true...
cwe
CWE-200
JavaScript
nfssvc_decode_readdirargs(struct svc_rqst *rqstp, __be32 *p, struct nfsd_readdirargs *args) { p = decode_fh(p, &args->fh); if (!p) return 0; args->cookie = ntohl(*p++); args->count = ntohl(*p++); args->count = min_t(u32, args->count, PAGE_SIZE); args->buffer = page_address(*(rqstp->rq_next_page++)); ...
cwe
CWE-404
C/C++
int ssl_cipher_list_to_bytes(SSL *s,STACK_OF(SSL_CIPHER) *sk,unsigned char *p, int (*put_cb)(const SSL_CIPHER *, unsigned char *)) { int i,j=0; SSL_CIPHER *c; unsigned char *q; int no_scsv = s->renegotiate; /* Set disabled masks for this session */ ssl_set_client_disabled(s); if (sk == NULL) return(0);...
cwe
CWE-310
Unknown
request_env(agooReq req, VALUE self) { if (Qnil == (VALUE)req->env) { volatile VALUE env = rb_hash_new(); // As described by // http://www.rubydoc.info/github/rack/rack/master/file/SPEC and // https://github.com/rack/rack/blob/master/SPEC. rb_hash_aset(env, request_method_val, req_method(req)); rb_hash_aset...
cwe
CWE-61
Unknown
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ #include <assert.h> #include <stddef.h> #include <stdlib.h> #include <string.h> #include <sys/queue.h> #include <time.h> #ifndef WIN32 #include <netinet/in.h> #include <sys/socket.h> #endif #include <openssl/aead.h> #include <openssl/hkdf.h> #i...
cwe
CWE-476
C/C++
int main(int argc, char ** argv) { int c; unsigned long flags = MS_MANDLOCK; char * orgoptions = NULL; char * share_name = NULL; const char * ipaddr = NULL; char * uuid = NULL; char * mountpoint = NULL; char * options = NULL; char * optionstail; char * resolved_path = NULL; char * temp; char * dev_name; in...
cwe
CWE-59
Unknown
function N(t){return Ge.test(t)}
cwe
CWE-79
JavaScript
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { const TfLiteTensor* input = GetInput(context, node, kInputTensor); TfLiteTensor* output = GetOutput(context, node, kOutputTensor); const int num_elements = NumElements(input); switch (input->type) { case kTfLiteInt64: memset(GetTensorData<i...
cwe
CWE-125
C/C++
void CLASS leaf_hdr_load_raw() { ushort *pixel=0; unsigned tile=0, r, c, row, col; if (!filters) { pixel = (ushort *) calloc (raw_width, sizeof *pixel); merror (pixel, "leaf_hdr_load_raw()"); } #ifdef LIBRAW_LIBRARY_BUILD try { #endif FORC(tiff_samples) for (r=0; r < raw_height; r++) { #ifdef L...
cwe
CWE-704
Unknown
Status OpLevelCostEstimator::PredictMaxPoolGrad(const OpContext& op_context, NodeCosts* node_costs) const { bool found_unknown_shapes = false; const auto& op_info = op_context.op_info; // x: op_info.inputs(0) // y: op_info.inputs(1) // y_grad: op_info.inputs(2) ...
cwe
CWE-369
C/C++
public function meta_box_subject() { $placeholder = __( 'What is your conversation about?', 'supportflow' ); echo '<h4>' . __( 'Subject', 'supportflow' ) . '</h4>'; echo '<input type="text" id="subject" name="post_title" class="sf_autosave" placeholder="' . $placeholder . '" value="' . get_the_title() . '" autoc...
cwe
CWE-79
PHP
function handleParseHeaders(req, res, next) { var mount = getMountForRequest(req); var info = { appId: req.get('X-Parse-Application-Id'), sessionToken: req.get('X-Parse-Session-Token'), masterKey: req.get('X-Parse-Master-Key'), installationId: req.get('X-Parse-Installation-Id'), clientKey: req....
cwe
CWE-285
JavaScript
mxEvent.consume(ua))},Za=U.actions.get("zoomIn"),cb=U.actions.get("zoomOut"),Ja=U.actions.get("resetView");Q=U.actions.get("fullscreen");var Ua=U.actions.get("undo"),$a=U.actions.get("redo"),z=X("",Ua.funct,null,mxResources.get("undo")+" ("+Ua.shortcut+")",Ua,Editor.undoImage),L=X("",$a.funct,null,mxResources.get("redo...
cwe
CWE-94
JavaScript
PJ_DEF(pj_status_t) pjmedia_rtcp_fb_parse_rpsi( const void *buf, pj_size_t length, pjmedia_rtcp_fb_rpsi *rpsi) { pjmedia_rtcp_common *hdr = (pjmedia_rtcp_common*) buf; pj_uint8_t *p; pj_uint8_t padlen; pj_size_t rpsi_len; PJ_ASSERT_RETURN(buf && rpsi, PJ_EINVAL); PJ_ASSERT_RETURN...
cwe
CWE-787
C/C++
/** * Copyright JS Foundation and other contributors, http://js.foundation * * 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 r...
cwe
CWE-22
JavaScript
/* Copyright 2016 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
cwe
CWE-824
Python
nfp_abm_u32_knode_replace(struct nfp_abm_link *alink, struct tc_cls_u32_knode *knode, __be16 proto, struct netlink_ext_ack *extack) { struct nfp_abm_u32_match *match = NULL, *iter; unsigned int tos_off; u8 mask, val; int err; if (!nfp_abm_u32_check_knode(alink->abm, knode, proto, extack)) goto err_del...
cwe
CWE-401
C/C++
function d(I,F,H,R){function W(){F.removeChild(U);F.removeChild(X);V.style.display="block";J.style.display="block"}z={div:F,comment:I,saveCallback:H,deleteOnCancel:R};var J=F.querySelector(".geCommentTxt"),V=F.querySelector(".geCommentActionsList"),U=document.createElement("textarea");U.className= "geCommentEditTxtArea...
cwe
CWE-94
JavaScript
WORD32 ih264d_parse_nal_unit(iv_obj_t *dec_hdl, ivd_video_decode_op_t *ps_dec_op, UWORD8 *pu1_buf, UWORD32 u4_length) { dec_bit_stream_t *ps_bitstrm; dec_struct_t *ps_dec = (dec_struct_t *)dec_hdl->pv_codec_handle; ivd_video_decode_ip_t *ps_dec_in = (ivd_video...
cwe
CWE-119
C/C++
/* Copyright (c) 2013, David C Horton Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute,...
cwe
CWE-416
C/C++
SProcXSendExtensionEvent(ClientPtr client) { CARD32 *p; int i; xEvent eventT; xEvent *eventP; EventSwapPtr proc; REQUEST(xSendExtensionEventReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq); swapl(&stuff->destination); swaps(&stuff->count); if (...
cwe
CWE-665
C/C++
static ssize_t _hostsock_writev( oe_fd_t* desc, const struct oe_iovec* iov, int iovcnt) { ssize_t ret = -1; sock_t* sock = _cast_sock(desc); void* buf = NULL; size_t buf_size = 0; if (!sock || !iov || iovcnt < 0 || iovcnt > OE_IOV_MAX) OE_RAISE_ERRNO(OE_EINVAL); /* Flatten ...
cwe
CWE-552
Unknown
function _sendFile(fileRequested, req, res, stats) { fs.open(fileRequested, "r", (err, fd) => { if (err) (err.code === "ENOENT") ? _sendError(req, res, 404, "Path Not Found.") : _sendError(req, res, 500, err); else { access.info(`Sending: ${fileRequested}`); const mime = conf.mimeTypes[path.extname(fileRequ...
cwe
CWE-79
JavaScript
/** BEGIN COPYRIGHT BLOCK * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. * Copyright (C) 2005 Red Hat, Inc. * All rights reserved. * * License: GPL (version 3 or any later version). * See LICENSE for details. * END COPYRIGHT BLOCK **/ #ifdef HAVE_CONFIG_H #include <config.h> #endif /* ldbm_con...
cwe
CWE-200
C/C++
function ajax(url, handler) { // URL should start with a slash, but cannot start with two slashes. // (Otherwise we have an XSS vulnerability.) if (url[0] != '/' || url[1] == '/') url = (''+location).replace( /[#\?].*/, '') + url; // A...
cwe
CWE-79
JavaScript
IDNSpoofChecker::IDNSpoofChecker() { UErrorCode status = U_ZERO_ERROR; checker_ = uspoof_open(&status); if (U_FAILURE(status)) { checker_ = nullptr; return; } uspoof_setRestrictionLevel(checker_, USPOOF_HIGHLY_RESTRICTIVE); SetAllowedUnicodeSet(&status); int32_t checks = uspoof_getChecks(check...
cwe
CWE-20
C/C++
static int cg_getattr(const char *path, struct stat *sb) { struct timespec now; struct fuse_context *fc = fuse_get_context(); char * cgdir = NULL; char *fpath = NULL, *path1, *path2; struct cgfs_files *k = NULL; const char *cgroup; const char *controller = NULL; int ret = -ENOENT; if (!fc) return -EIO; m...
cwe
CWE-264
C/C++
static std::string getComment(const std::string &fulltext, int line) { if (line < 1) return ""; // Locate line unsigned int start = 0; for (; start<fulltext.length() ; ++start) { if (line <= 1) break; if (fulltext[start] == '\n') line--; } int end = start + 1; while (fulltext[end] != '\n') end++; std::st...
cwe
CWE-125
Unknown
MONGO_EXPORT bson_bool_t mongo_cmd_authenticate( mongo *conn, const char *db, const char *user, const char *pass ) { bson from_db; bson cmd; const char *nonce; int result; mongo_md5_state_t st; mongo_md5_byte_t digest[16]; char hex_digest[33]; if( mongo_simple_int_command( conn, db, "g...
cwe
CWE-190
Unknown
function us(e,t){try{var n="",r=t;do{n+=$(r),r=r.return}while(r);var i=n}catch(e){i="\nError generating stack: "+e.message+"\n"+e.stack}return{value:e,source:t,stack:i}}
cwe
CWE-79
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
/************************************************************************ * 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
CURLcode Curl_ssl_addsessionid(struct Curl_easy *data, struct connectdata *conn, void *ssl_sessionid, size_t idsize, int sockindex) { size_t i; struct Curl_ssl_session *store = &data->state.se...
cwe
CWE-290
Unknown
# -*- coding: utf-8 -*- # rdiffweb, A web interface to rdiff-backup repositories # Copyright (C) 2012-2021 rdiffweb contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version ...
cwe
CWE-613
Python
R_API bool r_sys_mkdirp(const char *dir) { bool ret = true; char slash = R_SYS_DIR[0]; char *path = strdup (dir), *ptr = path; if (!path) { eprintf ("r_sys_mkdirp: Unable to allocate memory\n"); return false; } if (*ptr == slash) { ptr++; } #if __WINDOWS__ { char *p = strstr (ptr, ":\\"); if (p) { ...
cwe
CWE-78
Unknown
"insertLink","-"],X),B.menus.addSubmenu("insertLayout",V,X,mxResources.get("layout")),B.menus.addSubmenu("insertAdvanced",V,X,mxResources.get("advanced"))):(W.apply(this,arguments),B.menus.addSubmenu("table",V,X))}})();var S="horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split("...
cwe
CWE-20
JavaScript
/** @module querymen */ import _ from 'lodash' import Param from './querymen-param' import Schema from './querymen-schema' export { Param, Schema } export let handlers = { parsers: {}, formatters: {}, validators: {} } /** * Get or set a handler. * @memberof querymen * @param {string} type - Handler type. *...
cwe
CWE-74
JavaScript
void net_dns_print(pid_t pid) { EUID_ASSERT(); // drop privileges - will not be able to read /etc/resolv.conf for --noroot option // in case the pid is that of a firejail process, use the pid of the first child process pid = switch_to_child(pid); // exit if no permission to join the sandbox check_join_permissio...
cwe
CWE-94
Unknown
/* * linux/ipc/shm.c * Copyright (C) 1992, 1993 Krishna Balasubramanian * Many improvements/fixes by Bruno Haible. * Replaced `struct shm_desc' by `struct vm_area_struct', July 1994. * Fixed the shm swap deallocation (shm_unuse()), August 1998 Andrea Arcangeli. * * /proc/sysvipc/shm support (c) 1999 Dragos Acos...
cwe
CWE-20
C/C++
get_futex_key(u32 __user *uaddr, int fshared, union futex_key *key, enum futex_access rw) { unsigned long address = (unsigned long)uaddr; struct mm_struct *mm = current->mm; struct page *page, *tail; struct address_space *mapping; int err, ro = 0; /* * The futex address must be "naturally" aligned. */ key->...
cwe
CWE-416
Unknown
@app.route('/puppet/enc/<node>', methods=['GET', 'POST']) @cortex.lib.user.login_required def puppet_enc_edit(node): """Handles the manage Puppet node page""" # Get the system out of the database system = cortex.lib.systems.get_system_by_puppet_certname(node) environments = cortex.lib.core.get_puppet_environ...
cwe
CWE-502
Python
int __udp6_lib_rcv(struct sk_buff *skb, struct udp_table *udptable, int proto) { struct net *net = dev_net(skb->dev); struct sock *sk; struct udphdr *uh; struct in6_addr *saddr, *daddr; u32 ulen = 0; if (!pskb_may_pull(skb, sizeof(struct udphdr))) goto short_packet; saddr = &ipv6_hdr(skb)->saddr; daddr...
cwe
CWE-400
Unknown
package edu.stanford.nlp.util; import java.io.*; import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; import javax.xml.XMLConstants; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.ParserConfigurationException; import j...
cwe
CWE-611
Java
int CLua::loadfile(lua_State *ls, const char *filename, bool trusted, bool die_on_fail) { if (!ls) return -1; if (!is_path_safe(filename, trusted)) { lua_pushstring( ls, make_stringf("invalid filename: %s", filename).c_str()); return -1; ...
cwe
CWE-434
Unknown
public ECB() { super(new BlockCipherProvider() { public BlockCipher get() { return new AESFastEngine(); } }); }
cwe
CWE-310
Java
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
cwe
CWE-787
C/C++
static struct nlattr *reserve_sfa_size(struct sw_flow_actions **sfa, int attr_len, bool log) { struct sw_flow_actions *acts; int new_acts_size; size_t req_size = NLA_ALIGN(attr_len); int next_offset = offsetof(struct sw_flow_actions, actions) + (*sfa)->actions_len; if (req_size <= (ksize(*sfa) - ...
cwe
CWE-362
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-284
Python
TPMI_DH_PCR_Unmarshal(TPMI_DH_PCR *target, BYTE **buffer, INT32 *size, BOOL allowNull) { TPM_RC rc = TPM_RC_SUCCESS; if (rc == TPM_RC_SUCCESS) { rc = TPM_HANDLE_Unmarshal(target, buffer, size); } if (rc == TPM_RC_SUCCESS) { BOOL isNotPcr = (*target > PCR_LAST); BOOL isNotLegalNull = (*target != TP...
cwe
CWE-787
Unknown
/* * 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-200
Java
/* 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-190
C/C++
var create_tag_title = function(description, owner, tagset, link_owner) { var title = ""; if (owner) { title += "<b>Owner:</b> " + owner + "<br />"; } if (link_owner) { title += "<b>Linked by:</b> " + link_owner + "<br />"; } if (description) { ...
cwe
CWE-116
JavaScript
static Image *ReadEXRImage(const ImageInfo *image_info,ExceptionInfo *exception) { const ImfHeader *hdr_info; Image *image; ImageInfo *read_info; ImfInputFile *file; ImfRgba *scanline; int max_x, max_y, min_x, min_y; MagickBooleanType status; register ssize...
cwe
CWE-120
C/C++
static int __sock_diag_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) { int err; struct sock_diag_req *req = nlmsg_data(nlh); const struct sock_diag_handler *hndl; if (nlmsg_len(nlh) < sizeof(*req)) return -EINVAL; hndl = sock_diag_lock_handler(req->sdiag_family); if (hndl == NULL) err = -ENOENT; ...
cwe
CWE-20
C/C++
static int stszin(int size) { int cnt; uint32_t ofs; // version/flags u32in(); // Sample size u32in(); // Number of entries mp4config.frame.ents = u32in(); // fixme: check atom size mp4config.frame.data = malloc(sizeof(*mp4config.frame.data) * (...
cwe
CWE-787
Unknown
char *Hub::inflate(char *data, size_t &length) { dynamicInflationBuffer.clear(); inflationStream.next_in = (Bytef *) data; inflationStream.avail_in = length; int err; do { inflationStream.next_out = (Bytef *) inflationBuffer; inflationStream.avail_out = LARGE_BUFFER_SIZE; e...
cwe
CWE-400
C/C++
int main(int argc, char **argv) { int opt, timeout = 1800, family = AF_UNSPEC, hashlength = 0, hashmin = 0; int daemonize = FALSE, always_rewrite = FALSE; char *listen_addr = NULL, *forward_service = NULL, *reverse_service = NULL, *user = NULL, *domain = NULL, *chroot_dir = NULL; char separator...
cwe
CWE-703
C/C++
/* p_mach.cpp -- pack Mach Object executable This file is part of the UPX executable compressor. Copyright (C) 2004-2021 John Reiser All Rights Reserved. UPX and the UCL library are free software; you can redistribute them and/or modify them under the terms of the GNU General Public License as publ...
cwe
CWE-617
C/C++
inline typename V::MapType FBUnserializer<V>::unserializeMap() { p_ += CODE_SIZE; typename V::MapType ret = V::createMap(); size_t code = nextCode(); while (code != FB_SERIALIZE_STOP) { switch (code) { case FB_SERIALIZE_VARCHAR: case FB_SERIALIZE_STRING: { auto key = unserial...
cwe
CWE-674
C/C++
/* * Copyright (c) 2016-2017 Moddable Tech, Inc. * * This file is part of the Moddable SDK Runtime. * * The Moddable SDK Runtime 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 v...
cwe
CWE-125
C/C++
static int send_reply(struct svcxprt_rdma *rdma, struct svc_rqst *rqstp, struct page *page, struct rpcrdma_msg *rdma_resp, struct svc_rdma_req_map *vec, int byte_count, u32 inv_rkey) { struct svc_rdma_op_ctxt *ctxt; struct ib_send_wr send_wr; u32 xdr_off; int sge_no...
cwe
CWE-404
C/C++
/* * * drivers/staging/android/ion/ion.c * * Copyright (C) 2011 Google, Inc. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * This program is distribu...
cwe
CWE-264
C/C++
static ssize_t cpu_capacity_show(struct device *dev, struct device_attribute *attr, char *buf) { struct cpu *cpu = container_of(dev, struct cpu, dev); return sprintf(buf, "%lu\n", topology_get_cpu_scale(cpu->dev.id)); }
cwe
CWE-787
Unknown
async function getAppleCertificate(publicKeyUrl) { if (!verifyPublicKeyUrl(publicKeyUrl)) { throw new Parse.Error( Parse.Error.OBJECT_NOT_FOUND, `Apple Game Center - invalid publicKeyUrl: ${publicKeyUrl}` ); } if (cache[publicKeyUrl]) { return cache[publicKeyUrl]; } const url = new URL...
cwe
CWE-295
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
def getQueue(self, numberOfLinks=10): self.cursor.execute("SELECT url FROM queue WHERE visited = '0' LIMIT {};".format(numberOfLinks)) result = self.cursor.fetchall() self.remove(result) return result
cwe
CWE-89
Python
void ObjectBackedNativeHandler::Router( const v8::FunctionCallbackInfo<v8::Value>& args) { v8::Isolate* isolate = args.GetIsolate(); v8::HandleScope handle_scope(isolate); v8::Local<v8::Object> data = args.Data().As<v8::Object>(); v8::Local<v8::Context> context = isolate->GetCurrentContext(); v8::Local<v...
cwe
CWE-284
C/C++
inline bool checkNoWait(int length) { return check(length, 1, false)!=0; }
cwe
CWE-787
C/C++
import { FlowRouter } from 'meteor/ostrio:flow-router-extra' import './projectAccessRights.html' import { t, i18nReady } from '../../utils/i18n.js' import { validateEmail, getGlobalSetting, showToast, } from '../../utils/frontend_helpers' import Projects from '../../api/projects/projects.js' Template.projectAccessRi...
cwe
CWE-79
JavaScript