New python PIDL checks cause 2221 new Coverity warnings

Stefan Metzmacher metze at samba.org
Tue Sep 1 09:54:41 UTC 2015


Hi Andrew,

>>>> 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.
>>
>> For symetric reasons I've also added a helper function for the signed
>> case.
>>
>> I've also changed some leading whitespaces to tabs and added bug
>> markers.
> 
> Thanks.
> 
>> Everyone happy with the attached patches to be pushed to master?
> 
> I'm happy with them. 

Pushed to autobuild.

metze

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20150901/255016d1/signature.sig>


More information about the samba-technical mailing list