* [PATCH] tools/xenconsole: fix Segmentation fault
@ 2010-02-08 6:47 Yu Zhiguo
0 siblings, 0 replies; only message in thread
From: Yu Zhiguo @ 2010-02-08 6:47 UTC (permalink / raw)
To: Keir Fraser; +Cc: xen-devel
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@cn.fujitsu.com>
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]);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2010-02-08 6:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-08 6:47 [PATCH] tools/xenconsole: fix Segmentation fault Yu Zhiguo
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.