Re: [libvirt-python PATCH 23/23] coverity: resolve dead_error_condition

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

 




On 09/24/2015 10:02 AM, Pavel Hrdina wrote:
> Coverity cannot introspect the cpython code and it thinks, that if the
> PyTuple_New or similar will always give the same result.  In functions
> where the python function is called more than once with the same
> arguments, it will assume that if the first call don't return NULL, then
> also the every other call cannot return NULL.  This is a wrong
> assumption and it's a false-positive.
> 

My turn to make the obvious question... Have you asked the Coverity
folks?  This just seems very strange. I agree it seems to be a false
positive, but something isn't adding up.

John
> Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
> ---
>  libvirt-override.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/libvirt-override.c b/libvirt-override.c
> index 3192e74..5330d0f 100644
> --- a/libvirt-override.c
> +++ b/libvirt-override.c
> @@ -5409,6 +5409,7 @@ libvirt_virEventAddTimeoutFunc(int timeout,
>      Py_INCREF(python_cb);
>      VIR_PY_TUPLE_SET_GOTO(pyobj_args, 1, python_cb, cleanup);
>  
> +    /* coverity[notnull] */
>      if ((cb_args = PyTuple_New(3)) == NULL)
>          goto cleanup;
>  
> @@ -6125,6 +6126,7 @@ libvirt_virConnectDomainEventGraphicsCallback(virConnectPtr conn ATTRIBUTE_UNUSE
>                           libvirt_constcharPtrWrap(local->service),
>                           cleanup);
>  
> +    /* coverity[notnull] */
>      if ((pyobj_remote = PyDict_New()) == NULL)
>          goto cleanup;
>  
> 

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