From 762c7fd488d0bc6ce81d105fcb4f07ba2c9e6bc4 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 16 Nov 2023 09:14:10 +0100 Subject: [PATCH] Fix UB in hash-library (#1241) Fix https://oss-fuzz.com/testcase-detail/5137689594429440 Apply https://github.com/stbrumme/hash-library/pull/15 --- 3rdParty/hash-library/md5.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3rdParty/hash-library/md5.cpp b/3rdParty/hash-library/md5.cpp index 9c54dd9bd5..2bcb186cfc 100644 --- a/3rdParty/hash-library/md5.cpp +++ b/3rdParty/hash-library/md5.cpp @@ -292,7 +292,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;