mirror of
https://github.com/GrapheneOS/hardened_malloc.git
synced 2025-05-02 06:16:24 -04:00
malloc_usable_size: clean abort on invalid region
It's the region pointer that can be NULL here, and p was checked at the beginning of the function. Also fix the test accordingly.
This commit is contained in:
parent
5c8b686370
commit
76860c72e1
2 changed files with 5 additions and 3 deletions
|
@ -145,9 +145,11 @@ class TestSimpleMemoryCorruption(unittest.TestCase):
|
|||
"fatal allocator error: invalid free\n")
|
||||
|
||||
def test_uninitialized_malloc_usable_size(self):
|
||||
_stdout, _stderr, returncode = self.run_test(
|
||||
_stdout, stderr, returncode = self.run_test(
|
||||
"uninitialized_malloc_usable_size")
|
||||
self.assertEqual(returncode, -11)
|
||||
self.assertEqual(returncode, -6)
|
||||
self.assertEqual(stderr.decode("utf-8"),
|
||||
"fatal allocator error: invalid malloc_usable_size\n")
|
||||
|
||||
def test_uninitialized_realloc(self):
|
||||
_stdout, stderr, returncode = self.run_test("uninitialized_realloc")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue