top - Fix seg-fault when window made very wide
authorMatthew Dillon <dillon@apollo.backplane.com>
Sat, 12 Jun 2010 04:31:08 +0000 (21:31 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sat, 12 Jun 2010 04:31:08 +0000 (21:31 -0700)
* Fix a static buffer overflow when the window is made very wide.

Taken-from: NetBSD
Submitted-by: Trevor Kendall
usr.bin/top/m_dragonfly.c

index a1b4f8f..c23d019 100644 (file)
@@ -526,7 +526,7 @@ get_process_info(struct system_info *si, struct process_select *sel,
        return ((caddr_t) & handle);
 }
 
-char fmt[128];                 /* static area where result is built */
+char fmt[MAX_COLS];            /* static area where result is built */
 
 char *
 format_next_process(caddr_t xhandle, char *(*get_userid) (int))