bfd/
[deliverable/binutils-gdb.git] / bfd / vms-lib.c
index bbef19c7f4191a69d617aeb9b48b32df7905f9b9..0b45a131b8de92ccf6d939e0efeb22e550e6f687 100644 (file)
@@ -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;
This page took 0.030669 seconds and 4 git commands to generate.