http response: check if result would fit into chunkLen
Signed-off-by: Miklos Vajna <vmiklos@collabora.com> Change-Id: I6e3b73461653d2ab3cedaa3f6ca7fbfd2a826edbpull/2821/head
parent
858aaab5a7
commit
57d3d0f391
Binary file not shown.
|
@ -553,6 +553,11 @@ int64_t Response::readData(const char* p, int64_t len)
|
|||
if (digit < 0)
|
||||
break;
|
||||
|
||||
if (chunkLen >= (std::numeric_limits<int64_t>::max() - digit) / 16)
|
||||
{
|
||||
// Would not fit into chunkLen.
|
||||
return len - available;
|
||||
}
|
||||
chunkLen = chunkLen * 16 + digit;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue