From: Christos Zoulas Date: Wed, 13 May 2009 14:43:10 +0000 (+0000) Subject: Don't lose the last hardware capacity. Cheng Renquan X-Git-Tag: FILE5_04~72 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f311d2777b283bdc9e306fa229d1370c5a8749ab;p=file Don't lose the last hardware capacity. Cheng Renquan --- diff --git a/src/readelf.c b/src/readelf.c index 16955d1e..0e8b9a6b 100644 --- a/src/readelf.c +++ b/src/readelf.c @@ -27,7 +27,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: readelf.c,v 1.81 2008/11/04 16:38:28 christos Exp $") +FILE_RCSID("@(#)$File: readelf.c,v 1.82 2009/05/08 17:41:59 christos Exp $") #endif #ifdef BUILTIN_ELF @@ -909,7 +909,7 @@ doshn(struct magic_set *ms, int clazz, int swap, int fd, off_t off, int num, Elf64_Cap cap64; char cbuf[/*CONSTCOND*/ MAX(sizeof cap32, sizeof cap64)]; - if ((coff += xcap_sizeof) >= (off_t)xsh_size) + if ((coff += xcap_sizeof) > (off_t)xsh_size) break; if (read(fd, cbuf, (size_t)xcap_sizeof) != (ssize_t)xcap_sizeof) {