Weakness (CWE)
CWE-839: Numeric Range Comparison Without Minimum Check
The product checks a value to ensure that it is less than or equal to a maximum, but it does not also verify that the value is greater than or equal to the minimum.
How to prevent it (2 mitigations)
-
Implementation
If the number to be used is always expected to be positive, change the variable type from signed to unsigned or size_t.
-
Implementation
If the number to be used could have a negative value based on the specification (thus requiring a signed value), but the number should only be positive to preserve code correctness, then include a check to ensure that the value is positive.
Source: MITRE CWE-839
2 results · Clear filters · Feed
-
Medium 6.1
GNU mtools before 4.0.50 has an out-of-bounds write in parse_vses in vfat.c.
-
Medium 5.3
Exim 4.88 before 4.99.4, in some proxy configurations, mishandles certain short payloads, leading to disclosure of unin…