]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
objcopy: check input flavor before setting PE/COFF section alignment
authorJan Beulich <jbeulich@suse.com>
Fri, 26 Apr 2024 12:23:14 +0000 (14:23 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 26 Apr 2024 12:23:14 +0000 (14:23 +0200)
commit6fde04116b4b835fa9ec3b3497fcac4e4a0637e2
treef0c4791cd8db1be9172fb2d20ad6c2fb771acb63
parentcd0dbe767775fdbfdc875a14f9080fdea0841c92
objcopy: check input flavor before setting PE/COFF section alignment

coff_section_data() and elf_section_data() use the same underlying
field. The pointer being non-NULL therefore isn't sufficient to know
that pei_section_data() can validly be used on the incoming object.
Apparently in 64-bit-host builds the resulting memory corruption is
benign, whereas in 32-bit-host builds a segmentation fault occurs upon
de-referencing pei_section_data()'s return value.
binutils/objcopy.c