Commit 5d60a422 authored by erikchen's avatar erikchen Committed by Commit Bot

Fix uint32_t overflow in task manager UI.

A uint32_t was being multiplied by 1024, and then implicitly cast to uint64_t.
Instead, first explicitly cast to uint64_t, then multiply by 1024.

Bug: 798234
Change-Id: I93188aca5b1169eeed2e91ef68f9d1a007a6e48b
Reviewed-on: https://chromium-review.googlesource.com/848233Reviewed-by: default avatarAhmed Fakhry <afakhry@chromium.org>
Commit-Queue: Erik Chen <erikchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#526597}
parent 53cafe44
...@@ -524,7 +524,8 @@ void TaskManagerImpl::OnReceivedMemoryDump( ...@@ -524,7 +524,8 @@ void TaskManagerImpl::OnReceivedMemoryDump(
auto it = task_groups_by_proc_id_.find(pmd->pid); auto it = task_groups_by_proc_id_.find(pmd->pid);
if (it == task_groups_by_proc_id_.end()) if (it == task_groups_by_proc_id_.end())
continue; continue;
it->second->set_footprint_bytes(pmd->os_dump->private_footprint_kb * 1024); it->second->set_footprint_bytes(
static_cast<uint64_t>(pmd->os_dump->private_footprint_kb) * 1024);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment