1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-21 22:50:08 +03:00

xzlib: Fix harmless unsigned integer overflow

This commit is contained in:
Nick Wellnhofer 2023-12-19 19:47:07 +01:00
parent 1ef3566362
commit e62b0dbde5

View File

@ -321,8 +321,12 @@ is_format_lzma(xz_statep state)
* If someone complains, this will be reconsidered.
*/
if (dict_size != UINT32_MAX) {
uint32_t d = dict_size - 1;
uint32_t d;
if (dict_size == 0)
return 0;
d = dict_size - 1;
d |= d >> 2;
d |= d >> 3;
d |= d >> 4;