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

[Xen-devel] [PATCH] libxl: Don't derefence null new_name pointer in libxl_domain_rename()



libxl__domain_rename() unconditionally dereferences its new_name
parameter, to check whether it is an empty string.   Add a check to
avoid a segfault if new_name is null.

Signed-off-by: Euan Harris <euan.harris@xxxxxxxxxx>
---
 tools/libxl/libxl.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index f84f7c2..6e84b5d 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -385,6 +385,13 @@ int libxl__domain_rename(libxl__gc *gc, uint32_t domid,
         }
     }
 
+    if (!new_name) {
+        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
+                        "new domain name not specified");
+        rc = ERROR_INVAL;
+        goto x_rc;
+    }
+
     if (new_name[0]) {
         /* nonempty names must be unique */
         uint32_t domid_e;
-- 
1.7.1


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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