psmisc/psmisc-22.12-pstree_overflow.patch

12 lines
485 B
Diff
Raw Normal View History

--- src/pstree.c
+++ src/pstree.c 2010-07-13 10:18:31.454925471 +0000
@@ -69,7 +69,7 @@ extern const char *__progname;
#define VT_HD "w"
typedef struct _proc {
- char comm[COMM_LEN + 1];
+ char comm[COMM_LEN + 2 + 1]; /* add another 2 for thread brackets */
char **argv; /* only used : argv[0] is 1st arg; undef if argc < 1 */
int argc; /* with -a : number of arguments, -1 if swapped */
pid_t pid;