2007-07-26 Michael Snyder <msnyder@access-company.com>
authorMichael Snyder <msnyder@vmware.com>
Thu, 26 Jul 2007 18:45:13 +0000 (18:45 +0000)
committerMichael Snyder <msnyder@vmware.com>
Thu, 26 Jul 2007 18:45:13 +0000 (18:45 +0000)
* srec.c (srec_scan): Check for EOF (critical because return value
will be used as array index).

bfd/ChangeLog
bfd/srec.c

index 54ef404bc310e6e6bf744b5443cd21a60719f41c..45545f566807871bb65076958fd4a63147a88e87 100644 (file)
@@ -1,5 +1,8 @@
 2007-07-26  Michael Snyder  <msnyder@access-company.com>
 
+       * srec.c (srec_scan): Check for EOF (critical because return value
+       will be used as array index).
+
        * coffgen.c (_bfd_coff_read_internal_relocs): If internal_relocs
        are not to be cached, free the temporary buffer.
 
index ebb039bba36eb635cdc315d70d6ba49418b4e075..371e53a36656b2d01d961675794f7e315cf5c485 100644 (file)
@@ -428,6 +428,11 @@ srec_scan (bfd *abfd)
                  symval <<= 4;
                  symval += NIBBLE (c);
                  c = srec_get_byte (abfd, &error);
+                 if (c == EOF)
+                   {
+                     srec_bad_byte (abfd, lineno, c, error);
+                     goto error_return;
+                   }
                }
 
              if (! srec_new_symbol (abfd, symname, symval))