From: Michael Snyder Date: Thu, 26 Jul 2007 18:45:13 +0000 (+0000) Subject: 2007-07-26 Michael Snyder X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3d7b34d85ba1babf7cf086dc6651bd1bfe0f99fc;p=binutils-gdb.git 2007-07-26 Michael Snyder * srec.c (srec_scan): Check for EOF (critical because return value will be used as array index). --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 54ef404bc31..45545f56680 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,8 @@ 2007-07-26 Michael Snyder + * 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. 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))