Re: [PATCH 15/21] Adapt virDomainMigrateVersion3 for extensible migration APIs

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

 



On 06/18/2013 10:05 AM, Jiri Denemark wrote:
> ---
>  src/libvirt.c | 177 +++++++++++++++++++++++++++++++++++++++++++---------------
>  1 file changed, 133 insertions(+), 44 deletions(-)
> 

<...snip...>


> +    if (useParams) {
> +        if (virTypedParamsGetString(params, nparams,
> +                                    VIR_MIGRATE_PARAM_DEST_NAME, NULL) <= 0 &&
> +            virTypedParamsReplaceString(&params, &nparams,
> +                                        VIR_MIGRATE_PARAM_DEST_NAME,
> +                                        domain->name) < 0) {
> +            domain = NULL;


^^^ The setting of NULL right here causes Coverity problems later... 


4979 	            virTypedParamsReplaceString(&params, &nparams,
4980 	                                        VIR_MIGRATE_PARAM_DEST_NAME,
4981 	                                        domain->name) < 0) {

(45) Event assign_zero: 	Assigning: "domain" = "NULL".
Also see events: 	[var_deref_op]

4982 	            domain = NULL;


> +        } else {
> +            ddomain = dconn->driver->domainMigrateFinish3Params
> +                (dconn, params, nparams, cookiein, cookieinlen,
> +                 &cookieout, &cookieoutlen, destflags, cancelled);
> +        }
> +    } else {
> +        dname = dname ? dname : domain->name;
> +        ddomain = dconn->driver->domainMigrateFinish3
> +            (dconn, dname, cookiein, cookieinlen, &cookieout, &cookieoutlen,
> +             NULL, uri, destflags, cancelled);
> +    }
>  
>      /* If ddomain is NULL, then we were unable to start
>       * the guest on the target, and must restart on the


Later domain->conn is referenced:


(52) Event cond_true: 	Condition "notify_source", taking true branch

5017 	    if (notify_source) {

(53) Event var_deref_op: 	Dereferencing null pointer "domain".
Also see events: 	[assign_zero]

5018 	        VIR_DEBUG("Confirm3 %p ret=%d domain=%p", domain->conn, ret, domain);
5019 	        VIR_FREE(cookiein);
5020 	        cookiein = cookieout;


John

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