From: Ján Tomko Date: Thu, 10 Dec 2020 08:42:43 +0000 (+0100) Subject: virsh: virshAddressParse: check for malformed address X-Git-Tag: v7.0.0-rc1~228 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3d016477cc7e95b3191a933f25579fb1e53c7f88;p=thirdparty%2Flibvirt.git virsh: virshAddressParse: check for malformed address 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 Fixes: 67bf91e1c38b6569357c22b1c83f7b090badba2b Reviewed-by: Michal Privoznik --- 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';