Fix buffer overrun for wordchar list

This commit is contained in:
dail8859 2017-04-06 07:11:44 -04:00
parent 315a161ae2
commit c63673a1d8

View File

@ -303,6 +303,7 @@ void ScintillaEditView::init(HINSTANCE hInst, HWND hPere)
auto defaultCharListLen = execute(SCI_GETWORDCHARS); auto defaultCharListLen = execute(SCI_GETWORDCHARS);
char *defaultCharList = new char[defaultCharListLen + 1]; char *defaultCharList = new char[defaultCharListLen + 1];
execute(SCI_GETWORDCHARS, 0, reinterpret_cast<LPARAM>(defaultCharList)); execute(SCI_GETWORDCHARS, 0, reinterpret_cast<LPARAM>(defaultCharList));
defaultCharList[defaultCharListLen] = '\0';
_defaultCharList = defaultCharList; _defaultCharList = defaultCharList;
delete[] defaultCharList; delete[] defaultCharList;
} }