MHD_create_response_from_iovec(): more portable behavior

Reject responses larger than SSIZE_MAX as they could be rejected
by sendmsg()
This commit is contained in:
Evgeny Grin (Karlson2k) committed 2021-04-18 14:18:01 +03:00
1 parent 61858b1e1a
commit 17934e4ebf
1 file changed
+1 -1
+1 -1
View File
@@ -895,7 +895,7 @@ MHD_create_response_from_iovec (const struct MHD_IoVec *iov,
}
if ( (total_size > (total_size + iov[i].iov_len)) ||
(INT_MAX == i_cp) ||
(SSIZE_MAX < iov[i].iov_len) )
(SSIZE_MAX < (total_size + iov[i].iov_len)) )
{
i_cp = -1; /* overflow */
break;