Insure++ Reference - WRITE_UNINIT_PTR
This error is generated whenever an uninitialized pointer is
dereferenced.
This code attempts to use the value of the pointer a ,
even though it has not been initialized.
1: /*
2: * File: writuptr.c
3: */
4: main()
5: {
6: int *a;
7:
8: *a = 123;
9: return (0);
10: }
[writuptr.c:8] **WRITE_UNINIT_PTR**
1. >> *a = 123;
2. Writing to an uninitialized pointer: a
Stack trace where the error occurred:
3. main() writuptr.c, 8
4. **Memory corrupted. Program may crash!!**
- Source line at which the problem was detected.
- Description of the problem and the expression that is in error.
- Stack trace showing the function call sequence leading to the
error.
- Informational message indicating that a serious error has
occurred which may cause the program to crash.
This problem is usually caused by omitting an assignment or allocation
statement that would initialize a pointer. The code given, for example,
could be corrected by including an assignment as shown below.
/*
* File: writuptr.c (Modified)
*/
main()
{
int *a, b;
a = &b;
*a = 123;
}
WRITE_OVERFLOW
WRITE_WILD
|