mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
pgcrypto: fix memset() calls that might be optimized away
Specifically, on-stack memset() might be removed, so: * Replace memset() with px_memset() * Add px_memset to copy_crlf() * Add px_memset to pgp-s2k.c Patch by Marko Kreen Report by PVS-Studio Backpatch through 8.4.
This commit is contained in:
@ -142,7 +142,7 @@ EVP_MD_CTX_init(EVP_MD_CTX *ctx)
|
||||
static int
|
||||
EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx)
|
||||
{
|
||||
memset(ctx, 0, sizeof(*ctx));
|
||||
px_memset(ctx, 0, sizeof(*ctx));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -381,7 +381,7 @@ gen_ossl_free(PX_Cipher *c)
|
||||
{
|
||||
ossldata *od = (ossldata *) c->ptr;
|
||||
|
||||
memset(od, 0, sizeof(*od));
|
||||
px_memset(od, 0, sizeof(*od));
|
||||
px_free(od);
|
||||
px_free(c);
|
||||
}
|
||||
|
Reference in New Issue
Block a user