Fixed NULL Pointer Dereference
A weakness has been found by using PVS-Studio analyzer. Analyzer warnings: * V595 The 'pScint' pointer was utilized before it was verified against nullptr. Check lines: 347, 353. scintillaeditview.cpp 347 * V713 The pointer _langList[i] was utilized in the logical expression before it was verified against nullptr in the same logical expression. parameters.h 1286 closes #3400
This commit is contained in:
parent
694fd80fa5
commit
6d542a4041
@ -1283,7 +1283,7 @@ public:
|
||||
{
|
||||
for (int i = 0 ; i < _nbLang ; ++i)
|
||||
{
|
||||
if ((_langList[i]->_langID == langID) || (!_langList[i]))
|
||||
if ( _langList[i] && _langList[i]->_langID == langID )
|
||||
return _langList[i];
|
||||
}
|
||||
return nullptr;
|
||||
|
@ -343,7 +343,7 @@ LRESULT CALLBACK ScintillaEditView::scintillaStatic_Proc(HWND hwnd, UINT Message
|
||||
bool isSynpnatic = std::string(synapticsHack) == "SynTrackCursorWindowClass";
|
||||
bool makeTouchPadCompetible = ((NppParameters::getInstance())->getSVP())._disableAdvancedScrolling;
|
||||
|
||||
if (isSynpnatic || makeTouchPadCompetible)
|
||||
if (pScint && (isSynpnatic || makeTouchPadCompetible))
|
||||
return (pScint->scintillaNew_Proc(hwnd, Message, wParam, lParam));
|
||||
|
||||
ScintillaEditView *pScintillaOnMouse = (ScintillaEditView *)(::GetWindowLongPtr(hwndOnMouse, GWLP_USERDATA));
|
||||
|
Loading…
Reference in New Issue
Block a user