2006-01-12 Roland McGrath <roland@redhat.com>

* system.c (sys_sysctl): Don't read off end of NAME when max_strlen
	exceeds INFO.nlen.
	From Timo Lindfors <timo.lindfors@iki.fi>.
	Fixes Debian#339117.
This commit is contained in:
Roland McGrath 2006-01-12 11:03:46 +00:00
parent 0662b590ab
commit 8e4a3e61ef

View File

@ -1921,7 +1921,9 @@ struct tcb *tcp;
goto out;
}
out:
max_cnt = abbrev(tcp) ? max_strlen : info.nlen;
max_cnt = info.nlen;
if (abbrev(tcp) && max_cnt > max_strlen)
max_cnt = max_strlen;
while (cnt < max_cnt)
tprintf(", %x", name[cnt++]);
if (cnt < info.nlen)