diff options
author | George Hazan <ghazan@miranda.im> | 2017-12-20 18:58:58 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-12-20 18:58:58 +0300 |
commit | e141cd74d676f6e349941ca588711f741000f0fb (patch) | |
tree | f80672c04218b099bcc9a93619a6f8748dc3b370 /src | |
parent | 9f58bc3c53f10ae8e19af629a515407812e7c7e4 (diff) |
fix for occasional crash during auth request
Diffstat (limited to 'src')
-rw-r--r-- | src/mir_app/src/authdialogs.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mir_app/src/authdialogs.cpp b/src/mir_app/src/authdialogs.cpp index 4f9bcefe43..14b9fccdf8 100644 --- a/src/mir_app/src/authdialogs.cpp +++ b/src/mir_app/src/authdialogs.cpp @@ -160,9 +160,13 @@ INT_PTR CALLBACK DlgProcAuthReq(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP hDbEvent = lParam; SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam); + int iBlobSize = db_event_getBlobSize(hDbEvent); + if (iBlobSize == -1) + return FALSE; + // blob is: uin(DWORD), hcontact(DWORD), nick(ASCIIZ), first(ASCIIZ), last(ASCIIZ), email(ASCIIZ), reason(ASCIIZ) DBEVENTINFO dbei = {}; - dbei.cbBlob = db_event_getBlobSize(hDbEvent); + dbei.cbBlob = iBlobSize; dbei.pBlob = (PBYTE)alloca(dbei.cbBlob); db_event_get(hDbEvent, &dbei); |