projects
/
platform
/
upstream
/
syslinux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a40bb65
)
extlinux: Handle error case for find_mount()
author
Matt Fleming
<matt.fleming@intel.com>
Fri, 14 Sep 2012 13:54:40 +0000
(14:54 +0100)
committer
Matt Fleming
<matt.fleming@intel.com>
Fri, 14 Sep 2012 13:54:40 +0000
(14:54 +0100)
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>
extlinux/main.c
patch
|
blob
|
history
diff --git
a/extlinux/main.c
b/extlinux/main.c
index
73f3fbe
..
d7a239e
100644
(file)
--- 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)