From 3695a870502202d13641117fb57133ae5673a942 Mon Sep 17 00:00:00 2001 From: dyson Date: Sat, 27 Jul 1996 18:28:10 +0000 Subject: Under certain circumstances, reading the /proc/*/map file can crash the system. Nonexistant objects were not handled correctly. --- sys/fs/procfs/procfs_map.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'sys/fs/procfs') 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 @@ -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: -- cgit v1.1