projects
/
binutils-gdb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7096e88
)
Check S-record with 0 size
author
H.J. Lu
<hjl.tools@gmail.com>
Thu, 28 Aug 2014 15:22:42 +0000
(08:22 -0700)
committer
H.J. Lu
<hjl.tools@gmail.com>
Thu, 28 Aug 2014 15:24:19 +0000
(08:24 -0700)
* srec.c (srec_scan): Return error for 0 size.
bfd/ChangeLog
patch
|
blob
|
history
bfd/srec.c
patch
|
blob
|
history
diff --git
a/bfd/ChangeLog
b/bfd/ChangeLog
index bba079f481f4fc36bf3f04ef1ed38d870b13ee30..6484c91df8365b27376c91cf6b2c37cd724d1b87 100644
(file)
--- a/
bfd/ChangeLog
+++ b/
bfd/ChangeLog
@@
-1,3
+1,7
@@
+2014-08-28 H.J. Lu <hongjiu.lu@intel.com>
+
+ * srec.c (srec_scan): Return error for 0 size.
+
2014-08-27 H.J. Lu <hongjiu.lu@intel.com>
PR ld/17306
diff --git
a/bfd/srec.c
b/bfd/srec.c
index f11e74a0295fafe7d0bf1b4cc2719e10b11bba7d..d979bf55564250c59597e7254ae92a767038bc27 100644
(file)
--- a/
bfd/srec.c
+++ b/
bfd/srec.c
@@
-486,7
+486,8
@@
srec_scan (bfd *abfd)
bufsize = bytes * 2;
}
- if (bfd_bread (buf, (bfd_size_type) bytes * 2, abfd) != bytes * 2)
+ if (bytes == 0
+ || bfd_bread (buf, (bfd_size_type) bytes * 2, abfd) != bytes * 2)
goto error_return;
/* Ignore the checksum byte. */