void-packages/srcpkgs/psutils/patches/buffer-safety.patch
Jürgen Buchmüller 81f317d88c 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.
2021-02-05 23:18:29 +01:00

20 lines
482 B
Diff

--- 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