[PATCH/RFC] NULL terminate mips dis options

cgd@broadcom.com cgd@broadcom.com
Mon Feb 10 18:14:00 GMT 2003


At Mon, 10 Feb 2003 10:40:47 +0000 (UTC), "Elias Athanasopoulos" wrote:
> objdump --help may crash if mips_abi_choices[] and mips_arch_choices[] do
> not end in a record with a NULL name. I verified this in a Linux i586 host
> configured with --enable-targets=all --enable-64-bit-bfd, using gcc 3.3.

This is not a correct patch.

If you look through the uses of those arrays, you'll note other uses
do NOT rely on NULL-termination of the arrays, and that indeed if you
change the arrays as you describe you might get crashes in the other
places that use the arrays.

You should convert the uses of them in print_mips_disassembler_options
to use ARRAY_SIZE as other uses do.  That would be the correct patch.



cgd



More information about the Binutils mailing list