diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2022-05-16 15:12:08 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2022-05-16 19:46:29 +0300 |
commit | 393c5a451cab99ef5fdb9487434e4ecfb7864b1f (patch) | |
tree | a6a8819f4de9622afa2754399266f3a1922d432a /src/microhttpd/digestauth.c | |
parent | 6c3d5864dfbf5a9c07ad500d2217c67268ecddc8 (diff) | |
download | libmicrohttpd-393c5a451cab99ef5fdb9487434e4ecfb7864b1f.tar.gz libmicrohttpd-393c5a451cab99ef5fdb9487434e4ecfb7864b1f.zip |
digestauth: simplified overflow check
Diffstat (limited to 'src/microhttpd/digestauth.c')
-rw-r--r-- | src/microhttpd/digestauth.c | 2 |
1 files changed, 1 insertions, 1 deletions
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, | |||
671 | mod = daemon->nonce_nc_size; | 671 | mod = daemon->nonce_nc_size; |
672 | if (0 == mod) | 672 | if (0 == mod) |
673 | return MHD_DAUTH_NONCENC_STALE; /* no array! */ | 673 | return MHD_DAUTH_NONCENC_STALE; /* no array! */ |
674 | if (nc + 64 < nc) | 674 | if (nc >= UINT64_MAX - 64) |
675 | return MHD_DAUTH_NONCENC_STALE; /* Overflow, unrealistically high value */ | 675 | return MHD_DAUTH_NONCENC_STALE; /* Overflow, unrealistically high value */ |
676 | 676 | ||
677 | nn = &daemon->nnc[get_nonce_nc_idx (mod, nonce, noncelen)]; | 677 | nn = &daemon->nnc[get_nonce_nc_idx (mod, nonce, noncelen)]; |