summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMark Wielaard <[email protected]>2014-01-14 22:13:43 +0100
committerMark Wielaard <[email protected]>2014-01-17 22:01:45 +0100
commit04781c3e80412c7051b12dbdc58a642ab258cef0 (patch)
treea8de6065a053b25b14e8eb414a5d78ded5349795 /src
parentdca862bff918446f7e6fffc7f62d75663c73028f (diff)
readelf: print_debug_macro_section clear vendor array before use.
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 <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/readelf.c1
2 files changed, 6 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 50b6b588..d085d754 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2014-01-14 Mark Wielaard <[email protected]>
+
+ * readelf.c (print_debug_macro_section): Clear vendor array before
+ use.
+
2014-01-15 Jan Kratochvil <[email protected]>
Fix corruption of non-C++ symbols by the demangler.
diff --git a/src/readelf.c b/src/readelf.c
index 739156cf..39912243 100644
--- a/src/readelf.c
+++ b/src/readelf.c
@@ -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