summaryrefslogtreecommitdiff
path: root/libkmod/libkmod-index.c
diff options
context:
space:
mode:
authorLeandro Pereira <leandro@hardinfo.org>2014-04-28 20:47:49 -0300
committerLucas De Marchi <lucas.demarchi@intel.com>2014-05-14 20:18:00 -0300
commitb6d985c61aa8a267b6b6c26bb9d58626d97a7403 (patch)
treeaaaad5f4510a4ab65afef6eace2455d9e77bb5d2 /libkmod/libkmod-index.c
parentd36c886aed35491bf8e0e882eeae472f40f08eb7 (diff)
downloadkmod-b6d985c61aa8a267b6b6c26bb9d58626d97a7403.tar.gz
kmod-b6d985c61aa8a267b6b6c26bb9d58626d97a7403.tar.bz2
kmod-b6d985c61aa8a267b6b6c26bb9d58626d97a7403.zip
Ensure read_long() reads the correct number of bytes from the index
Diffstat (limited to 'libkmod/libkmod-index.c')
-rw-r--r--libkmod/libkmod-index.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libkmod/libkmod-index.c b/libkmod/libkmod-index.c
index 2136a96..0c49868 100644
--- a/libkmod/libkmod-index.c
+++ b/libkmod/libkmod-index.c
@@ -126,7 +126,7 @@ static uint32_t read_long(FILE *in)
uint32_t l;
errno = 0;
- if (fread(&l, sizeof(uint32_t), 1, in) <= 0)
+ if (fread(&l, sizeof(uint32_t), 1, in) != sizeof(uint32_t))
read_error();
return ntohl(l);
}