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

In cpp_message several fields can cause overflows from assignment to uint values during MIN/MAX checks #209

Open
willjohnsonk opened this issue Sep 14, 2023 · 0 comments
Labels
anomaly Something isn't working

Comments

@willjohnsonk
Copy link
Contributor

Summary

There are cases in certain cpp_message where a field uses a uint type to set a temporary variable to check against internal min/max values but this assignment can cause those values to overflow before the check occurs. Consider assigning these temporary fields to a more flexible type (long, double) prior to doing the check.

Version

4.3.0 (Current)

Expected Behavior

An incoming value that is larger/smaller than the MIN/MAX as defined in the ASN.1 message definition should be clamped to the MIN/MAX and raise an warning.

Actual Behavior

If an incoming value that is larger than the defined MAX and assigned to a uint type smaller than that max the value will overflow on assignment and not update or raise a warning.

Steps to Reproduce the Actual Behavior

Create an input test message with test data larger than the max value represented by a field that uses a temporary uint variable to check MAX/MIN adherence

Related Work

No response

@willjohnsonk willjohnsonk added the anomaly Something isn't working label Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
anomaly Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant