mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-04-08 17:15:37 +02:00
[EU-FOSSA] Check string length to copy to avoid crash in purgeMenuItemString function
This commit is contained in:
parent
eec82cc2a6
commit
5085d9c95a
@ -361,9 +361,13 @@ bool isInList(const TCHAR *token, const TCHAR *list)
|
||||
|
||||
generic_string purgeMenuItemString(const TCHAR * menuItemStr, bool keepAmpersand)
|
||||
{
|
||||
TCHAR cleanedName[64] = TEXT("");
|
||||
const size_t cleanedNameLen = 64;
|
||||
TCHAR cleanedName[cleanedNameLen] = TEXT("");
|
||||
size_t j = 0;
|
||||
size_t menuNameLen = lstrlen(menuItemStr);
|
||||
if (menuNameLen >= cleanedNameLen)
|
||||
menuNameLen = cleanedNameLen - 1;
|
||||
|
||||
for (size_t k = 0 ; k < menuNameLen ; ++k)
|
||||
{
|
||||
if (menuItemStr[k] == '\t')
|
||||
|
Loading…
x
Reference in New Issue
Block a user