summaryrefslogtreecommitdiff
path: root/protocols/MSN
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/MSN')
-rw-r--r--protocols/MSN/src/msn_errors.cpp6
-rw-r--r--protocols/MSN/src/msn_global.h6
-rw-r--r--protocols/MSN/src/msn_threads.cpp2
3 files changed, 8 insertions, 6 deletions
diff --git a/protocols/MSN/src/msn_errors.cpp b/protocols/MSN/src/msn_errors.cpp
index 6ced78f708..8e6a3a232a 100644
--- a/protocols/MSN/src/msn_errors.cpp
+++ b/protocols/MSN/src/msn_errors.cpp
@@ -56,9 +56,9 @@ int CMsnProto::MSN_HandleErrors(ThreadData* info, char* cmdString)
case ERR_CONTACT_LIST_FAILED:
case ERR_LIST_UNAVAILABLE:
- char* tWords[3];
- if (sttDivideWords(cmdString, 3, tWords) == 3)
- HReadBuffer(info, 0).surelyRead(atol(tWords[2]));
+ char* tWords[4];
+ if (sttDivideWords(cmdString, SIZEOF(tWords), tWords) == SIZEOF(tWords))
+ HReadBuffer(info, 0).surelyRead(atol(tWords[3]));
return 0;
case ERR_NOT_ONLINE:
diff --git a/protocols/MSN/src/msn_global.h b/protocols/MSN/src/msn_global.h
index 578de7ba52..f2b4074390 100644
--- a/protocols/MSN/src/msn_global.h
+++ b/protocols/MSN/src/msn_global.h
@@ -311,9 +311,9 @@ struct HReadBuffer
BYTE* surelyRead(size_t parBytes);
ThreadData* owner;
- BYTE* buffer;
- size_t totalDataSize;
- size_t startOffset;
+ BYTE* buffer;
+ size_t totalDataSize;
+ size_t startOffset;
};
enum TInfoType
diff --git a/protocols/MSN/src/msn_threads.cpp b/protocols/MSN/src/msn_threads.cpp
index 818cd0e453..f9be399735 100644
--- a/protocols/MSN/src/msn_threads.cpp
+++ b/protocols/MSN/src/msn_threads.cpp
@@ -678,6 +678,8 @@ HReadBuffer::~HReadBuffer()
owner->mBytesInData = (int)totalDataSize;
}
else owner->mBytesInData = 0;
+
+ buffer[owner->mBytesInData] = 0;
}
BYTE* HReadBuffer::surelyRead(size_t parBytes)