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

[Xen-changelog] [xen-unstable] xl: Check invalid domid in find_domain()



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1273820203 -3600
# Node ID d8afa50f7b11f6d9a6c42c82dd1b21f8b3912025
# Parent  cb8c180dfbcd9aed285133a548a532d2bf44f8e6
xl: Check invalid domid in find_domain()

If domain id is invalid, find_domain should return error because
the specified domain does not exist.

Signed-off-by: Yang Hongyang <yanghy@xxxxxxxxxxxxxx>
---
 tools/libxl/xl_cmdimpl.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletion(-)

diff -r cb8c180dfbcd -r d8afa50f7b11 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c  Fri May 14 07:55:14 2010 +0100
+++ b/tools/libxl/xl_cmdimpl.c  Fri May 14 07:56:43 2010 +0100
@@ -137,7 +137,11 @@ static void find_domain(const char *p)
         fprintf(stderr, "%s is an invalid domain identifier (rc=%d)\n", p, rc);
         exit(2);
     }
-    common_domname = was_name ? p : 0;
+    common_domname = was_name ? p : libxl_domid_to_name(&ctx, domid);
+    if (!common_domname) {
+        fprintf(stderr, "%s is an invalid domain identifier.\n", p);
+        exit(2);
+    }
 }
 
 #define LOG(_f, _a...)   dolog(__FILE__, __LINE__, __func__, _f "\n", ##_a)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
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®.