[libvirt] [PATCH] python: improve conversion validation

Eric Blake eblake at redhat.com
Sat Mar 31 15:16:37 UTC 2012


On 03/31/2012 01:36 AM, Osier Yang wrote:
> On 03/31/2012 02:49 AM, Eric Blake wrote:
>> Laszlo Ersek pointed out that in trying to convert a long to an
>> unsigned int, we used:
>>
>> long long_val = ...;
>> if ((unsigned int)long_val == long_val)
>>

>> Fix this by using direct comparisons, rather than casting.
>>
>> * python/typewrappers.c (libvirt_intUnwrap, libvirt_uintUnwrap)
>> (libvirt_ulongUnwrap, libvirt_ulonglongUnwrap): Fix conversion
>> checks.
>> ---

> 
> Looks good, ACK

Thanks; pushed.

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120331/06ebe47a/attachment-0001.sig>


More information about the libvir-list mailing list