Re: [PATCH 5/7] remoteDispatchDomainMigratePrepare: Don't pass uninitialized variable to VIR_FREE

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

 



On a Thursday in 2020, Peter Krempa wrote:
'uri_out' may be passed to VIR_FREE uninitialized if 'conn' is NULL.
Unfortunately the compiler isn't able to detect this problem when
VIR_FREE is implemented using g_clear_pointer. Initialize the variable.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
src/remote/remote_daemon_dispatch.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/remote/remote_daemon_dispatch.c b/src/remote/remote_daemon_dispatch.c
index 6f67d2fb30..69e9aa09b9 100644
--- a/src/remote/remote_daemon_dispatch.c
+++ b/src/remote/remote_daemon_dispatch.c
@@ -3030,7 +3030,7 @@ remoteDispatchDomainMigratePrepare(virNetServerPtr server G_GNUC_UNUSED,
    char *cookie = NULL;
    int cookielen = 0;
    char *uri_in;
-    char **uri_out;
+    char **uri_out = NULL;
    char *dname;
    int rv = -1;
    virConnectPtr conn = remoteGetHypervisorConn(client);

Same problem is present in:

    remoteDispatchDomainMigratePrepare2
    remoteDispatchDomainMigratePrepare3
    remoteDispatchDomainMigratePrepare3Params

Reviewed-by: Ján Tomko <jtomko@xxxxxxxxxx>

Jano

Attachment: signature.asc
Description: PGP signature


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

  Powered by Linux