summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/HTTP/EnvelopeParser.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/HTTP/EnvelopeParser.cpp b/src/HTTP/EnvelopeParser.cpp
index 1c49b643f..15ab95380 100644
--- a/src/HTTP/EnvelopeParser.cpp
+++ b/src/HTTP/EnvelopeParser.cpp
@@ -118,7 +118,14 @@ bool cEnvelopeParser::ParseLine(const char * a_Data, size_t a_Size)
if (a_Data[i] == ':')
{
m_LastKey.assign(a_Data, i);
- m_LastValue.assign(a_Data + i + 2, a_Size - i - 2);
+ if (a_Size > i + 1)
+ {
+ m_LastValue.assign(a_Data + i + 2, a_Size - i - 2);
+ }
+ else
+ {
+ m_LastValue.clear();
+ }
return true;
}
} // for i - a_Data[]