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-changelog

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

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] tools/xenconsole: fix Segmentation fault
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 08 Feb 2010 00:55:20 -0800
Delivery-date: Mon, 08 Feb 2010 00:56:09 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1265619003 0
# Node ID 5e49312fcb4465ec6715e204b6a50b0f06abf1c2
# Parent  12fc55dffb6bbd78864092eed705cec8192ed461
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>
---
 tools/console/client/main.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletion(-)

diff -r 12fc55dffb6b -r 5e49312fcb44 tools/console/client/main.c
--- a/tools/console/client/main.c       Mon Feb 08 08:49:19 2010 +0000
+++ b/tools/console/client/main.c       Mon Feb 08 08:50:03 2010 +0000
@@ -287,7 +287,13 @@ int main(int argc, char **argv)
                        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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] tools/xenconsole: fix Segmentation fault, Xen patchbot-unstable <=