diff options
author | Mattes D <github@xoft.cz> | 2016-08-24 08:28:44 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2016-08-24 08:28:44 +0200 |
commit | c45bd4b968392eeeed3954d6b91dec7ae5833a0d (patch) | |
tree | 53c5a6a97c2a2ce8ec5c4984edbc855d396cd3b6 /src/HTTP | |
parent | Merge pull request #3310 from cuberite/UrlClient (diff) | |
download | cuberite-c45bd4b968392eeeed3954d6b91dec7ae5833a0d.tar cuberite-c45bd4b968392eeeed3954d6b91dec7ae5833a0d.tar.gz cuberite-c45bd4b968392eeeed3954d6b91dec7ae5833a0d.tar.bz2 cuberite-c45bd4b968392eeeed3954d6b91dec7ae5833a0d.tar.lz cuberite-c45bd4b968392eeeed3954d6b91dec7ae5833a0d.tar.xz cuberite-c45bd4b968392eeeed3954d6b91dec7ae5833a0d.tar.zst cuberite-c45bd4b968392eeeed3954d6b91dec7ae5833a0d.zip |
Diffstat (limited to 'src/HTTP')
-rw-r--r-- | src/HTTP/EnvelopeParser.cpp | 9 |
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[] |