Tim Rühsen
2018-04-03 20:47:33 UTC
When running with clang's sanitizing on, there is a UB runtime error
triggered in sha256.c.
This is expected behavior but still it rings the 'alarm bell'.
This patch suppresses it:
diff --git a/lib/sha256.c b/lib/sha256.c
index 85405b20f..cf161c65c 100644
--- a/lib/sha256.c
+++ b/lib/sha256.c
@@ -448,6 +448,9 @@ static const uint32_t sha256_round_constants[64] = {
It is assumed that LEN % 64 == 0.
Most of this code comes from GnuPG's cipher/sha1.c. */
+#ifdef __clang__
+__attribute__((no_sanitize("unsigned-integer-overflow")))
+#endif
void
sha256_process_block (const void *buffer, size_t len, struct sha256_ctx
*ctx)
{
Regards, Tim
triggered in sha256.c.
This is expected behavior but still it rings the 'alarm bell'.
This patch suppresses it:
diff --git a/lib/sha256.c b/lib/sha256.c
index 85405b20f..cf161c65c 100644
--- a/lib/sha256.c
+++ b/lib/sha256.c
@@ -448,6 +448,9 @@ static const uint32_t sha256_round_constants[64] = {
It is assumed that LEN % 64 == 0.
Most of this code comes from GnuPG's cipher/sha1.c. */
+#ifdef __clang__
+__attribute__((no_sanitize("unsigned-integer-overflow")))
+#endif
void
sha256_process_block (const void *buffer, size_t len, struct sha256_ctx
*ctx)
{
Regards, Tim