aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/arena.cc
diff options
context:
space:
mode:
authorGravatar Jisi Liu <jisi.liu@gmail.com>2015-10-05 13:54:05 -0700
committerGravatar Jisi Liu <jisi.liu@gmail.com>2015-10-05 13:54:05 -0700
commit8d8177c75701014dfe27fec4cdd2b1647aefcb67 (patch)
treefdc5d0d0f2fd57f2ca641069c20b34ddf90ec919 /src/google/protobuf/arena.cc
parent46e8ff63cb67a6520711da5317aaaef04d0414d0 (diff)
parentcccf6fed7e2fad1240bb48ba0c47f3978ff7433d (diff)
Merge remote-tracking branch 'origin/master' into fix-author
Diffstat (limited to 'src/google/protobuf/arena.cc')
-rwxr-xr-xsrc/google/protobuf/arena.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/google/protobuf/arena.cc b/src/google/protobuf/arena.cc
index 74b09655..cd0b21a7 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;