0091-pmap: Check sscanf() in discover_shm_minor().

Need at least 6 items ("inode" is unused).

Signed-off-by: Craig Small <csmall@enc.com.au>
This commit is contained in:
Qualys Security Advisory 1970-01-01 00:00:00 +00:00 committed by Craig Small
parent 2119cd3dd5
commit 550a2a21f9

6
pmap.c
View File

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