From 737fbff0e67effead5a711761bb6c63e747598e0 Mon Sep 17 00:00:00 2001 From: Qualys Security Advisory Date: Thu, 1 Jan 1970 00:00:00 +0000 Subject: [PATCH] pmap: Check sscanf() in discover_shm_minor(). Need at least 6 items ("inode" is unused). --- pmap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pmap.c b/pmap.c index 075037fc..9bc9c4c0 100644 --- a/pmap.c +++ b/pmap.c @@ -174,9 +174,9 @@ static void discover_shm_minor(void) unsigned KLONG start, end; unsigned long long file_offset, inode; unsigned dev_major, dev_minor; - sscanf(mapbuf_b, "%" KLF "x-%" KLF "x %31s %llx %x:%x %llu", &start, - &end, perms, &file_offset, &dev_major, &dev_minor, - &inode); + if (sscanf(mapbuf_b, "%" KLF "x-%" KLF "x %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'; -- 2.40.0