riscvarchive / riscv-binutils-gdb

RISC-V backports for binutils-gdb. Development is done upstream at the FSF.
GNU General Public License v2.0
148 stars 233 forks source link

Fix crash when disassembling non-ELF files #259

Closed mtvec closed 3 years ago

mtvec commented 3 years ago

The return value of get_elf_backend_data was used without checking for NULL. Since this function seems to return NULL for non-ELF files, it caused a crash when disassembling binary files. This commit adds a NULL-check to fix this.

jim-wilson commented 3 years ago

Patches must go upstream, and you must have an FSF copyright assignment in order for us to accept patches unless the patch is trivial. Or you can submit a bug report, and let someone with an assignment write the patch. See sourceware.org/binutils.

Nelson1225 commented 3 years ago

Already include this on upstream.