summaryrefslogtreecommitdiffstats
path: root/Utilities/cmlibrhash
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-11-29 13:58:59 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-11-29 13:58:59 (GMT)
commita0af10e42371b17daa51646a3123ec5d8a6d0291 (patch)
treeda8c1e3f9750575e6894f8090ab494c26ab2966d /Utilities/cmlibrhash
parentdd4e25a5a6ed6b6a7019e46d56e6f4c098c61618 (diff)
parent9e07ffa4e4211ca165f24c1f45744fbe7984a43f (diff)
downloadCMake-a0af10e42371b17daa51646a3123ec5d8a6d0291.zip
CMake-a0af10e42371b17daa51646a3123ec5d8a6d0291.tar.gz
CMake-a0af10e42371b17daa51646a3123ec5d8a6d0291.tar.bz2
Merge topic 'librhash-left-shift-unsigned'
9e07ffa4 librhash: Avoid signed left-shift overflow in sha256
Diffstat (limited to 'Utilities/cmlibrhash')
-rw-r--r--Utilities/cmlibrhash/librhash/sha256.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Utilities/cmlibrhash/librhash/sha256.c b/Utilities/cmlibrhash/librhash/sha256.c
index 064dfe2..af5b0fe 100644
--- a/Utilities/cmlibrhash/librhash/sha256.c
+++ b/Utilities/cmlibrhash/librhash/sha256.c
@@ -218,8 +218,8 @@ void rhash_sha256_final(sha256_ctx *ctx, unsigned char* result)
/* pad message and run for last block */
/* append the byte 0x80 to the message */
- ctx->message[index] &= le2me_32(~(0xFFFFFFFF << shift));
- ctx->message[index++] ^= le2me_32(0x80 << shift);
+ ctx->message[index] &= le2me_32(~(0xFFFFFFFFu << shift));
+ ctx->message[index++] ^= le2me_32(0x80u << shift);
/* if no room left in the message to store 64-bit message length */
if (index > 14) {