summaryrefslogtreecommitdiff
path: root/bfd/srec.c
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@specifix.com>2007-07-26 18:45:13 +0000
committerMichael Snyder <msnyder@specifix.com>2007-07-26 18:45:13 +0000
commit3cf9e8e62d5d522ec8a047863870db6c0794fc68 (patch)
treebbecaa538053bb47fbae9e7a8081c14513aff2bd /bfd/srec.c
parentd161923a8a05367246e0b5c4d1d8a183fd376533 (diff)
downloadgdb-3cf9e8e62d5d522ec8a047863870db6c0794fc68.tar.gz
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).
Diffstat (limited to 'bfd/srec.c')
-rw-r--r--bfd/srec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/bfd/srec.c b/bfd/srec.c
index ebb039bba36..371e53a3665 100644
--- a/bfd/srec.c
+++ b/bfd/srec.c
@@ -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))