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

[Xen-changelog] [xen-3.4-testing] tools/xenconsole: fix Segmentation fault



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1265625438 0
# Node ID 5c8649303392c23df82ca02bc9a3f481455c7824
# Parent  e42b5532ac856e5f6f851e0e6d98af3315e533f4
tools/xenconsole: fix Segmentation fault

Segmentation fault occurs if DOMID isn't specified.
Some check be added to output error message in this situation.

Signed-off-by: Yu Zhiguo <yuzg@xxxxxxxxxxxxxx>
xen-unstable changeset:   20910:5e49312fcb44
xen-unstable date:        Mon Feb 08 08:50:03 2010 +0000
---
 tools/console/client/main.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletion(-)

diff -r e42b5532ac85 -r 5c8649303392 tools/console/client/main.c
--- a/tools/console/client/main.c       Mon Feb 08 10:36:53 2010 +0000
+++ b/tools/console/client/main.c       Mon Feb 08 10:37:18 2010 +0000
@@ -283,7 +283,13 @@ int main(int argc, char **argv)
                        argv[0]);
                exit(EINVAL);
        }
-       
+
+       if (optind >= argc) {
+               fprintf(stderr, "DOMID should be specified\n");
+               fprintf(stderr, "Try `%s --help' for more information.\n",
+                       argv[0]);
+               exit(EINVAL);
+       }
        domid = strtol(argv[optind], &end, 10);
        if (end && *end) {
                fprintf(stderr, "Invalid DOMID `%s'\n", argv[optind]);

_______________________________________________
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®.