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

Avoid signed int overflow in JsonIn::get_int and JsonIn::get_int64 #38453

Merged
merged 1 commit into from
Feb 29, 2020

Conversation

Qrox
Copy link
Contributor

@Qrox Qrox commented Feb 29, 2020

Summary

SUMMARY: None

Purpose of change

Should fix #36808. Use more elaborate code to avoid potential signed integer overflow, and add static assertions of the code's assumptions.

Testing

Game compiles and loads without problem, but I don't have UBSAN at hand to test if it fixes the overflow.

@ZhilkinSerg ZhilkinSerg added <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` labels Feb 29, 2020
@ZhilkinSerg ZhilkinSerg merged commit 5ae27eb into CleverRaven:master Feb 29, 2020
@Qrox Qrox deleted the json-overflow branch March 2, 2020 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code`
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Signed integer overflow in JsonIn::get_int
2 participants