Skip to content

Commit

Permalink
Fix parsing of /proc/pid/maps (iovisor#2025)
Browse files Browse the repository at this point in the history
Fix parsing of /proc/pid/maps
  • Loading branch information
zilder authored and sync_forks committed Jul 31, 2024
1 parent 73374e6 commit 474b8c4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cc/bcc_proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,14 @@ int bcc_procutils_each_module(int pid, bcc_procutils_modulecb callback,
if (!procmap)
return -1;

char buf[PATH_MAX + 1], perm[5], dev[6];
char buf[PATH_MAX + 1], perm[5], dev[8];
char *name;
uint64_t begin, end, inode;
unsigned long long offset;
while (true) {
buf[0] = '\0';
// From fs/proc/task_mmu.c:show_map_vma
if (fscanf(procmap, "%lx-%lx %4s %llx %5s %lu%[^\n]", &begin, &end, perm,
if (fscanf(procmap, "%lx-%lx %4s %llx %7s %lu%[^\n]", &begin, &end, perm,
&offset, dev, &inode, buf) != 7)
break;

Expand Down

0 comments on commit 474b8c4

Please sign in to comment.