diff options
author | Nathan Scott <nathans@redhat.com> | 2020-08-19 17:50:43 +1000 |
---|---|---|
committer | Nathan Scott <nathans@redhat.com> | 2020-08-19 17:50:43 +1000 |
commit | eef6bc447d3c0ecaac8bd0b0e3d291d9688ff35e (patch) | |
tree | b32f114542049b434c73dbf92aa9db87cb103930 /linux | |
parent | f9625cacf0358de3a7fe4645120711a89d6cd30c (diff) |
Correction to smaps buffer size passed to smaps path snprintf
Diffstat (limited to 'linux')
-rw-r--r-- | linux/LinuxProcessList.c | 4 |
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) |