Skip to content

Commit

Permalink
wut
Browse files Browse the repository at this point in the history
  • Loading branch information
bluca committed May 8, 2024
1 parent b6ec0f7 commit 4d6ba70
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dlopen-notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ def read_dlopen_notes(filename):
note_desc = note['n_desc']

try:
text = note_desc.decode('utf-8').rstrip('\0')
if not isinstance(note_desc, str):
text = note_desc.decode('utf-8').rstrip('\0')
else:
text = note_desc
except UnicodeDecodeError as e:
raise ValueError(f'{filename}: Invalid UTF-8 in .note.dlopen n_desc') from e

Expand Down

0 comments on commit 4d6ba70

Please sign in to comment.