aboutsummaryrefslogtreecommitdiff
path: root/src/backend/libpq/password.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/libpq/password.c')
-rw-r--r--src/backend/libpq/password.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/backend/libpq/password.c b/src/backend/libpq/password.c
index afbd95ad1ae..346d59e8bf6 100644
--- a/src/backend/libpq/password.c
+++ b/src/backend/libpq/password.c
@@ -79,7 +79,8 @@ verify_password(char *user, char *password, Port *port,
}
/* kill the newline */
- test_pw[strlen(test_pw)-1] = '\0';
+ if (test_pw[strlen(test_pw)-1] == '\n')
+ test_pw[strlen(test_pw)-1] = '\0';
strNcpy(salt, test_pw, 2);