w: stale utmp entries snuck in via uninitialized var -- thanks Robert A Basch
This commit is contained in:
parent
89ed9ba210
commit
87eb7ec462
1
NEWS
1
NEWS
@ -8,6 +8,7 @@ ps: fix s format (signals) output with thread display
|
||||
watch: avoid integer overflow for the time delay
|
||||
pwdx: buffer overflow fixed -- thanks Ulf Harnhammar
|
||||
procps.spec needed a slash -- thanks Jesse Brandeburg
|
||||
w: stale utmp entries snuck in via uninitialized var -- thanks Robert A Basch
|
||||
|
||||
procps-3.2.5 --> procps-3.2.6
|
||||
|
||||
|
2
w.c
2
w.c
@ -132,6 +132,7 @@ static const proc_t *getproc(const utmp_t *restrict const u, const char *restric
|
||||
const proc_t *secondbest = NULL;
|
||||
unsigned uid = ~0U;
|
||||
|
||||
*found_utpid = 0;
|
||||
if(!ignoreuser){
|
||||
char buf[UT_NAMESIZE+1];
|
||||
struct passwd *passwd_data; /* pointer to static data */
|
||||
@ -144,7 +145,6 @@ static const proc_t *getproc(const utmp_t *restrict const u, const char *restric
|
||||
}
|
||||
line = tty_to_dev(tty);
|
||||
*jcpu = 0;
|
||||
*found_utpid = 0;
|
||||
for(; *pptr; pptr++) {
|
||||
const proc_t *restrict const tmp = *pptr;
|
||||
if(unlikely(tmp->tgid == u->ut_pid)) {
|
||||
|
Loading…
Reference in New Issue
Block a user