diff options
Diffstat (limited to 'libc/bionic/__strncpy_chk.cpp')
-rw-r--r-- | libc/bionic/__strncpy_chk.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/libc/bionic/__strncpy_chk.cpp b/libc/bionic/__strncpy_chk.cpp index d0e90136a..76458aa74 100644 --- a/libc/bionic/__strncpy_chk.cpp +++ b/libc/bionic/__strncpy_chk.cpp @@ -42,10 +42,9 @@ * greater than 0. */ extern "C" char* __strncpy_chk(char* __restrict dest, const char* __restrict src, - size_t len, size_t dest_len) -{ + size_t len, size_t dest_len) { if (__predict_false(len > dest_len)) { - __fortify_chk_fail("strncpy prevented write past end of buffer", + __fortify_chk_fail("strncpy: prevented write past end of buffer", BIONIC_EVENT_STRNCPY_BUFFER_OVERFLOW); } @@ -64,7 +63,7 @@ extern "C" char* __strncpy_chk2(char* __restrict dst, const char* __restrict src size_t n, size_t dest_len, size_t src_len) { if (__predict_false(n > dest_len)) { - __fortify_chk_fail("strncpy prevented write past end of buffer", + __fortify_chk_fail("strncpy: prevented write past end of buffer", BIONIC_EVENT_STRNCPY_BUFFER_OVERFLOW); } if (n != 0) { @@ -83,7 +82,7 @@ extern "C" char* __strncpy_chk2(char* __restrict dst, const char* __restrict src size_t s_copy_len = static_cast<size_t>(s - src); if (__predict_false(s_copy_len > src_len)) { - __fortify_chk_fail("strncpy prevented read past end of buffer", 0); + __fortify_chk_fail("strncpy: prevented read past end of buffer", 0); } } |