GNU Binutils with patches for OS216
Révision | de25939739ffe9a9ad7cec07a35bb2a1e430fe39 (tree) |
---|---|
l'heure | 2017-08-18 16:45:12 |
Auteur | Nick Clifton <nickc@redh...> |
Commiter | Nick Clifton |
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.
@@ -1,3 +1,9 @@ | ||
1 | +2017-08-18 Nick Clifton <nickc@redhat.com> | |
2 | + | |
3 | + PR binutils/21962 | |
4 | + * tekhex.c (getsym): Fix check for source pointer walking off the | |
5 | + end of the input buffer. | |
6 | + | |
1 | 7 | 2017-08-17 Szabolcs Nagy <szabolcs.nagy@arm.com> |
2 | 8 | |
3 | 9 | PR ld/18808 |
@@ -307,7 +307,7 @@ getsym (char *dstp, char **srcp, unsigned int *lenp, char * endp) | ||
307 | 307 | len = hex_value (*src++); |
308 | 308 | if (len == 0) |
309 | 309 | len = 16; |
310 | - for (i = 0; i < len && src < endp; i++) | |
310 | + for (i = 0; i < len && (src + i) < endp; i++) | |
311 | 311 | dstp[i] = src[i]; |
312 | 312 | dstp[i] = 0; |
313 | 313 | *srcp = src + i; |