sha2.c: Changed address calculation to avoid type punning.
Use pointer arithmetics instead of taking the address of a
dereferenced array value to quiet warning about type punned pointer.
Change-Id: I6c833dafbf26502c8b4d132f21a733cc4f133bdb
diff --git a/sha2/sha2.c b/sha2/sha2.c
index c5e45b3..5f55352 100644
--- a/sha2/sha2.c
+++ b/sha2/sha2.c
@@ -637,7 +637,7 @@
*context->buffer = 0x80;
}
/* Set the bit count: */
- *(sha2_word64*)&context->buffer[DTLS_SHA256_SHORT_BLOCK_LENGTH] = context->bitcount;
+ *(sha2_word64*)(context->buffer+DTLS_SHA256_SHORT_BLOCK_LENGTH) = context->bitcount;
/* Final transform: */
dtls_sha256_transform(context, (sha2_word32*)context->buffer);