内存相关的代码安全

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);

}

posted @ 2017-11-28 16:38  wjbooks  阅读(280)  评论(0编辑  收藏  举报