PR29855, ch_type in bfd_init_section_decompress_status can be uninitialized
authorAlan Modra <amodra@gmail.com>
Mon, 5 Dec 2022 22:07:52 +0000 (08:37 +1030)
committerAlan Modra <amodra@gmail.com>
Tue, 6 Dec 2022 00:01:50 +0000 (10:31 +1030)
PR 29855
* compress.c (bfd_init_section_decompress_status): Set ch_type
to zero for zlib-gnu case.

bfd/compress.c

index 3d8c1d769f17f9336de9989f91a300f2f999a2b8..6b083468ca8e43e658b5840bb43a308c3cd736e3 100644 (file)
@@ -564,6 +564,7 @@ bfd_init_section_decompress_status (bfd *abfd, sec_ptr sec)
          return false;
        }
       uncompressed_size = bfd_getb64 (header + 4);
+      ch_type = 0;
     }
   else if (!bfd_check_compression_header (abfd, header, sec,
                                          &ch_type,