mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-23 13:54:54 +02:00
[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
|
// 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;
|
int ScintillaEditView::_refCount = 0;
|
||||||
UserDefineDialog ScintillaEditView::_userDefineDlg;
|
UserDefineDialog ScintillaEditView::_userDefineDlg;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user