code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
static int coalesced_mmio_write(struct kvm_vcpu *vcpu, struct kvm_io_device *this, gpa_t addr, int len, const void *val) { struct kvm_coalesced_mmio_dev *dev = to_mmio(this); struct kvm_coalesced_mmio_ring *ring = dev->kvm->coalesced_mmio_ring; if (!coalesced_mmio_in_range(dev, addr, len)) return -EOPNOTS...
cwe
CWE-787
Unknown
ext4_xattr_block_list(struct dentry *dentry, char *buffer, size_t buffer_size) { struct inode *inode = d_inode(dentry); struct buffer_head *bh = NULL; int error; struct mb_cache *ext4_mb_cache = EXT4_GET_MB_CACHE(inode); ea_idebug(inode, "buffer=%p, buffer_size=%ld", buffer, (long)buffer_size); error = 0; ...
cwe
CWE-19
Unknown
xfs_ioctl_setattr( xfs_inode_t *ip, struct fsxattr *fa, int mask) { struct xfs_mount *mp = ip->i_mount; struct xfs_trans *tp; unsigned int lock_flags = 0; struct xfs_dquot *udqp = NULL; struct xfs_dquot *pdqp = NULL; struct xfs_dquot *olddquot = NULL; int code; trace_xfs_ioctl_setattr(ip); if (mp->...
cwe
CWE-264
C/C++
static void __proc_set_tty(struct tty_struct *tty) { unsigned long flags; spin_lock_irqsave(&tty->ctrl_lock, flags); /* * The session and fg pgrp references will be non-NULL if * tiocsctty() is stealing the controlling tty */ put_pid(tty->session); put_pid(tty->pgrp); tty->pgrp = get_pid(task_pgrp(current)...
cwe
CWE-416
Unknown
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
C/C++
function importRecordsbySettings(siteurl) { var importlimit = document.getElementById('importlimit').value; var get_requested_count = importlimit; var tot_no_of_records = document.getElementById('checktotal').value; var importas = document.getElementById('selectedImporter').value; ...
cwe
CWE-352
JavaScript
package com.salesmanager.core.model.catalog.product.image; import java.io.InputStream; import java.util.ArrayList; import java.util.List; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue;...
cwe
CWE-639
Java
/* * Chronomaster DFA Video Decoder * Copyright (c) 2011 Konstantin Shishkov * based on work by Vladimir "VAG" Gneushev * * 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-119
C/C++
xcf_load_image_props (XcfInfo *info, GimpImage *image) { PropType prop_type; guint32 prop_size; while (TRUE) { if (! xcf_load_prop (info, &prop_type, &prop_size)) return FALSE; switch (prop_type) { case PROP_END: return TRUE; ca...
cwe
CWE-120
Unknown
// // 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
func landingPage(w http.ResponseWriter, r *http.Request) { ctx := r.Context() idStr := r.URL.Path[1:] // When we don't have an idStr or it contains any path elements, we would // serve the landing page if len(idStr) < 1 || strings.Contains(idStr, "/") || strings.HasSuffix(idStr, "index.html") { dcCh := confi...
cwe
CWE-79
Go
void ScreenOrientationDispatcherHost::OnLockRequest( RenderFrameHost* render_frame_host, blink::WebScreenOrientationLockType orientation, int request_id) { if (current_lock_) { NotifyLockError(current_lock_->request_id, blink::WebLockOrientationErrorCanceled); } current_loc...
cwe
CWE-362
C/C++
_rsvg_node_poly_build_path (const char *value, gboolean close_path) { double *pointlist; guint pointlist_len, i; GString *d; cairo_path_t *path; char buf[G_ASCII_DTOSTR_BUF_SIZE]; pointlist = rsvg_css_parse_number_list (value, &pointlist_len); if (pointlist == NU...
cwe
CWE-119
Unknown
gpg_ctx_add_recipient (struct _GpgCtx *gpg, const gchar *keyid) { if (gpg->mode != GPG_CTX_MODE_ENCRYPT && gpg->mode != GPG_CTX_MODE_EXPORT) return; if (!gpg->recipients) gpg->recipients = g_ptr_array_new (); g_ptr_array_add (gpg->recipients, g_strdup (keyid)); }
cwe
CWE-200
Unknown
package oidc import ( "encoding/hex" "encoding/json" "fmt" "html" "html/template" "net" "net/http" "net/url" "os" "path" "strings" "time" gooidc "github.com/coreos/go-oidc" "github.com/golang-jwt/jwt/v4" log "github.com/sirupsen/logrus" "golang.org/x/oauth2" "github.com/argoproj/argo-cd/v2/common" ...
cwe
CWE-863
Go
function templateAddFileBubble(element_id, iframe, filename, tmp_name, batch) { if (batch == 'no') { if (iframe == true) { $('#filenames_' + element_id, window.parent.document).html('<div id ="' + tmp_name + '_container" class ="template_file_box_container"><span class="tagFirstHalf template_file_box">' + filenam...
cwe
CWE-79
JavaScript
else if (!strcmp(canURN, "e2719d58-a985-b3c9-781a-b030af78d30e")) return "ClearKey1.0"; else if (!strcmp(canURN, "94CE86FB-07FF-4F43-ADB8-93D2FA968CA2")) return "FairPlay"; else if (!strcmp(canURN, "279fe473-512c-48fe-ade8-d176fee6b40f")) return "Arris Titanium"; else if (!strcmp(canURN, "aa11967f-cc01-4a4a-8e99-c5d...
cwe
CWE-787
Unknown
na},null,null,null,ma,x?null:[]),b.showDialog(ha.container,350,80,!0,!0),ha.init())}}function L(ha){za.innerHTML=mxUtils.htmlEntities(mxResources.get(Z||ha?"create":"copy"));ha=ha?"none":"";p&&(Ga.style.display=ha);for(var da=M.querySelectorAll(".geTempDlgLinkToDiagram"),ca=0;ca<da.length;ca++)da[ca].style.display=ha}f...
cwe
CWE-20
JavaScript
function PMA_EVN_getRowForList($event, $rowclass = '') { global $ajax_class, $url_query, $db, $titles; $sql_drop = sprintf( 'DROP EVENT IF EXISTS %s', PMA_backquote($event['EVENT_NAME']) ); $retval = " <tr class='noclick $rowclass'>\n"; $retval .= " <td>\n"; ...
cwe
CWE-79
PHP
int term_addstr(TERM_WINDOW *window, const char *str) { int len, raw_len; unichar tmp; const char *ptr; if (vcmove) term_move_real(); len = 0; raw_len = strlen(str); /* The string length depends on the terminal encoding */ ptr = str; if (term_type == TERM_TYPE_UTF8) { while (*ptr != '\0') { tmp = g_u...
cwe
CWE-476
Unknown
package state import ( "github.com/tendermint/tendermint/types" ) //------------------------------------------------------ // blockchain services types // NOTE: Interfaces used by RPC must be thread safe! //------------------------------------------------------ //----------------------------------------------------...
cwe
CWE-400
Go
# -*- coding: utf-8 -*- """Installer for the collective.task package.""" from setuptools import find_packages from setuptools import setup long_description = ( open('README.rst').read() + '\n' + 'Contributors\n' '============\n' + '\n' + open('CONTRIBUTORS.rst').read() + '\n' + open('...
cwe
CWE-74
Python
Status OpLevelCostEstimator::PredictCropAndResize(const OpContext& op_context, NodeCosts* node_costs) const { bool found_unknown_shapes = false; const auto method = op_context.op_info.attr().find("method"); bool use_bilinear_interp; if (method == op_context.op_...
cwe
CWE-190
C/C++
/* * GPAC - Multimedia Framework C SDK * * Authors: Jean Le Feuvre * Copyright (c) Telecom ParisTech 2000-2012 * 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-119
C/C++
#include "source/extensions/compression/gzip/decompressor/zlib_decompressor_impl.h" #include <zlib.h> #include <memory> #include "envoy/common/exception.h" #include "source/common/common/assert.h" #include "absl/container/fixed_array.h" namespace Envoy { namespace Extensions { namespace Compression { namespace Gz...
cwe
CWE-400
C/C++
/* * Copyright (C) 2018 Keepkey * * 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 version 3 of the License, or * (at your option) any later version. * * This library is dis...
cwe
CWE-668
C/C++
eap_print(netdissect_options *ndo, register const u_char *cp, u_int length) { const struct eap_frame_t *eap; const u_char *tptr; u_int tlen, type, subtype; int count=0, len; tptr = cp; tlen = length; eap = (const struct eap_frame_t *)cp; ND_TCHECK(*eap); /* in n...
cwe
CWE-125
C/C++
StatusOr<FullTypeDef> SpecializeType(const AttrSlice& attrs, const OpDef& op_def) { FullTypeDef ft; ft.set_type_id(TFT_PRODUCT); for (int i = 0; i < op_def.output_arg_size(); i++) { auto* t = ft.add_args(); *t = op_def.output_arg(i).experimental_full_type(); // ...
cwe
CWE-787
Unknown
// // 数据库驱动::ASP // 支持数据库:access,sqlserver,mysql // const LANG = antSword['language']['database']; const LANG_T = antSword['language']['toastr']; class ASP { constructor(opt) { this.opt = opt; this.core = this.opt.core; this.manager = this.opt.super; // // * 数据库驱动列表 // this.conns = { ...
cwe
CWE-79
JavaScript
pci_emul_alloc_pbar(struct pci_vdev *pdi, int idx, uint64_t hostbase, enum pcibar_type type, uint64_t size) { int error; uint64_t *baseptr, limit, addr, mask, lobits, bar; assert(idx >= 0 && idx <= PCI_BARMAX); if ((size & (size - 1)) != 0) size = 1UL << flsl(size); /* round up to a power of 2 */ /* Enf...
cwe
CWE-617
C/C++
ip_optprint(netdissect_options *ndo, register const u_char *cp, u_int length) { register u_int option_len; const char *sep = ""; for (; length > 0; cp += option_len, length -= option_len) { u_int option_code; ND_PRINT((ndo, "%s", sep)); sep = ","; ND_TCHECK(*cp); option_code = *cp; ND_PRI...
cwe
CWE-125
Unknown
void handle_debug_usb_rx(const void *msg, size_t len) { if (msg_tiny_flag) { uint8_t buf[64]; memcpy(buf, msg, sizeof(buf)); uint16_t msgId = buf[4] | ((uint16_t)buf[3]) << 8; uint32_t msgSize = buf[8] | ((uint32_t)buf[7]) << 8 | ((uint32_t)bu...
cwe
CWE-787
Unknown
PackLinuxElf32::check_pt_dynamic(Elf32_Phdr const *const phdr) { unsigned t = get_te32(&phdr->p_offset), s = sizeof(Elf32_Dyn) + t; unsigned filesz = get_te32(&phdr->p_filesz), memsz = get_te32(&phdr->p_memsz); if (s < t || file_size < (off_t)s || (3 & t) || (7 & (filesz | memsz)) // .balign 4; 8==siz...
cwe
CWE-415
Unknown
def add_article_action(request: HttpRequest, default_foreward_url: str): forward_url: str = default_foreward_url if request.GET.get("redirect"): forward_url = request.GET["redirect"] else: forward_url = "/admin" if "rid" not in request.GET: return HttpResponseRedirect("/admin?err...
cwe
CWE-79
Python
/* * Copyright (c) 2016, The OpenThread Authors. * 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 code must retain the above copyright * notice, this ...
cwe
CWE-787
C/C++
func (suite *KeeperTestSuite) TestPeriodChangesAfterEpochEnd() { suite.SetupTest() currentEpochPeriod := suite.app.InflationKeeper.GetEpochsPerPeriod(suite.ctx) // bondingRatio is zero in tests bondedRatio := suite.app.StakingKeeper.BondedRatio(suite.ctx) testCases := []struct { name string height int64 ...
cwe
CWE-287
Go
static int get_default_root(pool *p, int allow_symlinks, char **root) { config_rec *c = NULL; char *dir = NULL; int res; c = find_config(main_server->conf, CONF_PARAM, "DefaultRoot", FALSE); while (c) { pr_signals_handle(); /* Check the groups acl */ if (c->argc < 2) { dir = c->argv[0]; ...
cwe
CWE-59
C/C++
netdutils::Status XfrmController::ipSecSetEncapSocketOwner(const android::base::unique_fd& socket, int newUid, uid_t callerUid) { ALOGD("XfrmController:%s, line=%d", __FUNCTION__, __LINE__); const int fd = socket.get(); struct stat info; if (fstat(fd, &info)) { return netdutils::statusFromErrno(errno, "Failed...
cwe
CWE-909
C/C++
// SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (C) 2016 Namjae Jeon <linkinjeon@kernel.org> * Copyright (C) 2018 Samsung Electronics Co., Ltd. */ #include "glob.h" #include "nterr.h" #include "smb_common.h" #include "smbstatus.h" #include "mgmt/user_session.h" #include "connection.h" static int ch...
cwe
CWE-125
C/C++
dns_cache_find_delegation(struct module_env* env, uint8_t* qname, size_t qnamelen, uint16_t qtype, uint16_t qclass, struct regional* region, struct dns_msg** msg, time_t now) { /* try to find closest NS rrset */ struct ub_packed_rrset_key* nskey; struct packed_rrset_data* nsdata; struct delegpt* dp; nskey = f...
cwe
CWE-613
Unknown
int ff_h263_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; MpegEncContext *s = avctx->priv_data; int ret; int slice_ret = 0; AVFrame *pict = data; /* no suppleme...
cwe
CWE-617
Unknown
static void kvm_vcpu_ioctl_x86_get_vcpu_events(struct kvm_vcpu *vcpu, struct kvm_vcpu_events *events) { events->exception.injected = vcpu->arch.exception.pending && !kvm_exception_is_soft(vcpu->arch.exception.nr); events->exception.nr = vcpu->arch.exception.nr; events->exception.has_error_code = vcpu...
cwe
CWE-200
Unknown
R_API void r_core_anal_esil(RCore *core, const char *str, const char *target) { bool cfg_anal_strings = r_config_get_i (core->config, "anal.strings"); bool emu_lazy = r_config_get_i (core->config, "emu.lazy"); bool gp_fixed = r_config_get_i (core->config, "anal.gpfixed"); RAnalEsil *ESIL = core->anal->esil; ut64 r...
cwe
CWE-416
Unknown
int iscsi_conn_get_param(struct iscsi_cls_conn *cls_conn, enum iscsi_param param, char *buf) { struct iscsi_conn *conn = cls_conn->dd_data; int len; switch(param) { case ISCSI_PARAM_PING_TMO: len = sprintf(buf, "%u\n", conn->ping_timeout); break; case ISCSI_PARAM_RECV_TMO: len = sprintf(buf, "%u\n", con...
cwe
CWE-787
Unknown
crypt_pw_cmp(const char *userpwd, const char *dbpwd) { int rc; char *cp; struct crypt_data data; data.initialized = 0; /* we use salt (first 2 chars) of encoded password in call to crypt_r() */ cp = crypt_r(userpwd, dbpwd, &data); if (cp) { rc = slapi_ct_memcmp(dbpwd, cp, strlen(dbp...
cwe
CWE-284
C/C++
/* * GPAC - Multimedia Framework C SDK * * Authors: Jean Le Feuvre * Copyright (c) Telecom ParisTech 2000-2022 * All rights reserved * * This file is part of GPAC / ISO Media File Format sub-project * * GPAC is free software; you can redistribute it and/or modify * it under the terms of the GNU L...
cwe
CWE-787
C/C++
void setup(MockitoComponentManager componentManager) throws Exception { DocumentReferenceResolver<String> currentReferenceResolver = componentManager.getInstance(DocumentReferenceResolver.TYPE_STRING, "current"); when(currentReferenceResolver.resolve(testSource)).thenReturn(documentRefer...
cwe
CWE-94
Java
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ #include <stddef.h> #include <stdint.h> #include <string.h> #include "lsquic.h" #include "lsquic_types.h" #include "lsquic_int_types.h" #include "lsquic_enc_sess.h" #include "lsquic_version.h" const char *const lsquic_enclev2str[] = { [ENC...
cwe
CWE-476
C/C++
processQueryResponse(struct module_qstate* qstate, struct iter_qstate* iq, struct iter_env* ie, int id) { int dnsseclame = 0; enum response_type type; iq->num_current_queries--; if(!inplace_cb_query_response_call(qstate->env, qstate, iq->response)) log_err("unable to call query_response callback"); if(iq->re...
cwe
CWE-703
Unknown
$value = str_replace($originalName, $cleanedName, $value); } unset($value); } $result = hash_equals(GeneralUtility::hmac(serialize($fieldChangeFunctions)), $this->parameters['fieldChangeFuncHash']); } return $result; }
cwe
CWE-200
PHP
TfLiteTensor* GetTempLhs(TfLiteContext* context, TfLiteNode* node, const TfLiteTensor* lhs) { TfLiteTensor* transposed_lhs = GetTemporary(context, node, 0); if (lhs->type == kTfLiteInt8) { // Get the quantization params from the LHS tensor. transposed_lhs->params.scale = lhs->params...
cwe
CWE-125
Unknown
static int crypto_skcipher_init_tfm(struct crypto_tfm *tfm) { struct crypto_skcipher *skcipher = __crypto_skcipher_cast(tfm); struct skcipher_alg *alg = crypto_skcipher_alg(skcipher); if (tfm->__crt_alg->cra_type == &crypto_blkcipher_type) return crypto_init_skcipher_ops_blkcipher(tfm); if (tfm->__crt_alg->cra_...
cwe
CWE-476
C/C++
void dwc3_gadget_giveback(struct dwc3_ep *dep, struct dwc3_request *req, int status) { struct dwc3 *dwc = dep->dwc; req->started = false; list_del(&req->list); req->remaining = 0; if (req->request.status == -EINPROGRESS) req->request.status = status; if (req->trb) usb_gadget_unmap_request_by_dev(dwc->s...
cwe
CWE-667
C/C++
function buildQueryString(obj) { let str = "" if (obj) { for (let [key, value] of Object.entries(obj)) { if (!key || key === "") { continue } if (str !== "") { str += "&" } str += `${key}=${encodeURIComponent(value || "")}` } } return str }
cwe
CWE-913
JavaScript
static int ext4_init_block_bitmap(struct super_block *sb, struct buffer_head *bh, ext4_group_t block_group, struct ext4_group_desc *gdp) { unsigned int bit, bit_max; struct ext4_sb_info *sbi = EXT4_SB(sb); ext4_fsblk_t start, tmp; int flex_bg = 0; J_ASSERT_BH(bh, buffer_locked(bh)); /* If c...
cwe
CWE-787
C/C++
// A RestWrite encapsulates everything we need to run an operation // that writes to the database. // This could be either a "create" or an "update". var SchemaController = require('./Controllers/SchemaController'); var deepcopy = require('deepcopy'); const Auth = require('./Auth'); var cryptoUtils = require('./crypt...
cwe
CWE-1321
JavaScript
Http::FilterHeadersStatus OAuth2Filter::decodeHeaders(Http::RequestHeaderMap& headers, bool) { // The following 2 headers are guaranteed for regular requests. The asserts are helpful when // writing test code to not forget these important variables in mock requests const Http::HeaderEntry* host_header = headers....
cwe
CWE-416
Unknown
/* This file was converted by gperf_unfold_key_conv.py from gperf output file. */ /* ANSI-C code produced by gperf version 3.0.4 */ /* Command-line: gperf -n -C -T -c -t -j1 -L ANSI-C -F,-1,0 -N unicode_unfold_key unicode_unfold_key.gperf */ /* Computed positions: -k'1-3' */ /* This gperf source file was gene...
cwe
CWE-787
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-732
Java
package http import ( "io/fs" "net/http" "github.com/gorilla/mux" "github.com/filebrowser/filebrowser/v2/settings" "github.com/filebrowser/filebrowser/v2/storage" ) type modifyRequest struct { What string `json:"what"` // Answer to: what data type? Which []string `json:"which"` // Answer to: which fields...
cwe
CWE-79
Go
function showEditUser (request) { console.log("showEditUser",request); if (request.readyState==4) { var jsonData = JSON.parse(request.responseText); console.log(jsonData); editUser_data = jsonData; try{editUser_u2ftokens=JSON.parse(jsonData.u2fdata);}catch(ex){editUser_u2ftokens=[];} if(!editUser_u2ftokens...
cwe
CWE-79
JavaScript
find_closest_of_type(struct module_env* env, uint8_t* qname, size_t qnamelen, uint16_t qclass, time_t now, uint16_t searchtype, int stripfront) { struct ub_packed_rrset_key *rrset; uint8_t lablen; if(stripfront) { /* strip off so that DNAMEs have strict subdomain match */ lablen = *qname; qname += lablen + ...
cwe
CWE-613
Unknown
static plist_t parse_array_node(struct bplist_data *bplist, const char** bnode, uint64_t size) { uint64_t j; uint32_t str_j = 0; uint32_t index1; plist_data_t data = plist_new_plist_data(); data->type = PLIST_ARRAY; data->length = size; plist_t node = node_create(NULL, data); for (j ...
cwe
CWE-125
C/C++
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build ignore /* Input to cgo -godefs. See README.md */ // +godefs map struct_in_addr [4]byte /* in_addr */ // +godefs map struct_in6_addr [16]byte /* in6...
cwe
CWE-287
Go
crm_recv_remote_msg(void *session, gboolean encrypted) { char *reply = NULL; xmlNode *xml = NULL; if (encrypted) { #ifdef HAVE_GNUTLS_GNUTLS_H reply = cib_recv_tls(session); #else CRM_ASSERT(encrypted == FALSE); #endif } else { reply = cib_recv_plaintext(GPOINTER_TO_INT...
cwe
CWE-399
C/C++
juniper_monitor_print(netdissect_options *ndo, const struct pcap_pkthdr *h, register const u_char *p) { struct juniper_l2info_t l2info; struct juniper_monitor_header { uint8_t pkt_type; uint8_t padding; uint8_t iif[2]; uint8_t service...
cwe
CWE-125
C/C++
exif_data_load_data_content (ExifData *data, ExifIfd ifd, const unsigned char *d, unsigned int ds, unsigned int offset, unsigned int recursion_cost) { ExifLong o, thumbnail_offset = 0, thumbnail_length = 0; ExifShort n; ExifEntry *entry; unsigned int i; ExifTag tag; if (!data || !data->priv) r...
cwe
CWE-190
Unknown
_dbus_read_socket_with_unix_fds (DBusSocket fd, DBusString *buffer, int count, int *fds, unsigned int *n_fds) { #ifndef HAVE_UNIX_FD_PASSING i...
cwe
CWE-404
C/C++
isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg) { uint minor = iminor(inode); isdn_ctrl c; int drvidx; int chidx; int ret; int i; char __user *p; char *s; union iocpar { char name[10]; char bname[22]; isdn_ioctl_struct iocts; isdn_net_ioctl_phone phone; isdn_net_ioctl_cfg cfg;...
cwe
CWE-119
Unknown
void add_cmdname(struct cmdnames *cmds, const char *name, size_t len) { struct cmdname *ent = malloc(sizeof(*ent) + len + 1); ent->len = len; memcpy(ent->name, name, len); ent->name[len] = 0; ALLOC_GROW(cmds->names, cmds->cnt + 1, cmds->alloc); cmds->names[cmds->cnt++] = ent; }
cwe
CWE-476
C/C++
void add_timer_on(struct timer_list *timer, int cpu) { struct timer_base *new_base, *base; unsigned long flags; timer_stats_timer_set_start_info(timer); BUG_ON(timer_pending(timer) || !timer->function); new_base = get_timer_cpu_base(timer->flags, cpu); /* * If @timer was on a different CPU, it should be migr...
cwe
CWE-200
Unknown
RemoteFsDevice::Details RemoteDevicePropertiesWidget::details() { int t=type->itemData(type->currentIndex()).toInt(); RemoteFsDevice::Details det; det.name=name->text().trimmed(); switch (t) { case Type_SshFs: { det.url.setHost(sshHost->text().trimmed()); det.url.setUserName(sshUser...
cwe
CWE-20
Unknown
function DragAndDropEditBlock(runtime, element, params) { var gettext; var ngettext; if ('DragAndDropI18N' in window) { // Use DnDv2's local translations gettext = function(string) { var translated = window.DragAndDropI18N.gettext(string); // if DnDv2's translation i...
cwe
CWE-79
Python
protected function _add_comment_log( $id, $action, $comment = null ) { if ( is_null( $comment ) ) $comment = get_comment( $id ); aal_insert_log( array( 'action' => $action, 'object_type' => 'Comments', 'object_subtype' => get_post_type( $comment->comment_post_ID ), 'object_name' => g...
cwe
CWE-79
PHP
static JSValue js_sys_basecode_ex(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv, Bool is_dec, Bool is_16) { u32 out_size=0; u8 *out_ptr = NULL; JSValue res; GF_Err e; if (!argc) return GF_JS_EXCEPTION(ctx); if (is_dec) { u32 len; const char *str = JS_ToCString(ctx, argv[0]); if (!str)...
cwe
CWE-787
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
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* vim: set sw=4 sts=4 expandtab: */ /* rsvg-defs.c: Manage SVG defs and references. Copyright (C) 2000 Eazel, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public ...
cwe
CWE-255
C/C++
static int do_move_pages(struct mm_struct *mm, struct page_to_node *pm, int migrate_all) { int err; struct page_to_node *pp; LIST_HEAD(pagelist); down_read(&mm->mmap_sem); /* * Build a list of pages to migrate */ migrate_prep(); for (pp = pm; pp->node != MAX_NUMNODES; pp++) { struct vm_area_struct *v...
cwe
CWE-20
Unknown
static int shash_no_setkey(struct crypto_shash *tfm, const u8 *key, unsigned int keylen) { return -ENOSYS; }
cwe
CWE-787
C/C++
static void dd_unlock(struct dump_dir *dd) { if (dd->locked) { dd->locked = 0; unsigned dirname_len = strlen(dd->dd_dirname); char lock_buf[dirname_len + sizeof("/.lock")]; strcpy(lock_buf, dd->dd_dirname); strcpy(lock_buf + dirname_len, "/.lock"); xunlink(lock_b...
cwe
CWE-20
Unknown
Pl_PNGFilter::decodePaeth() { QTC::TC("libtests", "Pl_PNGFilter decodePaeth"); unsigned char* buffer = this->cur_row + 1; unsigned char* above_buffer = this->prev_row + 1; unsigned int bpp = this->bytes_per_pixel; for (unsigned int i = 0; i < this->bytes_per_row; ++i) { int left = 0; ...
cwe
CWE-787
Unknown
func ZeroTierJoinNetwork(c *gin.Context) { networkId := c.Param("id") service.MyService.ZeroTier().ZeroTierJoinNetwork(networkId) if len(networkId) == 0 { c.JSON(http.StatusOK, model.Result{Success: oasis_err2.INVALID_PARAMS, Message: oasis_err2.GetMsg(oasis_err2.INVALID_PARAMS)}) return } c.JSON(http.StatusOK...
cwe
CWE-78
Go
static int sanity_check_raw_super(struct super_block *sb, struct f2fs_super_block *raw_super) { unsigned int blocksize; if (F2FS_SUPER_MAGIC != le32_to_cpu(raw_super->magic)) { f2fs_msg(sb, KERN_INFO, "Magic Mismatch, valid(0x%x) - read(0x%x)", F2FS_SUPER_MAGIC, le32_to_cpu(raw_super->magic)); return 1;...
cwe
CWE-787
C/C++
/* dcraw.c -- Dave Coffin's raw photo decoder Copyright 1997-2013 by Dave Coffin, dcoffin a cybercom o net This is a command-line ANSI C program to convert raw photos from any digital camera on any computer running any operating system. No license is required to download and use dcraw.c. However, t...
cwe
CWE-119
C/C++
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) { static const int kOutputUniqueTensor = 0; static const int kOutputIndexTensor = 1; TF_LITE_ENSURE_EQ(context, NumInputs(node), 1); TF_LITE_ENSURE_EQ(context, NumOutputs(node), 2); const TfLiteTensor* input = GetInput(context, node, 0); TfLite...
cwe
CWE-787
C/C++
void PPB_URLLoader_Impl::FinishLoading(int32_t done_status) { done_status_ = done_status; if (TrackedCallback::IsPending(pending_callback_)) RunCallback(done_status_); }
cwe
CWE-119
C/C++
static int process_one_ticket(struct ceph_auth_client *ac, struct ceph_crypto_key *secret, void **p, void *end, void *dbuf, void *ticket_buf) { struct ceph_x_info *xi = ac->private; int type; u8 tkt_struct_v, blob_struct_v; struct ceph_x_ticket_handler *th; void *dp, *dend; int dlen; c...
cwe
CWE-119
C/C++
"""CILogon OAuthAuthenticator for JupyterHub Uses OAuth 2.0 with cilogon.org (override with CILOGON_HOST) Caveats: - For allowed user list /admin purposes, username will be the ePPN by default. This is typically an email address and may not work as a Unix userid. Normalization may be required to turn the Jupyter...
cwe
CWE-863
Python
def readOptInt(json: JsValue, fieldName: String, altName: String = "", min: Opt[i32] = None, max: Opt[i32] = None): Option[Int] = { readOptLong(json, fieldName).orElse(readOptLong(json, altName)) map { valueAsLong => val maxVal = max getOrElse Int.MaxValue val minVal = min getOrElse Int.MinVal...
cwe
CWE-613
Scala
apr_status_t h2_stream_recv_frame(h2_stream *stream, int ftype, int flags, size_t frame_len) { apr_status_t status = APR_SUCCESS; int new_state, eos = 0; new_state = on_frame_recv(stream->state, ftype); if (new_state < 0) { ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, stream->session->c, ...
cwe
CWE-770
Unknown
function uploadFile(ev) { var form, data, dialog, filename; ev.preventDefault(); form = $("#upload-form"); filename = form.find('input[name="file"]').val(); console.log("Filename: "+filename); if (filename === "") { alert("No file selected"); retur...
cwe
CWE-79
JavaScript
function Kt(e,t){var n,r;e&&e.response&&e.response.body?n=s()(r="".concat(e.response.body.code," ")).call(r,e.response.body.message):n=e.message;return new Ut("Could not resolve reference: ".concat(n),t,e)}
cwe
CWE-451
JavaScript
function E(){var b,c,d,e,f;if(Bc++,b=vc,c=[],d=vc,46===a.charCodeAt(vc)?(e=Va,vc++):(e=X,0===Bc&&g(Wa)),e!==X?(f=C(),f!==X?(wc=d,e=tb(f),d=e):(vc=d,d=aa)):(vc=d,d=aa),d!==X)for(;d!==X;)c.push(d),d=vc,46===a.charCodeAt(vc)?(e=Va,vc++):(e=X,0===Bc&&g(Wa)),e!==X?(f=C(),f!==X?(wc=d,e=tb(f),d=e):(vc=d,d=aa)):(vc=d,d=aa);els...
cwe
CWE-1321
JavaScript
package com.appsmith.util; import org.springframework.http.client.reactive.ReactorClientHttpConnector; import org.springframework.web.reactive.function.client.WebClient; import reactor.netty.http.client.HttpClient; public class WebClientUtils { private WebClientUtils() { } public static WebClient create...
cwe
CWE-918
Java
int ssh_dh_generate_y(ssh_session session) { session->next_crypto->y = bignum_new(); if (session->next_crypto->y == NULL) { return -1; } #ifdef HAVE_LIBGCRYPT bignum_rand(session->next_crypto->y, 128); #elif defined HAVE_LIBCRYPTO bignum_rand(session->next_crypto->y, 128, 0, -1); #endif /* not harde...
cwe
CWE-200
Unknown
handle_smtp_call(int *listen_sockets, int listen_socket_count, int accept_socket, struct sockaddr *accepted) { pid_t pid; union sockaddr_46 interface_sockaddr; EXIM_SOCKLEN_T ifsize = sizeof(interface_sockaddr); int dup_accept_socket = -1; int max_for_this_host = 0; int wfsize = 0; int wfptr = 0; int use_log_write_se...
cwe
CWE-264
Unknown
*/ static int send_client_reply_packet(MCPVIO_EXT *mpvio, const uchar *data, int data_len) { MYSQL *mysql= mpvio->mysql; NET *net= &mysql->net; char *buff, *end; size_t buff_size; size_t connect_attrs_len= (mysql->server_capabilities & CLIENT_CONNECT_ATTRS && mysql...
cwe
CWE-319
Unknown
return ia}function A(){function ea(ra,ia){var Da=mxResources.get(ra);null==Da&&(Da=ra.substring(0,1).toUpperCase()+ra.substring(1));18<Da.length&&(Da=Da.substring(0,18)+"&hellip;");return Da+" ("+ia.length+")"}function ta(ra,ia,Da){mxEvent.addListener(ia,"click",function(){Ea!=ia&&(Ea.style.backgroundColor="",Ea=ia,Ea....
cwe
CWE-94
JavaScript
public function checkRolesRight($right = null) { if ((int) $this->getValue('usr_id') === 0) { return false; } if (count($this->rolesRights) === 0) { $this->assignRoles = false; $tmpRolesRights = array( 'rol_all_lists_view' => false, ...
cwe
CWE-613
PHP
static int store_xauthority(void) { fs_build_mnt_dir(); char *src; char *dest = RUN_XAUTHORITY_FILE; FILE *fp = fopen(dest, "w"); if (fp) { fprintf(fp, "\n"); SET_PERMS_STREAM(fp, getuid(), getgid(), 0600); fclose(fp); } if (asprintf(&src, "%s/.Xauthority", cfg.homedir) == -1) errExit("asprintf"); ...
cwe
CWE-269
C/C++