Index: content/zygote/zygote_main_linux.cc |
diff --git a/content/zygote/zygote_main_linux.cc b/content/zygote/zygote_main_linux.cc |
index 123296907cef7d634ac3ca6f253323b0f01ef270..e506820a9529e809b1fc8b6617c833e27e8940fa 100644 |
--- a/content/zygote/zygote_main_linux.cc |
+++ b/content/zygote/zygote_main_linux.cc |
@@ -181,17 +181,6 @@ static void InitLibcLocaltimeFunctions() { |
g_libc_localtime64_r = g_libc_localtime_r; |
} |
-#if defined(MEMORY_SANITIZER) |
-void msan_unpoison_string(const char *s) { |
- if (!s) return; |
- // Can't call strlen() on an uninitialized string. Instead, unpoison byte by |
- // byte until the string is over. |
- do { |
- __msan_unpoison(s, sizeof(*s)); |
- } while(*(s++)); |
-} |
-#endif |
- |
// Define localtime_override() function with asm name "localtime", so that all |
// references to localtime() will resolve to this function. Notice that we need |
// to set visibility attribute to "default" to export the symbol, as it is set |
@@ -213,7 +202,7 @@ struct tm* localtime_override(const time_t* timep) { |
struct tm* res = g_libc_localtime(timep); |
#if defined(MEMORY_SANITIZER) |
if (res) __msan_unpoison(res, sizeof(*res)); |
- if (res->tm_zone) msan_unpoison_string(res->tm_zone); |
+ if (res->tm_zone) __msan_unpoison_string(res->tm_zone); |
#endif |
return res; |
} |
@@ -237,7 +226,7 @@ struct tm* localtime64_override(const time_t* timep) { |
struct tm* res = g_libc_localtime64(timep); |
#if defined(MEMORY_SANITIZER) |
if (res) __msan_unpoison(res, sizeof(*res)); |
- if (res->tm_zone) msan_unpoison_string(res->tm_zone); |
+ if (res->tm_zone) __msan_unpoison_string(res->tm_zone); |
#endif |
return res; |
} |
@@ -258,7 +247,7 @@ struct tm* localtime_r_override(const time_t* timep, struct tm* result) { |
struct tm* res = g_libc_localtime_r(timep, result); |
#if defined(MEMORY_SANITIZER) |
if (res) __msan_unpoison(res, sizeof(*res)); |
- if (res->tm_zone) msan_unpoison_string(res->tm_zone); |
+ if (res->tm_zone) __msan_unpoison_string(res->tm_zone); |
#endif |
return res; |
} |
@@ -279,7 +268,7 @@ struct tm* localtime64_r_override(const time_t* timep, struct tm* result) { |
struct tm* res = g_libc_localtime64_r(timep, result); |
#if defined(MEMORY_SANITIZER) |
if (res) __msan_unpoison(res, sizeof(*res)); |
- if (res->tm_zone) msan_unpoison_string(res->tm_zone); |
+ if (res->tm_zone) __msan_unpoison_string(res->tm_zone); |
#endif |
return res; |
} |