This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [PATCH/RFC] NULL terminate mips dis options
- From: cgd at broadcom dot com
- To: elathan at phys dot uoa dot gr
- Cc: binutils at sources dot redhat dot com
- Date: 10 Feb 2003 10:14:29 -0800
- Subject: Re: [PATCH/RFC] NULL terminate mips dis options
- References: <20030210123901.V8236@neutrino.particles.org><mailpost.1044873647.4282@news-sj1-1>
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