2
0
Эх сурвалжийг харах

MHD_create_response_from_iovec(): more portable behavior

Reject responses larger than SSIZE_MAX as they could be rejected
by sendmsg()
Evgeny Grin (Karlson2k) 4 жил өмнө
parent
commit
17934e4ebf

+ 1 - 1
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;