mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-03 05:12:28 +08:00
This patch fixes a flaw in the SREC parser which could cause a stack overflow
and potential secuiryt breach. PR binutils/17510 * srec.c (srec_bad_byte): Increase size of buf to allow for negative values. (srec_scan): Use an unsigned char buffer to hold header bytes.
This commit is contained in:
@ -1,3 +1,11 @@
|
||||
2014-10-28 Andreas Schwab <schwab@suse.de>
|
||||
Nick Clifton <nickc@redhat.com>
|
||||
|
||||
PR binutils/17510
|
||||
* srec.c (srec_bad_byte): Increase size of buf to allow for
|
||||
negative values.
|
||||
(srec_scan): Use an unsigned char buffer to hold header bytes.
|
||||
|
||||
2014-10-27 Nick Clifton <nickc@redhat.com>
|
||||
|
||||
PR binutils/17512
|
||||
|
@ -629,7 +629,7 @@ setup_group (bfd *abfd, Elf_Internal_Shdr *hdr, asection *newsect)
|
||||
memset (shdr->contents, 0, amt);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
/* Translate raw contents, a flag word followed by an
|
||||
array of elf section indices all in target byte order,
|
||||
to the flag word followed by an array of elf section
|
||||
|
@ -515,7 +515,6 @@ _bfd_XXi_swap_aouthdr_in (bfd * abfd,
|
||||
a->NumberOfRvaAndSizes = 0;
|
||||
}
|
||||
|
||||
|
||||
for (idx = 0; idx < a->NumberOfRvaAndSizes; idx++)
|
||||
{
|
||||
/* If data directory is empty, rva also should be 0. */
|
||||
|
@ -246,7 +246,7 @@ srec_bad_byte (bfd *abfd,
|
||||
}
|
||||
else
|
||||
{
|
||||
char buf[10];
|
||||
char buf[40];
|
||||
|
||||
if (! ISPRINT (c))
|
||||
sprintf (buf, "\\%03o", (unsigned int) c);
|
||||
@ -452,7 +452,7 @@ srec_scan (bfd *abfd)
|
||||
case 'S':
|
||||
{
|
||||
file_ptr pos;
|
||||
char hdr[3];
|
||||
unsigned char hdr[3];
|
||||
unsigned int bytes, min_bytes;
|
||||
bfd_vma address;
|
||||
bfd_byte *data;
|
||||
|
Reference in New Issue
Block a user