summaryrefslogtreecommitdiff
path: root/system.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>2006-01-12 11:03:46 +0000
committerRoland McGrath <roland@redhat.com>2006-01-12 11:03:46 +0000
commit8e4a3e61ef9034308d273fd10cb2cf256c9f068d (patch)
tree889e2e19abd0a82f2929081881620c4368093769 /system.c
parent0662b590abf091ea1b6f9d5fd0f6c1ab9fece2ee (diff)
downloadstrace-8e4a3e61ef9034308d273fd10cb2cf256c9f068d.tar.gz
strace-8e4a3e61ef9034308d273fd10cb2cf256c9f068d.tar.bz2
strace-8e4a3e61ef9034308d273fd10cb2cf256c9f068d.tar.xz
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.
Diffstat (limited to 'system.c')
-rw-r--r--system.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/system.c b/system.c
index a1c057e..9d84021 100644
--- 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)