Skip to content

Commit

Permalink
Check if a password already was prompted (reorg#354)
Browse files Browse the repository at this point in the history
This fixes infinite loop in case of an empty password.
Issue reorg#299.
  • Loading branch information
za-arthur authored Jun 14, 2023
1 parent 49072aa commit 5ca3f53
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions bin/pgut/pgut.c
Original file line number Diff line number Diff line change
Expand Up @@ -548,10 +548,9 @@ pgut_connect(const char *info, YesNo prompt, int elevel)
return conn;
}

if (conn && PQconnectionNeedsPassword(conn) && prompt != NO)
if (conn && PQconnectionNeedsPassword(conn) && !passwd && prompt != NO)
{
PQfinish(conn);
free(passwd);
passwd = prompt_for_password();
if (add_pass.data != NULL)
resetStringInfo(&add_pass);
Expand Down

0 comments on commit 5ca3f53

Please sign in to comment.