Merge "[RESTRICT AUTOMERGE] Fix OOB write in noteAtomLogged" into rvc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
8ccca289bf
@@ -459,9 +459,12 @@ void StatsdStats::notePullExceedMaxDelay(int pullAtomId) {
|
|||||||
void StatsdStats::noteAtomLogged(int atomId, int32_t timeSec) {
|
void StatsdStats::noteAtomLogged(int atomId, int32_t timeSec) {
|
||||||
lock_guard<std::mutex> lock(mLock);
|
lock_guard<std::mutex> lock(mLock);
|
||||||
|
|
||||||
if (atomId <= kMaxPushedAtomId) {
|
if (atomId >= 0 && atomId <= kMaxPushedAtomId) {
|
||||||
mPushedAtomStats[atomId]++;
|
mPushedAtomStats[atomId]++;
|
||||||
} else {
|
} else {
|
||||||
|
if (atomId < 0) {
|
||||||
|
android_errorWriteLog(0x534e4554, "187957589");
|
||||||
|
}
|
||||||
if (mNonPlatformPushedAtomStats.size() < kMaxNonPlatformPushedAtoms) {
|
if (mNonPlatformPushedAtomStats.size() < kMaxNonPlatformPushedAtoms) {
|
||||||
mNonPlatformPushedAtomStats[atomId]++;
|
mNonPlatformPushedAtomStats[atomId]++;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user