pcp
[Top] [All Lists]

Re: [pcp] coding issues and defects uncovered by Coverity scans

To: pcp@xxxxxxxxxxx
Subject: Re: [pcp] coding issues and defects uncovered by Coverity scans
From: Mark Goodwin <mgoodwin@xxxxxxxxxx>
Date: Wed, 25 Jan 2012 10:56:44 +1100
In-reply-to: <1327138752.11402.13.camel@xxxxxxxxxxxxxxxxxxxxxxx>
References: <94794049.48897.1326672071463.JavaMail.root@xxxxxxxxxxxxxxxxxxxxxx> <4F14BFB2.1090902@xxxxxxxxxx> <1327138752.11402.13.camel@xxxxxxxxxxxxxxxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111115 Thunderbird/8.0
On 01/21/2012 08:39 PM, Ken McDonell wrote:
#75 - I agree, dp _must_ be set in all cases except the bad PMID one
where we continue the outer loop and never hit the deref of dp ...

yep, so I simply can't see how it could fail. gcc may have done some kind
of optimization or something that has somehow confused coverity, but for
now I think we just ignore this one.


#95 - I think the test at line 358 is inverted ... should if logfile->fd
= 0

#101 - our logic is a bit convoluted here ... assuming a read with fd<
0 returns EBADF, the code will behave correctly.  Adding
        if (logfile->fd<  0)
                return 0;
before the read() would make it clearer and make coverity happy I'm
guessing.

ok I'll make that change - for the sake of clarity at least.


#139 - I don't follow the coverity logic here at all ... the existing
code looks OK to me.

coverity seems to have ignored nwhoamis++ at line 1670, or somehow found
a convoluted path thru the code that misses that line *and* also misses
j = last_free. I can't see how it can fail, so ignore this one too.

Thanks
- Mark

<Prev in Thread] Current Thread [Next in Thread>