From 7063b526b67f1e4ba122abcabcbd5f2093515d0a Mon Sep 17 00:00:00 2001 From: Pawan Wagh Date: Wed, 28 Sep 2022 18:52:26 +0000 Subject: libbinder : Use logging from liblog TextOutput based logs are causing direct leaks while fuzzing service manager. Modifying logs to use liblog based logging functions. BUG: 240388906 Test: m SANITIZE_HOST=address servicemanager_fuzzer && out/host/linux-x86/fuzz/x86_64/servicemanager_fuzzer/servicemanager_fuzzer Change-Id: I3721051bc92df86c80dce9ed2e9dcac20cafef84 --- libs/binder/Parcel.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'libs/binder/Parcel.cpp') diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp index 888757214d..83332980b2 100644 --- a/libs/binder/Parcel.cpp +++ b/libs/binder/Parcel.cpp @@ -2639,8 +2639,7 @@ status_t Parcel::rpcSetDataReference( return OK; } -void Parcel::print(TextOutput& to, uint32_t /*flags*/) const -{ +void Parcel::print(std::ostream& to, uint32_t /*flags*/) const { to << "Parcel("; if (errorCheck() != NO_ERROR) { @@ -2648,7 +2647,7 @@ void Parcel::print(TextOutput& to, uint32_t /*flags*/) const to << "Error: " << (void*)(intptr_t)err << " \"" << strerror(-err) << "\""; } else if (dataSize() > 0) { const uint8_t* DATA = data(); - to << indent << HexDump(DATA, dataSize()) << dedent; + to << "\t" << HexDump(DATA, dataSize()); #ifdef BINDER_WITH_KERNEL_IPC if (const auto* kernelFields = maybeKernelFields()) { const binder_size_t* OBJS = kernelFields->mObjects; @@ -2656,8 +2655,7 @@ void Parcel::print(TextOutput& to, uint32_t /*flags*/) const for (size_t i = 0; i < N; i++) { const flat_binder_object* flat = reinterpret_cast(DATA + OBJS[i]); - to << endl - << "Object #" << i << " @ " << (void*)OBJS[i] << ": " + to << "Object #" << i << " @ " << (void*)OBJS[i] << ": " << TypeCode(flat->hdr.type & 0x7f7f7f00) << " = " << flat->binder; } } -- cgit v1.2.3-59-g8ed1b