Skip to content

Commit a568b22

Browse files
committed
Be a little more careful with strtok().
1 parent f749b4c commit a568b22

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/libpq/password.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
33
* Portions Copyright (c) 1994, Regents of the University of California
44
*
5-
* $Id: password.c,v 1.33 2000/11/27 03:43:49 tgl Exp $
5+
* $Id: password.c,v 1.34 2000/11/27 03:46:01 tgl Exp $
66
*
77
*/
88

@@ -66,9 +66,9 @@ verify_password(const Port *port, const char *user, const char *password)
6666
p = pw_file_line;
6767

6868
test_user = strtok(p, ":");
69-
test_pw = strtok(NULL, ":");
7069
if (!test_user || test_user[0] == '\0')
7170
continue;
71+
test_pw = strtok(NULL, ":");
7272

7373
if (strcmp(user, test_user) == 0)
7474
{

0 commit comments

Comments
 (0)