Fix crashes in FCGI_PARAMS parsing

This commit is contained in:
flamingcow
2019-05-04 19:42:37 -07:00
parent bea5b76b7c
commit 2faf75e8e4
55 changed files with 24 additions and 4 deletions

View File

@@ -9,7 +9,9 @@ size_t ConstBuffer::ReadMaxLen() const {
}
const char *ConstBuffer::Read(size_t len) {
CHECK_LE(len, ReadMaxLen());
if (ReadMaxLen() < len) {
return nullptr;
}
const auto *ret = &const_buf_[start_];
start_ += len;
return ret;