summaryrefslogtreecommitdiffstats
path: root/Utilities
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-11-09 16:43:34 (GMT)
committerBrad King <brad.king@kitware.com>2016-11-10 13:29:36 (GMT)
commit465a85fb4615f4cfa20058c534bf3bfe71df1732 (patch)
treea90c16bd79f7c8f4362d8be7d1a1642a216fc563 /Utilities
parentfc2cb74feedf2637e4b2cc153ede7b0726b9a7d3 (diff)
downloadCMake-465a85fb4615f4cfa20058c534bf3bfe71df1732.zip
CMake-465a85fb4615f4cfa20058c534bf3bfe71df1732.tar.gz
CMake-465a85fb4615f4cfa20058c534bf3bfe71df1732.tar.bz2
librhash: Avoid signed left-shift overflow
Fix `rhash_md5_final` to use unsigned integers for left shifting to avoid the possibility of undefined overflow behavior.
Diffstat (limited to 'Utilities')
-rw-r--r--Utilities/cmlibrhash/librhash/md5.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Utilities/cmlibrhash/librhash/md5.c b/Utilities/cmlibrhash/librhash/md5.c
index 0feb090..b20de45 100644
--- a/Utilities/cmlibrhash/librhash/md5.c
+++ b/Utilities/cmlibrhash/librhash/md5.c
@@ -213,8 +213,8 @@ void rhash_md5_final(md5_ctx *ctx, unsigned char* result)
/* pad message and run for last block */
/* append the byte 0x80 to the message */
- ctx->message[index] &= ~(0xFFFFFFFF << shift);
- ctx->message[index++] ^= 0x80 << shift;
+ ctx->message[index] &= ~(0xFFFFFFFFu << shift);
+ ctx->message[index++] ^= 0x80u << shift;
/* if no room left in the message to store 64-bit message length */
if (index > 14) {