lkml.org 
[lkml]   [1999]   [Feb]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: pre-patch-2.2.2-5 breaks xosview
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--- 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;
\
 
 \ /
  Last update: 2005-03-22 13:50    [W:2.656 / U:0.000 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site