From 30b32340bd522f1b045626765ff402790362fd0c Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Tue, 16 Jul 2002 10:56:19 +0000 Subject: Do not assume NULL termination on the ut_id field. Thanks to mac12@po.cwru.edu for spotting this one. --- libc/misc/utmp/utent.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libc') diff --git a/libc/misc/utmp/utent.c b/libc/misc/utmp/utent.c index 3833742cc..186ee9927 100644 --- a/libc/misc/utmp/utent.c +++ b/libc/misc/utmp/utent.c @@ -138,7 +138,7 @@ struct utmp *getutid (const struct utmp *utmp_entry) utmp_entry->ut_type == DEAD_PROCESS || utmp_entry->ut_type == LOGIN_PROCESS || utmp_entry->ut_type == USER_PROCESS) && - !strcmp(lutmp->ut_id, utmp_entry->ut_id)) + !strncmp(lutmp->ut_id, utmp_entry->ut_id, sizeof(lutmp->ut_id))) { return lutmp; } -- cgit v1.2.3