Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check we don't overflow when casting down integers during parsing #4353

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Use std::isinf
  • Loading branch information
ArnaudBienner committed Apr 20, 2024
commit d2f1d904d9f79eeab157ba967c601a5412dcde2a
2 changes: 1 addition & 1 deletion include/nlohmann/detail/conversions/from_json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ ArithmeticTypeTarget static_cast_check_range(const BasicJsonType& j)
bool valIsInf = false;
if constexpr (std::is_floating_point<ArithmeticTypeSource>::value)
{
valIsInf = isinf(val);
valIsInf = std::isinf(val);
}
if ((val < min || val > max) && !valIsInf)
{
Expand Down