From: Christos Zoulas Date: Thu, 10 Sep 2015 13:59:32 +0000 (+0000) Subject: fix sign-compare error. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3981488444289a50055b6bd7378e6691292fb12f;p=file fix sign-compare error. --- diff --git a/src/readelf.c b/src/readelf.c index 957be031..2a7fc01b 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.121 2015/07/11 14:41:37 christos Exp $") +FILE_RCSID("@(#)$File: readelf.c,v 1.122 2015/09/10 13:59:32 christos Exp $") #endif #ifdef BUILTIN_ELF @@ -1052,7 +1052,8 @@ doshn(struct magic_set *ms, int clazz, int swap, int fd, off_t off, int num, /* Things we can determine when we seek */ switch (xsh_type) { case SHT_NOTE: - if (xsh_size + xsh_offset > (uintmax_t)fsize) { + if ((uintmax_t)(xsh_size + xsh_offset) > + (uintmax_t)fsize) { if (file_printf(ms, ", note offset/size 0x%" INTMAX_T_FORMAT "x+0x%" INTMAX_T_FORMAT "x exceeds"