Commit 7d65dc2b authored by Anton Bikineev's avatar Anton Bikineev Committed by Commit Bot

PartitionAlloc: PCScan: Add missing null check.

If maybe_ptr is within super-page payload, but refers to not allocated
memory, null is returned from GetSlotStartInSuperPage. The check for
returned null was missing.

Bug: 11297512
Change-Id: I4284b1c79f353c32c96e9cbc75d0200aa452bf30
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2549921
Auto-Submit: Anton Bikineev <bikineev@chromium.org>
Reviewed-by: default avatarMichael Lippautz <mlippautz@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#829256}
parent 1e8bae07
......@@ -205,7 +205,7 @@ size_t PCScan<thread_safe>::PCScanTask::TryMarkObjectInNormalBucketPool(
// Check if pointer was in the quarantine bitmap.
const uintptr_t base =
GetObjectStartInSuperPage<thread_safe>(maybe_ptr, root_);
if (!bitmap->CheckBit(base))
if (!base || !bitmap->CheckBit(base))
return 0;
PA_DCHECK((maybe_ptr & kSuperPageBaseMask) == (base & kSuperPageBaseMask));
......
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