New python PIDL checks cause 2221 new Coverity warnings

Volker Lendecke Volker.Lendecke at SerNet.DE
Fri Aug 28 04:59:05 UTC 2015


On Fri, Aug 28, 2015 at 12:04:33PM +1200, Andrew Bartlett wrote:
> > This is a reasonable, practical proposal, and I'm happy to do that
> > much.  It won't fix all the issues, but fixing the maximum value 
> > issues
> > will be a nice place to start.
> 
> See attached.  Please review.

That looks like a start. Also,

py_days_of_month = (uint32_t)object->days_of_month > LONG_MAX ?  PyLong_FromUnsignedLong((uint32_t)object->days_of_month) : PyInt_FromLong((uint32_t)object->days_of_month);

this pattern can easily be put into a helper function. In
addition to having just one coverity warning (or none if we
properly #ifdef this) we get less cluttered code to look at.

Volker

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de



More information about the samba-technical mailing list