]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
libxc: check pointer is not null before printing
authorWei Liu <wei.liu2@citrix.com>
Tue, 1 Aug 2017 11:25:39 +0000 (12:25 +0100)
committerWei Liu <wei.liu2@citrix.com>
Fri, 4 Aug 2017 10:55:51 +0000 (11:55 +0100)
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxc/xc_dom_core.c

index cf403432d27cc8a527c25ed0fad3a0c47fe70b8f..b5f316a1dc7b675a88a75431f4d9b0408d53f446 100644 (file)
@@ -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;