Re: pre-patch-2.2.2-5 breaks xosview

Tom Eastep (eastep@loc1.tandem.com)
Sat, 20 Feb 1999 17:09:45 +0000


This is a multi-part message in MIME format.
--------------84039CBD85AF2283518C8AB4
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Steve VanDevender wrote:
>
> pre-patch-2.2.2-5 broke xosview on my system (using libc-5.4.46,
> libg++-2.7.2.8).

It breaks kpm (the KDE Process Monitor) as well. Attached is a patch
against kde1.1 that fixes the problem for me. The patch is probably
overkill (I may have extended some buffers unnecessarily) but I didn't
want to extend one buffer only to find that another one overflowed...

-Tom

-- 
Tom Eastep
Compaq Computer Corporation
Enterprise Computing Group
Tandem Division
tom.eastep@compaq.com
--------------84039CBD85AF2283518C8AB4
Content-Type: text/plain; charset=us-ascii;
 name="patch-kpm"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="patch-kpm"

--- kdeutils-1.1/kpm/proc.C~ Tue Nov 10 12:41:05 1998 +++ kdeutils-1.1/kpm/proc.C Sat Feb 20 08:59:45 1999 @@ -59,8 +59,8 @@ int Procinfo::readproc(int proc_pid) { char path[256]; - char buf[256]; - char sbuf[384]; // should be enough to acommodate /proc/X/stat + char buf[1024]; + char sbuf[1024]; // should be enough to acommodate /proc/X/stat char cmdbuf[MAX_CMD_LEN]; sprintf(path, "%s/%d", procdir, proc_pid); @@ -157,7 +157,7 @@ void Procinfo::read_loadavg() { char path[80]; - char buf[512]; + char buf[1024]; strcpy(path, procdir); strcat(path, "/loadavg"); if(read_file(path, buf, sizeof(buf)) <= 0) { @@ -172,7 +172,7 @@ void Procinfo::read_common() { char path[80]; - char buf[512]; + char buf[1024]; // read memory info strcpy(path, procdir); @@ -268,7 +268,7 @@ FILE *f = fopen(path, "r"); if(!f) return FALSE; - char buf[256]; + char buf[1024]; while(fgets(buf, sizeof(buf), f) != 0) { Sockinfo *si = new Sockinfo(); si->proto = proto;

--------------84039CBD85AF2283518C8AB4--

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/