]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Avoid dereferencing a past-the-end iterator 13004/head
authorMartin Kronbichler <martin.kronbichler@it.uu.se>
Mon, 29 Nov 2021 14:12:20 +0000 (15:12 +0100)
committerMartin Kronbichler <martin.kronbichler@it.uu.se>
Mon, 29 Nov 2021 17:04:45 +0000 (18:04 +0100)
include/deal.II/base/utilities.h

index 9990ecbd036e70dd2a6cf2a908167c36677a2795..255b70095985eb0ad941f6f8ae5de35eab88730a 100644 (file)
@@ -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;

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.