From 264c563f54bd25f99db0e1bb8e3d37de915cbc66 Mon Sep 17 00:00:00 2001 From: csmall <> Date: Fri, 12 Apr 2002 11:12:58 +0000 Subject: [PATCH] Stopped ps from crashing if System.map is multiple of 1024 --- ChangeLog | 3 +++ proc/ksym.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ed2f2695..2a38f8d7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,4 +8,7 @@ Version ???? Put most of the Debian diffs in. + ps no longer crashes if System.map is %1024. Debian #109237 + (Thanks Colin Walters) + diff --git a/proc/ksym.c b/proc/ksym.c index 8925bd5a..4549ffaa 100644 --- a/proc/ksym.c +++ b/proc/ksym.c @@ -356,7 +356,7 @@ static int sysmap_mmap(const char *filename, void (*message)(const char *, ...)) sysmap_index = vp; for(;;){ char *vstart; - if(!*endp){ /* if we reached the end */ + if(endp - sysmap_data >= sbuf.st_size){ /* if we reached the end */ int i = VCNT; /* check VCNT times to verify this file */ if(*Version) goto bad_version; if(!ksyms_index) return 1; /* if can not verify, assume success */