liblog: fix android_log_printLogLine empty event string
Allow _one_ empty line to get through before evaluating
further. Add __android_log_bswrite testing for content
and contentless cases; checking for propagation and for
expected printing. As for printing which is fixed here,
security variants cover the same code paths as the events.
Bug: 26646213
Change-Id: I484718aa604e0a00afde4c34a00e87468ea93aa5
diff --git a/liblog/logprint.c b/liblog/logprint.c
index bd36cdd..4ef62a1 100644
--- a/liblog/logprint.c
+++ b/liblog/logprint.c
@@ -1488,7 +1488,7 @@
strcat(p, suffixBuf);
p += suffixLen;
} else {
- while(pm < (entry->message + entry->messageLen)) {
+ do {
const char *lineStart;
size_t lineLen;
lineStart = pm;
@@ -1510,7 +1510,7 @@
p += suffixLen;
if (*pm == '\n') pm++;
- }
+ } while (pm < (entry->message + entry->messageLen));
}
if (p_outLength != NULL) {