From: Timo Heister Date: Tue, 13 Aug 2024 03:14:02 +0000 (-0400) Subject: MGTransferMF: fix nullptr access X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4add8678061d6102cb598a52bc11710320b3d02d;p=dealii.git MGTransferMF: fix nullptr access transfer[min_level] is never used and okay to be null --- diff --git a/include/deal.II/multigrid/mg_transfer_global_coarsening.h b/include/deal.II/multigrid/mg_transfer_global_coarsening.h index 689fd70bef..b03fc8c28f 100644 --- a/include/deal.II/multigrid/mg_transfer_global_coarsening.h +++ b/include/deal.II/multigrid/mg_transfer_global_coarsening.h @@ -1454,7 +1454,8 @@ MGTransferMF::initialize_transfer_references( this->transfer.resize(min_level, max_level); - for (unsigned int l = min_level; l <= max_level; ++l) + // Note that transfer[min_level] is empty and never used: + for (unsigned int l = min_level + 1; l <= max_level; ++l) this->transfer[l] = &const_cast &>( static_cast &>( Utilities::get_underlying_value(transfer[l])));