Re: [PATCH] python: prefer PyList_SET_ITEM to PyList_SetItem

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

 



Martin Kletzander <mkletzan@xxxxxxxxxx> writes:

> Not that it has any connection to your patch, but I noticed that,
> somewhere, we check the return value of PyList_New(), but somewhere we
> don't...  I guess we should do it everywhere, shouldn't we?
>
> ... thinking about it, I searched through the code and
> PyList_SetItem() properly errors out when 'op' (its first param) is
> NULL, but PyList_SET_ITEM() will just segfault.  I think we should
> properly handle allocation errors before optimizing it this way.

Great you have noticed it.  I expected PyList_SetItem to crash too when
the list == NULL.

Thanks for the review.

Giuseppe

--
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]