Difference between ActiveCheck and FinalCheck



When does ActiveCheck perform its error checking?


ActiveCheck performs its error checking only on calls to routines from the C Runtime Library, system DLLs, and OLE interfaces. If the error occurs between such calls, ActiveCheck will not usually detect it, therefore FinalCheck should be used.


// Example Code:

char szBuff[9] = {'\0'};

// In the following statement, strcpy, a routine in the

// C Runtime Library, is called.  Therefore,  ActiveCheck

// performs its checking and will report

// a stack memory overrun.

strcpy(szBuff, "123456789112");

// In the following statement, there is no call to a routine

// from the CRT library, system DLL, or OLE interface.

// Therefore, ActiveCheck will perform no checking

// and the code must be instrumented in order for

// FinalCheck to detect the array index out of range

// and memory overflow.

szBuff[12] = 5;


Old KB# 12314
Comment List
Related Discussions