Re: Assistance required for procps bug
On Fri, 2002-04-12 at 00:30, Craig Small wrote:
> Hello,
> I have bug #142292, #109237 and #106414 for procps. The common thing
> is that if System.map file is a multiple of 1024 (or 4096 not sure
> which) ps crashes. Thanks to Dark for getting me that far.
>
> Can someone look at 106414 and Dark's analysis and help me out here?
> I'm not subscribed to debian-devel so contact me direct.
If dark's analysis is correct, the following patch should fix the bug.
But that code is some of the most awful C I've seen, so I wouldn't be
surprised if the bug was elsewhere.
--- ksym.c~ Fri Apr 12 02:44:25 2002
+++ ksym.c Fri Apr 12 02:38:07 2002
@@ -356,7 +356,7 @@
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 */
Reply to: