]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
readelf: Make room for DW_MACRO_hi_user opcode if used.
authorMark Wielaard <mark@klomp.org>
Tue, 5 Jun 2018 19:04:05 +0000 (21:04 +0200)
committerMark Wielaard <mark@klomp.org>
Fri, 8 Jun 2018 10:03:14 +0000 (12:03 +0200)
The vendor array should have room for all vendor opcode, including
DW_MACRO_hi_user if used.

Signed-off-by: Mark Wielaard <mark@klomp.org>
src/ChangeLog
src/readelf.c

index d6fc919aa4c6c7e728f68129bc46834b78508a4b..83c8532766b55e024f296bcdda7a20f7e0894fdc 100644 (file)
@@ -1,3 +1,8 @@
+2018-06-05  Mark Wielaard  <mark@klomp.org>
+
+       * readelf.c (print_debug_macro_section): Extend vendor array by one
+       to include max DW_MACRO_hi_user opcode.
+
 2018-06-07  Mark Wielaard  <mark@klomp.org>
 
        * readelf.c (main): Lookup "no" for no_str.
index 6ac45111c2efe3518be60d3599b1df7eb6c9d607..11a9b0e7a0f9c25a83b8b168610c45d046cfa359 100644 (file)
@@ -9721,7 +9721,7 @@ print_debug_macro_section (Dwfl_Module *dwflmod __attribute__ ((unused)),
                                                               ? cu->die.cu
                                                               : NULL));
 
-      const unsigned char *vendor[DW_MACRO_hi_user - DW_MACRO_lo_user];
+      const unsigned char *vendor[DW_MACRO_hi_user - DW_MACRO_lo_user + 1];
       memset (vendor, 0, sizeof vendor);
       if (flag & 0x04)
        {