pmap: Check sscanf() in discover_shm_minor().

Need at least 6 items ("inode" is unused).
This commit is contained in:
Qualys Security Advisory - committed by Craig Small
parent 8c84870d83
commit 737fbff0e6

6
pmap.c
View File

@ -174,9 +174,9 @@ static void discover_shm_minor(void)
unsigned KLONG start, end; unsigned KLONG start, end;
unsigned long long file_offset, inode; unsigned long long file_offset, inode;
unsigned dev_major, dev_minor; unsigned dev_major, dev_minor;
sscanf(mapbuf_b, "%" KLF "x-%" KLF "x %31s %llx %x:%x %llu", &start, if (sscanf(mapbuf_b, "%" KLF "x-%" KLF "x %31s %llx %x:%x %llu", &start,
&end, perms, &file_offset, &dev_major, &dev_minor, &end, perms, &file_offset, &dev_major, &dev_minor, &inode) < 6)
&inode); continue;
tmp = strchr(mapbuf_b, '\n'); tmp = strchr(mapbuf_b, '\n');
if (tmp) if (tmp)
*tmp = '\0'; *tmp = '\0';