From: Lucas De Marchi Date: Sat, 28 Feb 2015 19:11:53 +0000 (-0300) Subject: Check return of fseek while reading index X-Git-Tag: v20~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ebdac0005bf4e0e9a7a582ce2afa6fa3ca301956;p=thirdparty%2Fkmod.git Check return of fseek while reading index --- diff --git a/libkmod/libkmod-index.c b/libkmod/libkmod-index.c index aa17c2f0..1f3351a0 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;