内存相关的代码安全

g_FileSavePath = new char[len];
memset(g_FileSavePath, 0 ,sizeof(char)*len);
strcpy(g_FileSavePath, SaveFilePath.toStdString().c_str());

char name[64] = {0};

if (sizeof(tempName) < 64)

{

strcpy(name, tempName);

}

原文地址:https://www.cnblogs.com/whwywzhj/p/7910750.html