summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorPiotr Piastucki <leech.miranda@gmail.com>2015-11-11 10:48:53 +0000
committerPiotr Piastucki <leech.miranda@gmail.com>2015-11-11 10:48:53 +0000
commit88c8a10294620690a63de46d1314fb549f99e3a7 (patch)
tree28299fb28c4689f9464f03ac2f797af6c8357b78 /protocols
parent35b380499c87c521c4c9977c7c55bf169c6d3dfa (diff)
Bugfix for #1087
git-svn-id: http://svn.miranda-ng.org/main/trunk@15708 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r--protocols/MSN/src/msn_commands.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/protocols/MSN/src/msn_commands.cpp b/protocols/MSN/src/msn_commands.cpp
index 275ed84328..f6e7e74084 100644
--- a/protocols/MSN/src/msn_commands.cpp
+++ b/protocols/MSN/src/msn_commands.cpp
@@ -952,7 +952,9 @@ LBL_InvalidCommand:
MimeHeaders tHeader;
HReadBuffer buf(info, 0);
- char* msgBody = tHeader.readFromBuffer((char*)buf.surelyRead(atol(data.strMsgBytes)));
+ BYTE *msgb = buf.surelyRead(atol(data.strMsgBytes));
+ if (!msgb) break;
+ char* msgBody = tHeader.readFromBuffer((char*)msgb);
replaceStr(msnRegistration,tHeader["Set-Registration"]);
if (!mir_strcmp(data.typeId, "CON")) {
@@ -995,6 +997,7 @@ LBL_InvalidCommand:
} else {
/* Skype username/pass login */
+ if (!msgBody) break;
ezxml_t xmlcnt = ezxml_parse_str(msgBody, mir_strlen(msgBody));
ezxml_t xmlnonce = ezxml_child(xmlcnt, "nonce");
if (xmlnonce) {
@@ -1028,7 +1031,9 @@ LBL_InvalidCommand:
MimeHeaders tHeader;
HReadBuffer buf(info, 0);
- char* msgBody = tHeader.readFromBuffer((char*)buf.surelyRead(atol(data.strMsgBytes)));
+ BYTE *msgb = buf.surelyRead(atol(data.strMsgBytes));
+ if (!msgb) break;
+ char* msgBody = tHeader.readFromBuffer((char*)msgb);
ezxml_t xmli;
if (tHeader["Set-Registration"]) replaceStr(msnRegistration,tHeader["Set-Registration"]);
@@ -1263,7 +1268,9 @@ LBL_InvalidCommand:
MimeHeaders tHeader;
HReadBuffer buf(info, 0);
- char* msgBody = tHeader.readFromBuffer((char*)buf.surelyRead(atol(data.strMsgBytes)));
+ BYTE *msgb = buf.surelyRead(atol(data.strMsgBytes));
+ if (!msgb) break;
+ char* msgBody = tHeader.readFromBuffer((char*)msgb);
if (tHeader["Set-Registration"]) replaceStr(msnRegistration,tHeader["Set-Registration"]);
if (cmdString[1]=='N') { // PNG
@@ -1314,7 +1321,9 @@ LBL_InvalidCommand:
MimeHeaders tHeader;
HReadBuffer buf(info, 0);
- char* msgBody = tHeader.readFromBuffer((char*)buf.surelyRead(atol(data.strMsgBytes)));
+ BYTE *msgb = buf.surelyRead(atol(data.strMsgBytes));
+ if (!msgb) break;
+ char* msgBody = tHeader.readFromBuffer((char*)msgb);
if (!mir_strcmp(data.typeId, "CON")) {
ezxml_t xmlxfr = ezxml_parse_str(msgBody, mir_strlen(msgBody));
ezxml_t xmltgt = ezxml_child(xmlxfr, "target");