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=6e4c3c4f75fb2a304e30ee222a898058471d5f0d;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;