| Index: syzygy/agent/asan/block.cc
|
| diff --git a/syzygy/agent/asan/block.cc b/syzygy/agent/asan/block.cc
|
| index 3399d02c7a21483f652386775b76d9472b03bf4d..c0f6e8f96e0347881806ba1c1f1b1fdc937a18b2 100644
|
| --- a/syzygy/agent/asan/block.cc
|
| +++ b/syzygy/agent/asan/block.cc
|
| @@ -239,6 +239,11 @@ bool BlockPlanLayout(uint32_t chunk_size,
|
| DCHECK_GE(chunk_size, alignment);
|
| DCHECK(::common::IsPowerOfTwo(alignment));
|
|
|
| + // Prevent from trying to allocate a memory block bigger than what we can
|
| + // represent in the block header.
|
| + if (size > kMaxBlockHeaderBodySize)
|
| + return false;
|
| +
|
| // Calculate minimum redzone sizes that respect the parameters.
|
| uint32_t left_redzone_size = static_cast<uint32_t>(::common::AlignUp(
|
| std::max<uint32_t>(min_left_redzone_size, sizeof(BlockHeader)),
|
|
|