diff options
author | Alan Modra <amodra@gmail.com> | 2020-03-31 14:51:25 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2020-03-31 15:04:21 +1030 |
commit | b3b360dec78845e30e7994cd633905da5668a96c (patch) | |
tree | cfc1f32c156c500f011031c31e8752a58603ee6b /bfd/tekhex.c | |
parent | d262797294039fc828e36f76c45e462966c5c72a (diff) | |
download | gdb-b3b360dec78845e30e7994cd633905da5668a96c.zip gdb-b3b360dec78845e30e7994cd633905da5668a96c.tar.gz gdb-b3b360dec78845e30e7994cd633905da5668a96c.tar.bz2 |
tekhex: Uninitialised read
* tekhex.c (pass_over): Check is_eof before reading buffer.
Diffstat (limited to 'bfd/tekhex.c')
-rw-r--r-- | bfd/tekhex.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bfd/tekhex.c b/bfd/tekhex.c index c2834b3..0001457 100644 --- a/bfd/tekhex.c +++ b/bfd/tekhex.c @@ -525,7 +525,7 @@ pass_over (bfd *abfd, bfd_boolean (*func) (bfd *, int, char *, char *)) /* Find first '%'. */ is_eof = (bfd_boolean) (bfd_bread (src, (bfd_size_type) 1, abfd) != 1); - while (*src != '%' && !is_eof) + while (!is_eof && *src != '%') is_eof = (bfd_boolean) (bfd_bread (src, (bfd_size_type) 1, abfd) != 1); if (is_eof) |