WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] tools/xenconsole: fix Segmentation fault

To: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] tools/xenconsole: fix Segmentation fault
From: Yu Zhiguo <yuzg@xxxxxxxxxxxxxx>
Date: Mon, 08 Feb 2010 14:47:48 +0800
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Sun, 07 Feb 2010 22:47:38 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 3.0a1 (Windows/2008050715)
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>

diff -r 7b751b0e6f1b -r 22dfbd21b44e tools/console/client/main.c
--- a/tools/console/client/main.c       Thu Feb 04 19:40:19 2010 +0000
+++ b/tools/console/client/main.c       Mon Feb 08 11:31:06 2010 +0800
@@ -287,7 +287,13 @@
                        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-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] tools/xenconsole: fix Segmentation fault, Yu Zhiguo <=