aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2018-02-08 14:57:10 (GMT)
committerRob Landley <rob@landley.net>2018-02-08 14:57:10 (GMT)
commit24c63d1dd238ed762297786dbd2912f0bbaf941a (patch)
treeadfe311368d0797a53682409fa7f57ebaaa71d04
parent29fb63849d4d49bc5afda2b6562faca3e4791ac4 (diff)
downloadandroid_external_toybox-24c63d1dd238ed762297786dbd2912f0bbaf941a.zip
android_external_toybox-24c63d1dd238ed762297786dbd2912f0bbaf941a.tar.gz
android_external_toybox-24c63d1dd238ed762297786dbd2912f0bbaf941a.tar.bz2
Thinko pointed out by Andreas Gampe (causing segfaults in top, oops).
-rw-r--r--toys/posix/ps.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/toys/posix/ps.c b/toys/posix/ps.c
index fd9b54b..8ee68ad 100644
--- a/toys/posix/ps.c
+++ b/toys/posix/ps.c
@@ -1417,7 +1417,7 @@ static void top_common(
mix.count = 0;
while (old.count || new.count) {
- struct carveup *otb = *old.tb, *ntb = *new.tb;
+ struct carveup *otb = old.tb ? *old.tb : 0, *ntb = new.tb ? *new.tb : 0;
// If we just have old for this process, it exited. Discard it.
if (old.count && (!new.count || *otb->slot < *ntb->slot)) {