[libvirt] [PATCH 1/7 v2] Coverity: Fix the forward_null error in Python binding codes

Eric Blake eblake at redhat.com
Wed May 2 18:14:51 UTC 2012


On 05/02/2012 09:05 AM, Osier Yang wrote:
> Related coverity log:
> 
> Error: FORWARD_NULL:
> /builddir/build/BUILD/libvirt-0.9.10/python/libvirt-override.c:355:
> assign_zero: Assigning: "params" = 0.
> /builddir/build/BUILD/libvirt-0.9.10/python/libvirt-override.c:458:
> var_deref_model: Passing null variable "params" to function
> "getPyVirTypedParameter", which dereferences it. (The dereference is assumed on
> the basis of the 'nonnull' parameter attribute.)
> ---
>  python/libvirt-override.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/python/libvirt-override.c b/python/libvirt-override.c
> index 56f96ba..130e702 100644
> --- a/python/libvirt-override.c
> +++ b/python/libvirt-override.c
> @@ -71,7 +71,7 @@ static char *py_str(PyObject *obj)
>  /* Helper function to convert a virTypedParameter output array into a
>   * Python dictionary for return to the user.  Return NULL on failure,
>   * after raising a python exception.  */
> -static PyObject * ATTRIBUTE_NONNULL(1)
> +static PyObject *

ACK.

-- 
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/20120502/b30c9a8d/attachment-0001.sig>


More information about the libvir-list mailing list