]> granicus.if.org Git - file/commitdiff
fix sign-compare error.
authorChristos Zoulas <christos@zoulas.com>
Thu, 10 Sep 2015 13:59:32 +0000 (13:59 +0000)
committerChristos Zoulas <christos@zoulas.com>
Thu, 10 Sep 2015 13:59:32 +0000 (13:59 +0000)
src/readelf.c

index 957be0316f7934497dc4450100aa710c48ccba1f..2a7fc01b78b50126658ce3496c23ce50ccd9e0ed 100644 (file)
@@ -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"