Function pointer declared without its type or number of parameters causes unexpected behavior
This defect occurs when a function without a complete prototype is called using a function pointer.
A function prototype specifies the type and number of parameters.
Arguments passed to a function without a prototype might not match the number and type of parameters of the function definition, which can cause undefined behavior. If the parameters are restricted to a subset of their type domain, arguments from untrusted sources can trigger vulnerabilities in the called function.
Before calling the function through a pointer, provide a function prototype.
| Group: Programming |
| Language: C |
| Default: On for handwritten code, off for generated code |
Command-Line Syntax:
UNPROTOTYPED_FUNC_CALL
|
| Impact: Medium |