debuggerd_handler: don't use snprintf in handler. am: 60515bf9f1 am: 021028e020 am: 7e26f7e0bb
am: df2192d259
Change-Id: I5a54370da4c600fdef92992f4c19c3f131cc9148
diff --git a/debuggerd/handler/debuggerd_handler.cpp b/debuggerd/handler/debuggerd_handler.cpp
index a5de83a..b1dc01a 100644
--- a/debuggerd/handler/debuggerd_handler.cpp
+++ b/debuggerd/handler/debuggerd_handler.cpp
@@ -81,7 +81,7 @@
va_start(args, fmt);
char buf[4096];
- vsnprintf(buf, sizeof(buf), fmt, args);
+ __libc_format_buffer_va_list(buf, sizeof(buf), fmt, args);
fatal("%s: %s", buf, strerror(err));
}
@@ -256,8 +256,9 @@
char main_tid[10];
char pseudothread_tid[10];
- snprintf(main_tid, sizeof(main_tid), "%d", thread_info->crashing_tid);
- snprintf(pseudothread_tid, sizeof(pseudothread_tid), "%d", thread_info->pseudothread_tid);
+ __libc_format_buffer(main_tid, sizeof(main_tid), "%d", thread_info->crashing_tid);
+ __libc_format_buffer(pseudothread_tid, sizeof(pseudothread_tid), "%d", thread_info->pseudothread_tid);
+
execl(CRASH_DUMP_PATH, CRASH_DUMP_NAME, main_tid, pseudothread_tid, nullptr);
fatal_errno("exec failed");