From 6c915528d3fc6e51557d0ad26016080a8ca064ce Mon Sep 17 00:00:00 2001 From: Mark Salyzyn Date: Thu, 1 Sep 2016 07:28:44 -0700 Subject: [PATCH] logd: crash in prune mLastWorstPidOfSystem (cherry-pick from commit 1eefca281ee837d183e49951ae29683d8665129a) mLastWorstPidOfSystem is supposed to be indexed by element->getPid() Bug: 31237377 Bug: 30797725 Bug: 30688716 Change-Id: I81a55e92f175ded1c571a0aa8836736d86b36b1d --- logd/LogBuffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/logd/LogBuffer.cpp b/logd/LogBuffer.cpp index 8c30f79cb..79a7e8ce0 100644 --- a/logd/LogBuffer.cpp +++ b/logd/LogBuffer.cpp @@ -691,7 +691,7 @@ bool LogBuffer::prune(log_id_t id, unsigned long pruneRows, uid_t caller_uid) { && ((!gc && (element->getPid() == worstPid)) || (mLastWorstPidOfSystem[id].find(element->getPid()) == mLastWorstPidOfSystem[id].end()))) { - mLastWorstPidOfSystem[id][element->getUid()] = it; + mLastWorstPidOfSystem[id][element->getPid()] = it; } if ((!gc && !worstPid && (element->getUid() == worst)) || (mLastWorstUid[id].find(element->getUid())