svn commit: r1937109 - httpd/httpd/trunk/modules/aaa
| Newsgroups | gmane.comp.apache.cvs |
|---|---|
| Message-ID | <178663416142.1595895.13124091834099957362@svn03-he-fi> |
Author: jorton Date: Thu Aug 13 15:16:01 2026 New Revision: 1937109 Log: * 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) <[email protected]> GitHub: PR #705 Modified: httpd/httpd/trunk/modules/aaa/mod_auth_digest.c Modified: httpd/httpd/trunk/modules/aaa/mod_auth_digest.c ============================================================================== --- httpd/httpd/trunk/modules/aaa/mod_auth_digest.c Thu Aug 13 15:15:56 2026 (r1937108) +++ httpd/httpd/trunk/modules/aaa/mod_auth_digest.c Thu Aug 13 15:16:01 2026 (r1937109) @@ -1149,6 +1149,12 @@ static client_id_t client_generate(const 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 "