[patch/committed]: VMS lib: fix traverse index

Tristan Gingold gingold@adacore.com
Fri Dec 23 09:26:00 GMT 2011


Hi,

the index pointer was not correctly updated for extended key names, leading to crashes.

(Funny, we correctly generated these entries).

Committed on trunk.

Tristan.

bfd/
2011-12-23  Tristan Gingold  <gingold@adacore.com>

        * vms-lib.c (vms_traverse_index): Move pointer update code.

diff --git a/bfd/vms-lib.c b/bfd/vms-lib.c
index b325d74..48d656b 100644
--- a/bfd/vms-lib.c
+++ b/bfd/vms-lib.c
@@ -277,6 +277,9 @@ vms_traverse_index (bfd *abfd, unsigned int vbn, struct cars
       if (idx_vbn == 0)
         return FALSE;
 
+      /* Point to the next index entry.  */
+      p = keyname + keylen;
+
       if (idx_off == RFADEF__C_INDEX)
         {
           /* Indirect entry.  Recurse.  */
@@ -368,9 +371,6 @@ vms_traverse_index (bfd *abfd, unsigned int vbn, struct cars
                 return FALSE;
             }
         }
-
-      /* Point to the next index entry.  */
-      p = keyname + keylen;
     }
 
   return TRUE;



More information about the Binutils mailing list