]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mod_md: change types of fields of ocsp_summary_ctx_t
authorJoe Orton <jorton@apache.org>
Thu, 18 Dec 2025 12:50:42 +0000 (12:50 +0000)
committerJoe Orton <jorton@apache.org>
Thu, 18 Dec 2025 12:50:42 +0000 (12:50 +0000)
The number of members in ostat_by_id may be up to UINT_MAX
and there are no guarantees that all types of members (good,
revoked or unknown) are present. An integer overflow may also
occur in md_ocsp_get_summary() when they are summed as ints.

Change types of good, revoked and unknown to unsigned.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Submitted by: Anastasia Belova <nabelova31 gmail.com>
Github: closes #534

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1930710 13f79535-47bb-0310-9956-ffa450edef68

modules/md/md_ocsp.c

index d2dfd73b68bc0f06ee792f1565f80255b26fd2e4..74dd49058a8ecf34f01c88b2c572f2fabcc4c210 100644 (file)
@@ -930,9 +930,9 @@ apr_status_t md_ocsp_remove_responses_older_than(md_ocsp_reg_t *reg, apr_pool_t
 typedef struct {
     apr_pool_t *p;
     md_ocsp_reg_t *reg;
-    int good;
-    int revoked;
-    int unknown;
+    unsigned good;
+    unsigned revoked;
+    unsigned unknown;
 } ocsp_summary_ctx_t;
 
 static int add_to_summary(void *baton, const void *key, apr_ssize_t klen, const void *val)