summaryrefslogtreecommitdiffstats
path: root/src/HTTP
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2016-08-24 09:32:27 +0200
committerGitHub <noreply@github.com>2016-08-24 09:32:27 +0200
commit6c57cc389cbbd43d40e160db311dc685557c95f7 (patch)
tree53c5a6a97c2a2ce8ec5c4984edbc855d396cd3b6 /src/HTTP
parentMerge pull request #3310 from cuberite/UrlClient (diff)
parentHTTP: Fixed empty headers parsing. (diff)
downloadcuberite-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.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[]