mirror of
				https://github.com/postgres/postgres.git
				synced 2025-10-29 22:49:41 +03:00 
			
		
		
		
	Be a little more careful with strtok().
This commit is contained in:
		| @@ -2,7 +2,7 @@ | |||||||
|  * Portions Copyright (c) 1996-2000, PostgreSQL, Inc |  * Portions Copyright (c) 1996-2000, PostgreSQL, Inc | ||||||
|  * Portions Copyright (c) 1994, Regents of the University of California |  * Portions Copyright (c) 1994, Regents of the University of California | ||||||
|  * |  * | ||||||
|  * $Id: password.c,v 1.33 2000/11/27 03:43:49 tgl Exp $ |  * $Id: password.c,v 1.34 2000/11/27 03:46:01 tgl Exp $ | ||||||
|  * |  * | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
| @@ -66,9 +66,9 @@ verify_password(const Port *port, const char *user, const char *password) | |||||||
| 		p = pw_file_line; | 		p = pw_file_line; | ||||||
|  |  | ||||||
| 		test_user = strtok(p, ":"); | 		test_user = strtok(p, ":"); | ||||||
| 		test_pw = strtok(NULL, ":"); |  | ||||||
| 		if (!test_user || test_user[0] == '\0') | 		if (!test_user || test_user[0] == '\0') | ||||||
| 			continue; | 			continue; | ||||||
|  | 		test_pw = strtok(NULL, ":"); | ||||||
|  |  | ||||||
| 		if (strcmp(user, test_user) == 0) | 		if (strcmp(user, test_user) == 0) | ||||||
| 		{ | 		{ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user