projects
/
platform
/
upstream
/
kmod.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c48b269
)
Bail out of index_mm_open() if fstat() fails
author
Leandro Pereira
<leandro@hardinfo.org>
Mon, 28 Apr 2014 23:44:14 +0000
(20:44 -0300)
committer
Lucas De Marchi
<lucas.demarchi@intel.com>
Wed, 14 May 2014 23:17:30 +0000
(20:17 -0300)
libkmod/libkmod-index.c
patch
|
blob
|
history
diff --git
a/libkmod/libkmod-index.c
b/libkmod/libkmod-index.c
index
fa7db41
..
2136a96
100644
(file)
--- a/
libkmod/libkmod-index.c
+++ b/
libkmod/libkmod-index.c
@@
-800,7
+800,8
@@
struct index_mm *index_mm_open(struct kmod_ctx *ctx, const char *filename,
goto fail_open;
}
- fstat(fd, &st);
+ if (fstat(fd, &st) < 0)
+ goto fail_nommap;
if ((size_t) st.st_size < sizeof(hdr))
goto fail_nommap;