diff options
author | Jeffrey Altman <jaltman@secure-endpoints.com> | 2007-06-22 18:58:09 +0000 |
---|---|---|
committer | Jeffrey Altman <jaltman@secure-endpoints.com> | 2007-06-22 18:58:09 +0000 |
commit | b3ce9032f0a19eaab43c3bbccb3bfc63635292ae (patch) | |
tree | 6b3b5aaabe7cf264e11a1d46312b6d3b56053546 /src/windows/identity/plugins/krb4 | |
parent | 2edfc72bab12e4f7c745184e7795b60f7b567527 (diff) | |
download | krb5-b3ce9032f0a19eaab43c3bbccb3bfc63635292ae.tar.gz krb5-b3ce9032f0a19eaab43c3bbccb3bfc63635292ae.tar.xz krb5-b3ce9032f0a19eaab43c3bbccb3bfc63635292ae.zip |
Don't assume that WM_DESTROY is the last message to be received by a
window. Since the child windows are still alive and kicking by the
time the parent receives WM_DESTROY, it's still possible to receive
other messages after WM_DESTROY.
If we free any window specific data when handling WM_DESTROY, we
should reset the window data field as well, and check if we have a
valid pointer when retrieving the window data field later.
ticket: 5584
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19627 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/windows/identity/plugins/krb4')
-rw-r--r-- | src/windows/identity/plugins/krb4/krb4configdlg.c | 22 | ||||
-rw-r--r-- | src/windows/identity/plugins/krb4/krb4newcreds.c | 11 |
2 files changed, 30 insertions, 3 deletions
diff --git a/src/windows/identity/plugins/krb4/krb4configdlg.c b/src/windows/identity/plugins/krb4/krb4configdlg.c index 338cf7fa88..309bf542b0 100644 --- a/src/windows/identity/plugins/krb4/krb4configdlg.c +++ b/src/windows/identity/plugins/krb4/krb4configdlg.c @@ -113,6 +113,9 @@ krb4_ids_config_proc(HWND hwnd, d = (k4_ids_data *) (LONG_PTR) GetWindowLongPtr(hwnd, DWLP_USER); + if (d == NULL) + break; + if (HIWORD(wParam) == BN_CLICKED) { k4_ids_check_mod(hwnd, d); } @@ -122,6 +125,9 @@ krb4_ids_config_proc(HWND hwnd, d = (k4_ids_data *) (LONG_PTR) GetWindowLongPtr(hwnd, DWLP_USER); + if (d == NULL) + break; + if (HIWORD(wParam) == WMCFG_APPLY) { k4_ids_write_params(hwnd, d); } @@ -131,7 +137,11 @@ krb4_ids_config_proc(HWND hwnd, d = (k4_ids_data *) (LONG_PTR) GetWindowLongPtr(hwnd, DWLP_USER); - PFREE(d); + if (d) { + PFREE(d); + SetWindowLongPtr(hwnd, DWLP_USER, (LONG_PTR) 0); + } + break; } @@ -297,6 +307,9 @@ krb4_id_config_proc(HWND hwnd, d = (k4_id_data *) (LONG_PTR) GetWindowLongPtr(hwnd, DWLP_USER); + if (d == NULL) + break; + if (wParam == MAKEWPARAM(IDC_CFG_GETTIX, BN_CLICKED)) { int gettix = 0; @@ -321,7 +334,7 @@ krb4_id_config_proc(HWND hwnd, d = (k4_id_data *) (LONG_PTR) GetWindowLongPtr(hwnd, DWLP_USER); - if (!d) + if (d == NULL) break; if (HIWORD(wParam) == WMCFG_APPLY) { @@ -343,10 +356,12 @@ krb4_id_config_proc(HWND hwnd, d = (k4_id_data *) (LONG_PTR) GetWindowLongPtr(hwnd, DWLP_USER); - if (!d) + if (d == NULL) break; PFREE(d); + + SetWindowLongPtr(hwnd, DWLP_USER, 0); } break; } @@ -531,6 +546,7 @@ krb4_confg_proc(HWND hwnd, if (d) { PFREE(d); + SetWindowLongPtr(hwnd, DWLP_USER, (LONG_PTR) 0); } break; diff --git a/src/windows/identity/plugins/krb4/krb4newcreds.c b/src/windows/identity/plugins/krb4/krb4newcreds.c index c2d477e0ee..9c200b618d 100644 --- a/src/windows/identity/plugins/krb4/krb4newcreds.c +++ b/src/windows/identity/plugins/krb4/krb4newcreds.c @@ -389,6 +389,9 @@ INT_PTR CALLBACK k4_nc_dlg_proc(HWND hwnd, d = (k4_dlg_data *) (LONG_PTR) GetWindowLongPtr(hwnd, DWLP_USER); + if (d == NULL) + break; + k4_update_data(d); if (LOWORD(wParam) == IDC_NCK4_OBTAIN) { @@ -404,6 +407,10 @@ INT_PTR CALLBACK k4_nc_dlg_proc(HWND hwnd, { d = (k4_dlg_data *) (LONG_PTR) GetWindowLongPtr(hwnd, DWLP_USER); + + if (d == NULL) + break; + k4_handle_wmnc_notify(d, wParam, lParam); } break; @@ -413,9 +420,13 @@ INT_PTR CALLBACK k4_nc_dlg_proc(HWND hwnd, d = (k4_dlg_data *) (LONG_PTR) GetWindowLongPtr(hwnd, DWLP_USER); + if (d == NULL) + break; + d->nct->aux = 0; PFREE(d); + SetWindowLongPtr(hwnd, DWLP_USER, 0); } break; } |