From cdf3b756fde6e901bca3c98380ae2700f7bdcac2 Mon Sep 17 00:00:00 2001 From: Fabián Cañas Date: Fri, 10 Mar 2023 13:20:42 -0500 Subject: Avoid bad string conversion in RecordedBinder error log BUG=271730529 Test: This was discovered by an existing fuzz test, and should be reproducible that way. Or create a recording with record_binder and edit the interface name to include an emoji or other multi-byte character. Change-Id: I91b301f8930f5e3abbda531ce89e4b55a8c2e319 --- libs/binder/RecordedTransaction.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libs/binder/RecordedTransaction.cpp b/libs/binder/RecordedTransaction.cpp index 51b971651d..ef58ed365f 100644 --- a/libs/binder/RecordedTransaction.cpp +++ b/libs/binder/RecordedTransaction.cpp @@ -127,8 +127,7 @@ std::optional RecordedTransaction::fromDetails( t.mData.mInterfaceName = std::string(String8(interfaceName).string()); if (interfaceName.size() != t.mData.mInterfaceName.size()) { LOG(ERROR) << "Interface Name is not valid. Contains characters that aren't single byte " - "utf-8: " - << interfaceName; + "utf-8."; return std::nullopt; } -- cgit v1.2.3-59-g8ed1b