From 438d66a85c1609e4a9b79f37ba3dc32bff74e3a3 Mon Sep 17 00:00:00 2001 From: Craig Small Date: Fri, 25 Nov 2005 22:25:38 +0000 Subject: [PATCH] fixed pstree -a segfault --- ChangeLog | 5 ++++- src/pstree.c | 10 ++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 15f4842..b5bc353 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,12 +1,15 @@ Changes in 21.9 =============== +2005-11-26 Paul Martin + * Fxied segfault in pstree -a Debian #338108 + 2005-11-22 Craig Small * fuser can not use IPv6, for things like uClibc * configure has --disable-ipv6 for above 2005-11-15 Craig Small - * fuser finds unix sockets. + * fuser finds unix sockets. Closes: #338868 2005-11-05 Rene Rebe * fixed print_matches to only print unmatched objects if -a is diff --git a/src/pstree.c b/src/pstree.c index 8207f23..2a14a24 100644 --- a/src/pstree.c +++ b/src/pstree.c @@ -648,9 +648,15 @@ read_proc (void) if ((thread=atoi(dt->d_name)) !=0) { if (thread != pid) { #ifdef WITH_SELINUX - add_proc(threadname, thread, pid, st.st_uid, NULL, 0, scontext); + if (print_args) + add_proc(threadname, thread, pid, st.st_uid, threadname, strlen(threadname)+1, scontext); + else + add_proc(threadname, thread, pid, st.st_uid, NULL, 0, scontext); #else /*WITH_SELINUX*/ - add_proc(threadname, thread, pid, st.st_uid, NULL, 0); + if (print_args) + add_proc(threadname, thread, pid, st.st_uid, threadname, strlen(threadname)+1); + else + add_proc(threadname, thread, pid, st.st_uid, NULL, 0); #endif /*WITH_SELINUX*/ } } -- 2.40.0