[MMC] DoSaveFileAs(): Respect szPath size (#2068)

CORE-11688
This commit is contained in:
Serge Gautherie 2019-11-26 23:24:51 +01:00 committed by Katayama Hirofumi MZ
parent cfdbccf937
commit 3bc93e9353

View File

@ -18,6 +18,8 @@
*/
#include "precomp.h"
#include <stdlib.h>
#include <strsafe.h>
#include "resource.h"
@ -233,12 +235,12 @@ DoSaveFileAs(
if (pChildInfo->pFileName != NULL)
{
_tcscpy(szPath, pChildInfo->pFileName);
StringCbCopy(szPath, sizeof(szPath), pChildInfo->pFileName);
}
else
{
GetWindowText(pChildInfo->hwnd, szPath, MAX_PATH);
_tcscat(szPath, TEXT(".msc"));
GetWindowText(pChildInfo->hwnd, szPath, _countof(szPath));
StringCbCat(szPath, sizeof(szPath), TEXT(".msc"));
}
saveas.lStructSize = sizeof(OPENFILENAME);