diff options
-rwxr-xr-x | src/google/protobuf/arena.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/google/protobuf/arena.cc b/src/google/protobuf/arena.cc index ed1c5ef2..f499108d 100755 --- a/src/google/protobuf/arena.cc +++ b/src/google/protobuf/arena.cc @@ -61,6 +61,9 @@ void Arena::Init() { cleanup_list_ = 0; if (options_.initial_block != NULL && options_.initial_block_size > 0) { + GOOGLE_CHECK_GE(options_.initial_block_size, sizeof(Block)) + << ": Initial block size too small for header."; + // Add first unowned block to list. Block* first_block = reinterpret_cast<Block*>(options_.initial_block); first_block->size = options_.initial_block_size; |