diff options
author | George Hazan <ghazan@miranda.im> | 2018-07-24 21:27:51 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-07-24 21:27:51 +0300 |
commit | e6fe8b75c5f524b5dc87ef74777219b58ed63d14 (patch) | |
tree | 33ff5722216c1ec2185de126fb48f735e75cea83 /plugins | |
parent | 40f23d124ab95f9bc589e28cd97d1af761be7f56 (diff) |
fixes #1520 (crash in GmailNotifier)
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/GmailNotifier/src/options.cpp | 14 | ||||
-rw-r--r-- | plugins/GmailNotifier/src/version.h | 2 |
2 files changed, 9 insertions, 7 deletions
diff --git a/plugins/GmailNotifier/src/options.cpp b/plugins/GmailNotifier/src/options.cpp index 3d037c5b59..720bc9aa01 100644 --- a/plugins/GmailNotifier/src/options.cpp +++ b/plugins/GmailNotifier/src/options.cpp @@ -2,6 +2,9 @@ static void SaveButton(HWND hwndDlg, HWND hwndCombo, int curIndex)
{
+ if (curIndex < 0 || curIndex >= g_accs.getCount())
+ return;
+
Account &acc = g_accs[curIndex];
if (GetDlgItemTextA(hwndDlg, IDC_NAME, acc.name, _countof(acc.name))) {
char *tail = strstr(acc.name, "@");
@@ -12,7 +15,7 @@ static void SaveButton(HWND hwndDlg, HWND hwndCombo, int curIndex) SendMessageA(hwndCombo, CB_SETCURSEL, curIndex, 0);
db_set_s(acc.hContact, MODULENAME, "name", acc.name);
db_set_s(acc.hContact, MODULENAME, "Nick", acc.name);
-
+
GetDlgItemTextA(hwndDlg, IDC_PASS, acc.pass, _countof(acc.pass));
db_set_s(acc.hContact, MODULENAME, "Password", acc.pass);
}
@@ -128,11 +131,10 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA break;
case IDC_PRGBROWSE:
+ wchar_t szName[_MAX_PATH];
+ GetDlgItemText(hwndDlg, IDC_PRG, szName, _countof(szName));
{
- OPENFILENAME OpenFileName;
- wchar_t szName[_MAX_PATH];
- memset(&OpenFileName, 0, sizeof(OPENFILENAME));
- GetDlgItemText(hwndDlg, IDC_PRG, szName, _countof(szName));
+ OPENFILENAME OpenFileName = {};
OpenFileName.lStructSize = sizeof(OPENFILENAME);
OpenFileName.hwndOwner = hwndDlg;
OpenFileName.lpstrFilter = L"Executables (*.exe;*.com;*.bat)\0*.exe;*.com;*.bat\0\0";
@@ -145,7 +147,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA }
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
-
+
case IDC_BTNADD:
{
Account *p = new Account();
diff --git a/plugins/GmailNotifier/src/version.h b/plugins/GmailNotifier/src/version.h index e75e38a1e6..7310c89c5f 100644 --- a/plugins/GmailNotifier/src/version.h +++ b/plugins/GmailNotifier/src/version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 1
#define __MINOR_VERSION 0
#define __RELEASE_NUM 1
-#define __BUILD_NUM 1
+#define __BUILD_NUM 2
#include <stdver.h>
|