From: Nick Clifton Date: Mon, 13 Feb 2017 14:17:07 +0000 (+0000) Subject: Fix access violation when reporting sections that could not be dumped. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0ee3043f58aae078a1ecc54b7be2810cae39a718;p=binutils-gdb.git Fix access violation when reporting sections that could not be dumped. PR binutils/21147 * readelf.c (process_section_contents): Fix off by one error reporting un-dumped sections. --- diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 254268945c9..f099467d3fd 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,9 @@ +2017-02-13 Nick Clifton + + PR binutils/21147 + * readelf.c (process_section_contents): Fix off by one error + reporting un-dumped sections. + 2017-02-13 Nick Clifton PR binutils/21139 diff --git a/binutils/readelf.c b/binutils/readelf.c index de961c48303..6fd7ff7a1e6 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -13172,9 +13172,12 @@ process_section_contents (FILE * file) /* Check to see if the user requested a dump of a section that does not exist. */ - while (i++ < num_dump_sects) - if (dump_sects[i]) - warn (_("Section %d was not dumped because it does not exist!\n"), i); + while (i < num_dump_sects) + { + if (dump_sects[i]) + warn (_("Section %d was not dumped because it does not exist!\n"), i); + i++; + } } static void