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

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



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).
I've sometimes noticed that the first instance is a false positive
while one of the others are not, but that was years ago, maybe they've
improved this.

> There were 14 that I
> felt worthy of small fixes; those are included in the patch below.  I
> believe that leaves 14 others where I wasn't confident of a fix;
> several  of them are in zftp, as I recall.
>
> A batch of the warnings that I ignored were assignments of one field
> of a union to another field of the same union, e.g., a casted long
> onto a double, etc., which elicited "overlapping copy" warnings.  I'm
> fairly confident we'd have seen things crashing by now if this wasn't
> safe, but I mention it in case someone knows why it might be a
> problem.
>
> One of those I did NOT fix is this, mentioned recently:
>
>> > *** CID 1547827:  Null pointer dereferences  (FORWARD_NULL)
>> > /Src/Modules/pcre.c: 370 in bin_pcre_match()
>> > >>>     Passing null pointer "named" to "zpcre_get_substrings", which
>> > >>> dereferences it.
>>
>> This is from Oliver's 51738 (PCRE's alternative DFA), I'm not going to
>> interpret futher.
>
> Let me know if there's anything controversial here.

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

-- 
Mikael Magnusson




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