1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-01-23 02:04:16 +03:00

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 <jtomko@redhat.com>
Fixes: 67bf91e1c38b6569357c22b1c83f7b090badba2b
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Ján Tomko 2020-12-10 09:42:43 +01:00
parent 61802ce3f0
commit 3d016477cc

View File

@ -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';