Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] Fix a bunch of Coverity-reported defects



On Thu, Oct 26, 2023 at 1:19 AM Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
>
> On 10/26/23, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> > I triaged about 85 defects in the Coverity scan UI.  The majority of
> > them were spurious, and I marked them "Ignore".
>
> One thing to keep in mind is it sometimes groups several "occurrences"
> of the same issue together, you can switch them with a combo box near
> the bottom right of the UI. (maybe a bit late to point this out now).

As far as I could tell each ID number referenced a single occurrence.
A lot of them were like this one:

> > >>>     CID 1547833:  Memory - illegal accesses  (NEGATIVE_RETURNS)
> > >>>     Using variable "*lineptr" as an index to array "typtab".
> > /Src/hist.c: 3809 in histsplitwords()

That is, using a macro to index the typtab array using a *(char*) and
complaining that the byte pointed to could be a negative number.  In
practice this is just not going to happen (or if it does something
else is already desperately wrong).

Many others were about not checking error status of system calls when
in practice there's no sensible recovery mode, e.g., what would we do
instead if setting the close-on-exec flag on an fd does not work?

> I uploaded a new build to coverity with this patch applied and it
> seems to be happy with it.

Thanks.




Messages sorted by: Reverse Date, Date, Thread, Author