]> granicus.if.org Git - psmisc/commitdiff
fixed pstree -a segfault
authorCraig Small <csmall@users.sourceforge.net>
Fri, 25 Nov 2005 22:25:38 +0000 (22:25 +0000)
committerCraig Small <csmall@users.sourceforge.net>
Fri, 25 Nov 2005 22:25:38 +0000 (22:25 +0000)
ChangeLog
src/pstree.c

index 15f48420cd3aa241d3c45ec8f3e1ca3a401240dc..b5bc353b69915473dc70761a6b2064140c59d2f7 100644 (file)
--- 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 <rene@exactcode.de>
        * fixed print_matches to only print unmatched objects if -a is
index 8207f23fd2e56790fca0c85f0cb88d6c64b41311..2a14a249dd76471547b11eb17de64494df83f3ed 100644 (file)
@@ -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*/
                            }
                         }