commit | d36c886aed35491bf8e0e882eeae472f40f08eb7 | [log] [tgz] |
---|---|---|
author | Leandro Pereira <leandro@hardinfo.org> | Mon Apr 28 20:44:14 2014 -0300 |
committer | Lucas De Marchi <lucas.demarchi@intel.com> | Wed May 14 20:17:30 2014 -0300 |
tree | 52e8f8282062627752c2fcb36dae3f6e2b912778 | |
parent | c48b269d64e4c2e23194f0a7c20d27e7727cdf3d [diff] [blame] |
Bail out of index_mm_open() if fstat() fails
diff --git a/libkmod/libkmod-index.c b/libkmod/libkmod-index.c index fa7db41..2136a96 100644 --- a/libkmod/libkmod-index.c +++ b/libkmod/libkmod-index.c
@@ -800,7 +800,8 @@ 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;