diff options
author | Mattes D <github@xoft.cz> | 2016-08-24 09:32:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-24 09:32:27 +0200 |
commit | 6c57cc389cbbd43d40e160db311dc685557c95f7 (patch) | |
tree | 53c5a6a97c2a2ce8ec5c4984edbc855d396cd3b6 /src/HTTP/EnvelopeParser.cpp | |
parent | Merge pull request #3310 from cuberite/UrlClient (diff) | |
parent | HTTP: Fixed empty headers parsing. (diff) | |
download | cuberite-6c57cc389cbbd43d40e160db311dc685557c95f7.tar cuberite-6c57cc389cbbd43d40e160db311dc685557c95f7.tar.gz cuberite-6c57cc389cbbd43d40e160db311dc685557c95f7.tar.bz2 cuberite-6c57cc389cbbd43d40e160db311dc685557c95f7.tar.lz cuberite-6c57cc389cbbd43d40e160db311dc685557c95f7.tar.xz cuberite-6c57cc389cbbd43d40e160db311dc685557c95f7.tar.zst cuberite-6c57cc389cbbd43d40e160db311dc685557c95f7.zip |
Diffstat (limited to '')
-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[] |