From 3653d41931eec57f6bbcd6f50fb8e495ee01c3da Mon Sep 17 00:00:00 2001 From: Heiko Hund Date: Thu, 21 Jul 2011 17:59:08 +0200 Subject: [PATCH] fix write out of array bounds --- openvpn.c | 4 ++-- proxy.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/openvpn.c b/openvpn.c index 29d82d9..4df60fa 100644 --- a/openvpn.c +++ b/openvpn.c @@ -240,7 +240,7 @@ UserAuthDialogFunc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) /* Clear buffers */ memset(buf, 'x', sizeof(buf)); - buf[sizeof(buf) - 1] = _T('\0'); + buf[_tsizeof(buf) - 1] = _T('\0'); SetDlgItemText(hwndDlg, ID_EDT_AUTH_USER, buf); SetDlgItemText(hwndDlg, ID_EDT_AUTH_PASS, buf); @@ -297,7 +297,7 @@ PrivKeyPassDialogFunc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) /* Clear buffer */ memset(buf, 'x', sizeof(buf)); - buf[sizeof(buf) - 1] = _T('\0'); + buf[_tsizeof(buf) - 1] = _T('\0'); SetDlgItemText(hwndDlg, ID_EDT_PASSPHRASE, buf); EndDialog(hwndDlg, LOWORD(wParam)); diff --git a/proxy.c b/proxy.c index ce2a57e..8004bca 100644 --- a/proxy.c +++ b/proxy.c @@ -357,7 +357,7 @@ ProxyAuthDialogFunc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) /* Clear buffers */ memset(buf, 'x', sizeof(buf)); - buf[sizeof(buf) - 1] = _T('\0'); + buf[_tsizeof(buf) - 1] = _T('\0'); SetDlgItemText(hwndDlg, ID_EDT_PROXY_USER, buf); SetDlgItemText(hwndDlg, ID_EDT_PROXY_PASS, buf);