Re: [PATCH 2/2] python: return error if PyObject obj is NULL for unwrapper helper functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 04/17/2012 11:45 AM, Guannan Ren wrote:
>     The result is indeterminate for NULL argument to python
>     functions as follows. It's better to return negative value in
>     these situations.
> 
>     PyObject_IsTrue will segfault if the argument is NULL
>     PyFloat_AsDouble(NULL) is -1.000000
>     PyLong_AsUnsignedLongLong(NULL) is 0.000000
> ---
>  python/typewrappers.c |   26 +++++++++++++++++++++++---
>  1 files changed, 23 insertions(+), 3 deletions(-)

ACK.

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]