Fix an (almost) infinite loop in the tekhex parser.
PR binutils/17512 * tekhex.c (first_phase): Check that the section range is sane.
This commit is contained in:
parent
f54498b457
commit
690725fa0d
2 changed files with 4 additions and 0 deletions
|
@ -5,6 +5,7 @@
|
||||||
symbol table bigger than the file.
|
symbol table bigger than the file.
|
||||||
* elf.c (bfd_elf_get_str_section): Do not try to load a string
|
* elf.c (bfd_elf_get_str_section): Do not try to load a string
|
||||||
table bigger than the file.
|
table bigger than the file.
|
||||||
|
* tekhex.c (first_phase): Check that the section range is sane.
|
||||||
|
|
||||||
2014-10-30 Nick Clifton <nickc@redhat.com>
|
2014-10-30 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
|
|
|
@ -403,6 +403,9 @@ first_phase (bfd *abfd, int type, char *src)
|
||||||
if (!getvalue (&src, &val))
|
if (!getvalue (&src, &val))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
section->size = val - section->vma;
|
section->size = val - section->vma;
|
||||||
|
/* PR binutils/17512: Make sure that the size is sane. */
|
||||||
|
if (section->size > (bfd_size_type) bfd_get_size (abfd))
|
||||||
|
return FALSE;
|
||||||
section->flags = SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC;
|
section->flags = SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC;
|
||||||
break;
|
break;
|
||||||
case '0':
|
case '0':
|
||||||
|
|
Loading…
Reference in a new issue