]> 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:24:13 +0000 (11:24 +0100)
commitc016a9239503e6278d8e2d276ac5ffa36f57bd3a
tree044eb606e877d5c1b7dadf75657bfe34925585f2
parentbefb2f7914a48deec108f1a046ff0fd0a065bef6
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