Sourceware Bugzilla – Attachment 8471 Details for
Bug 18750
Stack buffer overflow when printing bad bytes in Intel Hex objects
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Fix incorrect escape sequence on platform with signed char (v4)
0001v4-Fix-incorrect-escape-sequence-on-platform-with-signe.patch (text/plain), 1.77 KB, created by
Yuriy Kaminskiy
on 2015-07-31 22:04:15 UTC
(
hide
)
Description:
Fix incorrect escape sequence on platform with signed char (v4)
Filename:
MIME Type:
Creator:
Yuriy Kaminskiy
Created:
2015-07-31 22:04:15 UTC
Size:
1.77 KB
patch
obsolete
>From 49d37fc42a86e6f47080c3b86f04c406b554c77d Mon Sep 17 00:00:00 2001 >From: "Yuriy M. Kaminskiy" <yumkam@gmail.com> >Date: Sat, 1 Aug 2015 00:37:36 +0300 >Subject: [PATCH] Fix incorrect escape sequence on platform with signed char > >bfd/ > PR binutils/18750 > * ihex.c (ihex_bad_byte): Fix incorrect escape sequence (and stack > overflow) on platforms with signed char. > * srec.c (srec_bad_byte): Ditto (but impossible to trigger). >binutils/ > * readelf.c (process_mips_specific): Ditto (but no stack overflow). >--- > bfd/ihex.c | 2 +- > bfd/srec.c | 2 +- > binutils/readelf.c | 2 +- > 3 files changed, 3 insertions(+), 3 deletions(-) > >diff --git a/bfd/ihex.c b/bfd/ihex.c >index 8e66372..faee8cf 100644 >--- a/bfd/ihex.c >+++ b/bfd/ihex.c >@@ -219,7 +219,7 @@ ihex_bad_byte (bfd *abfd, unsigned int lineno, int c, bfd_boolean error) > char buf[10]; > > if (! ISPRINT (c)) >- sprintf (buf, "\\%03o", (unsigned int) c); >+ sprintf (buf, "\\%03o", (unsigned int) c & 0xff); > else > { > buf[0] = c; >diff --git a/bfd/srec.c b/bfd/srec.c >index 24573cf..96b6a2f 100644 >--- a/bfd/srec.c >+++ b/bfd/srec.c >@@ -249,7 +249,7 @@ srec_bad_byte (bfd *abfd, > char buf[40]; > > if (! ISPRINT (c)) >- sprintf (buf, "\\%03o", (unsigned int) c); >+ sprintf (buf, "\\%03o", (unsigned int) c & 0xff); > else > { > buf[0] = c; >diff --git a/binutils/readelf.c b/binutils/readelf.c >index a9b9f2d..6298f1e 100644 >--- a/binutils/readelf.c >+++ b/binutils/readelf.c >@@ -14467,7 +14467,7 @@ process_mips_specific (FILE * file) > len = sizeof (* eopt); > while (len < option->size) > { >- char datum = * ((char *) eopt + offset + len); >+ unsigned char datum = * ((unsigned char *) eopt + offset + len); > > if (ISPRINT (datum)) > printf ("%c", datum); >-- >2.1.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 18750
:
8465
|
8466
|
8468
|
8469
|
8470
|
8471
|
8472