diff options
author | Feng Xiao <xiaofeng@google.com> | 2015-09-24 17:41:45 -0700 |
---|---|---|
committer | Feng Xiao <xiaofeng@google.com> | 2015-09-24 17:41:45 -0700 |
commit | 0e5686a70768a289782eb1e1aa86646e56897e4d (patch) | |
tree | 07c1ee3c3b04b19abbde2e7fd5dec5c2d8cfff11 /src | |
parent | 97a1c1e08d87ca8c669418a6c46d605d3d602497 (diff) | |
parent | ad1d726cc28e783495e7d11c73c49a7502400a89 (diff) |
Merge pull request #727 from AustinSchuh/arena_bounds_fix
Handled blocks being too small in arena.cc
Diffstat (limited to 'src')
-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 907a6a20..2d66dfd7 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; |