From: Joe Orton Date: Thu, 13 Aug 2026 15:16:01 +0000 (+0000) Subject: * modules/aaa/mod_auth_digest.c (client_generate): Skip a client id X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=5216183dd3cdf8a9f1324b8e7e51788fa29849fa;p=thirdparty%2Fapache%2Fhttpd.git * modules/aaa/mod_auth_digest.c (client_generate): Skip a client id of zero, which the counter hands out once it wraps: zero means "no client", so add_client() refuses it. Assisted-by: Claude Opus 5 (1M context) GitHub: PR #705 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1937109 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/aaa/mod_auth_digest.c b/modules/aaa/mod_auth_digest.c index a85a8c9731..50cd0961d5 100644 --- a/modules/aaa/mod_auth_digest.c +++ b/modules/aaa/mod_auth_digest.c @@ -1149,6 +1149,12 @@ static client_id_t client_generate(const request_rec *r) client_id_t op = apr_atomic_inc32(client_id_counter); client_entry new_entry = { 0, NULL, 0, 0 }; + /* The counter wraps after 2^32 clients: skip an id of zero, which means + * "no client" and which add_client() would refuse. */ + if (op == 0) { + op = apr_atomic_inc32(client_id_counter); + } + if (!add_client(op, &new_entry, r->server)) { ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01769) "unable to allocate a client entry - failing the "