diff --git a/include/nlohmann/detail/output/serializer.hpp b/include/nlohmann/detail/output/serializer.hpp index a7dab5cd6..02bfaa548 100644 --- a/include/nlohmann/detail/output/serializer.hpp +++ b/include/nlohmann/detail/output/serializer.hpp @@ -927,7 +927,7 @@ class serializer : (0xFFu >> type) & (byte); const std::size_t index = 256u + static_cast(state) * 16u + static_cast(type); - JSON_ASSERT(index < 400); + JSON_ASSERT(index < utf8d.size()); state = utf8d[index]; return state; } diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index e11f52968..d419f44fe 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -18849,7 +18849,7 @@ class serializer : (0xFFu >> type) & (byte); const std::size_t index = 256u + static_cast(state) * 16u + static_cast(type); - JSON_ASSERT(index < 400); + JSON_ASSERT(index < utf8d.size()); state = utf8d[index]; return state; }