summaryrefslogtreecommitdiff
path: root/libc/malloc_hooks/tests/malloc_hooks_tests.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <pcc@google.com>2019-08-08 18:47:22 -0700
committerPeter Collingbourne <pcc@google.com>2019-08-08 18:54:31 -0700
commita51bded572a84d2db646f6022dcb676ced4edcbb (patch)
treee748cb272a835c7fa0bc90493a38468b1e5daa5c /libc/malloc_hooks/tests/malloc_hooks_tests.cpp
parent639ad55176c78bfd70c3786a92a05dd3d2299953 (diff)
Fix OOB read in fortify str[np]cpy implementations found by hwasan.
The fortify implementations of stpncpy and strncpy read out of bounds and only then check that they did so. This causes newer versions of hwasan to complain during the fortify tests as a result of the new support for byte-precise error checks. Move the bounds check into the loop so that it is detected before the load. Test: bionic-unit-tests Change-Id: Id990a4a0217f6c4b39bba60ff41776875615fcb4
Diffstat (limited to 'libc/malloc_hooks/tests/malloc_hooks_tests.cpp')
0 files changed, 0 insertions, 0 deletions