From: Martin Kronbichler Date: Fri, 24 Jun 2022 14:20:19 +0000 (+0200) Subject: Add extra check for index range. X-Git-Tag: v9.5.0-rc1~1164^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F14024%2Fhead;p=dealii.git Add extra check for index range. Co-authored-by: David Wells --- diff --git a/include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h b/include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h index ce3c49bebc..56b90bb344 100644 --- a/include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h +++ b/include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h @@ -739,8 +739,11 @@ namespace internal dof_handler_fine.get_fe(buffer[i]).n_dofs_per_cell(); ++i; for (unsigned int j = 0; j < dofs_per_cell; ++j, ++i) - if (!is_extended_locally_owned.is_element(buffer[i])) - ghost_indices.push_back(buffer[i]); + { + AssertIndexRange(i, buffer.size()); + if (!is_extended_locally_owned.is_element(buffer[i])) + ghost_indices.push_back(buffer[i]); + } } const unsigned int rank = status.MPI_SOURCE;