aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2016-10-17 18:32:35 -0500
committerRob Landley <rob@landley.net>2016-10-17 18:32:35 -0500
commitb2574799d14e45ad1b43e8dfd1099fd8cf9b5420 (patch)
tree8c5c81c04e47bc425fc5cfc03d6b0ac7acff17af
parent3a6d31707720cd51c03a722e057acab6c1b959d6 (diff)
downloadtoybox-b2574799d14e45ad1b43e8dfd1099fd8cf9b5420.tar.gz
The recent --help infrastructure fiddling made "toybox --help unknown" segfault
because lookup failure left this->which NULL and error_exit() dereferenced it. (Oops.)
-rw-r--r--main.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/main.c b/main.c
index 5a2a272d..07fd3415 100644
--- a/main.c
+++ b/main.c
@@ -70,6 +70,7 @@ static const int NEED_OPTIONS =
static void unknown(char *name)
{
toys.exitval = 127;
+ toys.which = toy_list;
error_exit("Unknown command %s", name);
}