diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 5bbfbf2e1..4339e1c09 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -4497,7 +4497,7 @@ void Notepad_plus::docOpenInNewInstance(FileTransferMode mode, int x, int y) if (x) { - TCHAR pX[10]; + TCHAR pX[10]{}; _itow(x, pX, 10); command += TEXT(" -x"); command += pX; @@ -4505,7 +4505,7 @@ void Notepad_plus::docOpenInNewInstance(FileTransferMode mode, int x, int y) if (y) { - TCHAR pY[10]; + TCHAR pY[10]{}; _itow(y, pY, 10); command += TEXT(" -y"); command += pY; diff --git a/PowerEditor/src/ScintillaComponent/Buffer.cpp b/PowerEditor/src/ScintillaComponent/Buffer.cpp index 12d0d25c3..2cebb0d74 100644 --- a/PowerEditor/src/ScintillaComponent/Buffer.cpp +++ b/PowerEditor/src/ScintillaComponent/Buffer.cpp @@ -672,6 +672,9 @@ void FileManager::closeBuffer(BufferID id, ScintillaEditView * identifier) // backupFileName is sentinel of backup mode: if it's not NULL, then we use it (load it). Otherwise we use filename BufferID FileManager::loadFile(const TCHAR* filename, Document doc, int encoding, const TCHAR* backupFileName, FILETIME fileNameTimestamp) { + if (!filename) + return BUFFER_INVALID; + //Get file size int64_t fileSize = -1; const TCHAR* pPath = filename; diff --git a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.h b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.h index 538c14fd2..d16c57464 100644 --- a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.h +++ b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.h @@ -154,7 +154,7 @@ private: enum CurrentPosInLineStatus { pos_infront, pos_between, pos_inside, pos_behind }; struct CurrentPosInLineInfo { - CurrentPosInLineStatus _status; + CurrentPosInLineStatus _status = pos_infront; intptr_t auxiliaryInfo = -1; // according the status }; diff --git a/PowerEditor/src/WinControls/AnsiCharPanel/ansiCharPanel.cpp b/PowerEditor/src/WinControls/AnsiCharPanel/ansiCharPanel.cpp index 9f9de05ef..0de2d7a2f 100644 --- a/PowerEditor/src/WinControls/AnsiCharPanel/ansiCharPanel.cpp +++ b/PowerEditor/src/WinControls/AnsiCharPanel/ansiCharPanel.cpp @@ -177,7 +177,7 @@ void AnsiCharPanel::insertChar(unsigned char char2insert) const void AnsiCharPanel::insertString(LPWSTR string2insert) const { - char multiByteStr[10]; + char multiByteStr[10]{}; int codepage = (*_ppEditView)->getCurrentBuffer()->getEncoding(); if (codepage == -1) { diff --git a/PowerEditor/src/WinControls/ClipboardHistory/clipboardHistoryPanel.cpp b/PowerEditor/src/WinControls/ClipboardHistory/clipboardHistoryPanel.cpp index 4eaf6b4fc..4a3d9c62f 100644 --- a/PowerEditor/src/WinControls/ClipboardHistory/clipboardHistoryPanel.cpp +++ b/PowerEditor/src/WinControls/ClipboardHistory/clipboardHistoryPanel.cpp @@ -57,7 +57,7 @@ ClipboardData ClipboardHistoryPanel::getClipboadData() } } } - else + else if (lpWchar != nullptr) { int nbBytes = (lstrlenW(lpWchar) + 1) * sizeof(wchar_t); for (int i = 0 ; i < nbBytes ; ++i)