diff options
author | Rozhuk Ivan <rozhuk.im@gmail.com> | 2014-11-25 11:31:16 +0000 |
---|---|---|
committer | Rozhuk Ivan <rozhuk.im@gmail.com> | 2014-11-25 11:31:16 +0000 |
commit | fe869e77674f8e18ea984e2cc3a663fab80c1055 (patch) | |
tree | 396296fa59fe2ae44904286fa94c131b86833b55 /protocols/MRA | |
parent | cba2ad851f1b6cd106c2fdb9f805fcd46c9fa57d (diff) |
Add nullptr checks for offline messages parser.
git-svn-id: http://svn.miranda-ng.org/main/trunk@11052 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/MRA')
-rw-r--r-- | protocols/MRA/src/MraOfflineMsg.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/protocols/MRA/src/MraOfflineMsg.cpp b/protocols/MRA/src/MraOfflineMsg.cpp index 72095a872f..67bff4d22a 100644 --- a/protocols/MRA/src/MraOfflineMsg.cpp +++ b/protocols/MRA/src/MraOfflineMsg.cpp @@ -164,7 +164,7 @@ static DWORD PlainText2message(const CMStringA &szContentType, const CMStringA & DWORD MraOfflineMessageGet(CMStringA *plpsMsg, DWORD *pdwTime, DWORD *pdwFlags, CMStringA *plpsEMail, CMStringA *plpsText, CMStringA *plpsRTFText, CMStringA *plpsMultiChatData)
{
- if (plpsMsg == NULL || plpsMsg->IsEmpty())
+ if (plpsMsg == NULL || plpsMsg->IsEmpty() || plpsText == NULL)
return ERROR_INVALID_HANDLE;
LPSTR lpszHeader, lpszBody, lpszContentTypeLow;
@@ -175,8 +175,9 @@ DWORD MraOfflineMessageGet(CMStringA *plpsMsg, DWORD *pdwTime, DWORD *pdwFlags, return ERROR_INVALID_HANDLE;
ptrA lpszHeaderLow((LPSTR)mir_calloc(dwHeaderSize));
- if (lpszHeaderLow)
- BuffToLowerCase(lpszHeaderLow, lpszHeader, dwHeaderSize);
+ if (lpszHeaderLow == NULL)
+ return ERROR_OUTOFMEMORY;
+ BuffToLowerCase(lpszHeaderLow, lpszHeader, dwHeaderSize);
if (pdwTime)
if (MraOfflineMessageGetHeaderValue(lpszHeader, lpszHeaderLow, dwHeaderSize, "date", 4, szTemp) == NO_ERROR) {
|