New python PIDL checks cause 2221 new Coverity warnings

Andrew Bartlett abartlet at samba.org
Tue Sep 1 03:45:14 UTC 2015


On Fri, 2015-08-28 at 06:59 +0200, Volker Lendecke wrote:
> 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.

Can you review and push the attached?

This handles the unsigned case.  The remaining case is for signed 64
bit integers in IDL, which are vanishingly rare (6 instances), so I've
left those in the generated output rather than add another helper
function for those.

Once this is one, I would like to discuss getting the underlying
changes into 4.3, as the purpose of this work is to allow AD sites
using the sudo (and other custom) schema to upgrade their domains
successfully.

Thanks,

Andrew Bartlett

-- 
Andrew Bartlett
https://samba.org/~abartlet/
Authentication Developer, Samba Team         https://samba.org
Samba Development and Support, Catalyst IT   
https://catalyst.net.nz/services/samba




-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-pidl-python-Calculate-maximum-integer-values-using-a.patch
Type: text/x-patch
Size: 2734 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20150901/ec774f5d/0001-pidl-python-Calculate-maximum-integer-values-using-a.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-pidl-Provide-static-inline-helper-function-ndr_PyLon.patch
Type: text/x-patch
Size: 2625 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20150901/ec774f5d/0002-pidl-Provide-static-inline-helper-function-ndr_PyLon.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-python-tests-Add-tests-for-64-bit-signed-integers.patch
Type: text/x-patch
Size: 2058 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20150901/ec774f5d/0003-python-tests-Add-tests-for-64-bit-signed-integers.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-python-tests-Add-more-assertions-that-we-get-back-th.patch
Type: text/x-patch
Size: 2364 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20150901/ec774f5d/0004-python-tests-Add-more-assertions-that-we-get-back-th.bin>


More information about the samba-technical mailing list