[PATCH] Fix buffer overflow in srec error handling
Andreas Schwab
schwab@linux-m68k.org
Mon Oct 27 21:42:00 GMT 2014
More information about the Binutils mailing list
Mon Oct 27 21:42:00 GMT 2014
- Previous message (by thread): MIPS backports to 2.25
- Next message (by thread): [PATCH] Fix buffer overflow in srec error handling
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
This patch makes sure the character passed to srec_bad_byte is never
negative.
Andreas.
PR binutils/17512
* srec.c (srec_scan): Read bytes after 'S' as unsigned.
---
bfd/srec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bfd/srec.c b/bfd/srec.c
index 9ed2080..0c473b2 100644
--- a/bfd/srec.c
+++ b/bfd/srec.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;
--
2.1.2
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
- Previous message (by thread): MIPS backports to 2.25
- Next message (by thread): [PATCH] Fix buffer overflow in srec error handling
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Binutils mailing list