From 88cd182349219df4b17028195a7bae0ef7ca0f23 Mon Sep 17 00:00:00 2001 From: Shivendra Agarwal Date: Fri, 20 Jul 2018 03:29:06 +0530 Subject: [PATCH] Restricting (typed=false, fixed=true) combination in flexbuffer CreateVector (#4825) https://github.com/google/flatbuffers/issues/4815 --- include/flatbuffers/flexbuffers.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/flatbuffers/flexbuffers.h b/include/flatbuffers/flexbuffers.h index 1fb0485..99345d9 100644 --- a/include/flatbuffers/flexbuffers.h +++ b/include/flatbuffers/flexbuffers.h @@ -1417,6 +1417,7 @@ class Builder FLATBUFFERS_FINAL_CLASS { Value CreateVector(size_t start, size_t vec_len, size_t step, bool typed, bool fixed, const Value *keys = nullptr) { + FLATBUFFERS_ASSERT(!fixed || typed); // typed=false, fixed=true combination is not supported. // Figure out smallest bit width we can store this vector with. auto bit_width = (std::max)(force_min_bit_width_, WidthU(vec_len)); auto prefix_elems = 1; -- 2.7.4