aboutsummaryrefslogtreecommitdiff
path: root/sys/ddb
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>1996-06-15 07:08:02 +0000
committerPeter Wemm <peter@FreeBSD.org>1996-06-15 07:08:02 +0000
commit4a32095f34340eb7d15ed63090992bbe6b7cb6ca (patch)
tree54c871b5498834c0fe38c93eabc862625f18107f /sys/ddb
parent3f21e4122d2b29eaa94296a09ee0dd49e225a677 (diff)
downloadsrc-4a32095f34340eb7d15ed63090992bbe6b7cb6ca.tar.gz
src-4a32095f34340eb7d15ed63090992bbe6b7cb6ca.zip
A small bit of defensive programming in case the panic is during process
exit and cleanup. the 'ps' command assumes that there are always 'nproc' processes on the lists and will walk off the end without checking if not, causing ddb to trap during the 'ps' command.
Notes
Notes: svn path=/head/; revision=16381
Diffstat (limited to 'sys/ddb')
-rw-r--r--sys/ddb/db_ps.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/ddb/db_ps.c b/sys/ddb/db_ps.c
index 780d4e6affc4..c2b03aa62db0 100644
--- a/sys/ddb/db_ps.c
+++ b/sys/ddb/db_ps.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: db_ps.c,v 1.10 1995/12/10 19:08:08 bde Exp $
+ * $Id: db_ps.c,v 1.11 1996/03/11 05:53:59 hsu Exp $
*/
#include <sys/param.h>
#include <sys/systm.h>
@@ -84,6 +84,10 @@ db_ps(dummy1, dummy2, dummy3, dummy4)
return;
}
}
+ if (p == NULL) {
+ printf("oops, ran out of processes early!\n");
+ break;
+ }
pp = p->p_pptr;
if (pp == NULL)
pp = p;