]> granicus.if.org Git - strace/commitdiff
2006-01-12 Roland McGrath <roland@redhat.com>
authorRoland McGrath <roland@redhat.com>
Thu, 12 Jan 2006 11:03:46 +0000 (11:03 +0000)
committerRoland McGrath <roland@redhat.com>
Thu, 12 Jan 2006 11:03:46 +0000 (11:03 +0000)
* 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.

system.c

index a1c057e34a3405bb682eff43c481db7d76fc0242..9d84021520cdf33ac44412d90be2e2cbab619dfe 100644 (file)
--- a/system.c
+++ b/system.c
@@ -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)