Merge "liblog: print message payload of zero length" am: 50413c7626 am: e13efa6112

am: 1f6a9473a7

* commit '1f6a9473a73371c2e7d8e28e1692c64e5a2efd0a':
  liblog: print message payload of zero length
This commit is contained in:
Mark Salyzyn 2015-12-08 04:53:54 +00:00 committed by android-build-merger
commit eb0137eeca
1 changed files with 2 additions and 2 deletions

View File

@ -500,14 +500,14 @@ int android_log_processLogBuffer(struct logger_entry *buf,
}
if (msgEnd == -1) {
/* incoming message not null-terminated; force it */
msgEnd = buf->len - 1;
msgEnd = buf->len - 1; /* may result in msgEnd < msgStart */
msg[msgEnd] = '\0';
}
entry->priority = msg[0];
entry->tag = msg + 1;
entry->message = msg + msgStart;
entry->messageLen = msgEnd - msgStart;
entry->messageLen = (msgEnd < msgStart) ? 0 : (msgEnd - msgStart);
return 0;
}