commit 23b704ee3dcbc6d05eb5230e590207d08ab7c49a
parent 47ec146ce3d848bc91e5cbb6e5509584025f9763
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date: Fri, 4 Dec 2020 11:40:47 +0300
mhd_send.c: avoid double checking of parameter
For TLS transmissions buffer_size was checked two times for overflow.
Diffstat:
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c
@@ -331,10 +331,6 @@ MHD_send_on_connection_ (struct MHD_Connection *connection,
return MHD_ERR_NOTCONN_;
}
- /* from send_param_adapter() */
- if (buffer_size > MHD_SCKT_SEND_MAX_SIZE_)
- buffer_size = MHD_SCKT_SEND_MAX_SIZE_; /* return value limit */
-
/* Get socket options, change/set options if necessary. */
switch (options)
{
@@ -387,6 +383,9 @@ MHD_send_on_connection_ (struct MHD_Connection *connection,
else
{
/* plaintext transmission */
+ if (buffer_size > MHD_SCKT_SEND_MAX_SIZE_)
+ buffer_size = MHD_SCKT_SEND_MAX_SIZE_; /* return value limit */
+
#ifdef MHD_USE_MSG_MORE
ret = send (s,
buffer,