From: Mark Wielaard Date: Wed, 26 Nov 2014 23:12:32 +0000 (+0100) Subject: readelf: Cast Dwarf_Word length to ptrdiff_t for comparison. X-Git-Tag: elfutils-0.161~64 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=13a9fa3013acdc318ebd65f73a9192087a5a39ab;p=thirdparty%2Felfutils.git readelf: Cast Dwarf_Word length to ptrdiff_t for comparison. Avoids comparison between signed and unsigned integer expressions warning. Signed-off-by: Mark Wielaard --- diff --git a/src/ChangeLog b/src/ChangeLog index 0082e651b..a6d18b5c0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2014-11-26 Mark Wielaard + + * readelf.c (print_debug_aranges_section): Cast Dwarf_Word length + to ptrdiff_t for comparison. + 2014-11-24 Mark Wielaard * readelf.c (print_debug_line_section): Check line_range is not zero diff --git a/src/readelf.c b/src/readelf.c index 00986d1ec..cd15e4c0a 100644 --- a/src/readelf.c +++ b/src/readelf.c @@ -4693,7 +4693,7 @@ print_debug_aranges_section (Dwfl_Module *dwflmod __attribute__ ((unused)), printf (gettext ("\n Length: %6" PRIu64 "\n"), (uint64_t) length); - if (unlikely (length > readendp - readp)) + if (unlikely ((ptrdiff_t) length > readendp - readp)) goto invalid_data; if (length == 0)