libcrypto: Initialize returning size_t value

This prevents the usage of uninitialized value on error in the known
hosts hasing code if invalid (empty) hostname is used.

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Sahana Prasad <sahana@redhat.com>
This commit is contained in:
Jakub Jelen
2022-01-31 13:38:32 +01:00
parent d171a6e444
commit ea83a27371

View File

@@ -468,7 +468,7 @@ void hmac_update(HMACCTX ctx, const void *data, unsigned long len)
void hmac_final(HMACCTX ctx, unsigned char *hashmacbuf, unsigned int *len)
{
size_t res;
size_t res = 0;
EVP_DigestSignFinal(ctx, hashmacbuf, &res);
EVP_MD_CTX_free(ctx);
*len = res;