In this section:

Overview

This problem occurs when an attempt is made to copy a pointer with an invalid value or that Insure++ did not see allocated. There are two causes of this behavior:

This section focuses on the first type of problem described above. For information about the second type of problem, contact Parasoft’s Quality Consultants.

CodeDescriptionEnabledReportedPlatform
COPY_UNINIT_PTR

Attempt to copy a wild pointer

(error)RuntimeWindows/Unix


Problem

In the following code, the function attempts to use the address of a variable, but it contains an error at line 9–the address operator (&) has been omitted.

*
* File: copywild.cpp
*/

main() 
{
	int a = 123, *b;

	b = a;
	return 0;
}

Diagnosis at Runtime

[copywild.c:9] **COPY_WILD**
>> 		b = a;
	Copying wild pointer: a 
	Pointer : 0x0000007b
	Stack trace where the error occurred:
		main() copywild.c, 9

Most compilers will generate warning messages for this error since the assignment uses incompatible types.