Fixing a bug introduced due to refactoring var names
SELinux messages weren't properly filtering into the events buffer
because message_len was being used to determine length of event data
instead of str_len
Bug: 65597269
Test: SELinux denials show up in the events buffer
Change-Id: I857e10211f71dd0db33a272241c7051c5d0c59ca
(cherry picked from commit 3a5acdaa8dfc6b4a3e6c546a46b68a3129d49853)
diff --git a/logd/LogAudit.cpp b/logd/LogAudit.cpp
index b76160d..269db2f 100755
--- a/logd/LogAudit.cpp
+++ b/logd/LogAudit.cpp
@@ -331,7 +331,7 @@
reinterpret_cast<android_log_event_string_t*>(buffer);
event->header.tag = htole32(AUDITD_LOG_TAG);
event->type = EVENT_TYPE_STRING;
- event->length = htole32(message_len);
+ event->length = htole32(str_len);
memcpy(event->data, str, str_len - bug_metadata.length());
memcpy(event->data + str_len - bug_metadata.length(),
bug_metadata.c_str(), bug_metadata.length());