diff options
author | Eric Andersen <andersen@codepoet.org> | 2002-07-16 10:56:19 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2002-07-16 10:56:19 +0000 |
commit | 30b32340bd522f1b045626765ff402790362fd0c (patch) | |
tree | fe8518d73cfa39411e76ec22e2706914f8dc7cfb /libc/misc/utmp | |
parent | c96a844f5209ee078b282b1bec690f80f7411ada (diff) |
Do not assume NULL termination on the ut_id field. Thanks
to mac12@po.cwru.edu for spotting this one.
Diffstat (limited to 'libc/misc/utmp')
-rw-r--r-- | libc/misc/utmp/utent.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; } |