summaryrefslogtreecommitdiff
path: root/usr/src/cmd
diff options
context:
space:
mode:
authorNathan Burnett <nathan.burnett@delphix.com>2016-08-01 19:42:41 -0700
committerMatthew Ahrens <mahrens@delphix.com>2016-08-02 09:49:32 -0700
commitbe1977d8f5897cf3f531fa59cd0e40fc5c03bcb4 (patch)
treeabd5e15864f9012320e9a50921efb5d4203568d2 /usr/src/cmd
parent0f7643c7376dd69a08acbfc9d1d7d548b10c846a (diff)
downloadillumos-joyent-be1977d8f5897cf3f531fa59cd0e40fc5c03bcb4.tar.gz
7234 check for empty column strings in svcs
Reviewed by: Sebastien Roy <sebastien.roy@delphix.com> Reviewed by: George Wilson <george.wilson@delphix.com> Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com> Reviewed by: Robert Mustacchi <rm@joyent.com> Approved by: Matthew Ahrens <mahrens@delphix.com>
Diffstat (limited to 'usr/src/cmd')
-rw-r--r--usr/src/cmd/svc/svcs/svcs.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/usr/src/cmd/svc/svcs/svcs.c b/usr/src/cmd/svc/svcs/svcs.c
index c54f4bd12d..2bd5387daf 100644
--- a/usr/src/cmd/svc/svcs/svcs.c
+++ b/usr/src/cmd/svc/svcs/svcs.c
@@ -22,6 +22,7 @@
/*
* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ * Copyright (c) 2015 by Delphix. All rights reserved.
*/
/*
@@ -3811,6 +3812,9 @@ again:
if (*cp == ',')
++opt_cnum;
+ if (*columns_str == '\0')
+ uu_die(gettext("No columns specified.\n"));
+
opt_columns = malloc(opt_cnum * sizeof (*opt_columns));
if (opt_columns == NULL)
uu_die(gettext("Too many columns.\n"));