Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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/935443BA-D42E-4CE0-B181-1AD79E6DD45A@yesql.se
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

Lines changed: 3 additions & 0 deletions
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)