Boost logo

Boost-Commit :

From: dwalker07_at_[hidden]
Date: 2008-08-20 18:03:35


Author: dlwalker
Date: 2008-08-20 18:03:34 EDT (Wed, 20 Aug 2008)
New Revision: 48272
URL: http://svn.boost.org/trac/boost/changeset/48272

Log:
Ensured that some arrays are the size I think they are, for s11n (Boost.S11N normally takes care of this, but I'm serializing each element separately, so I need to manually check the element count.)
Text files modified:
   sandbox/md5/boost/coding/md5_context.hpp | 6 +++++-
   sandbox/md5/boost/coding/md5_digest.hpp | 2 ++
   2 files changed, 7 insertions(+), 1 deletions(-)

Modified: sandbox/md5/boost/coding/md5_context.hpp
==============================================================================
--- sandbox/md5/boost/coding/md5_context.hpp (original)
+++ sandbox/md5/boost/coding/md5_context.hpp 2008-08-20 18:03:34 EDT (Wed, 20 Aug 2008)
@@ -25,6 +25,7 @@
 #include <boost/integer.hpp> // for boost::sized_integral, fast_integral
 
 #include <boost/mpl/arithmetic.hpp> // for boost:mpl:times, divides, modulus
+#include <boost/mpl/assert.hpp> // for BOOST_MPL_ASSERT_RELATION
 #include <boost/mpl/int.hpp> // for boost:mpl:int_
 #include <boost/mpl/next_prior.hpp> // for boost:mpl:next
 #include <boost/mpl/not_equal_to.hpp> // for boost:mpl:not_equal_to
@@ -316,7 +317,10 @@
 template < class Archive >
 inline void
 md5_context::serialize( Archive &ar, const unsigned int version )
-{ boost::serialization::split_member( ar, *this, version ); }
+{
+ BOOST_MPL_ASSERT_RELATION( words_per_digest::value, ==, 4 );
+ boost::serialization::split_member( ar, *this, version );
+}
 
 
 } // namespace coding

Modified: sandbox/md5/boost/coding/md5_digest.hpp
==============================================================================
--- sandbox/md5/boost/coding/md5_digest.hpp (original)
+++ sandbox/md5/boost/coding/md5_digest.hpp 2008-08-20 18:03:34 EDT (Wed, 20 Aug 2008)
@@ -282,6 +282,8 @@
     {
     default:
     case 0u:
+ BOOST_MPL_ASSERT_RELATION( coding::md5_digest::words_per_digest::value,
+ ==, 4 );
         ar & make_nvp( "word-A", d.hash[0] )
            & make_nvp( "word-B", d.hash[1] )
            & make_nvp( "word-C", d.hash[2] )


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk