From: David Wells Date: Thu, 6 Jan 2022 20:30:30 +0000 (-0500) Subject: Add some more index range checks. X-Git-Tag: v9.4.0-rc1~656^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7c4c35da6541c7730de380ac0d3e6b17617acc29;p=dealii.git Add some more index range checks. We presently segmentation fault with #13179 (the draft intel oneAPI patch) here since ptr and data are both empty. --- diff --git a/include/deal.II/matrix_free/matrix_free.h b/include/deal.II/matrix_free/matrix_free.h index 0b8d1e5394..d7240ef755 100644 --- a/include/deal.II/matrix_free/matrix_free.h +++ b/include/deal.II/matrix_free/matrix_free.h @@ -4688,11 +4688,15 @@ namespace internal if (fu == nullptr) return; + AssertIndexRange(range_index + 1, ptr.size()); for (unsigned int i = ptr[range_index]; i < ptr[range_index + 1]; ++i) - (container.*fu)(matrix_free, - this->dst, - this->src, - std::make_pair(data[2 * i], data[2 * i + 1])); + { + AssertIndexRange(2 * i + 1, data.size()); + (container.*fu)(matrix_free, + this->dst, + this->src, + std::make_pair(data[2 * i], data[2 * i + 1])); + } } public: