Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Nov 2017 22:14:49 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r325906 - head/usr.bin/procstat
Message-ID:  <201711162214.vAGMEn3P041228@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201711162214.vAGMEn3P041228>