From: Yaroslav Borbat <[email protected]>

virTypedParamsValidateTemplate() iterated templates with
  an inverted sentinel condition and counted entries incorrectly.

  This caused valid params to be rejected as unsupported, e.g.
  migration parameter 'disks_uri'.

  Fixes: a650af5002a7477cab649c44fff58bbbc909b8a8

Signed-off-by: Yaroslav Borbat <[email protected]>
---
 src/util/virtypedparam.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/virtypedparam.c b/src/util/virtypedparam.c
index 92f25cea39..530136978b 100644
--- a/src/util/virtypedparam.c
+++ b/src/util/virtypedparam.c
@@ -213,7 +213,7 @@ virTypedParamsValidateTemplate(virTypedParameterPtr params,

     /* we need to copy the list of templates because
      * 'virTypedParamsValidateInternal' will need to sort it */
-    while (*templates[ntemplates++].name == '\0')
+    while (*templates[ntemplates++].name != '\0')
         ;

     templ_copy = g_new0(virTypedParamValidationTemplate, ntemplates);
--
2.54.0

Reply via email to