Make error messages even better!
Change-Id: I72bd1eb1d526dc59833e5bc3c636171f7f9545af
diff --git a/libc/bionic/__strncpy_chk.cpp b/libc/bionic/__strncpy_chk.cpp
index d362b34..5e72c2c 100644
--- a/libc/bionic/__strncpy_chk.cpp
+++ b/libc/bionic/__strncpy_chk.cpp
@@ -45,7 +45,7 @@
size_t len, size_t dest_len)
{
if (__predict_false(len > dest_len)) {
- __fortify_chk_fail("strncpy dest buffer overflow prevented",
+ __fortify_chk_fail("strncpy prevented write past end of buffer",
BIONIC_EVENT_STRNCPY_BUFFER_OVERFLOW);
}
@@ -64,7 +64,7 @@
size_t n, size_t dest_len, size_t src_len)
{
if (__predict_false(n > dest_len)) {
- __fortify_chk_fail("strncpy dest buffer overflow prevented",
+ __fortify_chk_fail("strncpy prevented write past end of buffer",
BIONIC_EVENT_STRNCPY_BUFFER_OVERFLOW);
}
if (n != 0) {
@@ -83,7 +83,7 @@
size_t s_copy_len = static_cast<size_t>(s - src);
if (__predict_false(s_copy_len > src_len)) {
- __fortify_chk_fail("strncpy buffer overrun prevented", 0);
+ __fortify_chk_fail("strncpy prevented read past end of buffer", 0);
}
}