diff options
Diffstat (limited to 'src/microhttpd/mhd_send.c')
-rw-r--r-- | src/microhttpd/mhd_send.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c index 3e5a4ab7..38a8a499 100644 --- a/src/microhttpd/mhd_send.c +++ b/src/microhttpd/mhd_send.c | |||
@@ -862,6 +862,9 @@ MHD_send_hdr_and_body_ (struct MHD_Connection *connection, | |||
862 | (0 == body_size) || | 862 | (0 == body_size) || |
863 | ((size_t) SSIZE_MAX <= header_size) || | 863 | ((size_t) SSIZE_MAX <= header_size) || |
864 | ((size_t) _MHD_SEND_VEC_MAX < header_size) | 864 | ((size_t) _MHD_SEND_VEC_MAX < header_size) |
865 | #ifdef _WIN32 | ||
866 | || ((size_t) UINT_MAX < header_size) | ||
867 | #endif /* _WIN32 */ | ||
865 | #else /* ! _MHD_USE_SEND_VEC */ | 868 | #else /* ! _MHD_USE_SEND_VEC */ |
866 | true | 869 | true |
867 | #endif /* ! _MHD_USE_SEND_VEC */ | 870 | #endif /* ! _MHD_USE_SEND_VEC */ |
@@ -916,7 +919,7 @@ MHD_send_hdr_and_body_ (struct MHD_Connection *connection, | |||
916 | if (((size_t) _MHD_SEND_VEC_MAX <= body_size) || | 919 | if (((size_t) _MHD_SEND_VEC_MAX <= body_size) || |
917 | ((size_t) _MHD_SEND_VEC_MAX < (header_size + body_size))) | 920 | ((size_t) _MHD_SEND_VEC_MAX < (header_size + body_size))) |
918 | { | 921 | { |
919 | /* Send value limit */ | 922 | /* Send total amount limit */ |
920 | body_size = _MHD_SEND_VEC_MAX - header_size; | 923 | body_size = _MHD_SEND_VEC_MAX - header_size; |
921 | complete_response = false; | 924 | complete_response = false; |
922 | push_body = complete_response; | 925 | push_body = complete_response; |
@@ -947,6 +950,13 @@ MHD_send_hdr_and_body_ (struct MHD_Connection *connection, | |||
947 | #endif /* HAVE_WRITEV */ | 950 | #endif /* HAVE_WRITEV */ |
948 | #endif /* HAVE_SENDMSG || HAVE_WRITEV */ | 951 | #endif /* HAVE_SENDMSG || HAVE_WRITEV */ |
949 | #ifdef _WIN32 | 952 | #ifdef _WIN32 |
953 | if ((size_t) UINT_MAX < body_size) | ||
954 | { | ||
955 | /* Send item size limit */ | ||
956 | body_size = UINT_MAX; | ||
957 | complete_response = false; | ||
958 | push_body = complete_response; | ||
959 | } | ||
950 | vector[0].buf = (char *) header; | 960 | vector[0].buf = (char *) header; |
951 | vector[0].len = (unsigned long) header_size; | 961 | vector[0].len = (unsigned long) header_size; |
952 | vector[1].buf = (char *) body; | 962 | vector[1].buf = (char *) body; |