code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
execstack_continue(i_ctx_t *i_ctx_p) { os_ptr op = osp; return do_execstack(i_ctx_p, false, op); }
cwe
CWE-200
Unknown
static pj_status_t get_name(int rec_counter, const pj_uint8_t *pkt, const pj_uint8_t *start, const pj_uint8_t *max, pj_str_t *name) { const pj_uint8_t *p; pj_status_t status; /* Limit the number of recursion */ if (rec_counter > 10) { /* Too many name recursion */ return PJLIB_UTIL_EDN...
cwe
CWE-120
Unknown
create_principal_2_svc(cprinc_arg *arg, struct svc_req *rqstp) { static generic_ret ret; char *prime_arg; gss_buffer_desc client_name, service_name; OM_uint32 minor_stat; kadm5_server_handle_t handle; restriction_t ...
cwe
CWE-772
C/C++
static zend_bool add_post_var(zval *arr, post_var_data_t *var, zend_bool eof TSRMLS_DC) { char *ksep, *vsep, *val; size_t klen, vlen; /* FIXME: string-size_t */ unsigned int new_vlen; if (var->ptr >= var->end) { return 0; } vsep = memchr(var->ptr, '&', var->end - var->ptr); if (!vsep) { if (!eof) { ret...
cwe
CWE-703
Unknown
fiber_switch(mrb_state *mrb, mrb_value self, mrb_int len, const mrb_value *a, mrb_bool resume, mrb_bool vmexec) { struct mrb_context *c = fiber_check(mrb, self); struct mrb_context *old_c = mrb->c; enum mrb_fiber_state status; mrb_value value; fiber_check_cfunc(mrb, c); status = c->status; switch (status...
cwe
CWE-703
C/C++
u_undo_end( int did_undo, // just did an undo int absolute) // used ":undo N" { char *msgstr; u_header_T *uhp; char_u msgbuf[80]; #ifdef FEAT_FOLDING if ((fdo_flags & FDO_UNDO) && KeyTyped) foldOpenCursor(); #endif if (global_busy // no messages now, wait until global is finished ...
cwe
CWE-787
Unknown
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { const TfLiteTensor* lookup = GetInput(context, node, 0); const TfLiteTensor* value = GetInput(context, node, 1); TfLiteTensor* output = GetOutput(context, node, 0); switch (value->type) { case kTfLiteFloat32: return EvalSimple(context, node...
cwe
CWE-787
C/C++
int Reverb_command(effect_handle_t self, uint32_t cmdCode, uint32_t cmdSize, void *pCmdData, uint32_t *replySize, void *pReplyData){ android::ReverbContext * pContext = (android::ReverbContext *) self; int retsize; LVREV_ControlParams_st ActiveParams; /* Current control Parameter...
cwe
CWE-189
C/C++
get_function_body( exarg_T *eap, garray_T *newlines, char_u *line_arg_in, char_u **line_to_free) { linenr_T sourcing_lnum_top = SOURCING_LNUM; linenr_T sourcing_lnum_off; int saved_wait_return = need_wait_return; char_u *line_arg = line_arg_in; int vim9_function = eap->cmdidx ==...
cwe
CWE-416
Unknown
import ast import enum import inspect import re import builtins import torch import warnings from .._jit_internal import List, Tuple, is_tuple, is_list, Dict, is_dict, Optional, \ is_optional, _qualified_name, Any, Future, is_future, is_ignored_fn, Union, is_union from .._jit_internal import BroadcastingList1, Broa...
cwe
CWE-77
Python
int main(int argc, char *argv[]) { opj_dinfo_t* dinfo; opj_event_mgr_t event_mgr; /* event manager */ int tnum; unsigned int snum; opj_mj2_t *movie; mj2_tk_t *track; mj2_sample_t *sample; unsigned char* frame_codestream; FILE *file, *outfile; char outfilename[50]; mj2_dp...
cwe
CWE-119
Unknown
static Image *ReadVIFFImage(const ImageInfo *image_info, ExceptionInfo *exception) { #define VFF_CM_genericRGB 15 #define VFF_CM_ntscRGB 1 #define VFF_CM_NONE 0 #define VFF_DEP_DECORDER 0x4 #define VFF_DEP_NSORDER 0x8 #define VFF_DES_RAW 0 #define VFF_LOC_IMPLICIT 1 #define VFF_MAPTYP_NONE 0 #define VFF_MAPTY...
cwe
CWE-399
C/C++
void Filter::onDownstreamEvent(Network::ConnectionEvent event) { ENVOY_CONN_LOG(trace, "on downstream event {}, has upstream = {}", read_callbacks_->connection(), static_cast<int>(event), upstream_ == nullptr); if (upstream_) { Tcp::ConnectionPool::ConnectionDataPtr conn_data(upstream_->onDowns...
cwe
CWE-416
Unknown
function addScoutsToParent(adult, connection) { var strQuery = "SELECT * FROM scout WHERE parent_id= '" +adult.rowID+"'"; connection.query( strQuery, function(err, rows) {if(err) { throw err; }else{ if(debug) {console.log("addScoutsToParent \n");} for(i=0;i<rows.length ;i++) { if(debu...
cwe
CWE-89
JavaScript
#include "PortForwardHandler.hpp" namespace et { PortForwardHandler::PortForwardHandler( shared_ptr<SocketHandler> _networkSocketHandler, shared_ptr<SocketHandler> _pipeSocketHandler) : networkSocketHandler(_networkSocketHandler), pipeSocketHandler(_pipeSocketHandler) {} void PortForwardHandler::upd...
cwe
CWE-362
C/C++
static noinline_for_stack int ethtool_get_rxnfc(struct net_device *dev, void __user *useraddr) { struct ethtool_rxnfc info; const struct ethtool_ops *ops = dev->ethtool_ops; int ret; void *rule_buf = NULL; if (!ops->get_rxnfc) return -EOPNOTSUPP; if (copy_from_user(&info, useraddr, sizeof(info))) retu...
cwe
CWE-190
Unknown
package artifacts import ( "context" "encoding/json" "errors" "fmt" "io" "io/fs" "net/http" "os" "path" "path/filepath" "strings" "time" "github.com/julienschmidt/httprouter" "github.com/nektos/act/pkg/common" ) type FileContainerResourceURL struct { FileContainerResourceURL string `json:"fileContaine...
cwe
CWE-22
Go
static int selectExpander(Walker *pWalker, Select *p){ Parse *pParse = pWalker->pParse; int i, j, k; SrcList *pTabList; ExprList *pEList; struct SrcList_item *pFrom; sqlite3 *db = pParse->db; Expr *pE, *pRight, *pExpr; u16 selFlags = p->selFlags; u32 elistFlags = 0; p->selFlags |= SF_Expanded; if...
cwe
CWE-787
Unknown
/* * VC3/DNxHD decoder. * Copyright (c) 2007 SmartJog S.A., Baptiste Coudurier <baptiste dot coudurier at smartjog dot com> * Copyright (c) 2011 MirriAd Ltd * Copyright (c) 2015 Christophe Gisquet * * 10 bit support added by MirriAd Ltd, Joseph Artsimovich <joseph@mirriad.com> * Slice multithreading and MB inter...
cwe
CWE-125
C/C++
def clean_cache(self, limit): """ Method that remove several User objects from cache - the least active users :param limit: number of the users that the method should remove from cache :return: None """ log.info('Figuring out the least active users...') ...
cwe
CWE-89
Python
static int iscsi_add_notunderstood_response( char *key, char *value, struct iscsi_param_list *param_list) { struct iscsi_extra_response *extra_response; if (strlen(value) > VALUE_MAXLEN) { pr_err("Value for notunderstood key \"%s\" exceeds %d," " protocol error.\n", key, VALUE_MAXLEN); return -1; } extr...
cwe
CWE-119
C/C++
BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert) { int i, j; BIO *out = NULL, *btmp = NULL, *etmp = NULL, *bio = NULL; X509_ALGOR *xa; ASN1_OCTET_STRING *data_body = NULL; const EVP_MD *evp_md; const EVP_CIPHER *evp_cipher = NULL; EVP_CIPHER_CTX *evp_ctx = NULL; ...
cwe
CWE-327
Unknown
cupsdReadClient(cupsd_client_t *con) /* I - Client to read from */ { char line[32768], /* Line from client... */ locale[64], /* Locale */ *ptr; /* Pointer into strings */ http_status_t status; /* Transfer status */ ipp_state_t ipp_state; /* State of IPP transfer */ int bytes; /* Number of bytes t...
cwe
CWE-120
Unknown
static void do_file_clean(int flags, char *name) { char *page; char fn[30]; snprintf(fn, 30, TMPDIR "~test%d", tmpcount++); int fd = open(fn, O_RDWR|O_TRUNC|O_CREAT); if (fd < 0) err("open temp file"); write(fd, fn, 4); page = checked_mmap(NULL, PS, PROT_READ|PROT_WRITE, MAP_SHARED|flags, fd, 0); fsync(fd);...
cwe
CWE-732
C/C++
/** * Copyright (c) 2006-2012, JGraph Ltd */ // Workaround for handling named HTML entities in mxUtils.parseXml // LATER: How to configure DOMParser to just ignore all entities? (function() { var entities = [ ['nbsp', '160'], ['shy', '173'] ]; var parseXml = mxUtils.parseXml; mxUtils.parseXml = function...
cwe
CWE-79
JavaScript
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may n...
cwe
CWE-502
Java
public void refreshConfig() { Yaml yaml = new Yaml(); StringWriter writer = new StringWriter(); yaml.dump(configObj, writer); configStr = writer.toString(); try { Files.write(Paths.get("config.yaml"), configStr.getBytes(StandardCharsets.UTF_8)); ...
cwe
CWE-502
Java
/* signature.c * * Copyright (C) 2006-2019 wolfSSL Inc. * * This file is part of wolfSSL. * * wolfSSL 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 opt...
cwe
CWE-327
C/C++
atm_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p) { u_int caplen = h->caplen; u_int length = h->len; uint32_t llchdr; u_int hdrlen = 0; if (caplen < 1 || length < 1) { ND_PRINT((ndo, "%s", tstr)); return (caplen); } /* Cisco Style NLPID ? */ if ...
cwe
CWE-125
Unknown
import React from 'react'; import Immutable, { Map } from 'immutable'; import { format } from 'util'; import sync from './sync'; import * as l from './core/index'; import { dataFns } from './utils/data_utils'; const { get, set } = dataFns(['i18n']); import enDictionary from './i18n/en'; import { load, preload } from '....
cwe
CWE-79
JavaScript
int dns_packet_is_reply_for(DnsPacket *p, const DnsResourceKey *key) { int r; assert(p); assert(key); /* Checks if the specified packet is a reply for the specified * key and the specified key is the only one in the question * section. */ if (DNS_PACKET_QR(p)...
cwe
CWE-476
C/C++
#include "gd.h" #include <cmath> #include <cstring> #include <cstdlib> #include "gdhelpers.h" #include "hphp/runtime/base/memory-manager.h" using std::abs; #ifdef _OSD_POSIX /* BS2000 uses the EBCDIC char set instead of ASCII */ #define CHARSET_EBCDIC #define __attribute__(any) /*nothing */ #endif /*_OSD_POSIX*...
cwe
CWE-787
C/C++
# Copyright 2014-2016 OpenMarket Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
cwe
CWE-79
Python
import dayjs from 'dayjs' import customParseFormat from 'dayjs/plugin/customParseFormat' import { t } from './i18n.js' import Projects from '../api/projects/projects.js' import projectUsers from '../api/users/users.js' import { periodToDates } from './periodHelpers.js' import { getGlobalSetting, getUserSetting } from '...
cwe
CWE-79
JavaScript
static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type, char *tn, void (*func_p)()) { zval *imgind; char *file = NULL; int file_len = 0; long quality, basefilter; gdImagePtr im; int argc = ZEND_NUM_ARGS(); int q = -1, i; int f = -1; gdIOCtx *ctx = NULL; zval *to_zval = NULL; php_strea...
cwe
CWE-20
C/C++
static void perf_event_for_each(struct perf_event *event, void (*func)(struct perf_event *)) { struct perf_event_context *ctx = event->ctx; struct perf_event *sibling; WARN_ON_ONCE(ctx->parent_ctx); mutex_lock(&ctx->mutex); event = event->group_leader; perf_event_for_each_child(event, func); list_for_eac...
cwe
CWE-284
Unknown
static Image *ReadJBIGImage(const ImageInfo *image_info, ExceptionInfo *exception) { Image *image; IndexPacket index; MagickStatusType status; register IndexPacket *indexes; register ssize_t x; register PixelPacket *q; register unsigned char *p; ssize_t length, ...
cwe
CWE-120
C/C++
/* * mms_client_files.c * * Copyright 2013 - 2022 Michael Zillgith * * This file is part of libIEC61850. * * libIEC61850 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 L...
cwe
CWE-22
Go
function SwaggerUI(opts) { win.versions = win.versions || {} win.versions.swaggerUi = { version: PACKAGE_VERSION, gitRevision: GIT_COMMIT, gitDirty: GIT_DIRTY, buildTimestamp: BUILD_TIME, } const defaults = { // Some general settings, that we floated to the top dom_id: null, // eslint-...
cwe
CWE-20
JavaScript
int ssl3_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) { int al,i,j,ret; unsigned int n; SSL3_RECORD *rr; void (*cb)(const SSL *ssl,int type2,int val)=NULL; if (s->s3->rbuf.buf == NULL) /* Not initialized yet */ if (!ssl3_setup_read_buffer(s)) return(-1); if ((type && (type != SSL3_R...
cwe
CWE-326
Unknown
function OA_runMPE() { $objResponse = new xajaxResponse(); $objResponse->addAssign("run-mpe", "innerHTML", "<img src='run-mpe.php' />"); return $objResponse; }
cwe
CWE-352
PHP
static int pppoe_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *m, size_t total_len, int flags) { struct sock *sk = sock->sk; struct sk_buff *skb; int error = 0; if (sk->sk_state & PPPOX_BOUND) { error = -EIO; goto end; } skb = skb_recv_datagram(sk, flags & ~MSG_DONTWAIT, flags & MS...
cwe
CWE-20
C/C++
@site.route('/lost_found', methods=['GET', 'POST']) def PropertyPage(): if request.method == "POST": formtype = request.form['form-name'] if formtype == "LostSomething": lostdesc = request.form['LostSomethingDescription'] lostlocation = request.form['LostSomethingPossibleLoca...
cwe
CWE-89
Python
package com.salesmanager.core.business.repositories.catalog.product.attribute; import java.util.List; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import com.salesmanager.core.model.catalog.product.attribute.ProductAttribute; public interface Pr...
cwe
CWE-79
Java
def remove_acl_remote(params, request, session) if not allowed_for_local_cluster(session, Permissions::GRANT) return 403, 'Permission denied' end if params["item"] == "permission" retval = remove_acl_permission(session, params["acl_perm_id"]) elsif params["item"] == "usergroup" retval = remove_acl_u...
cwe
CWE-384
Ruby
void CharToWideMap(const char *Src,wchar *Dest,size_t DestSize,bool &Success) { // Map inconvertible characters to private use Unicode area 0xE000. // Mark such string by placing special non-character code before // first inconvertible character. Success=false; bool MarkAdded=false; uint SrcPos=0,DestPos=0;...
cwe
CWE-787
C/C++
foreach ($oBlock->getSelectors() as $oSelector) { if ($sSpecificitySearch === null) { $aResult[] = $oSelector; } else { $sComparison = "\$bRes = {$oSelector->getSpecificity()} $sSpecificitySearch;"; eval($sComparison); if ($bRes) { $aResult[] = $oSelector; } } } }
cwe
CWE-94
PHP
static inline int handle_dots(struct nameidata *nd, int type) { if (type == LAST_DOTDOT) { if (nd->flags & LOOKUP_RCU) { return follow_dotdot_rcu(nd); } else follow_dotdot(nd); } return 0; }
cwe
CWE-254
C/C++
static int MP4_ReadBox_String( stream_t *p_stream, MP4_Box_t *p_box ) { MP4_READBOX_ENTER( MP4_Box_data_string_t ); p_box->data.p_string->psz_text = malloc( p_box->i_size + 1 - 8 ); /* +\0, -name, -size */ if( p_box->data.p_string->psz_text == NULL ) MP4_READBOX_EXIT( 0 ); memcpy( p_box->data....
cwe
CWE-787
C/C++
void inode_init_owner(struct inode *inode, const struct inode *dir, umode_t mode) { inode->i_uid = current_fsuid(); if (dir && dir->i_mode & S_ISGID) { inode->i_gid = dir->i_gid; if (S_ISDIR(mode)) mode |= S_ISGID; } else inode->i_gid = current_fsgid(); inode->i_mode = mode; }
cwe
CWE-269
C/C++
int ssl3_get_record(SSL *s) { int ssl_major, ssl_minor, al; int enc_err, n, i, ret = -1; SSL3_RECORD *rr; SSL3_BUFFER *rbuf; SSL_SESSION *sess; unsigned char *p; unsigned char md[EVP_MAX_MD_SIZE]; short version; unsigned mac_size; unsigned int num_recs = 0; unsigned int max_r...
cwe
CWE-20
C/C++
int nfc_llcp_send_cc(struct nfc_llcp_sock *sock) { struct nfc_llcp_local *local; struct sk_buff *skb; u8 *miux_tlv = NULL, miux_tlv_length; u8 *rw_tlv = NULL, rw_tlv_length, rw; int err; u16 size = 0; __be16 miux; pr_debug("Sending CC\n"); local = sock->local; if (local == NULL) return -ENODEV; /* If th...
cwe
CWE-476
C/C++
Array.prototype.push.apply(N.shape.customProperties,Editor.commonEdgeProperties)),T(N.shape.customProperties));u=u.getAttribute("customProperties");if(null!=u)try{T(JSON.parse(u))}catch(Q){}}};var x=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var u=this.editorUi.getSelectionState();"image...
cwe
CWE-20
JavaScript
static struct task_struct *copy_process(unsigned long clone_flags, unsigned long stack_start, struct pt_regs *regs, unsigned long stack_size, int __user *child_tidptr, struct pid *pid, int trace) { int retval; struct task_struct *p; int cgroup_callbacks_done = 0; if ((clone_flags & (C...
cwe
CWE-264
Unknown
int secure_check(void *data) { const at91_secure_header_t *header; void *file; if (secure_decrypt(data, sizeof(*header), 0)) return -1; header = (const at91_secure_header_t *)data; if (header->magic != AT91_SECURE_MAGIC) return -1; file = (unsigned char *)data + sizeof(*header); return secure_decrypt(file...
cwe
CWE-212
C/C++
hufDecode (const Int64 * hcode, // i : encoding table const HufDec * hdecod, // i : decoding table const char* in, // i : compressed input buffer int ni, // i : input size (in bits) int rlc, // i : run-length code int no, // i : expected output size (in bytes) unsigned short* out...
cwe
CWE-190
C/C++
static void host_callback(void *arg, int status, int timeouts, unsigned char *abuf, int alen) { struct host_query *hquery = (struct host_query*)arg; int addinfostatus = ARES_SUCCESS; hquery->timeouts += timeouts; hquery->remaining--; if (status == ARES_SUCCESS) { addinfost...
cwe
CWE-310
C/C++
user: function (next) { User.create( { username: postData.username, email: postData.email, password: postData.password, fullname: postData.fullname, title: postData.title, role: postData.role, accessToken: chance.hash(...
cwe
CWE-521
JavaScript
TPMI_DH_CONTEXT_Unmarshal(TPMI_DH_CONTEXT *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) { BOOL isNotHmacSession = (*target < HMAC_SESSION_FIRST ) || (*target > HMAC_SESSION_...
cwe
CWE-787
Unknown
static Image *ReadTXTImage(const ImageInfo *image_info,ExceptionInfo *exception) { char colorspace[MaxTextExtent], text[MaxTextExtent]; double x_offset, y_offset; Image *image; IndexPacket *indexes; MagickBooleanType status; MagickPixelPacket pixel; QuantumAny ran...
cwe
CWE-401
Unknown
/* * Pannellum - An HTML5 based Panorama Viewer * Copyright (c) 2011-2019 Matthew Petroff * * 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 limit...
cwe
CWE-79
JavaScript
int nfs4_path_walk(struct nfs_server *server, struct nfs_fh *mntfh, const char *path) { struct nfs_fsinfo fsinfo; struct nfs_fattr fattr; struct nfs_fh lastfh; struct qstr name; int ret; dprintk("--> nfs4_path_walk(,,%s)\n", path); fsinfo.fattr = &fattr; nfs_fattr_init(&fattr); /* Eat leading slas...
cwe
CWE-20
Unknown
/** * <a href="http://www.openolat.org"> * OpenOLAT - Online Learning and Training</a><br> * <p> * Licensed under the Apache License, Version 2.0 (the "License"); <br> * you may not use this file except in compliance with the License.<br> * You may obtain a copy of the License at the * <a href="http://www.apache...
cwe
CWE-91
Java
void InferenceContext::PreInputInit( const OpDef& op_def, const std::vector<const Tensor*>& input_tensors, const std::vector<ShapeHandle>& input_tensors_as_shapes) { // TODO(mdan): This is also done at graph construction. Run only here instead? const auto ret = full_type::SpecializeType(attrs_, op_def); D...
cwe
CWE-754
C/C++
static MprJson *queryRange(MprJson *obj, char *property, cchar *rest, MprJson *value, int flags) { MprJson *child, *result; ssize start, end; char *e, *s, ibuf[16]; int index; result = mprCreateJson(MPR_JSON_ARRAY); if (!(obj->type & MPR_JSON_ARRAY)) { return re...
cwe
CWE-476
C/C++
static int renameTableSelectCb(Walker *pWalker, Select *pSelect){ int i; RenameCtx *p = pWalker->u.pRename; SrcList *pSrc = pSelect->pSrc; if( pSrc==0 ){ assert( pWalker->pParse->db->mallocFailed ); return WRC_Abort; } for(i=0; i<pSrc->nSrc; i++){ struct SrcList_item *pItem = &pSrc->a[i]; if...
cwe
CWE-787
Unknown
exports.set = function(obj, path, value) { var cachekey = 'S+' + path; if (F.temporary.other[cachekey]) return F.temporary.other[cachekey](obj, value); var arr = parsepath(path); var builder = []; for (var i = 0; i < arr.length - 1; i++) { var type = arr[i + 1] ? (REGISARR.test(arr[i + 1]) ? '[]' : '{}') : ...
cwe
CWE-94
JavaScript
static struct snd_seq_client *seq_create_client1(int client_index, int poolsize) { unsigned long flags; int c; struct snd_seq_client *client; /* init client data */ client = kzalloc(sizeof(*client), GFP_KERNEL); if (client == NULL) return NULL; client->pool = snd_seq_pool_new(poolsize); if (client->pool == N...
cwe
CWE-362
Unknown
void LanLinkProvider::newConnection() { qCDebug(KDECONNECT_CORE) << "LanLinkProvider newConnection"; while (m_server->hasPendingConnections()) { QSslSocket* socket = m_server->nextPendingConnection(); configureSocket(socket); //This socket is still managed by us (and child of the QTcpSe...
cwe
CWE-400
Unknown
/* * linux/fs/ceph/acl.c * * Copyright (C) 2013 Guangliang Zhao, <lucienchao@gmail.com> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope ...
cwe
CWE-285
C/C++
static bool l2cap_check_enc_key_size(struct hci_conn *hcon) { /* The minimum encryption key size needs to be enforced by the * host stack before establishing any L2CAP connections. The * specification in theory allows a minimum of 1, but to align * BR/EDR and LE transports, a minimum of 7 is chosen. * * This...
cwe
CWE-327
C/C++
static inline void vmacache_invalidate(struct mm_struct *mm) { mm->vmacache_seqnum++; /* deal with overflows */ if (unlikely(mm->vmacache_seqnum == 0)) vmacache_flush_all(mm); }
cwe
CWE-416
Unknown
static void k_ascii(struct vc_data *vc, unsigned char value, char up_flag) { int base; if (up_flag) return; if (value < 10) { /* decimal input of code, while Alt depressed */ base = 10; } else { /* hexadecimal input of code, while AltGr depressed */ value -= 10; base = 16; } if (npadch == -1) npa...
cwe
CWE-190
C/C++
*/ int re_yyget_column (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (! YY_CURRENT_BUFFER) return 0; return yycolumn;
cwe
CWE-476
Unknown
void TiffImage::readMetadata() { #ifdef DEBUG std::cerr << "Reading TIFF file " << io_->path() << "\n"; #endif if (io_->open() != 0) throw Error(kerDataSourceOpenFailed, io_->path(), strError()); IoCloser closer(*io_); // Ensure that this is the correct image type if (!isTiff...
cwe
CWE-476
Unknown
status_t BnOMX::onTransact( uint32_t code, const Parcel &data, Parcel *reply, uint32_t flags) { switch (code) { case LIVES_LOCALLY: { CHECK_OMX_INTERFACE(IOMX, data, reply); node_id node = (node_id)data.readInt32(); pid_t pid = (pid_t)data.readInt32(); reply->writeInt32(livesLoc...
cwe
CWE-119
C/C++
Ra,"geMenuItem");null!=Na?(Ra.style.backgroundImage="url("+Na+")",Ra.style.backgroundPosition="center center",Ra.style.backgroundRepeat="no-repeat",Ra.style.backgroundSize="24px 24px",Ra.style.width="34px",Ra.innerHTML=""):ya||(Ra.style.backgroundImage="url("+mxWindow.prototype.normalizeImage+")",Ra.style.backgroundPos...
cwe
CWE-94
JavaScript
static size_t copy_page_to_iter_pipe(struct page *page, size_t offset, size_t bytes, struct iov_iter *i) { struct pipe_inode_info *pipe = i->pipe; struct pipe_buffer *buf; unsigned int p_tail = pipe->tail; unsigned int p_mask = pipe->ring_size - 1; unsigned int i_head = i->head; size_t off; if (unlikely(byt...
cwe
CWE-284
C/C++
xmlParseDocument(xmlParserCtxtPtr ctxt) { xmlChar start[4]; xmlCharEncoding enc; xmlInitParser(); if ((ctxt == NULL) || (ctxt->input == NULL)) return(-1); GROW; /* * SAX: detecting the level. */ xmlDetectSAX2(ctxt); /* * SAX: beginning of the document processi...
cwe
CWE-119
C/C++
int print_deleg_lookup(RES* ssl, struct worker* worker, uint8_t* nm, size_t nmlen, int ATTR_UNUSED(nmlabs)) { /* deep links into the iterator module */ struct delegpt* dp; struct dns_msg* msg; struct regional* region = worker->scratchpad; char b[260]; struct query_info qinfo; struct iter_hints_stub* stub; regi...
cwe
CWE-703
Unknown
ProcessRepliesIfAny(void) { unsigned char firstchar; int r; bool received = false; for (;;) { r = pq_getbyte_if_available(&firstchar); if (r < 0) { /* unexpected error or EOF */ ereport(COMMERROR, (errcode(ERRCODE_PROTOCOL_VIOLATION), errmsg("unexpected EOF on standby connection"))); ...
cwe
CWE-89
Unknown
int VvcSpsUnit::deserialize() { int rez = VvcUnit::deserialize(); if (rez) return rez; try { sps_id = m_reader.getBits(4); vps_id = m_reader.getBits(4); max_sublayers_minus1 = m_reader.getBits(3); if (max_sublayers_minus1 == 7) return 1; chroma...
cwe
CWE-22
Unknown
package api // Visibility is the type of a visibility. type Visibility string const ( // Public is the PUBLIC visibility. Public Visibility = "PUBLIC" // Protected is the PROTECTED visibility. Protected Visibility = "PROTECTED" // Private is the PRIVATE visibility. Private Visibility = "PRIVATE" ) func (e Visi...
cwe
CWE-284
Go
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.model.document import Document from frappe.utils import get_path from os.path import join as join_path, exists as...
cwe
CWE-79
Python
package keeper import ( "bytes" "fmt" "math/big" "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/ethereum/go-ethereum/common" ethermint "github.com/evmos/ethermint/types" "github.com/evmos/ethermint/x/evm/s...
cwe
CWE-668
Go
rpl_dao_print(netdissect_options *ndo, const u_char *bp, u_int length) { const struct nd_rpl_dao *dao = (const struct nd_rpl_dao *)bp; const char *dagid_str = "<elided>"; ND_TCHECK(*dao); if (length < ND_RPL_DAO_MIN_LEN) goto tooshort; bp += ND_RPL_DAO_MI...
cwe
CWE-125
C/C++
# -*- coding: utf-8 -*- ### NOTE ################################################################################# # This file has to stay format compatible to Python 2, or pip under Python 2 will # not be able to detect that OctoPrint requires Python 3 but instead fail with a # syntax error. # # So, no f-strings, no ...
cwe
CWE-307
Python
static size_t handle_returned_header (void *ptr, size_t size, size_t nmemb, void *stream) { auth_client *auth_user = stream; size_t bytes = size * nmemb; client_t *client = auth_user->client; if (client) { auth_t *auth = client->auth; auth_url *url = auth->state; if (strncas...
cwe
CWE-119
C/C++
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */ /* vim: set ts=2 et sw=2 tw=80: */ /************************************************************* * * MathJax/extensions/TeX/unicode.js * * Implements the \unicode extension to TeX to allow arbitrary unicode * code points to be entered ...
cwe
CWE-79
Java
MagickExport size_t GetQuantumExtent(const Image *image, const QuantumInfo *quantum_info,const QuantumType quantum_type) { size_t extent, packet_size; assert(quantum_info != (QuantumInfo *) NULL); assert(quantum_info->signature == MagickCoreSignature); packet_size=1; switch (quantum_type) { c...
cwe
CWE-125
Unknown
/* BlueZ - Bluetooth protocol stack for Linux Copyright (C) 2000-2001 Qualcomm Incorporated Copyright (C) 2009-2010 Gustavo F. Padovan <gustavo@padovan.org> Copyright (C) 2010 Google Inc. Copyright (C) 2011 ProFUSION Embedded Systems Copyright (c) 2012 Code Aurora Forum. All rights reserved. Writ...
cwe
CWE-824
C/C++
static void ttm_put_pages(struct page **pages, unsigned npages, int flags, enum ttm_caching_state cstate) { struct ttm_page_pool *pool = ttm_get_pool(flags, false, cstate); #ifdef CONFIG_TRANSPARENT_HUGEPAGE struct ttm_page_pool *huge = ttm_get_pool(flags, true, cstate); #endif unsigned long irq_flags; unsigne...
cwe
CWE-125
C/C++
/* * "NUT" Container Format demuxer * Copyright (c) 2004-2006 Michael Niedermayer * Copyright (c) 2003 Alex Beregszaszi * * 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 Free So...
cwe
CWE-476
C/C++
bool is_item_tree_change_register_required() { return !stmt_arena->is_conventional() || stmt_arena->type() == Query_arena::TABLE_ARENA; }
cwe
CWE-416
Unknown
QUtil::string_to_ll(char const* str) { #ifdef _MSC_VER return _strtoi64(str, 0, 10); #else return strtoll(str, 0, 10); #endif }
cwe
CWE-125
Unknown
/* * Copyright (C) 2017 The Android Open Source Project * * 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 app...
cwe
CWE-20
Java
// // Copyright 2021 The Sigstore 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 ...
cwe
CWE-295
Go
// 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
void ReshapeSparseTensor(OpKernelContext *context, const Tensor &input_indices_in, const Tensor &input_shape_in, const Tensor &target_shape_in, int output_indices_idx, int output_shape_idx) { OP_REQUIRES(context, Tenso...
cwe
CWE-369
C/C++
static MagickBooleanType ReadPSDLayersInternal(Image *image, const ImageInfo *image_info,const PSDInfo *psd_info, const MagickBooleanType skip_layers,ExceptionInfo *exception) { char type[4]; LayerInfo *layer_info; MagickSizeType size; MagickBooleanType status; register ssize_t i; ...
cwe
CWE-834
C/C++