-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Harden
--locals
against trashed memory
When attempting to produce a repr for local variables, attempt to cope better with trashed memory: - Use "<invalid object at 0x1234>" as the repr of a `PyObject*` pointing directly at invalid memory, or one whose `ob_type` points at invalid memory. - Use "<list object at 0x1234>" as, for instance, the repr of a list containing an invalid `ob_items` pointer. More generally, use this for any object where we can determine the type, but generating the repr according to that type's rules fails due to accessing unmapped memory. Test this with some ctypes abuse. Signed-off-by: Matt Wozniski <[email protected]>
- Loading branch information
Showing
3 changed files
with
119 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Heap corruption could cause PyStack to fail to generate a stack when ``--locals`` mode was used. This has been fixed by falling back to a reasonable default when attempting to format the repr of a local variable causes a dereference of an invalid pointer. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters