Package: procps
Version: 1:3.2.7-3
Followup-For: Bug #256376

After further review it looks like PUFF is not checking if it has
enough memory to write on.  This is a simple fix to the problem.
Index: top.h
===================================================================
RCS file: /cvsroot/procps/procps/top.h,v
retrieving revision 1.57
diff -u -p -r1.57 top.h
--- top.h	25 Jun 2006 02:15:35 -0000	1.57
+++ top.h	14 Mar 2007 06:21:58 -0000
@@ -149,6 +149,8 @@ do {                                    
    int _len = 1 + snprintf(_str, sizeof(_str), fmt, ## arg);   \
    if (Batch) _ptr = _str;                                   \
    else {                                                 \
+      if (Pseudo_row * Pseudo_cols + _len > Pseudo_size) \ 
+         Pseudo_scrn = realloc(Pseudo_scrn,Pseudo_row * Pseudo_cols + _len); \
       _ptr = &Pseudo_scrn[Pseudo_row++ * Pseudo_cols];  \
       if (memcmp(_ptr, _str, _len)) {                \
          memcpy(_ptr, _str, _len);                \

Reply via email to