psmisc/psmisc-22.7-pstree_overflow.patch

12 lines
339 B
Diff
Raw Normal View History

--- src/pstree.c
+++ src/pstree.c
@@ -70,7 +70,7 @@
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;