components/binutils/patches/ihex.c.patch
author Stefan Teleman <stefan.teleman@oracle.com>
Thu, 19 Nov 2015 14:12:20 -0800
changeset 5110 92c73cda9414
permissions -rw-r--r--
22199341 libbfd's file caching scheme bombs in 32-bit

# Patch is from RedHat binutils-2.25.1 src rpm.
# No need to send to binutils, they know about it.
--- bfd/ihex.c	2014-11-04 01:54:41.000000000 -0800
+++ bfd/ihex.c	2015-11-14 22:31:59.559502520 -0800
@@ -219,7 +219,7 @@
       char buf[10];
 
       if (! ISPRINT (c))
-	sprintf (buf, "\\%03o", (unsigned int) c);
+	sprintf (buf, "\\%03o", (unsigned int) (c & 0xff));
       else
 	{
 	  buf[0] = c;
@@ -276,7 +276,7 @@
       else
 	{
 	  file_ptr pos;
-	  char hdr[8];
+	  unsigned char hdr[8];
 	  unsigned int i;
 	  unsigned int len;
 	  bfd_vma addr;
@@ -553,7 +553,7 @@
   error = FALSE;
   while ((c = ihex_get_byte (abfd, &error)) != EOF)
     {
-      char hdr[8];
+      unsigned char hdr[8];
       unsigned int len;
       unsigned int type;
       unsigned int i;