code
stringlengths
10
33.4M
task
stringclasses
2 values
label
stringclasses
121 values
language
stringclasses
13 values
/* * Copyright (C) 2019 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-269
Java
main(int argc, char *argv[]) { char pidstr[16]; ssize_t ret; int c, log_method; char *logfile, *pidfile; int facility, fd; char *username = NULL; char *chrootdir = NULL; int configtest = 0; int singleprocess = 0; #ifdef HAVE_GETOPT_LONG int opt_idx; #endif pname = ((pname=strrchr(argv[0],'/')) != NULL)?pnam...
cwe
CWE-20
C/C++
public function misc_tab( $post ) { $upgrade_link = Envira_Gallery_Common_Admin::get_instance()->get_upgrade_link( 'http://enviragallery.com/docs/creating-first-envira-gallery/', 'adminpagemisc', 'readthedocumentation' ); ?> <div id="envira-misc"> <p class="envira-intro"> ...
cwe
CWE-79
PHP
function setGuestLobbyMessage(message) { try { check(message, String); const { meetingId, requesterUserId } = extractCredentials(this.userId); check(meetingId, String); check(requesterUserId, String); const payload = { message }; Logger.info(`User=${requesterUserId} set guest lobby message...
cwe
CWE-79
JavaScript
function doSearch(searchStr) { if (lastSearchStr == searchStr && isGetAll == lastGetAll) return; deselectTempCat(); tempDlgContent.scrollTop = 0; diagramsTiles.innerHTML = ''; diagramsListTitle.innerHTML = mxUtils.htmlEntities(mxResources.get('searchResults')) + ' "' + mxUtils.htmlEntities(sear...
cwe
CWE-94
JavaScript
static void add_bytes_c(uint8_t *dst, uint8_t *src, int w){ long i; for(i=0; i<=w-sizeof(long); i+=sizeof(long)){ long a = *(long*)(src+i); long b = *(long*)(dst+i); *(long*)(dst+i) = ((a&pb_7f) + (b&pb_7f)) ^ ((a^b)&pb_80); } for(; i<w; i++) dst[i+0] += src[i+0]; }
cwe
CWE-189
Unknown
static void _slurm_rpc_allocate_pack(slurm_msg_t * msg) { static int select_serial = -1; static int active_rpc_cnt = 0; int error_code = SLURM_SUCCESS, inx, pack_cnt = -1; DEF_TIMERS; job_desc_msg_t *job_desc_msg; List job_req_list = (List) msg->data; /* Locks: Read config, write job, write node, read partition ...
cwe
CWE-20
Unknown
resolve_op_end (FlatpakTransaction *self, FlatpakTransactionOperation *op, const char *checksum, GFile *sideload_path, GBytes *metadata_bytes) { g_autoptr(GBytes) old_metadata_bytes = NULL; old_metadata_bytes = load_deployed_metadata (self, op->ref, N...
cwe
CWE-269
C/C++
function g(t){return t&&Promise.resolve(t)===t}
cwe
CWE-1236
JavaScript
static int mpage_da_map_blocks(struct mpage_da_data *mpd) { int err, blks, get_blocks_flags; struct buffer_head new; sector_t next = mpd->b_blocknr; unsigned max_blocks = mpd->b_size >> mpd->inode->i_blkbits; loff_t disksize = EXT4_I(mpd->inode)->i_disksize; handle_t *handle = NULL; /* * We consider only non-...
cwe
CWE-703
Unknown
def swap_public_ssh_key(remote_node): """ Swap public ssh key between remote_node and local """ # Detect whether need password to login to remote_node if utils.check_ssh_passwd_need(remote_node): # If no passwordless configured, paste /root/.ssh/id_rsa.pub to remote_node's /root/.ssh/authori...
cwe
CWE-269
Python
package org.openmrs.module.appointmentscheduling; import org.openmrs.BaseOpenmrsData; import org.openmrs.Patient; import org.openmrs.Provider; import java.util.Date; /** * persisted object that reflects a request by a provider (or other user) for a scheduler to schedule a patient for a future appointment; * has an...
cwe
CWE-74
Java
protected function _filePutContents($path, $content) { return $this->query(sprintf('UPDATE %s SET content="%s", size=%d, mtime=%d WHERE id=%d LIMIT 1', $this->tbf, $this->db->real_escape_string($content), strlen($content), time(), $path)); }
cwe
CWE-89
JavaScript
CreateForeignServer(CreateForeignServerStmt *stmt) { Relation rel; Datum srvoptions; Datum values[Natts_pg_foreign_server]; bool nulls[Natts_pg_foreign_server]; HeapTuple tuple; Oid srvId; Oid ownerId; AclResult aclresult; ObjectAddress myself; ObjectAddress referenced; ForeignDataWrapper *fdw; rel ...
cwe
CWE-94
Unknown
function braceExpand (pattern, options) { if (!options) { if (this instanceof Minimatch) { options = this.options } else { options = {} } } pattern = typeof pattern === 'undefined' ? this.pattern : pattern if (typeof pattern === 'undefined') { throw new TypeError('undefined pat...
cwe
CWE-1333
JavaScript
static void mntput_no_expire(struct mount *mnt) { rcu_read_lock(); mnt_add_count(mnt, -1); if (likely(mnt->mnt_ns)) { /* shouldn't be the last one */ rcu_read_unlock(); return; } lock_mount_hash(); if (mnt_get_count(mnt)) { rcu_read_unlock(); unlock_mount_hash(); return; } if (unlikely(mnt->mnt.mnt_fl...
cwe
CWE-284
C/C++
GIT_INLINE(bool) verify_dotgit_ntfs(git_repository *repo, const char *path, size_t len) { git_buf *reserved = git_repository__reserved_names_win32; size_t reserved_len = git_repository__reserved_names_win32_len; size_t start = 0, i; if (repo) git_repository__reserved_names(&reserved, &reserved_len, repo, true); ...
cwe
CWE-20
C/C++
char *compose_path(ctrl_t *ctrl, char *path) { struct stat st; static char rpath[PATH_MAX]; char *name, *ptr; char dir[PATH_MAX] = { 0 }; strlcpy(dir, ctrl->cwd, sizeof(dir)); DBG("Compose path from cwd: %s, arg: %s", ctrl->cwd, path ?: ""); if (!path || !strlen(path)) goto check; if (path) { if (path[0] ...
cwe
CWE-22
C/C++
void WebGL2RenderingContextBase::bindVertexArray( WebGLVertexArrayObject* vertex_array) { if (isContextLost()) return; if (vertex_array && (vertex_array->IsDeleted() || !vertex_array->Validate(nullptr, this))) { SynthesizeGLError(GL_INVALID_OPERATION, "bindVertexArray", "i...
cwe
CWE-787
C/C++
#include "crypto.h" #include <tier0/vprof.h> #include <tier0/dbg.h> #include "tier0/memdbgoff.h" #include <sodium.h> #include "tier0/memdbgon.h" #ifdef STEAMNETWORKINGSOCKETS_CRYPTO_LIBSODIUM SymmetricCryptContextBase::SymmetricCryptContextBase() : m_ctx(nullptr), m_cbIV(0), m_cbTag(0) { } void SymmetricCryptC...
cwe
CWE-787
C/C++
int wmi_set_ie(struct wil6210_priv *wil, u8 type, u16 ie_len, const void *ie) { static const char *const names[] = { [WMI_FRAME_BEACON] = "BEACON", [WMI_FRAME_PROBE_REQ] = "PROBE_REQ", [WMI_FRAME_PROBE_RESP] = "WMI_FRAME_PROBE_RESP", [WMI_FRAME_ASSOC_REQ] = "WMI_FRAME_ASSOC_REQ", [WMI_FRAME_ASSOC_RESP] = "WM...
cwe
CWE-119
Unknown
def search escaped = params[:name].gsub('\\', '\\\\\\\\').gsub('%', '\%').gsub('_', '\_') @searched = Restaurant.where("name like '%" + escaped + "%'" + "or hurigana like '%" + escaped + "%'") if @searched.empty? @error = "検索ワードがヒットしませんでした。もう一度入れなおして下さい。" end end
cwe
CWE-89
Ruby
internals.Socket.prototype._authenticate = function () { const config = this._listener._settings.auth; if (!config) { return; } if (config.timeout) { this.auth._timeout = setTimeout(() => this.disconnect(), config.timeout); } const cookies = this._ws.upgradeReq.headers.cookie;...
cwe
CWE-400
JavaScript
int x86_emulate_instruction(struct kvm_vcpu *vcpu, gpa_t cr2_or_gpa, int emulation_type, void *insn, int insn_len) { int r; struct x86_emulate_ctxt *ctxt = vcpu->arch.emulate_ctxt; bool writeback = true; bool write_fault_to_spt; if (unlikely(!kvm_can_emulate_insn(vcpu, emulation_type, insn, insn_len))) r...
cwe
CWE-476
Unknown
TPMA_SESSION_Unmarshal(TPMA_SESSION *target, BYTE **buffer, INT32 *size) { TPM_RC rc = TPM_RC_SUCCESS; if (rc == TPM_RC_SUCCESS) { rc = UINT8_Unmarshal((UINT8 *)target, buffer, size); /* libtpms changed */ } if (rc == TPM_RC_SUCCESS) { if (*target & TPMA_SESSION_reserved) { rc = TPM_RC_RESERVED...
cwe
CWE-787
Unknown
create_filesystem_object(struct archive_write_disk *a) { /* Create the entry. */ const char *linkname; mode_t final_mode, mode; int r; /* We identify hard/symlinks according to the link names. */ /* Since link(2) and symlink(2) don't handle modes, we're done here. */ linkname = archive_entry_hardlink(a->e...
cwe
CWE-20
C/C++
TfLiteStatus EvalHashtableSize(TfLiteContext* context, TfLiteNode* node) { const TfLiteTensor* input_resource_id_tensor = GetInput(context, node, kInputResourceIdTensor); int resource_id = input_resource_id_tensor->data.i32[0]; TfLiteTensor* output_tensor = GetOutput(context, node, kOutputTensor); auto* ...
cwe
CWE-125
C/C++
def self._all # :nodoc: unless defined?(@@all) && @@all then @@all = stubs.map(&:to_spec) # After a reset, make sure already loaded specs # are still marked as activated. specs = {} Gem.loaded_specs.each_value{|s| specs[s] = true} @@all.each{|s| s.activated = true if specs[s]} ...
cwe
CWE-502
Ruby
xcf_load_old_paths (XcfInfo *info, GimpImage *image) { guint32 num_paths; guint32 last_selected_row; GimpVectors *active_vectors; xcf_read_int32 (info, &last_selected_row, 1); xcf_read_int32 (info, &num_paths, 1); while (num_paths-- > 0) xcf_load_old_path (info,...
cwe
CWE-120
Unknown
public void translate(ServerUpdateTileEntityPacket packet, GeyserSession session) { String id = BlockEntityUtils.getBedrockBlockEntityId(packet.getType().name()); if (packet.getNbt().isEmpty()) { // Fixes errors in servers sending empty NBT BlockEntityUtils.updateBlockEntity(session, NbtMap....
cwe
CWE-287
Java
/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. */ /* * lsquic_qdec_hdl.c -- QPACK decoder streams handler */ #include <assert.h> #include <errno.h> #include <inttypes.h> #include <stdlib.h> #include <string.h> #include <sys/queue.h> #include "lsquic.h" #include "lsquic_types.h" #include "lsx...
cwe
CWE-476
C/C++
ReceiveAndUnpackTarFile(PGconn *conn, PGresult *res, int rownum) { char current_path[MAXPGPATH]; char filename[MAXPGPATH]; int current_len_left; int current_padding = 0; bool basetablespace = PQgetisnull(res, rownum, 0); char *copybuf = NULL; FILE *file = NULL; if (basetablespace) strcpy(current...
cwe
CWE-119
Unknown
wf_cliprdr_server_file_contents_request(CliprdrClientContext* context, const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest) { DWORD uSize = 0; BYTE* pData = NULL; HRESULT hRet = S_OK; FORMATETC vFormatEtc; LPDATAOBJECT pDataObj = NULL; STGMEDIUM vStgMedium; BOOL bIsSt...
cwe
CWE-20
Unknown
MagickExport MagickBooleanType RegisterStaticModule(const char *module, ExceptionInfo *exception) { char module_name[MagickPathExtent]; PolicyRights rights; const CoderInfo *p; size_t extent; ssize_t i; /* Assign module name from alias. */ assert(module != (const char *) N...
cwe
CWE-200
Unknown
void Curl_attach_connnection(struct Curl_easy *data, struct connectdata *conn) { DEBUGASSERT(!data->conn); DEBUGASSERT(conn); data->conn = conn; Curl_llist_insert_next(&conn->easyq, conn->easyq.tail, data, &data->conn_queue); if(conn->handler->attach) ...
cwe
CWE-295
Unknown
int nfc_fw_download(struct nfc_dev *dev, const char *firmware_name) { int rc = 0; pr_debug("%s do firmware %s\n", dev_name(&dev->dev), firmware_name); device_lock(&dev->dev); if (!device_is_registered(&dev->dev)) { rc = -ENODEV; goto error; } if (dev->dev_up) { rc = -EBUSY; goto error; } if (!dev->...
cwe
CWE-416
Unknown
/* * Copyright © 2015-2018 Aeneas Rekkas <aeneas+oss@aeneas.io> * * 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...
cwe
CWE-20
Go
require('dotenv').config(); const randUserAgent = require('./utils/rand-user-agent'); let envs = process.env; let value; const TRUE_UA = 'RSSHub/1.0 (+http://github.com/DIYgod/RSSHub; like FeedFetcher-Google)'; const calculateValue = () => { const bilibili_cookies = {}; const twitter_tokens = {}; const ema...
cwe
CWE-918
JavaScript
def __init__(self, pidfile=None): if not pidfile: self.pidfile = "/tmp/%s.pid" % self.__class__.__name__.lower() else: self.pidfile = pidfile
cwe
CWE-59
Python
/* * Copyright (c) 2011-2015 The original author or authors * ------------------------------------------------------ * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * and Apache License v2.0 which accompanies this distr...
cwe
CWE-287
Java
package open import ( "fmt" "os/exec" "runtime" ) var execCommand = exec.Command // Browser takes a url and opens it using the default browser on the operating system func Browser(url string) error { var err error switch runtime.GOOS { case "linux": err = execCommand("xdg-open", url).Start() case "windows"...
cwe
CWE-78
Go
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % ...
cwe
CWE-190
C/C++
null!=na){ca=ha.getAttribute("section");aa=ha.getAttribute("subsection");if(null==ca&&(la=na.indexOf("/"),ca=na.substring(0,la),null==aa)){var oa=na.indexOf("/",la+1);-1<oa&&(aa=na.substring(la+1,oa))}la=za[ca];null==la&&(xa++,la=[],za[ca]=la);na=ha.getAttribute("clibs");null!=qa[na]&&(na=qa[na]);na={url:ha.getAttribut...
cwe
CWE-94
JavaScript
/* * Swagger Petstore * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * * NOTE: This class is auto generated by the swagger code generator p...
cwe
CWE-732
Java
/* 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-197
C/C++
pdf_repair_xref(fz_context *ctx, pdf_document *doc) { int c; pdf_lexbuf *buf = &doc->lexbuf.base; int num_roots = 0; int max_roots = 0; fz_var(encrypt); fz_var(id); fz_var(roots); fz_var(num_roots); fz_var(max_roots); fz_var(info); fz_var(list); fz_var(obj); if (doc->repair_attempted) fz_throw(ctx, FZ...
cwe
CWE-416
C/C++
dwarf_global_formref_b(Dwarf_Attribute attr, Dwarf_Off * ret_offset, Dwarf_Bool * offset_is_info, Dwarf_Error * error) { Dwarf_Debug dbg = 0; Dwarf_Unsigned offset = 0; Dwarf_CU_Context cu_context = 0; Dwarf_Half context_version = 0; Dwarf_Byte_Ptr section_end = 0; Dwarf_Bool is_info...
cwe
CWE-703
C/C++
function er(e,t){return[t,e]}
cwe
CWE-200
JavaScript
/* Copyright (c) 1996-2015, OPC Foundation. All rights reserved. The source code in this file is covered under a dual-license scenario: - RCL: for OPC Foundation members in good-standing - GPL V2: everybody else RCL license terms accompanied with this source code. See http://opcfoundation.org/License/RC...
cwe
CWE-400
Java
jbig2_decode_gray_scale_image(Jbig2Ctx *ctx, Jbig2Segment *segment, const byte *data, const size_t size, bool GSMMR, uint32_t GSW, uint32_t GSH, uint32_t GSBPP, bool GSUSESKIP, Jbig2Image *GSKIP, int GSTEMPLATE, Jbig2ArithCx *GB_s...
cwe
CWE-190
C/C++
static int lmf_header_load(lmf_header *lmfh, RBuffer *buf, Sdb *db) { if (r_buf_size (buf) < sizeof (lmf_header)) { return false; } if (r_buf_fread_at (buf, QNX_HEADER_ADDR, (ut8 *) lmfh, "iiiiiiiicccciiiicc", 1) < QNX_HDR_SIZE) { return false; } r_strf_buffer (32); sdb_set (db, "qnx.version", r_strf ("0x%xH"...
cwe
CWE-400
C/C++
bgp_size_t bgp_packet_attribute(struct bgp *bgp, struct peer *peer, struct stream *s, struct attr *attr, struct bpacket_attr_vec_arr *vecarr, struct prefix *p, afi_t afi, safi_t safi, struct peer *from, struct prefix_rd *prd, mpls_label_t *label, uint32_t num_labels, int addpath_encode, uint32_t...
cwe
CWE-20
Unknown
function f(a,b){var d=/^([-\w:]+)/.exec(a[b]),f={};f.name=d[1].toLowerCase();f.c=g.f[f.name];for(var e=a[b].substr(d[0].length),h=b+1,j=a.length;h<j&&">"!==a[h];h++)e+=a[h];if(!(j<=h)){for(var l=[];""!== e;)if(d=ja.exec(e))if(d[4]&&!d[5]||d[6]&&!d[7]){for(var d=d[4]||d[6],i=C,e=[e,a[h++]];h<j;h++){if(i){if(">"===a[h])b...
cwe
CWE-94
JavaScript
/* * MOV, 3GP, MP4 muxer * Copyright (c) 2003 Thomas Raivio * Copyright (c) 2004 Gildas Bazin <gbazin at videolan dot org> * Copyright (c) 2009 Baptiste Coudurier <baptiste dot coudurier at gmail dot com> * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it u...
cwe
CWE-125
C/C++
private function _handleCallback(){ try { // Try to get an access token using the authorization code grant. $accessToken = $this->_provider->getAccessToken('authorization_code', [ 'code' => $_GET['code'] ]); } catch (\League\OAuth2\Client\Provider\Exception\IdentityProviderException $e) { // Faile...
cwe
CWE-352
PHP
int ParseDsdiffHeaderConfig (FILE *infile, char *infilename, char *fourcc, WavpackContext *wpc, WavpackConfig *config) { int64_t infilesize, total_samples; DFFFileHeader dff_file_header; DFFChunkHeader dff_chunk_header; uint32_t bcount; infilesize = DoGetFileSize (infile); memcpy (&dff_file_hea...
cwe
CWE-125
Unknown
def post(self, request): totp_secret = pyotp.random_base32() request.user.totp_secret = totp_secret request.user.totp_status = TOTPStatus.VERIFYING request.user.save() add_2fa.send(sender=self.__class__, user=request.user) return FormattedResponse({"totp_secret": totp_sec...
cwe
CWE-287
Python
int rsa_rsaes_oaep_decrypt( rsa_context *ctx, int mode, const unsigned char *label, size_t label_len, size_t *olen, const unsigned char *input, unsigned char *output, ...
cwe
CWE-310
Unknown
private boolean isAdmin(String accountName) { if (this.adminFilter != null) { try { InitialDirContext context = initContext(); String searchString = adminFilter.replace(":login", accountName); SearchControls searchControls = new SearchControls(); ...
cwe
CWE-74
Java
static void parse_rtcp_bye(pjmedia_rtcp_session *sess, const void *pkt, pj_size_t size) { pj_str_t reason = {"-", 1}; /* Check and get BYE reason */ if (size > 8) { reason.slen = PJ_MIN(sizeof(sess->stat.peer_sdes_buf_), *((pj_uint8_t*)pkt+8)); pj_memcpy(sess->sta...
cwe
CWE-125
Unknown
static int __ext4_get_inode_loc(struct inode *inode, struct ext4_iloc *iloc, int in_mem) { struct ext4_group_desc *gdp; struct buffer_head *bh; struct super_block *sb = inode->i_sb; ext4_fsblk_t block; int inodes_per_block, inode_offset; iloc->bh = NULL; if (!ext4_valid_inum(sb, inode->i_ino)) return -...
cwe
CWE-787
Unknown
static int uvc_scan_chain_backward(struct uvc_video_chain *chain, struct uvc_entity **_entity) { struct uvc_entity *entity = *_entity; struct uvc_entity *term; int id = -EINVAL, i; switch (UVC_ENTITY_TYPE(entity)) { case UVC_VC_EXTENSION_UNIT: case UVC_VC_PROCESSING_UNIT: id = entity->baSourceID[0]; break; ...
cwe
CWE-269
Unknown
/* * See the NOTICE file distributed with this work for additional * information regarding copyright ownership. * * This 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 2.1 of * th...
cwe
CWE-327
Java
void DestroySkImageOnOriginalThread( sk_sp<SkImage> image, base::WeakPtr<WebGraphicsContext3DProviderWrapper> context_provider_wrapper, std::unique_ptr<gpu::SyncToken> sync_token) { if (context_provider_wrapper && image->isValid( context_provider_wrapper->ContextProvider()->GetGrContext())...
cwe
CWE-787
C/C++
/** * <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
static void vrend_renderer_init_blit_ctx(struct vrend_blitter_ctx *blit_ctx) { struct virgl_gl_ctx_param ctx_params; int i; if (blit_ctx->initialised) { vrend_clicbs->make_current(0, blit_ctx->gl_context); return; } ctx_params.shared = true; ctx_params.major_ver = VREND_GL_VER_MAJOR;...
cwe
CWE-772
C/C++
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include "JSLibInternal.h" #include "hermes/BCGen/HBC/BytecodeFileFormat.h" #include "hermes/Support/Base64vlq.h" #include "herm...
cwe
CWE-476
C/C++
def parse_uri(self, uri): """ Parse URLs. This method fixes an issue where credentials specified in the URL are interpreted differently in Python 2.6.1+ than prior versions of Python. It also deals with the peculiarity that new-style Swift URIs have where a username can contain a...
cwe
CWE-200
Python
public void write(byte[] b, int offset, int length) throws IOException { if (b == null) { throw new NullPointerException(); } if (offset < 0 || offset + length > b.length) { throw new ArrayIndexOutOfBoundsException(); } write(fd, b, offset, length); }
cwe
CWE-190
Java
int enter_svm_guest_mode(struct vcpu_svm *svm, u64 vmcb12_gpa, struct vmcb *vmcb12) { int ret; svm->nested.vmcb12_gpa = vmcb12_gpa; load_nested_vmcb_control(svm, &vmcb12->control); nested_prepare_vmcb_save(svm, vmcb12); nested_prepare_vmcb_control(svm); ret = nested_svm_load_cr3(&svm->vcpu, vmcb12->save.cr3...
cwe
CWE-416
Unknown
(function() { Sidebar.prototype.addC4Palette = function() { var w = 100; var h = 100; var gn = 'mxgraph.c4'; var dt = 'c4 '; var pts = 'points=[[0.25,0,0],[0.5,0,0],[0.75,0,0],[1,0.25,0],[1,0.5,0],[1,0.75,0],[0.75,1,0],[0.5,1,0],[0.25,1,0],[0,0.75,0],[0,0.5,0],[0,0.25,0]];'; this.setCurrentSearchEntryLibr...
cwe
CWE-79
Java
file_asynch_write (struct rw *rw, struct command *command, nbd_completion_callback cb) { int dummy = 0; file_synch_write (rw, slice_ptr (command->slice), command->slice.len, command->offset); if (cb.callback (cb.user_data, &dummy) == -1) { perror (rw-...
cwe
CWE-252
Unknown
Status Conv2DShapeImpl(shape_inference::InferenceContext* c, bool supports_explicit_padding) { string data_format_str, filter_format_str; if (!c->GetAttr("data_format", &data_format_str).ok()) { data_format_str = "NHWC"; } if (!c->GetAttr("filter_format", &filter_format_str).ok()) { ...
cwe
CWE-369
Unknown
exports.database.prototype.get = function (key, callback) { this.db.query("SELECT `value` FROM `store` WHERE `key` = ?", [key], function(err,results) { var value = null; if(!err && results.length == 1) { value = results[0].value; } callback(err,value); }); this.schedulePing()...
cwe
CWE-697
JavaScript
another_hunk (enum diff difftype, bool rev) { char *s; lin context = 0; size_t chars_read; char numbuf0[LINENUM_LENGTH_BOUND + 1]; char numbuf1[LINENUM_LENGTH_BOUND + 1]; char numbuf2[LINENUM_LENGTH_BOUND + 1]; char numbuf3[LINENUM_LENGTH_BOUND + 1]; while (p_end >= 0) { if (p_end == p...
cwe
CWE-399
Unknown
function wp_http_validate_url( $url ) { $original_url = $url; $url = wp_kses_bad_protocol( $url, array( 'http', 'https' ) ); if ( ! $url || strtolower( $url ) !== strtolower( $original_url ) ) { return false; } $parsed_url = @parse_url( $url ); if ( ! $parsed_url || empty( $parsed_url['host'] ) ) { ...
cwe
CWE-601
PHP
MagickExport MemoryInfo *AcquireVirtualMemory(const size_t count, const size_t quantum) { MemoryInfo *memory_info; size_t extent; if (CheckMemoryOverflow(count,quantum) != MagickFalse) return((MemoryInfo *) NULL); memory_info=(MemoryInfo *) MagickAssumeAligned(AcquireAlignedMemory(1, sizeof(...
cwe
CWE-120
Unknown
// Query Compiler // ------- const helpers = require('../helpers'); const Raw = require('../raw'); const JoinClause = require('./joinclause'); const debug = require('debug'); const { assign, bind, compact, groupBy, isEmpty, isString, isUndefined, map, omitBy, reduce, has, keys, } = require('lod...
cwe
CWE-89
JavaScript
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
cwe
CWE-74
Python
header_put_marker (SF_PRIVATE *psf, int x) { if (psf->headindex < SIGNED_SIZEOF (psf->header) - 4) { psf->header [psf->headindex++] = x ; psf->header [psf->headindex++] = (x >> 8) ; psf->header [psf->headindex++] = (x >> 16) ; psf->header [psf->headindex++] = (x >> 24) ; } ; } /* header_put_marker */
cwe
CWE-119
Unknown
def update_history_and_sourcebyinstitution(conn, sqlite, k10plus, ai): """ Get all current sources and title numbers from Solr and log them into database. """ current_sources = get_all_current_sources(k10plus, ai) current_institutions = get_all_current_institutions(k10plus, ai) old_sourcebyinsti...
cwe
CWE-89
Python
//Copyright (c) 2016 Crystalline Technologies // // 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, pu...
cwe
CWE-79
JavaScript
RefCountedMemory* ChromeWebUIControllerFactory::GetFaviconResourceBytes( const GURL& page_url) const { if (page_url.host() == extension_misc::kBookmarkManagerId) return BookmarksUI::GetFaviconResourceBytes(); if (page_url.SchemeIs(chrome::kExtensionScheme)) { NOTREACHED(); return NULL; } if...
cwe
CWE-264
C/C++
/********************************************************************* * * Linux multisound pinnacle/fiji driver for ALSA. * * 2002/06/30 Karsten Wiese: * for now this is only used to build a pinnacle / fiji driver. * the OSS parent of this code is designed to also support * the multisound classic via the file m...
cwe
CWE-125
C/C++
long do_io_submit(aio_context_t ctx_id, long nr, struct iocb __user *__user *iocbpp, bool compat) { struct kioctx *ctx; long ret = 0; int i; struct hlist_head batch_hash[AIO_BATCH_HASH_SIZE] = { { 0, }, }; if (unlikely(nr < 0)) return -EINVAL; if (unlikely(!access_ok(VERIFY_READ, iocbpp, (nr*sizeof(*iocbp...
cwe
CWE-190
Unknown
'<md-dialog flex="40" flex-sm="80" flex-xs="100" aria-label="' + l('View Raw Source') + '">', ' <md-dialog-content class="md-dialog-content">', ' <pre>', data, ' </pre>', ' </md-dialog-content>', ' <md-dialog-actions>', ' <m...
cwe
CWE-79
JavaScript
import requests from redash import settings class ConfiguredSession(requests.Session): def request(self, *args, **kwargs): if not settings.REQUESTS_ALLOW_REDIRECTS: kwargs.update({"allow_redirects": False}) return super().request(*args, **kwargs) requests_session = ConfiguredSession(...
cwe
CWE-918
Python
$f_content_n .= _mysqldump_table_data($row[$column_name]); } $f_content_n .= "-- -- -- CREATE VIEW marking_periods AS SELECT q.marking_period_id, 'openSIS' AS mp_source, q.syear, q.school_id, 'quarter' AS mp_type, q.title, q.short_name...
cwe
CWE-79
PHP
parse_user_name(char *user_input, char **ret_username) { register char *ptr; register int index = 0; char username[PAM_MAX_RESP_SIZE]; /* Set the default value for *ret_username */ *ret_username = NULL; /* * Set the initial value for username - this is a buffer holds * the user name. */ bzero((void *)use...
cwe
CWE-120
C/C++
void Compute(OpKernelContext* context) override { const Tensor& prefix = context->input(0); const Tensor& tensor_names = context->input(1); const Tensor& shape_and_slices = context->input(2); ValidateInputs(true /* is save op */, context, prefix, tensor_names, shape_and_slices); ...
cwe
CWE-369
C/C++
function escapeArgZsh(arg, interpolation, quoted) { let result = arg.replace(/\u0000/g, ""); if (interpolation) { result = result .replace(/\\/g, "\\\\") .replace(/\n/g, " ") .replace(/(^|\s)(~|#|=)/g, "$1\\$2") .replace(/(\*|\?)/g, "\\$1") .replace(/(\$|\;|\&|\|)/g, "\\$1") ...
cwe
CWE-1333
JavaScript
# -*- test-case-name: twisted.web.test.test_script -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ I contain PythonScript, which is a very simple python script resource. """ import os import traceback from io import StringIO from twisted import copyright from twisted.python.compat im...
cwe
CWE-79
Python
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { const OpData* op_data = reinterpret_cast<OpData*>(node->user_data); const TfLiteTensor* cond = GetInput(context, node, 0); bool cond_value = cond->data.b[0]; Subgraph* this_subgraph = reinterpret_cast<Subgraph*>(context->impl_); auto* subgraphs =...
cwe
CWE-125
C/C++
float CLASS find_green (int bps, int bite, int off0, int off1) { UINT64 bitbuf=0; int vbits, col, i, c; ushort img[2][2064]; double sum[]={0,0}; FORC(2) { fseek (ifp, c ? off1:off0, SEEK_SET); for (vbits=col=0; col < width; col++) { for (vbits -= bps; vbits < 0; vbits += bite) { bitbuf <<= bit...
cwe
CWE-787
Unknown
int fscrypt_process_policy(struct inode *inode, const struct fscrypt_policy *policy) { if (policy->version != 0) return -EINVAL; if (!inode_has_encryption_context(inode)) { if (!inode->i_sb->s_cop->empty_dir) return -EOPNOTSUPP; if (!inode->i_sb->s_cop->empty_dir(inode)) return -ENOTEMPTY; ret...
cwe
CWE-264
C/C++
package org.hl7.fhir.igtools.publisher; /*- * #%L * org.hl7.fhir.publisher.core * %% * Copyright (C) 2014 - 2019 Health Level 7 * %% * 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 * ...
cwe
CWE-22
Java
/** * FreeRDP: A Remote Desktop Protocol Implementation * ZGFX (RDP8) Bulk Data Compression * * Copyright 2014 Marc-Andre Moreau <marcandre.moreau@gmail.com> * Copyright 2017 Armin Novak <armin.novak@thincast.com> * Copyright 2017 Thincast Technologies GmbH * * Licensed under the Apache License, Version 2.0 (th...
cwe
CWE-787
C/C++
"""Admin API.""" from django import http from django.contrib.contenttypes.models import ContentType from django.utils.translation import ugettext as _ from django_filters import rest_framework as dj_filters from drf_spectacular.utils import extend_schema, extend_schema_view from rest_framework import filters, rendere...
cwe
CWE-285
Python
/*! Copyright (c) REBUILD <https://getrebuild.com/> and/or its owners. All rights reserved. rebuild is dual-licensed under commercial and open source licenses (GPLv3). See LICENSE and COMMERCIAL in the project root for license information. */ package com.rebuild.core.metadata.impl; /** * @author devezhao * @since ...
cwe
CWE-89
Java
ModuleExport size_t RegisterXWDImage(void) { MagickInfo *entry; entry=SetMagickInfo("XWD"); #if defined(MAGICKCORE_X11_DELEGATE) entry->decoder=(DecodeImageHandler *) ReadXWDImage; entry->encoder=(EncodeImageHandler *) WriteXWDImage; #endif entry->magick=(IsImageFormatHandler *) IsXWD; entry->adjoin=Ma...
cwe
CWE-125
Unknown