Prior to 1a09c5113a ("libxlu: rework internal representation of
setting") empty lists in config files did get accepted. Restore that
behavior.

Signed-off-by: Jan Beulich <jbeul...@suse.com>

--- a/tools/libxl/libxlu_cfg.c
+++ b/tools/libxl/libxlu_cfg.c
@@ -397,7 +397,7 @@ XLU_ConfigValue *xlu__cfg_list_mk(CfgPar
     value = malloc(sizeof(*value));
     if (!value) goto xe;
     value->type = XLU_LIST;
-    value->u.list.nvalues = 1;
+    value->u.list.nvalues = !!val;
     value->u.list.avalues = 1;
     value->u.list.values = values;
     memcpy(&value->loc, loc, sizeof(*loc));



libxlu: don't crash on empty lists

Prior to 1a09c5113a ("libxlu: rework internal representation of
setting") empty lists in config files did get accepted. Restore that
behavior.

Signed-off-by: Jan Beulich <jbeul...@suse.com>

--- a/tools/libxl/libxlu_cfg.c
+++ b/tools/libxl/libxlu_cfg.c
@@ -397,7 +397,7 @@ XLU_ConfigValue *xlu__cfg_list_mk(CfgPar
     value = malloc(sizeof(*value));
     if (!value) goto xe;
     value->type = XLU_LIST;
-    value->u.list.nvalues = 1;
+    value->u.list.nvalues = !!val;
     value->u.list.avalues = 1;
     value->u.list.values = values;
     memcpy(&value->loc, loc, sizeof(*loc));
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

Reply via email to