[BUG_FIXED] Fix a vulnerability: get full ScinLexer.dll path to avoid hijack.
git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@657 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
parent
f602782337
commit
3fa8a89e76
@ -22,7 +22,17 @@
|
||||
|
||||
|
||||
// initialize the static variable
|
||||
HINSTANCE ScintillaEditView::_hLib = ::LoadLibrary(TEXT("SciLexer.DLL"));
|
||||
|
||||
// get full ScinLexer.dll path to avoid hijack
|
||||
TCHAR * getSciLexerFullPathName(TCHAR * moduleFileName, size_t len){
|
||||
::GetModuleFileName(NULL, moduleFileName, len);
|
||||
::PathRemoveFileSpec(moduleFileName);
|
||||
::PathAppend(moduleFileName, TEXT("SciLexer.dll"));
|
||||
return moduleFileName;
|
||||
};
|
||||
|
||||
TCHAR moduleFileName[1024];
|
||||
HINSTANCE ScintillaEditView::_hLib = ::LoadLibrary(getSciLexerFullPathName(moduleFileName, 1024));
|
||||
int ScintillaEditView::_refCount = 0;
|
||||
UserDefineDialog ScintillaEditView::_userDefineDlg;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user