[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] tools/xenconsole: fix Segmentation fault
# 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
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |