Skip to content
This repository was archived by the owner on Mar 5, 2024. It is now read-only.

Commit 72ed9c8

Browse files
author
Ramakrishna Pallala
committed
tinycrypt/sha256: Array compared to NULL has no effect
This commit fixes the issue reported by Coverity: an array compared against NULL is always false. Signed-off-by: Ramakrishna Pallala <[email protected]>
1 parent 3e4e536 commit 72ed9c8

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/source/sha256.c

+1-3
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ int tc_sha256_update(TCSha256State_t s, const uint8_t *data, size_t datalen)
6666
{
6767
/* input sanity check: */
6868
if (s == (TCSha256State_t) 0 ||
69-
s->iv == (unsigned int *) 0 ||
7069
data == (void *) 0) {
7170
return TC_CRYPTO_FAIL;
7271
} else if (datalen == 0) {
@@ -91,8 +90,7 @@ int tc_sha256_final(uint8_t *digest, TCSha256State_t s)
9190

9291
/* input sanity check: */
9392
if (digest == (uint8_t *) 0 ||
94-
s == (TCSha256State_t) 0 ||
95-
s->iv == (unsigned int *) 0) {
93+
s == (TCSha256State_t) 0) {
9694
return TC_CRYPTO_FAIL;
9795
}
9896

0 commit comments

Comments
 (0)