Code like this: int mvCmp(unsigned char* a_pKey1, unsigned char* a_pKey2, size_t a_iSize) const { void* str1 = alloca(a_iSize); void* str2 = alloca(a_iSize); memcpy(str1, a_pKey1, a_iSize); memcpy(str2, a_pKey2, a_iSize); ... } Generates a false error of: Invalid write of size 4 and comment that: Address 0x22003700 is not derived from any known block and suppression like this: { <insert_a_suppression_name_here> exp-ptrcheck:Heap fun:memcpy ... } This means that ptrcheck thinks that memory is allocated on the heap instead of the stack. alloca calls should add the memory allocated to the stack analysis.
*** This bug has been marked as a duplicate of bug 206618 ***