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:
@ -158,7 +158,7 @@ px_gen_salt(const char *salt_type, char *buf, int rounds)
|
||||
return res;
|
||||
|
||||
p = g->gen(rounds, rbuf, g->input_len, buf, PX_MAX_SALT_LEN);
|
||||
memset(rbuf, 0, sizeof(rbuf));
|
||||
px_memset(rbuf, 0, sizeof(rbuf));
|
||||
|
||||
if (p == NULL)
|
||||
return PXE_BAD_SALT_ROUNDS;
|
||||
|
Reference in New Issue
Block a user