[PATCH] Reject compressed sections exceding 4 GiB on LLP64 machines

Jan Beulich jbeulich@suse.com
Tue Jun 3 06:49:19 GMT 2025


On 03.06.2025 04:16, Rui Ueyama wrote:
> @@ -1009,6 +1007,15 @@ bfd_init_section_decompress_status (bfd *abfd, sec_ptr sec)
>        return false;
>      }
>  
> +  /* PR28530, reject sizes unsupported by decompress_contents. zlib
> +     supports only up to 4 GiB input on machines whose long is 32 bits. */
> +  if (ch_type != ch_compress_zstd

I think using == here is going to be better, going forward (i.e. as new methods
may be supported).

> +      && (sec->size >= ULONG_MAX || uncompressed_size >= ULONG_MAX))

Why the 2nd of the checks, when the comment only says "input"?

Jan


More information about the Binutils mailing list