Pointer to constant assigned address that does not contain a value
This defect
occurs when a pointer to a constant (const int*, const
char*, etc.) is assigned an address that does not yet contain a
value.
A pointer to a constant stores a value that must not be changed later in the program. If you assign the address of a non-initialized variable to the pointer, it now points to an address with garbage values for the remainder of the program.
Initialize a variable before assigning its address to a pointer to a constant.
| Group: Data flow |
| Language: C | C++ |
| Default: Off |
Command-Line Syntax: NON_INIT_PTR_CONV |
| Impact: Medium |