[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] xl: check json string is not null before printing in create_domain



commit a1e6d8923c5d16ac1d7a10fcd09eab50b0501de7
Author:     Wei Liu <wei.liu2@xxxxxxxxxx>
AuthorDate: Thu Jul 23 08:59:06 2015 +0100
Commit:     Ian Campbell <ian.campbell@xxxxxxxxxx>
CommitDate: Fri Jul 24 11:27:52 2015 +0100

    xl: check json string is not null before printing in create_domain
    
    Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
    Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
 tools/libxl/xl_cmdimpl.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 9027acb..a38074f 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -2781,6 +2781,11 @@ static uint32_t create_domain(struct domain_create 
*dom_info)
             printf_info_sexp(-1, &d_config, cfg_print_fh);
         } else {
             char *json = libxl_domain_config_to_json(ctx, &d_config);
+            if (!json) {
+                fprintf(stderr,
+                        "Failed to convert domain configuration to JSON\n");
+                exit(1);
+            }
             fputs(json, cfg_print_fh);
             free(json);
             flush_stream(cfg_print_fh);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.