Avoid confusing "read prevented write" log messages.
Moving to a "function: message" style avoids ambiguity.
Change-Id: If9d590e50265c61725d3673bd03796e65edd2d5e
diff --git a/libc/bionic/__strncpy_chk.cpp b/libc/bionic/__strncpy_chk.cpp
index d0e9013..76458aa 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 @@
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 @@
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);
}
}