summaryrefslogtreecommitdiffstats
path: root/linux
diff options
context:
space:
mode:
authorNathan Scott <nathans@redhat.com>2020-08-19 17:50:43 +1000
committerNathan Scott <nathans@redhat.com>2020-08-19 17:50:43 +1000
commiteef6bc447d3c0ecaac8bd0b0e3d291d9688ff35e (patch)
treeb32f114542049b434c73dbf92aa9db87cb103930 /linux
parentf9625cacf0358de3a7fe4645120711a89d6cd30c (diff)
Correction to smaps buffer size passed to smaps path snprintf
Diffstat (limited to 'linux')
-rw-r--r--linux/LinuxProcessList.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/linux/LinuxProcessList.c b/linux/LinuxProcessList.c
index c1ccd420..0f756b35 100644
--- a/linux/LinuxProcessList.c
+++ b/linux/LinuxProcessList.c
@@ -505,9 +505,9 @@ static bool LinuxProcessList_readSmapsFile(LinuxProcess* process, const char* di
ssize_t nread=0;
int tmp=0;
if(haveSmapsRollup) {// only available in Linux 4.14+
- snprintf(buffer, MAX_NAME, "%s/%s/smaps_rollup", dirname, name);
+ snprintf(buffer, PAGE_SIZE-1, "%s/%s/smaps_rollup", dirname, name);
} else {
- snprintf(buffer, MAX_NAME, "%s/%s/smaps", dirname, name);
+ snprintf(buffer, PAGE_SIZE-1, "%s/%s/smaps", dirname, name);
}
int fd = open(buffer, O_RDONLY);
if (fd == -1)

© 2014-2024 Faster IT GmbH | imprint | privacy policy