diff options
author | 2021-11-01 11:23:22 -0700 | |
---|---|---|
committer | 2022-09-28 13:27:14 +0545 | |
commit | 413a60a31daafe60a539fc113dafb1760abb1d20 (patch) | |
tree | 5c10285e8a8f69ff06e0f3b2cc5b6ccca6c9ed18 /lddtree.py | |
parent | lddtree: specify utf-8 encoding with text files (diff) | |
download | pax-utils-413a60a31daafe60a539fc113dafb1760abb1d20.tar.gz pax-utils-413a60a31daafe60a539fc113dafb1760abb1d20.tar.bz2 pax-utils-413a60a31daafe60a539fc113dafb1760abb1d20.zip |
lddtree: Add logging for ELFParseError
Add logging inside parseELF to print the bad file if the parser
fails with ELFParseError.
Bug: https://issuetracker.google.com/issues/203821449
Signed-off-by: Manoj Gupta <manojgupta@chromium.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'lddtree.py')
-rwxr-xr-x | lddtree.py | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -432,7 +432,11 @@ def ParseELF(path, root='/', cwd=None, prefix='', dbg(debug, 'ParseELF(%s)' % path) with open(path, 'rb') as f: - elf = ELFFile(f) + try: + elf = ELFFile(f) + except exceptions.ELFParseError: + warn("ELFParser failed to parse", path) + raise # If this is the first ELF, extract the interpreter. if _first: |