From: Matt Fleming Date: Fri, 14 Sep 2012 13:54:40 +0000 (+0100) Subject: extlinux: Handle error case for find_mount() X-Git-Tag: syslinux-5.00-pre8~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=040f273035ca84fc963d0d0c0b39794f7a5fc7d4;p=platform%2Fupstream%2Fsyslinux.git extlinux: Handle error case for find_mount() find_mount() may return NULL, so we'd really better check for that *before* dereferencing the pointer. Signed-off-by: Matt Fleming --- diff --git a/extlinux/main.c b/extlinux/main.c index 73f3fbe..d7a239e 100644 --- a/extlinux/main.c +++ b/extlinux/main.c @@ -915,6 +915,8 @@ static const char *find_device_mountinfo(const char *path, dev_t dev) struct stat st; m = find_mount(path, NULL); + if (!m) + return NULL; if (m->devpath[0] == '/' && m->dev == dev && !stat(m->devpath, &st) && S_ISBLK(st.st_mode) && st.st_rdev == dev)