]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
Check return of fseek while reading index
authorLucas De Marchi <lucas.demarchi@intel.com>
Sat, 28 Feb 2015 19:11:53 +0000 (16:11 -0300)
committerLucas De Marchi <lucas.demarchi@intel.com>
Sat, 28 Feb 2015 19:11:53 +0000 (16:11 -0300)
libkmod/libkmod-index.c

index aa17c2f0234a9c54ebbda82d59fe51d73a14f55e..1f3351a0443c7f92acc738e1d6b39c1ab80e2dae 100644 (file)
@@ -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;