Fix read past end of malloc block in logd

Bug: 35412453
Test: Local build
Change-Id: I0f9dee84ef689b042926b6b48abf0caeaa784add
diff --git a/logd/LogBuffer.cpp b/logd/LogBuffer.cpp
index 7613c1e..e03731b 100644
--- a/logd/LogBuffer.cpp
+++ b/logd/LogBuffer.cpp
@@ -183,7 +183,8 @@
     lenr -= avcr - msgr;
     if (lenl != lenr) return DIFFERENT;
     if (fastcmp<memcmp>(avcl + strlen(avc),
-                        avcr + strlen(avc), lenl)) return DIFFERENT;
+                        avcr + strlen(avc),
+                        lenl - strlen(avc))) return DIFFERENT;
     return SAME;
 }