summaryrefslogtreecommitdiff
path: root/protocols/MSN
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-05-15 12:58:09 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-05-15 12:58:09 +0000
commit714b5dfb8f159c8d54ef42c905c3c85f4b4e7962 (patch)
tree0b165971e9bdb09c4599203193ed5481b81eba13 /protocols/MSN
parent4336962bfb77acdebcb167571a8ce9e1d6c26778 (diff)
- when data are dropped from the network buffer, the end of buffer should be '\0';
- valid ERR_LIST_UNAVAILABLE handler git-svn-id: http://svn.miranda-ng.org/main/trunk@13603 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
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)