diff options
author | Elliott Hughes <enh@google.com> | 2013-10-15 16:43:38 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2013-10-15 16:49:28 -0700 |
commit | d1eda33f012e46083b91e087fb79d14a5ce70f0e (patch) | |
tree | 2d075e9d43c3a300327e79ee27c5b8330d8dce4c /libc/bionic/__strncpy_chk.cpp | |
parent | dc9d8d050a43e1cd32f1337e79187124bb15d938 (diff) | |
download | android_bionic-d1eda33f012e46083b91e087fb79d14a5ce70f0e.tar.gz android_bionic-d1eda33f012e46083b91e087fb79d14a5ce70f0e.tar.bz2 android_bionic-d1eda33f012e46083b91e087fb79d14a5ce70f0e.zip |
Avoid confusing "read prevented write" log messages.
Moving to a "function: message" style avoids ambiguity.
Change-Id: If9d590e50265c61725d3673bd03796e65edd2d5e
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); } } |