From 9f45d314d5da7ae43a56457cd366810f622bad74 Mon Sep 17 00:00:00 2001 From: Joseph Blackman Date: Tue, 24 Nov 2020 11:02:58 -0800 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Niels Lohmann --- include/nlohmann/detail/output/serializer.hpp | 2 +- single_include/nlohmann/json.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/nlohmann/detail/output/serializer.hpp b/include/nlohmann/detail/output/serializer.hpp index d2a5b1e31..0a34c8011 100644 --- a/include/nlohmann/detail/output/serializer.hpp +++ b/include/nlohmann/detail/output/serializer.hpp @@ -881,7 +881,7 @@ class serializer } }; - JSON_ASSERT(byte < 400); + JSON_ASSERT(byte < utf8d.size()); const std::uint8_t type = utf8d[byte]; codep = (state != UTF8_ACCEPT) diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index c3dc12917..933e0f525 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -16392,7 +16392,7 @@ class serializer } }; - JSON_ASSERT(byte < 400); + JSON_ASSERT(byte < utf8d.size()); const std::uint8_t type = utf8d[byte]; codep = (state != UTF8_ACCEPT)