diff options
-rw-r--r-- | memps.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -825,6 +825,7 @@ mapinfo *load_maps_rollup(int pid) * for getting values quickly */ snprintf(tmp, sizeof(tmp), "/proc/%d/smaps_rollup", pid); + tmp[sizeof(tmp) - 1] = '\0'; if (access(tmp, F_OK) < 0) return 0; return __load_maps(tmp); @@ -835,6 +836,7 @@ mapinfo *load_maps(int pid) char tmp[128]; snprintf(tmp, sizeof(tmp), "/proc/%d/smaps", pid); + tmp[sizeof(tmp) - 1] = '\0'; return __load_maps(tmp); } |