aboutsummaryrefslogtreecommitdiffstats
path: root/libc/bionic/__strcpy_chk.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libc/bionic/__strcpy_chk.cpp')
-rw-r--r--libc/bionic/__strcpy_chk.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/libc/bionic/__strcpy_chk.cpp b/libc/bionic/__strcpy_chk.cpp
index 9b39627e9..1f6bc8085 100644
--- a/libc/bionic/__strcpy_chk.cpp
+++ b/libc/bionic/__strcpy_chk.cpp
@@ -41,13 +41,13 @@
* This strcpy check is called if _FORTIFY_SOURCE is defined and
* greater than 0.
*/
-extern "C" char *__strcpy_chk (char *dest, const char *src, size_t dest_len) {
- // TODO: optimize so we don't scan src twice.
- size_t src_len = strlen(src) + 1;
- if (__predict_false(src_len > dest_len)) {
- __fortify_chk_fail("strcpy prevented write past end of buffer",
- BIONIC_EVENT_STRCPY_BUFFER_OVERFLOW);
- }
+extern "C" char* __strcpy_chk (char* dest, const char* src, size_t dest_len) {
+ // TODO: optimize so we don't scan src twice.
+ size_t src_len = strlen(src) + 1;
+ if (__predict_false(src_len > dest_len)) {
+ __fortify_chk_fail("strcpy: prevented write past end of buffer",
+ BIONIC_EVENT_STRCPY_BUFFER_OVERFLOW);
+ }
- return strcpy(dest, src);
+ return strcpy(dest, src);
}