aboutsummaryrefslogtreecommitdiffstats
path: root/fastlib
diff options
context:
space:
mode:
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;
}