This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH/RFC] NULL terminate mips dis options


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]