diff options
author | Nick Clifton <nickc@redhat.com> | 2017-02-13 14:17:07 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2017-02-13 14:17:07 +0000 |
commit | 0ee3043f58aae078a1ecc54b7be2810cae39a718 (patch) | |
tree | b83f2133a87e5b895bcb7debaaafc46d80cba61f /binutils | |
parent | f84ce13b6708801ca1d6289b7c4003e2f5a6d7f9 (diff) | |
download | gdb-0ee3043f58aae078a1ecc54b7be2810cae39a718.zip gdb-0ee3043f58aae078a1ecc54b7be2810cae39a718.tar.gz gdb-0ee3043f58aae078a1ecc54b7be2810cae39a718.tar.bz2 |
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.
Diffstat (limited to 'binutils')
-rw-r--r-- | binutils/ChangeLog | 6 | ||||
-rw-r--r-- | binutils/readelf.c | 9 |
2 files changed, 12 insertions, 3 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 2542689..f099467 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,5 +1,11 @@ 2017-02-13 Nick Clifton <nickc@redhat.com> + PR binutils/21147 + * readelf.c (process_section_contents): Fix off by one error + reporting un-dumped sections. + +2017-02-13 Nick Clifton <nickc@redhat.com> + PR binutils/21139 * readelf.c (target_specific_reloc_handling): Add num_syms parameter. Check for symbol table overflow before accessing diff --git a/binutils/readelf.c b/binutils/readelf.c index de961c4..6fd7ff7 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 |