Fix crashes by re-invoking with command line argument "-udl"

Fix crashes when re-invoked with -udl command line parameter with more than 7 characters as its value:
Serialize _udlName from generic_string to wchar_t _udlName[MAX_PATH].

Fix #11633, close #11681
This commit is contained in:
Shridhar Kumar 2022-05-16 11:03:09 -04:00 committed by Don Ho
parent a630b63c9a
commit 2aa85006d2
1 changed files with 3 additions and 4 deletions

View File

@ -281,8 +281,7 @@ struct CmdLineParamsDTO
intptr_t _pos2go = 0; intptr_t _pos2go = 0;
LangType _langType = L_EXTERNAL; LangType _langType = L_EXTERNAL;
generic_string _udlName; wchar_t _udlName[MAX_PATH];
wchar_t _pluginMessage[MAX_PATH]; wchar_t _pluginMessage[MAX_PATH];
static CmdLineParamsDTO FromCmdLineParams(const CmdLineParams& params) static CmdLineParamsDTO FromCmdLineParams(const CmdLineParams& params)
@ -298,9 +297,9 @@ struct CmdLineParamsDTO
dto._line2go = params._line2go; dto._line2go = params._line2go;
dto._column2go = params._column2go; dto._column2go = params._column2go;
dto._pos2go = params._pos2go; dto._pos2go = params._pos2go;
dto._langType = params._langType; dto._langType = params._langType;
dto._udlName = params._udlName; wcsncpy(dto._udlName, params._udlName.c_str(), MAX_PATH);
wcsncpy(dto._pluginMessage, params._pluginMessage.c_str(), MAX_PATH); wcsncpy(dto._pluginMessage, params._pluginMessage.c_str(), MAX_PATH);
return dto; return dto;
} }