summaryrefslogtreecommitdiff
path: root/libs/binder/TextOutput.cpp
diff options
context:
space:
mode:
author Pawan Wagh <waghpawan@google.com> 2022-09-28 18:52:26 +0000
committer Pawan Wagh <waghpawan@google.com> 2022-09-28 20:16:59 +0000
commit7063b526b67f1e4ba122abcabcbd5f2093515d0a (patch)
tree7be0020921613e0385287ca9ac385e5e0dde2d32 /libs/binder/TextOutput.cpp
parente583df86038451c8a60b2b943f403cc294ae5c97 (diff)
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
Diffstat (limited to 'libs/binder/TextOutput.cpp')
-rw-r--r--libs/binder/TextOutput.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/libs/binder/TextOutput.cpp b/libs/binder/TextOutput.cpp
index a0ade50efb..5dd1f902f8 100644
--- a/libs/binder/TextOutput.cpp
+++ b/libs/binder/TextOutput.cpp
@@ -39,11 +39,10 @@ TextOutput::~TextOutput() {
static void textOutputPrinter(void* cookie, const char* txt)
{
- ((TextOutput*)cookie)->print(txt, strlen(txt));
+ ((std::ostream*)cookie)->write(txt, strlen(txt));
}
-TextOutput& operator<<(TextOutput& to, const TypeCode& val)
-{
+std::ostream& operator<<(std::ostream& to, const TypeCode& val) {
printTypeCode(val.typeCode(), textOutputPrinter, (void*)&to);
return to;
}
@@ -61,8 +60,7 @@ HexDump::HexDump(const void *buf, size_t size, size_t bytesPerLine)
else mAlignment = 1;
}
-TextOutput& operator<<(TextOutput& to, const HexDump& val)
-{
+std::ostream& operator<<(std::ostream& to, const HexDump& val) {
printHexData(0, val.buffer(), val.size(), val.bytesPerLine(),
val.singleLineCutoff(), val.alignment(), val.carrayStyle(),
textOutputPrinter, (void*)&to);