Added actual event logging calls to the FORTIFY_SOURCE methods.
Change-Id: I3bf4fa8678c33187cb8ce4b75e666ddcd24403ab
This commit is contained in:
@@ -50,11 +50,17 @@ char *__strcat_chk (char *dest, const char *src, size_t dest_buf_size)
|
||||
size_t sum;
|
||||
|
||||
// sum = src_len + dest_len + 1 (with overflow protection)
|
||||
if (!safe_add3(&sum, src_len, dest_len, 1U)) abort();
|
||||
if (!safe_add3(&sum, src_len, dest_len, 1U)) {
|
||||
__libc_android_log_print(ANDROID_LOG_FATAL, "libc",
|
||||
"*** strcat integer overflow detected ***\n");
|
||||
__libc_android_log_event_uid(BIONIC_EVENT_STRCAT_INTEGER_OVERFLOW);
|
||||
abort();
|
||||
}
|
||||
|
||||
if (sum > dest_buf_size) {
|
||||
__libc_android_log_print(ANDROID_LOG_FATAL, "libc",
|
||||
"*** strcat buffer overflow detected ***\n");
|
||||
__libc_android_log_event_uid(BIONIC_EVENT_STRNCAT_BUFFER_OVERFLOW);
|
||||
abort();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user