psutils: add safety margin to buffer

The combination of gcc-10.2.1 and musl-1.2.2 detects a possible buffer
overrun psutil.c line 305. Add a safety margin of 24 byts to buffer.
This commit is contained in:
Jürgen Buchmüller 2021-02-05 23:18:29 +01:00
parent 273b9e8e87
commit 81f317d88c
1 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,20 @@
--- psutils/psutil.c 2021-02-05 23:12:50.141587998 +0100
+++ psutils/psutil.c 2021-02-05 23:15:17.861925136 +0100
@@ -38,7 +38,7 @@
extern char pagelabel[BUFSIZ];
extern int pageno;
-static char buffer[BUFSIZ];
+static char buffer[BUFSIZ+24];
static long bytes = 0;
static off_t pagescmt = 0;
static off_t headerpos = 0;
@@ -97,7 +97,7 @@
long r, w ;
#endif
char *p;
- char buffer[BUFSIZ] ;
+ char buffer[BUFSIZ+24] ;
#if defined(WINNT)
struct _stat fs ;
#else