Skip to content

Commit e4db972

Browse files
committed
Use explicit_bzero() when clearing sslpassword in libpq
Since 74a308c, any security-sensitive information gets cleared from memory this way. This was forgotten in 4dc6355. Author: Daniel Gustafsson Reviewed-by: Peter Eisentraut, Michael Paquier Discussion: https://postgr.es/m/[email protected]
1 parent d2a9959 commit e4db972

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/interfaces/libpq/fe-connect.c

+3
Original file line numberDiff line numberDiff line change
@@ -4037,7 +4037,10 @@ freePGconn(PGconn *conn)
40374037
if (conn->sslkey)
40384038
free(conn->sslkey);
40394039
if (conn->sslpassword)
4040+
{
4041+
explicit_bzero(conn->sslpassword, strlen(conn->sslpassword));
40404042
free(conn->sslpassword);
4043+
}
40414044
if (conn->sslrootcert)
40424045
free(conn->sslrootcert);
40434046
if (conn->sslcrl)

0 commit comments

Comments
 (0)