CWE-197

Numeric Truncation Error

Medium

Description

Truncation errors occur when a primitive is cast to a primitive of a smaller size and data is lost in the conversion.

Potential Impact

How to Fix

Implementation

Ensure that no casts, implicit or explicit, take place that move from a larger size primitive or a smaller size primitive.

Detection Methods

Related Weaknesses

References

View on MITRE CWE Database →

Need Help Fixing This Vulnerability?

Our security experts can help you identify and remediate CWE-197 vulnerabilities in your codebase.

Get Security Assessment