commit 5dc74d31244729d1bc51b8b55d1a1c404eac7b99 Author: Marko Turk Date: Sun Feb 19 20:50:09 2017 +0100 Fix systat crash on some argument combinations diff --git a/usr.bin/systat/devs.c b/usr.bin/systat/devs.c index 3c74fb7..3777487 100644 --- a/usr.bin/systat/devs.c +++ b/usr.bin/systat/devs.c @@ -191,6 +191,10 @@ dsmatchselect(const char *args, devstat_select_mode select_mode, int maxshowdevs int i; int retval = 0; + if (!args) { + return(1); + } + /* * Break the (pipe delimited) input string out into separate * strings. @@ -249,6 +253,10 @@ dsselect(const char *args, devstat_select_mode select_mode, int maxshowdevs, int i; int retval = 0; + if (!args) { + return(1); + } + /* * If we've gone through this code before, free previously * allocated resources.