From: Stefan Eissing Date: Tue, 15 Jul 2025 06:35:04 +0000 (+0000) Subject: * mod_http2/mod_proxy_http2: fix a bug in calculating the log2 value of X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8e529ceccac445872f534a13902ed10466efc056;p=thirdparty%2Fapache%2Fhttpd.git * 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 --- diff --git a/changes-entries/pr69741.txt b/changes-entries/pr69741.txt new file mode 100644 index 0000000000..2b1d876b50 --- /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 5e1ebe663d..c0b3948c2e 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 202363dede..610908eeb2 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 605c348ca1..685e771eaa 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 d1a809c52b..e813bf586f 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