gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] 01/02: mhd_send.c: avoid double checking of parameter


From: gnunet
Subject: [libmicrohttpd] 01/02: mhd_send.c: avoid double checking of parameter
Date: Fri, 04 Dec 2020 09:56:12 +0100

This is an automated email from the git hooks/post-receive script.

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

commit 23b704ee3dcbc6d05eb5230e590207d08ab7c49a
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Fri Dec 4 11:40:47 2020 +0300

    mhd_send.c: avoid double checking of parameter
    
    For TLS transmissions buffer_size was checked two times for overflow.
---
 src/microhttpd/mhd_send.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c
index 891c70b7..db88a5d5 100644
--- 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,

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]