]> git.ipfire.org Git - thirdparty/util-linux.git/commit
last: fix utmplist usage
authorKarel Zak <kzak@redhat.com>
Fri, 13 Mar 2015 10:13:26 +0000 (11:13 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 13 Mar 2015 10:30:16 +0000 (11:30 +0100)
commitda1a8ed0b04763af99db4dd239f98a1ed6c60caa
tree7226cfa02fa70441189c2bb243c4e091a5785c21
parent2a4b073e8b2d34dfadd8306f7d71957687923bdd
last: fix utmplist usage

last(1) uses a global list of entries, this is unnecessary and it's
also mistake because the pointer to the list is not set to NULL when
last(1) opens another utmp file. For example:

 last -f /var/log/wtmp -f /var/log/wtmp-20150220

ends with unexpected free() call or sometimes with never ending loop.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1201033
Signed-off-by: Karel Zak <kzak@redhat.com>
login-utils/last.c