diff options
author | Peter Collingbourne <pcc@google.com> | 2019-08-08 18:47:22 -0700 |
---|---|---|
committer | Peter Collingbourne <pcc@google.com> | 2019-08-08 18:54:31 -0700 |
commit | a51bded572a84d2db646f6022dcb676ced4edcbb (patch) | |
tree | e748cb272a835c7fa0bc90493a38468b1e5daa5c /libc/malloc_hooks/tests/malloc_hooks_tests.cpp | |
parent | 639ad55176c78bfd70c3786a92a05dd3d2299953 (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