diff options
author | Martin Lindhe <martin-commit@ubique.se> | 2016-11-16 15:56:42 +0100 |
---|---|---|
committer | Cyrill Gorcunov <gorcunov@gmail.com> | 2017-01-05 22:38:41 +0300 |
commit | 058782948d08c9f49b78434cf271cc79f63b90e7 (patch) | |
tree | 00e67a4f80bffae5465a0ad7791b81eba15788d3 | |
parent | 3478078c5f5ec7b38f2537ab65d249fe51c607d4 (diff) | |
download | nasm-058782948d08c9f49b78434cf271cc79f63b90e7.tar.gz |
nasmlib: md5c -- Use size of struct ctx for memset
fixes pvs-studio 'V512 A call of the 'memset' function will lead to
underflow of the buffer 'ctx'.'
Signed-off-by: Martin Lindhe <martin-commit@ubique.se>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
-rw-r--r-- | nasmlib/md5c.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/nasmlib/md5c.c b/nasmlib/md5c.c index 5d5c91a3..5d580f0a 100644 --- a/nasmlib/md5c.c +++ b/nasmlib/md5c.c @@ -143,7 +143,7 @@ void MD5Final(unsigned char digest[16], MD5_CTX *ctx) MD5Transform(ctx->buf, (uint32_t *) ctx->in); byteReverse((unsigned char *) ctx->buf, 4); memcpy(digest, ctx->buf, 16); - memset((char *) ctx, 0, sizeof(ctx)); /* In case it's sensitive */ + memset((char *) ctx, 0, sizeof(*ctx)); /* In case it's sensitive */ } /* The four core functions - F1 is optimized somewhat */ |