Fix async_safe_fatal overflow handling
Bug: b/79116392
Test: manual
Change-Id: I46cd1007be165489db27cdcd4b42ec69de40d645
diff --git a/libc/async_safe/async_safe_log.cpp b/libc/async_safe/async_safe_log.cpp
index d5aad16..1018ef5 100644
--- a/libc/async_safe/async_safe_log.cpp
+++ b/libc/async_safe/async_safe_log.cpp
@@ -537,7 +537,7 @@
// Log to stderr for the benefit of "adb shell" users and gtests.
struct iovec iov[2] = {
- {msg, os.total}, {const_cast<char*>("\n"), 1},
+ {msg, strlen(msg)}, {const_cast<char*>("\n"), 1},
};
TEMP_FAILURE_RETRY(writev(2, iov, 2));