FORTIFY_SOURCE: emphasize prevention in error messages.
FORTIFY_SOURCE prevents buffer overflows from occurring.
However, the error message often implies that we only
detect it, not prevent it.
Bring more clarity to the error messages by emphasizing
prevention over detection.
Change-Id: I5f3e1478673bdfc589e6cc4199fce8e52e197a24
diff --git a/libc/bionic/__strchr_chk.cpp b/libc/bionic/__strchr_chk.cpp
index 72559bc..87d8893 100644
--- a/libc/bionic/__strchr_chk.cpp
+++ b/libc/bionic/__strchr_chk.cpp
@@ -33,7 +33,7 @@
extern "C" char* __strchr_chk(const char* p, int ch, size_t s_len) {
for (;; ++p, s_len--) {
if (__predict_false(s_len == 0)) {
- __fortify_chk_fail("read beyond buffer", 0);
+ __fortify_chk_fail("strchr buffer overrun prevented", 0);
}
if (*p == static_cast<char>(ch)) {
return const_cast<char*>(p);