diff options
author | 2015-12-12 16:26:25 -0500 | |
---|---|---|
committer | 2015-12-12 16:26:25 -0500 | |
commit | c6a0c552339026b7379099c02592b07712264d06 (patch) | |
tree | aa5cf4f87064e1ea1782fef818b6f2ce4758645f /dumpelf.c | |
parent | xarray: move ele update to after bounds check (diff) | |
download | pax-utils-c6a0c552339026b7379099c02592b07712264d06.tar.gz pax-utils-c6a0c552339026b7379099c02592b07712264d06.tar.bz2 pax-utils-c6a0c552339026b7379099c02592b07712264d06.zip |
dumpelf: reset dynamic phdr pointer with every elf
When dumping multiple ELFs, the dynamic phdr pointer might be left
pointing to memory from the previous ELF. Make sure we clear it at
the start of every run.
Diffstat (limited to 'dumpelf.c')
-rw-r--r-- | dumpelf.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -28,7 +28,7 @@ static void parseargs(int argc, char *argv[]); static char be_verbose = 0; /* misc dynamic tag caches */ -static void *phdr_dynamic_void = NULL; +static void *phdr_dynamic_void; /* dump all internal elf info */ static void dumpelf(const char *filename, long file_cnt) @@ -40,6 +40,8 @@ static void dumpelf(const char *filename, long file_cnt) if ((elf = readelf(filename)) == NULL) return; + phdr_dynamic_void = NULL; + printf("#include <elf.h>\n"); printf( |