]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
readelf: print_debug_macro_section clear vendor array before use.
authorMark Wielaard <mjw@redhat.com>
Tue, 14 Jan 2014 21:13:43 +0000 (22:13 +0100)
committerMark Wielaard <mjw@redhat.com>
Fri, 17 Jan 2014 21:01:45 +0000 (22:01 +0100)
Not setting a vendor code before use would be invalid which we tried to
catch. But to detect that we do need to initialize the vendor array to
zero first.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
src/ChangeLog
src/readelf.c

index 50b6b58841942825bcb7c41f2a329368d669b030..d085d754ce7bb46e1134ab06d4e8e37dca52c8cb 100644 (file)
@@ -1,3 +1,8 @@
+2014-01-14  Mark Wielaard  <mjw@redhat.com>
+
+       * readelf.c (print_debug_macro_section): Clear vendor array before
+       use.
+
 2014-01-15  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        Fix corruption of non-C++ symbols by the demangler.
index 739156cf8abb058c8951375d155fe80c236cb928..39912243b5b8f57f212f7153b1f4d74ea18be7cb 100644 (file)
@@ -6896,6 +6896,7 @@ print_debug_macro_section (Dwfl_Module *dwflmod __attribute__ ((unused)),
        }
 
       const unsigned char *vendor[DW_MACRO_GNU_hi_user - DW_MACRO_GNU_lo_user];
+      memset (vendor, 0, sizeof vendor);
       if (flag & 0x04)
        {
          // 1 byte length, for each item, 1 byte opcode, uleb128 number