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/__memcpy_chk.cpp | |
parent | dc9d8d050a43e1cd32f1337e79187124bb15d938 (diff) | |
download | bionic-d1eda33f012e46083b91e087fb79d14a5ce70f0e.zip bionic-d1eda33f012e46083b91e087fb79d14a5ce70f0e.tar.gz bionic-d1eda33f012e46083b91e087fb79d14a5ce70f0e.tar.bz2 |
Avoid confusing "read prevented write" log messages.
Moving to a "function: message" style avoids ambiguity.
Change-Id: If9d590e50265c61725d3673bd03796e65edd2d5e
Diffstat (limited to 'libc/bionic/__memcpy_chk.cpp')
-rw-r--r-- | libc/bionic/__memcpy_chk.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/libc/bionic/__memcpy_chk.cpp b/libc/bionic/__memcpy_chk.cpp index 9416e49..8a4f207 100644 --- a/libc/bionic/__memcpy_chk.cpp +++ b/libc/bionic/__memcpy_chk.cpp @@ -42,13 +42,12 @@ * This memcpy check is called if _FORTIFY_SOURCE is defined and * greater than 0. */ -extern "C" void *__memcpy_chk(void *dest, const void *src, - size_t copy_amount, size_t dest_len) -{ - if (__predict_false(copy_amount > dest_len)) { - __fortify_chk_fail("memcpy prevented write past end of buffer", - BIONIC_EVENT_MEMCPY_BUFFER_OVERFLOW); - } +extern "C" void* __memcpy_chk(void* dest, const void* src, + size_t copy_amount, size_t dest_len) { + if (__predict_false(copy_amount > dest_len)) { + __fortify_chk_fail("memcpy: prevented write past end of buffer", + BIONIC_EVENT_MEMCPY_BUFFER_OVERFLOW); + } - return memcpy(dest, src, copy_amount); + return memcpy(dest, src, copy_amount); } |