This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] elf-eh-frame, move buffer alloc out of if block
> On Fri, Jul 27, 2007 at 04:52:10PM -0700, msnyder@sonic.net wrote:
> > > So, if ecies is NULL (implies invalid .eh_frame section and also
> > > ecie_count == 0), I don't see anything invalid on the
> > > ecie = NULL assignment or NULL < NULL + 0 comparison (false), then it
> > > will just do if (NULL == NULL + 0) goto free_no_table;
> >
> > Well, that reasoning requires that you *know* that (ecies == NULL)
> > implies invalid .eh_frame section and ecie_count == 0.
>
> But sufficiently good analysis tool must be able to figure that out.
> Initially ecies = NULL and ecie_count = 0 (var initialization at their
> respective definitions). The only place where ecie_count is increased
> is after ecies = bfd_realloc () succeeded, at which point ecies != NULL.
>
> So I'm not really sure we should work around Coverity inefficiencies.
>
> You need to take the reported issues with a grain of salt, they show where
> a problem might be. You then analyze the thing and either assess there is
> no problem and ideally report that to the provider of the tool, so that
> they can improve it, or fix the problem.
No worries -- I've reported back to them more than a dozen
false hits.