mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-24 13:33:01 +03:00
xzlib: Fix harmless unsigned integer overflow
This commit is contained in:
6
xzlib.c
6
xzlib.c
@@ -321,8 +321,12 @@ is_format_lzma(xz_statep state)
|
|||||||
* If someone complains, this will be reconsidered.
|
* If someone complains, this will be reconsidered.
|
||||||
*/
|
*/
|
||||||
if (dict_size != UINT32_MAX) {
|
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 >> 2;
|
||||||
d |= d >> 3;
|
d |= d >> 3;
|
||||||
d |= d >> 4;
|
d |= d >> 4;
|
||||||
|
|||||||
Reference in New Issue
Block a user