clean up FORTIFY_SOURCE handling.
Avoid duplicating huge chunks of code. Change-Id: Id6145cdfce781c5ffba2abaaa79681d25a7ab28f
This commit is contained in:
@@ -45,10 +45,8 @@ 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 (src_len > dest_len) {
|
||||
__libc_android_log_print(ANDROID_LOG_FATAL, "libc",
|
||||
"*** strcpy buffer overflow detected ***\n");
|
||||
__libc_android_log_event_uid(BIONIC_EVENT_STRCPY_BUFFER_OVERFLOW);
|
||||
abort();
|
||||
__fortify_chk_fail("strcpy buffer overflow",
|
||||
BIONIC_EVENT_STRCPY_BUFFER_OVERFLOW);
|
||||
}
|
||||
|
||||
return strcpy(dest, src);
|
||||
|
Reference in New Issue
Block a user