summaryrefslogtreecommitdiffstats
path: root/sys/fs/procfs
diff options
context:
space:
mode:
authordyson <dyson@FreeBSD.org>1996-07-27 18:28:10 +0000
committerdyson <dyson@FreeBSD.org>1996-07-27 18:28:10 +0000
commit3695a870502202d13641117fb57133ae5673a942 (patch)
tree99d9cf47f52053ca0ce75820829a029a1256187c /sys/fs/procfs
parent2fbfe9777527db14a4afa673e11a9d9a438b4c4a (diff)
downloadFreeBSD-src-3695a870502202d13641117fb57133ae5673a942.zip
FreeBSD-src-3695a870502202d13641117fb57133ae5673a942.tar.gz
Under certain circumstances, reading the /proc/*/map file can
crash the system. Nonexistant objects were not handled correctly.
Diffstat (limited to 'sys/fs/procfs')
-rw-r--r--sys/fs/procfs/procfs_map.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/fs/procfs/procfs_map.c b/sys/fs/procfs/procfs_map.c
index 0a586bf..ef71909 100644
--- a/sys/fs/procfs/procfs_map.c
+++ b/sys/fs/procfs/procfs_map.c
@@ -36,7 +36,7 @@
*
* @(#)procfs_status.c 8.3 (Berkeley) 2/17/94
*
- * $Id: procfs_map.c,v 1.1 1996/06/17 22:53:27 dyson Exp $
+ * $Id: procfs_map.c,v 1.2 1996/06/18 05:15:59 dyson Exp $
*/
#include <sys/param.h>
@@ -128,7 +128,7 @@ procfs_domap(curp, p, pfs, uio)
for( lobj = tobj = obj; tobj; tobj = tobj->backing_object)
lobj = tobj;
- switch(lobj->type) {
+ if (lobj) switch(lobj->type) {
default:
case OBJT_DEFAULT:
@@ -143,7 +143,10 @@ case OBJT_SWAP:
case OBJT_DEVICE:
type = "device";
break;
+ } else {
+ type = "none";
}
+
/*
* format:
OpenPOWER on IntegriCloud