From: Leandro Pereira Date: Mon, 28 Apr 2014 23:47:49 +0000 (-0300) Subject: Ensure read_long() reads the correct number of bytes from the index X-Git-Tag: v18~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b6d985c61aa8a267b6b6c26bb9d58626d97a7403;p=thirdparty%2Fkmod.git Ensure read_long() reads the correct number of bytes from the index --- diff --git a/libkmod/libkmod-index.c b/libkmod/libkmod-index.c index 2136a968..0c49868d 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); }