aboutsummaryrefslogtreecommitdiffstats
path: root/extlinux
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2012-09-14 14:54:40 +0100
committerMatt Fleming <matt.fleming@intel.com>2012-09-14 14:54:40 +0100
commit040f273035ca84fc963d0d0c0b39794f7a5fc7d4 (patch)
treedfa6890ce13726168a8af4c7f712292fd2b56305 /extlinux
parenta40bb65a4d1351c7c2b414152186f63aa5ea2a07 (diff)
downloadsyslinux-040f273035ca84fc963d0d0c0b39794f7a5fc7d4.tar.gz
syslinux-040f273035ca84fc963d0d0c0b39794f7a5fc7d4.tar.xz
syslinux-040f273035ca84fc963d0d0c0b39794f7a5fc7d4.zip
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 <matt.fleming@intel.com>
Diffstat (limited to 'extlinux')
-rw-r--r--extlinux/main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/extlinux/main.c b/extlinux/main.c
index 73f3fbe1..d7a239e0 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)