From: Martin Kronbichler Date: Mon, 29 Nov 2021 14:12:20 +0000 (+0100) Subject: Avoid dereferencing a past-the-end iterator X-Git-Tag: v9.4.0-rc1~790^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F13004%2Fhead;p=dealii.git Avoid dereferencing a past-the-end iterator --- diff --git a/include/deal.II/base/utilities.h b/include/deal.II/base/utilities.h index 9990ecbd03..255b700959 100644 --- a/include/deal.II/base/utilities.h +++ b/include/deal.II/base/utilities.h @@ -1307,7 +1307,7 @@ namespace Utilities #else (void)allow_compression; #endif - fisb.push(boost::iostreams::array_source(&*cbegin, &*cend)); + fisb.push(boost::iostreams::array_source(&*cbegin, cend - cbegin)); boost::archive::binary_iarchive bia(fisb); bia >> object; @@ -1355,7 +1355,7 @@ namespace Utilities #else (void)allow_compression; #endif - fisb.push(boost::iostreams::array_source(&*cbegin, &*cend)); + fisb.push(boost::iostreams::array_source(&*cbegin, cend - cbegin)); boost::archive::binary_iarchive bia(fisb); bia >> unpacked_object;