Skip to content

Commit

Permalink
Sanitize short signature
Browse files Browse the repository at this point in the history
The short signature can contain characters that affect console output.
  • Loading branch information
tysmith committed Jan 5, 2024
1 parent ba1129b commit 449aa69
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion grizzly/common/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,16 @@ def short_signature(self):
# FM crash signature creation failed
self._short_signature = "Signature creation failed"
else:
self._short_signature = self.crash_info.createShortSignature()
# sanitize short signature
# error messages can contain characters that affect console output
# for example: b'\xef\xbf\xbd\xc2\x8dA'
self._short_signature = str(
self.crash_info.createShortSignature().encode(
"utf-8", errors="replace"
),
"ascii",
errors="backslashreplace",
)
return self._short_signature

@staticmethod
Expand Down

0 comments on commit 449aa69

Please sign in to comment.