From 8e529ceccac445872f534a13902ed10466efc056 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Tue, 15 Jul 2025 06:35:04 +0000 Subject: [PATCH] * mod_http2/mod_proxy_http2: fix a bug in calculating the log2 value of integers, used in push diaries and proxy window size calculations. PR69741 [Benjamin P. Kallus] git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1927235 13f79535-47bb-0310-9956-ffa450edef68 --- changes-entries/pr69741.txt | 3 +++ modules/http2/h2_proxy_util.c | 2 +- modules/http2/h2_proxy_util.h | 2 +- modules/http2/h2_util.c | 2 +- modules/http2/h2_util.h | 2 +- 5 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 changes-entries/pr69741.txt diff --git a/changes-entries/pr69741.txt b/changes-entries/pr69741.txt new file mode 100644 index 00000000000..2b1d876b500 --- /dev/null +++ b/changes-entries/pr69741.txt @@ -0,0 +1,3 @@ + * mod_http2/mod_proxy_http2: fix a bug in calculating the log2 value of + integers, used in push diaries and proxy window size calculations. + PR69741 [Benjamin P. Kallus] diff --git a/modules/http2/h2_proxy_util.c b/modules/http2/h2_proxy_util.c index 5e1ebe663db..c0b3948c2ed 100644 --- a/modules/http2/h2_proxy_util.c +++ b/modules/http2/h2_proxy_util.c @@ -34,7 +34,7 @@ APLOG_USE_MODULE(proxy_http2); /* h2_log2(n) iff n is a power of 2 */ -unsigned char h2_proxy_log2(int n) +unsigned char h2_proxy_log2(unsigned int n) { int lz = 0; if (!n) { diff --git a/modules/http2/h2_proxy_util.h b/modules/http2/h2_proxy_util.h index 202363dede8..610908eeb24 100644 --- a/modules/http2/h2_proxy_util.h +++ b/modules/http2/h2_proxy_util.h @@ -150,7 +150,7 @@ int h2_proxy_iq_shift(h2_proxy_iqueue *q); * common helpers ******************************************************************************/ /* h2_proxy_log2(n) iff n is a power of 2 */ -unsigned char h2_proxy_log2(int n); +unsigned char h2_proxy_log2(unsigned int n); /******************************************************************************* * HTTP/2 header helpers diff --git a/modules/http2/h2_util.c b/modules/http2/h2_util.c index 605c348ca12..685e771eaa4 100644 --- a/modules/http2/h2_util.c +++ b/modules/http2/h2_util.c @@ -32,7 +32,7 @@ #include "h2_util.h" /* h2_log2(n) iff n is a power of 2 */ -unsigned char h2_log2(int n) +unsigned char h2_log2(unsigned int n) { int lz = 0; if (!n) { diff --git a/modules/http2/h2_util.h b/modules/http2/h2_util.h index d1a809c52bf..e813bf586f9 100644 --- a/modules/http2/h2_util.h +++ b/modules/http2/h2_util.h @@ -323,7 +323,7 @@ apr_status_t h2_ififo_remove(h2_ififo *fifo, int id); * common helpers ******************************************************************************/ /* h2_log2(n) iff n is a power of 2 */ -unsigned char h2_log2(int n); +unsigned char h2_log2(unsigned int n); /** * Count the bytes that all key/value pairs in a table have -- 2.47.2