From ebdac0005bf4e0e9a7a582ce2afa6fa3ca301956 Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Sat, 28 Feb 2015 16:11:53 -0300 Subject: Check return of fseek while reading index --- libkmod/libkmod-index.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- cgit v1.2.1