aboutsummaryrefslogtreecommitdiff
path: root/src/base/QXmppSasl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/base/QXmppSasl.cpp')
-rw-r--r--src/base/QXmppSasl.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/base/QXmppSasl.cpp b/src/base/QXmppSasl.cpp
index d566dc5c..184732a3 100644
--- a/src/base/QXmppSasl.cpp
+++ b/src/base/QXmppSasl.cpp
@@ -876,8 +876,12 @@ QMap<QByteArray, QByteArray> QXmppSaslDigestMd5::parseMessage(const QByteArray &
const QByteArray key = ba.mid(startIndex, pos - startIndex).trimmed();
pos++;
- // check whether string is quoted
- if (ba.at(pos) == '"') {
+ if (pos == ba.size()) {
+ // end of the input
+ map.insert(key, QByteArray());
+ startIndex = pos;
+ } else if (ba.at(pos) == '"') {
+ // check whether string is quoted
// skip opening quote
pos++;
int endPos = ba.indexOf('"', pos);