Skip to content

Commit

Permalink
sha2: use size of struct and not of pointer in memset()
Browse files Browse the repository at this point in the history
The size of the struct should be given here and not the size of the
pointer. clang pointed out this error.

Signed-off-by: Hauke Mehrtens <[email protected]>
  • Loading branch information
hauke committed Feb 8, 2014
1 parent 9ffd978 commit 26a3563
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sha2/sha2.c
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ void SHA256_Final(sha2_byte digest[], SHA256_CTX* context) {
}

/* Clean up state data: */
MEMSET_BZERO(context, sizeof(context));
MEMSET_BZERO(context, sizeof(*context));
usedspace = 0;
}

Expand All @@ -678,7 +678,7 @@ char *SHA256_End(SHA256_CTX* context, char buffer[]) {
}
*buffer = (char)0;
} else {
MEMSET_BZERO(context, sizeof(context));
MEMSET_BZERO(context, sizeof(*context));
}
MEMSET_BZERO(digest, SHA256_DIGEST_LENGTH);
return buffer;
Expand Down

0 comments on commit 26a3563

Please sign in to comment.