mirror of
https://github.com/nlohmann/json.git
synced 2025-07-13 20:21:48 +03:00
added missing overflow check for #329
This commit is contained in:
@ -8257,6 +8257,13 @@ class basic_json
|
||||
{
|
||||
// parse with strtod
|
||||
result.m_value.number_float = str_to_float_t(static_cast<number_float_t*>(nullptr), NULL);
|
||||
|
||||
// replace infinity and NAN by null
|
||||
if (not std::isfinite(result.m_value.number_float))
|
||||
{
|
||||
type = value_t::null;
|
||||
result.m_value = basic_json::json_value();
|
||||
}
|
||||
}
|
||||
|
||||
// save the type
|
||||
|
Reference in New Issue
Block a user