From 753c3c8adfec9c084c7bd3aea2cfb7674c6f3cc6 Mon Sep 17 00:00:00 2001 From: Vitalii Demediuk Date: Wed, 12 Oct 2022 12:00:21 +0300 Subject: [PATCH] fix ub in md5.cpp --- md5.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/md5.cpp b/md5.cpp index 2743319..60052e2 100644 --- a/md5.cpp +++ b/md5.cpp @@ -296,7 +296,7 @@ void MD5::processBuffer() if (paddedLength < BlockSize) addLength = m_buffer + paddedLength; else - addLength = extra + paddedLength - BlockSize; + addLength = extra + (paddedLength - BlockSize); // must be little endian *addLength++ = msgBits & 0xFF; msgBits >>= 8;