From: Hans Kristian Rosbach Date: Wed, 15 Apr 2026 11:39:54 +0000 (+0200) Subject: Fix UBSAN implicit conversion warning in inftrees.c. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=44d0529a6ff0ec83cfcfa597d90c7559a06cc7cb;p=thirdparty%2Fzlib-ng.git Fix UBSAN implicit conversion warning in inftrees.c. Co-authored-by: Nathan Moin Vaziri --- diff --git a/inftrees.c b/inftrees.c index 1320eb988..d65e6a9ce 100644 --- a/inftrees.c +++ b/inftrees.c @@ -342,7 +342,7 @@ int Z_INTERNAL zng_inflate_table(codetype type, uint16_t *lens, unsigned codes, } while (fill != 0); /* backwards increment the len-bit code huff */ - rhuff += (0x8000u >> (len - 1)); + rhuff = (uint16_t)(rhuff + (0x8000u >> (len - 1))); huff = zng_bitreverse16(rhuff); /* go to next symbol, update count, len */