svn commit: r325906 - head/usr.bin/procstat

Andriy Gapon avg at FreeBSD.org
Thu Nov 16 22:14:51 UTC 2017


Author: avg
Date: Thu Nov 16 22:14:49 2017
New Revision: 325906
URL: https://svnweb.freebsd.org/changeset/base/325906

Log:
  procstat: fix a crash with -k -a options
  
  The traditional / legacy usage should still be supported.
  This fixes a regression in r324619 that introduced a nicer, verb based
  interface.
  
  Reviewed by:	brooks
  X-MFC with:	r324619

Modified:
  head/usr.bin/procstat/procstat.c

Modified: head/usr.bin/procstat/procstat.c
==============================================================================
--- head/usr.bin/procstat/procstat.c	Thu Nov 16 21:47:41 2017	(r325905)
+++ head/usr.bin/procstat/procstat.c	Thu Nov 16 22:14:49 2017	(r325906)
@@ -296,7 +296,7 @@ main(int argc, char *argv[])
 			cmd = getcmd("tsignals");
 			break;
 		case 'k':
-			if (cmd->cmd == procstat_kstack) {
+			if (cmd != NULL && cmd->cmd == procstat_kstack) {
 				if ((procstat_opts & PS_OPT_VERBOSE) != 0)
 					usage();
 				procstat_opts |= PS_OPT_VERBOSE;


More information about the svn-src-head mailing list