From 76f62bd7c52808c9153f2634504d6ca2979dee60 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Mon, 16 Sep 2013 18:47:35 -0700 Subject: [PATCH] Fix undefined behavior in UnsignedIntegerCalc --- src/beast/modules/beast_crypto/math/UnsignedIntegerCalc.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/beast/modules/beast_crypto/math/UnsignedIntegerCalc.h b/src/beast/modules/beast_crypto/math/UnsignedIntegerCalc.h index 74afd7cb8f..e714c0895b 100644 --- a/src/beast/modules/beast_crypto/math/UnsignedIntegerCalc.h +++ b/src/beast/modules/beast_crypto/math/UnsignedIntegerCalc.h @@ -137,8 +137,8 @@ public: while (lo < hi) { std::swap (*lo, *hi); - *lo++ = toNetworkByteOrder (*lo); - *hi-- = toNetworkByteOrder (*hi); + *lo = toNetworkByteOrder (*lo); ++lo; + *hi = toNetworkByteOrder (*hi); --hi; } if (lo == hi) *lo = toNetworkByteOrder (*lo);