diff options
author | Lucas De Marchi <lucas.demarchi@intel.com> | 2015-02-28 16:11:53 -0300 |
---|---|---|
committer | Lucas De Marchi <lucas.demarchi@intel.com> | 2015-02-28 16:11:53 -0300 |
commit | ebdac0005bf4e0e9a7a582ce2afa6fa3ca301956 (patch) | |
tree | bd53f329ccac16be34bf1386bb9c30a8eab61775 | |
parent | d98f2d32d1e663bfb7a069a1623de15df6be765d (diff) | |
download | kmod-ebdac0005bf4e0e9a7a582ce2afa6fa3ca301956.tar.gz kmod-ebdac0005bf4e0e9a7a582ce2afa6fa3ca301956.tar.bz2 kmod-ebdac0005bf4e0e9a7a582ce2afa6fa3ca301956.zip |
Check return of fseek while reading index
-rw-r--r-- | libkmod/libkmod-index.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libkmod/libkmod-index.c b/libkmod/libkmod-index.c index aa17c2f..1f3351a 100644 --- a/libkmod/libkmod-index.c +++ b/libkmod/libkmod-index.c @@ -242,7 +242,8 @@ static struct index_node_f *index_read(FILE *in, uint32_t offset) if ((offset & INDEX_NODE_MASK) == 0) return NULL; - fseek(in, offset & INDEX_NODE_MASK, SEEK_SET); + if (fseek(in, offset & INDEX_NODE_MASK, SEEK_SET) < 0) + return NULL; if (offset & INDEX_NODE_PREFIX) { struct strbuf buf; |