diff options
Diffstat (limited to 'bfd/vms-lib.c')
-rw-r--r-- | bfd/vms-lib.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/bfd/vms-lib.c b/bfd/vms-lib.c index bbef19c..0b45a13 100644 --- a/bfd/vms-lib.c +++ b/bfd/vms-lib.c @@ -577,6 +577,7 @@ _bfd_vms_lib_archive_p (bfd *abfd, enum vms_lib_kind kind) off = bfd_getl16 (sbm->next); if (off != 0) { + /* Read the 'next' array. */ sbmdesc->next = (unsigned short *)bfd_alloc (abfd, sbm_len * sizeof (unsigned short)); buf1 = data + off; @@ -585,6 +586,7 @@ _bfd_vms_lib_archive_p (bfd *abfd, enum vms_lib_kind kind) } else { + /* There is no next array if there is only one submap. */ BFD_ASSERT (tdata->nbr_dcxsbm == 1); sbmdesc->next = NULL; } @@ -1200,7 +1202,7 @@ vms_lib_bopen (bfd *el, file_ptr filepos) /* Check id. */ if (mhd->id != MHD__C_MHDID) return FALSE; - if (len >= sizeof (struct vms_mhd)) + if (len >= MHD__C_MHDLEN + 1) el->selective_search = (mhd->objstat & MHD__M_SELSRC) ? 1 : 0; el->mtime = vms_rawtime_to_time_t (mhd->datim); el->mtime_set = TRUE; |