X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fsha%2Fsha512.c;h=c58cc1b44b650e2831b8257e87b31c7f0cd5bd2e;hp=f934c74414851e0a363c8e5a36f7dd9de4343db3;hb=16f8d4ebf0fd4847fa83d9c61f4150273cb4f533;hpb=12048657a91b12e499d03ec9ff406b42aba67366 diff --git a/crypto/sha/sha512.c b/crypto/sha/sha512.c index f934c74414..c58cc1b44b 100644 --- a/crypto/sha/sha512.c +++ b/crypto/sha/sha512.c @@ -107,9 +107,11 @@ int SHA512_Final(unsigned char *md, SHA512_CTX *c) p[n] = 0x80; /* There always is a room for one */ n++; - if (n > (sizeof(c->u) - 16)) - memset(p + n, 0, sizeof(c->u) - n), n = 0, - sha512_block_data_order(c, p, 1); + if (n > (sizeof(c->u) - 16)) { + memset(p + n, 0, sizeof(c->u) - n); + n = 0; + sha512_block_data_order(c, p, 1); + } memset(p + n, 0, sizeof(c->u) - 16 - n); #ifdef B_ENDIAN