diff options
author | Jussi Kivilinna <jussi.kivilinna@iki.fi> | 2021-10-17 15:01:25 +0300 |
---|---|---|
committer | Jussi Kivilinna <jussi.kivilinna@iki.fi> | 2021-10-25 20:57:10 +0300 |
commit | 5881114e08601745857a68bc3318f3421155f645 (patch) | |
tree | e715383a9a0ecda7a13b6c86df28e6f3f0525ad5 | |
parent | 6333cdeee5c1ca5bd4255f9cdcd266db314a2122 (diff) | |
download | libgcrypt-5881114e08601745857a68bc3318f3421155f645.tar.gz |
md: clear context with wipememory to avoid false warning
* cipher/md.c (md_open): Initialize ctx with wipememory2 instead
of memset.
--
GCC 11 gives warning on use of memset:
warning: '__builtin_memset' offset [0, 19] is out of the bounds [0, 0] [-Warray-bounds]
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
-rw-r--r-- | cipher/md.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cipher/md.c b/cipher/md.c index 428959b2..64dc235a 100644 --- a/cipher/md.c +++ b/cipher/md.c @@ -493,7 +493,7 @@ md_open (gcry_md_hd_t *h, int algo, unsigned int flags) hd->bufpos = 0; /* Initialize the private data. */ - memset (ctx, 0, sizeof *ctx); + wipememory2 (ctx, 0, sizeof *ctx); ctx->magic = secure ? CTX_MAGIC_SECURE : CTX_MAGIC_NORMAL; ctx->actual_handle_size = n + sizeof (struct gcry_md_context); ctx->flags.secure = secure; |