* src/lastlog.c, src/faillog.c: Fix underflows causing wrong entry
to be displayed.
This commit is contained in:
@ -102,9 +102,8 @@ static void print_one (/*@null@*/const struct passwd *pw)
|
||||
}
|
||||
|
||||
|
||||
offset = pw->pw_uid * sizeof (ll);
|
||||
|
||||
if (offset <= (statbuf.st_size - sizeof (ll))) {
|
||||
offset = (off_t) pw->pw_uid * sizeof (ll);
|
||||
if (offset + sizeof (ll) <= statbuf.st_size) {
|
||||
/* fseeko errors are not really relevant for us. */
|
||||
int err = fseeko (lastlogfile, offset, SEEK_SET);
|
||||
assert (0 == err);
|
||||
|
Reference in New Issue
Block a user