[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 01/02: Updated doxy; explicitly tolerated NULL in MHD_qu
From: |
gnunet |
Subject: |
[libmicrohttpd] 01/02: Updated doxy; explicitly tolerated NULL in MHD_queue*_auth*() |
Date: |
Thu, 27 Jan 2022 18:31:42 +0100 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit 63b63330fbe75873dce0e4e820da75de295ffd51
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Thu Jan 27 20:31:05 2022 +0300
Updated doxy; explicitly tolerated NULL in MHD_queue*_auth*()
---
src/include/microhttpd.h | 10 +++++-----
src/microhttpd/basicauth.c | 7 +++++--
src/microhttpd/connection.c | 4 ++--
src/microhttpd/digestauth.c | 7 ++++++-
4 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h
index 23ce06c7..42409403 100644
--- a/src/include/microhttpd.h
+++ b/src/include/microhttpd.h
@@ -3226,8 +3226,8 @@ MHD_lookup_connection_value_n (struct MHD_Connection
*connection,
*
* @param connection the connection identifying the client
* @param status_code HTTP status code (i.e. #MHD_HTTP_OK)
- * @param response response to transmit
- * @return #MHD_NO on error (i.e. reply already sent),
+ * @param response response to transmit, the NULL is tolerated
+ * @return #MHD_NO on error (reply already sent, response is NULL),
* #MHD_YES on success or if message has been queued
* @ingroup response
* @sa #MHD_AccessHandlerCallback
@@ -4226,7 +4226,7 @@ MHD_digest_auth_check_digest (struct MHD_Connection
*connection,
* @param opaque string to user for opaque value
* @param response reply to send; should contain the "access denied"
* body; note that this function will set the "WWW Authenticate"
- * header and that the caller should not do this
+ * header and that the caller should not do this; the NULL is tolerated
* @param signal_stale #MHD_YES if the nonce is invalid to add
* 'stale=true' to the authentication header
* @param algo digest algorithm to use
@@ -4253,7 +4253,7 @@ MHD_queue_auth_fail_response2 (struct MHD_Connection
*connection,
* @param opaque string to user for opaque value
* @param response reply to send; should contain the "access denied"
* body; note that this function will set the "WWW Authenticate"
- * header and that the caller should not do this
+ * header and that the caller should not do this; the NULL is tolerated
* @param signal_stale #MHD_YES if the nonce is invalid to add
* 'stale=true' to the authentication header
* @return #MHD_YES on success, #MHD_NO otherwise
@@ -4290,7 +4290,7 @@ MHD_basic_auth_get_username_password (struct
MHD_Connection *connection,
*
* @param connection The MHD connection structure
* @param realm the realm presented to the client
- * @param response response object to modify and queue
+ * @param response response object to modify and queue; the NULL is tolerated
* @return #MHD_YES on success, #MHD_NO otherwise
* @ingroup authentication
*/
diff --git a/src/microhttpd/basicauth.c b/src/microhttpd/basicauth.c
index d39019f5..a20a43d3 100644
--- a/src/microhttpd/basicauth.c
+++ b/src/microhttpd/basicauth.c
@@ -109,14 +109,14 @@ MHD_basic_auth_get_username_password (struct
MHD_Connection *connection,
/**
- * Queues a response to request basic authentication from the client.
+ * Queues a response to request basic authentication from the client
* The given response object is expected to include the payload for
* the response; the "WWW-Authenticate" header will be added and the
* response queued with the 'UNAUTHORIZED' status code.
*
* @param connection The MHD connection structure
* @param realm the realm presented to the client
- * @param response response object to modify and queue
+ * @param response response object to modify and queue; the NULL is tolerated
* @return #MHD_YES on success, #MHD_NO otherwise
* @ingroup authentication
*/
@@ -130,6 +130,9 @@ MHD_queue_basic_auth_fail_response (struct MHD_Connection
*connection,
size_t hlen = strlen (realm) + strlen ("Basic realm=\"\"") + 1;
char *header;
+ if (NULL == response)
+ return MHD_NO;
+
header = (char *) malloc (hlen);
if (NULL == header)
{
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 21c4d338..f6a871c0 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -5084,8 +5084,8 @@ MHD_set_connection_option (struct MHD_Connection
*connection,
*
* @param connection the connection identifying the client
* @param status_code HTTP status code (i.e. #MHD_HTTP_OK)
- * @param response response to transmit
- * @return #MHD_NO on error (i.e. reply already sent),
+ * @param response response to transmit, the NULL is tolerated
+ * @return #MHD_NO on error (reply already sent, response is NULL),
* #MHD_YES on success or if message has been queued
* @ingroup response
* @sa #MHD_AccessHandlerCallback
diff --git a/src/microhttpd/digestauth.c b/src/microhttpd/digestauth.c
index a1b7bcf4..e0a26b30 100644
--- a/src/microhttpd/digestauth.c
+++ b/src/microhttpd/digestauth.c
@@ -1326,11 +1326,12 @@ MHD_digest_auth_check_digest (struct MHD_Connection
*connection,
* @param opaque string to user for opaque value
* @param response reply to send; should contain the "access denied"
* body; note that this function will set the "WWW Authenticate"
- * header and that the caller should not do this
+ * header and that the caller should not do this; the NULL is tolerated
* @param signal_stale #MHD_YES if the nonce is invalid to add
* 'stale=true' to the authentication header
* @param algo digest algorithm to use
* @return #MHD_YES on success, #MHD_NO otherwise
+ * @note Available since #MHD_VERSION 0x00096200
* @ingroup authentication
*/
enum MHD_Result
@@ -1345,6 +1346,10 @@ MHD_queue_auth_fail_response2 (struct MHD_Connection
*connection,
int hlen;
SETUP_DA (algo, da);
+ if (NULL == response)
+ return MHD_NO;
+
+ if (1)
{
char nonce[NONCE_STD_LEN (VLA_ARRAY_LEN_DIGEST (da.digest_size)) + 1];
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.