Fix buffer overrun parsing a corrupt tekhex binary.
PR binutils/21962 * tekhex.c (getsym): Fix check for source pointer walking off the end of the input buffer.
This commit is contained in:
parent
dd66b39984
commit
de25939739
@ -1,3 +1,9 @@
|
||||
2017-08-18 Nick Clifton <nickc@redhat.com>
|
||||
|
||||
PR binutils/21962
|
||||
* tekhex.c (getsym): Fix check for source pointer walking off the
|
||||
end of the input buffer.
|
||||
|
||||
2017-08-17 Szabolcs Nagy <szabolcs.nagy@arm.com>
|
||||
|
||||
PR ld/18808
|
||||
|
@ -307,7 +307,7 @@ getsym (char *dstp, char **srcp, unsigned int *lenp, char * endp)
|
||||
len = hex_value (*src++);
|
||||
if (len == 0)
|
||||
len = 16;
|
||||
for (i = 0; i < len && src < endp; i++)
|
||||
for (i = 0; i < len && (src + i) < endp; i++)
|
||||
dstp[i] = src[i];
|
||||
dstp[i] = 0;
|
||||
*srcp = src + i;
|
||||
|
Loading…
x
Reference in New Issue
Block a user