[libvirt PATCH 1/3] virsh: virshAddressParse: check for malformed address

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

 



The refactor left in the 'if (addr)' check,
but before 'addr' was the return value of strchr
and now it's the return value of virshAddressParse.

Check 'a' instead since that's the return of strchr now.

Signed-off-by: Ján Tomko <jtomko@xxxxxxxxxx>
Fixes: 67bf91e1c38b6569357c22b1c83f7b090badba2b
---
 tools/virsh-domain.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index befa8d2448..1ef9b8d606 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -124,7 +124,7 @@ virshAddressParse(const char *str,
     g_autofree char *type = g_strdup(str);
     char *a = strchr(type, ':');
 
-    if (!addr)
+    if (!a)
         return -1;
 
     *a = '\0';
-- 
2.26.2




[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