diff options
author | Nick Kralevich <nnk@google.com> | 2012-12-04 13:55:19 -0800 |
---|---|---|
committer | Nick Kralevich <nnk@google.com> | 2012-12-04 15:27:30 -0800 |
commit | 326ea5413d18ea019cd1bda415ce428f7bdcafd2 (patch) | |
tree | 630469ff443d522e356418bfda081452d28606f6 /libc/string/strchr.c | |
parent | db79e827ebcb077ebaa6d6c96915c5bffba9a0ca (diff) | |
download | android_bionic-326ea5413d18ea019cd1bda415ce428f7bdcafd2.tar.gz android_bionic-326ea5413d18ea019cd1bda415ce428f7bdcafd2.tar.bz2 android_bionic-326ea5413d18ea019cd1bda415ce428f7bdcafd2.zip |
clean up FORTIFY_SOURCE handling.
Avoid duplicating huge chunks of code.
Change-Id: Id6145cdfce781c5ffba2abaaa79681d25a7ab28f
Diffstat (limited to 'libc/string/strchr.c')
-rw-r--r-- | libc/string/strchr.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/libc/string/strchr.c b/libc/string/strchr.c index 44516efd1..564ea8051 100644 --- a/libc/string/strchr.c +++ b/libc/string/strchr.c @@ -35,11 +35,8 @@ char * __strchr_chk(const char *p, int ch, size_t s_len) { for (;; ++p, s_len--) { - if (s_len == 0) { - __libc_android_log_print(ANDROID_LOG_FATAL, "libc", - "*** FORTIFY_SOURCE strchr read beyond buffer ***\n"); - abort(); - } + if (s_len == 0) + __fortify_chk_fail("strchr read beyond buffer", 0); if (*p == (char) ch) return((char *)p); if (!*p) |