1
0
mirror of https://github.com/nlohmann/json.git synced 2025-08-06 07:02:42 +03:00

🐛 add missing EOF check

This commit is contained in:
Niels Lohmann
2020-07-20 22:40:28 +02:00
parent a9117828e1
commit 1339d6b683
2 changed files with 8 additions and 0 deletions

View File

@@ -2016,6 +2016,10 @@ class binary_reader
for (std::size_t i = 0; i < size; ++i) for (std::size_t i = 0; i < size; ++i)
{ {
get(); get();
if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(input_format_t::ubjson, "number")))
{
return false;
}
number_vector.push_back(current); number_vector.push_back(current);
} }

View File

@@ -9516,6 +9516,10 @@ class binary_reader
for (std::size_t i = 0; i < size; ++i) for (std::size_t i = 0; i < size; ++i)
{ {
get(); get();
if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(input_format_t::ubjson, "number")))
{
return false;
}
number_vector.push_back(current); number_vector.push_back(current);
} }