commit 17934e4ebf550d3df5abe785bbdee34fd0c4b61b
parent 61858b1e1af6a9c73e778c3f5765d5819ad6c924
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date: Sun, 18 Apr 2021 14:18:01 +0300
MHD_create_response_from_iovec(): more portable behavior
Reject responses larger than SSIZE_MAX as they could be rejected
by sendmsg()
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/microhttpd/response.c b/src/microhttpd/response.c
@@ -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;