aboutsummaryrefslogtreecommitdiffstats
path: root/fastlib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2016-09-27 13:04:23 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2016-09-27 13:04:23 +0000
commit643b9ac1bef191cab2d06c70c8339b4eb9583f5e (patch)
tree60b2907fa6d25df99d4049a58843fba58ef23c5d /fastlib
parent2c5b6196381b37a2a813f1592977a1b85a902093 (diff)
Leave room for PUSH_BACK
Diffstat (limited to 'fastlib')
-rw-r--r--fastlib/src/vespa/fastlib/net/httpheaderparser.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/fastlib/src/vespa/fastlib/net/httpheaderparser.cpp b/fastlib/src/vespa/fastlib/net/httpheaderparser.cpp
index 929caa39011..87268e283dc 100644
--- a/fastlib/src/vespa/fastlib/net/httpheaderparser.cpp
+++ b/fastlib/src/vespa/fastlib/net/httpheaderparser.cpp
@@ -81,8 +81,9 @@ Fast_HTTPHeaderParser::ReadHeader(const char *&name, const char *&value)
idx++;
}
- while ((idx + 1) < _bufferSize) {
- size_t readLen = _input->ReadBufferFullUntil(&_lineBuffer[idx], _bufferSize - idx, '\n');
+ constexpr size_t ROOM_FOR_PUSH_BACK = 1u;
+ while ((idx + ROOM_FOR_PUSH_BACK) < _bufferSize) {
+ size_t readLen = _input->ReadBufferFullUntil(&_lineBuffer[idx], _bufferSize - idx - ROOM_FOR_PUSH_BACK, '\n');
if (readLen <= 0) {
return false;
}