-
Notifications
You must be signed in to change notification settings - Fork 2
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
When validating integers, validate for overflow as well #82
Comments
To check for overflow, I just need to do this: try {
auto value = std::stoi("999999999999999999999999999");
}
catch (const std::out_of_range&) {
...
} Also, I need to write an isValidUnsigned* family of functions as well. When I do, revsisit my validation of SET_TIMER_PERIOD in instantiator.cpp. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When I validate integers, I should also validate for overflow (make sure the value represented in the string isn't larger than what can actually be stored in the data type.) That means I should have versions of this function that check for 32 as well as 64-bit integers, and both signed and unsigned for each.
The text was updated successfully, but these errors were encountered: