mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-20 01:50:24 +08:00
Fix address violation parsing a corrupt texhex format file.
PR binutils/21670 * tekhex.c (getvalue): Check for the source pointer exceeding the end pointer before the first byte is read.
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
2017-06-26 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
|
PR binutils/21670
|
||||||
|
* tekhex.c (getvalue): Check for the source pointer exceeding the
|
||||||
|
end pointer before the first byte is read.
|
||||||
|
|
||||||
2017-06-26 Nick Clifton <nickc@redhat.com>
|
2017-06-26 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
PR binutils/21665
|
PR binutils/21665
|
||||||
|
@ -273,6 +273,9 @@ getvalue (char **srcp, bfd_vma *valuep, char * endp)
|
|||||||
bfd_vma value = 0;
|
bfd_vma value = 0;
|
||||||
unsigned int len;
|
unsigned int len;
|
||||||
|
|
||||||
|
if (src >= endp)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
if (!ISHEX (*src))
|
if (!ISHEX (*src))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
@ -514,9 +517,10 @@ pass_over (bfd *abfd, bfd_boolean (*func) (bfd *, int, char *, char *))
|
|||||||
/* To the front of the file. */
|
/* To the front of the file. */
|
||||||
if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0)
|
if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
while (! is_eof)
|
while (! is_eof)
|
||||||
{
|
{
|
||||||
char src[MAXCHUNK];
|
static char src[MAXCHUNK];
|
||||||
char type;
|
char type;
|
||||||
|
|
||||||
/* Find first '%'. */
|
/* Find first '%'. */
|
||||||
|
Reference in New Issue
Block a user