Skip to contentSkip to conversation

libxc: check pointer is not null before printing

PATCH In review Wei Liu 2 participants 2 messages Aug 1, 2017

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

PATCH 1/1 libxc: check pointer is not null before printing

---
 tools/libxc/xc_dom_core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/libxc/xc_dom_core.c +2 -1
index cf403432d2..b5f316a1dc 100644
@@ -754,7 +754,8 @@ struct xc_dom_image *xc_dom_allocate(xc_interface *xch,
     struct xc_dom_image *dom;
 
     xc_dom_printf(xch, "%s: cmdline=\"%s\", features=\"%s\"",
-                  __FUNCTION__, cmdline, features);
+                  __FUNCTION__, cmdline ? cmdline : "",
+                  features ? features : "");
     dom = malloc(sizeof(*dom));
     if ( !dom )
         goto err;
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel