diff options
| author | Mitch Phillips <mitchp@google.com> | 2022-04-11 13:22:01 -0700 |
|---|---|---|
| committer | Mitch Phillips <mitchp@google.com> | 2022-04-11 13:36:39 -0700 |
| commit | c70311c2966babf699dff0db5d16e5d5ffcc24cf (patch) | |
| tree | 68155a3fe13763a5d68ce3c05ddca9fda230c21b /libc/malloc_hooks/tests/malloc_hooks_tests.cpp | |
| parent | 9263a823eac6a46b8f9acad475d588536dd4da18 (diff) | |
[GWP-ASan] Fix bugs in realloc().
Two edge cases were found in aosp/2038947:
1. realloc(p, 0) == free() and returns nullptr. Previously, we just
returned a new pointer.
2. If the malloc() part of realloc() fails (e.g. when the size of the
allocation is 1 << 56), then the old memory shouldn't be destroyed.
Bug: N/A
Test: Covered using atest bionic-unit-tests using aosp/2038947.
Change-Id: Ibafc752787129922a1e0323ffa14221d6a14f108
Diffstat (limited to 'libc/malloc_hooks/tests/malloc_hooks_tests.cpp')
0 files changed, 0 insertions, 0 deletions
