From 1c58c968ced8a3401bd6c5006eb47a92a5998c02 Mon Sep 17 00:00:00 2001 From: "Evgeny Grin (Karlson2k)" Date: Thu, 5 May 2022 15:06:16 +0300 Subject: [PATCH] Fixed wrong (inverted) asserts --- src/microhttpd/connection.c | 2 +- src/microhttpd/digestauth.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c index 0a3dc282..93408eb7 100644 --- a/src/microhttpd/connection.c +++ b/src/microhttpd/connection.c @@ -1189,7 +1189,7 @@ try_ready_chunked_body (struct MHD_Connection *connection, const size_t data_write_offset = (size_t) (connection->response_write_position - response->data_start); /* buffer already ready, use what is there for the chunk */ - mhd_assert (SSIZE_MAX < (response->data_size - data_write_offset)); + mhd_assert (SSIZE_MAX >= (response->data_size - data_write_offset)); mhd_assert (response->data_size >= data_write_offset); ret = (ssize_t) (response->data_size - data_write_offset); if ( ((size_t) ret) > size_to_fill) diff --git a/src/microhttpd/digestauth.c b/src/microhttpd/digestauth.c index cf4a9256..5232ae10 100644 --- a/src/microhttpd/digestauth.c +++ b/src/microhttpd/digestauth.c @@ -568,7 +568,7 @@ get_nonce_nc_idx (size_t arr_size, const char *nonce, size_t noncelen) { - mhd_assert (0 == arr_size); + mhd_assert (0 != arr_size); return fast_simple_hash ((const uint8_t *) nonce, noncelen) % arr_size; }