diff options
author | Jim Kingdon <jkingdon@engr.sgi.com> | 1991-05-03 05:56:58 +0000 |
---|---|---|
committer | Jim Kingdon <jkingdon@engr.sgi.com> | 1991-05-03 05:56:58 +0000 |
commit | 6f48f7f198e458b3518cf0e7310b8edf744f546a (patch) | |
tree | ac280ba3695fefdea6ed6901e71f7e95bacfd870 | |
parent | ede87e2901f110cbfa9c5b135571941c6fc131c0 (diff) | |
download | gdb-6f48f7f198e458b3518cf0e7310b8edf744f546a.zip gdb-6f48f7f198e458b3518cf0e7310b8edf744f546a.tar.gz gdb-6f48f7f198e458b3518cf0e7310b8edf744f546a.tar.bz2 |
(osys_read_record): If record->header.lenth <= sizeof (record->header),
then return rather than passing a negative (or zero) nelts to bfd_read.
-rw-r--r-- | bfd/oasys.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/bfd/oasys.c b/bfd/oasys.c index 61db383..c34b09a 100644 --- a/bfd/oasys.c +++ b/bfd/oasys.c @@ -40,6 +40,8 @@ DEFUN(oasys_read_record,(abfd, record), bfd_read(record, 1, sizeof(record->header), abfd); + if ((size_t) record->header.length <= (size_t) sizeof (record->header)) + return; bfd_read(((char *)record )+ sizeof(record->header), 1, record->header.length - sizeof(record->header), abfd); |