Main Content
Function pointer assigned with absolute address
Constant expression is used as function address is vulnerable to code injection
Description
This defect occurs when a function pointer is assigned an absolute address.
Bug Finder considers expressions with any combination of literal constants as an absolute address. The one exception is when the value of the expression is zero.
Risk
Using a fixed address is not portable because it is possible that the address is invalid on other platforms.
An attacker can inject code at the absolute address, causing your program to execute arbitrary, possibly malicious, code.
Fix
Do not use an absolute address with function pointers.
Examples
Result Information
Group: Security |
Language: C | C++ |
Default: Off |
Command-Line Syntax: FUNC_PTR_ABSOLUTE_ADDR |
Impact: Low |
Version History
Introduced in R2015b
See Also
Topics
- Interpret Bug Finder Results in Polyspace Desktop User Interface
- Interpret Bug Finder Results in Polyspace Access Web Interface (Polyspace Access)
- Address Results in Polyspace User Interface Through Bug Fixes or Justifications
- Address Results in Polyspace Access Through Bug Fixes or Justifications (Polyspace Access)