1776
Applicable Platforms
Language : C (Prevalence = Often)
Language : C++ (Prevalence = Often)
Language : Not Language-Specific (Prevalence = Undetermined)
Common Consequences
Scope Impact Likelihood
Other Other
Detection Methods
Fuzzing
Fuzz testing (fuzzing) is a powerful technique for generating large numbers of diverse inputs
- either randomly or algorithmically - and dynamically invoking the code with those inputs.
Even with random inputs, it is often capable of generating unexpected results such as crashes,
memory corruption, or resource consumption. Fuzzing effectively produces repeatable test cases
that clearly indicate bugs, which helps developers to diagnose the issues.
Effectiveness = High
Demonstrative Examples
Example 1:
In this example, depending on the return value of accecssmainframe(), the variable amount can
hold a negative value when it is returned. Because the function is declared to return an unsigned
value, amount will be implicitly cast to an unsigned number.
Example Language: C (Bad)
unsigned int readdata () {
int amount = 0;
...
CWE Version 4.14
CWE-704: Incorrect Type Conversion or Cast
CWE-704: Incorrect Type Conversion or Cast