...
- a return value (especially of type
errno_t
) - an argument passed by address
- a global object (e.g., errno)
longjmp()
- some combination of the above
...
- Source code still becomes larger, though smaller than the previous examples.
- All error indicators must be checked after calling functions.
- A function that allocates resources must still free them in spite of the error.
- In general, combining registries of different sets of errors is difficult. For example, changing the above code to use
errno
is difficult and bug-prone; as one must be precisely aware of when C library functions set and clearerrno
, and one must be aware of all validerrno
values before adding new ones.
longjmp()
Compliant Solution ( setjmp()
and longjmp()
)
...
Recommendation | Severity | Likelihood | Remediation Cost | Priority | Level |
---|---|---|---|---|---|
ERR05-A | high | likely | high | P9 | L2 |
Related Vulnerabilities
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
...