From 393c5a451cab99ef5fdb9487434e4ecfb7864b1f Mon Sep 17 00:00:00 2001 From: "Evgeny Grin (Karlson2k)" Date: Mon, 16 May 2022 15:12:08 +0300 Subject: [PATCH] digestauth: simplified overflow check --- src/microhttpd/digestauth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/microhttpd/digestauth.c b/src/microhttpd/digestauth.c index 26f972b8..cda8b478 100644 --- a/src/microhttpd/digestauth.c +++ b/src/microhttpd/digestauth.c @@ -671,7 +671,7 @@ check_nonce_nc (struct MHD_Connection *connection, mod = daemon->nonce_nc_size; if (0 == mod) return MHD_DAUTH_NONCENC_STALE; /* no array! */ - if (nc + 64 < nc) + if (nc >= UINT64_MAX - 64) return MHD_DAUTH_NONCENC_STALE; /* Overflow, unrealistically high value */ nn = &daemon->nnc[get_nonce_nc_idx (mod, nonce, noncelen)];