0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-11 06:28:55 +02:00

ircd::server: Check for empty buffer and bail before recv()'ing on it.

This commit is contained in:
Jason Volk 2020-09-16 01:35:51 -07:00
parent 335a045d41
commit f8841a7f60

View file

@ -2468,6 +2468,13 @@ try
buffer + copied
};
if(unlikely(empty(remaining)))
throw buffer_overrun
{
"Buffer of %zu bytes is insufficient to receive the HTTP request.",
size(buffer),
};
const const_buffer view
{
read(remaining)