summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorroot <root@dolby.ad.plainjoe.org>2008-06-19 12:14:32 -0500
committerGerald Carter <coffeedude@plainjoe.org>2008-06-19 13:41:47 -0500
commit37ae3f9c20b9882522abb33276e716dca296d63f (patch)
tree3b91e8d78a85f6f6b6f64be4704dfb32310e016e /source3/utils
parentbe5dc4f3c82210860661954cad81bcb37d495db7 (diff)
downloadsamba-37ae3f9c20b9882522abb33276e716dca296d63f.tar.gz
samba-37ae3f9c20b9882522abb33276e716dca296d63f.tar.bz2
samba-37ae3f9c20b9882522abb33276e716dca296d63f.zip
net: Fix crash when specifying invalid options on the command line
(This used to be commit 4c3bfea9f8d238f9100eaa264b9b2941dff5a6dd)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net_util.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source3/utils/net_util.c b/source3/utils/net_util.c
index 6029231d74..8938b9cf01 100644
--- a/source3/utils/net_util.c
+++ b/source3/utils/net_util.c
@@ -550,6 +550,14 @@ int net_run_function(struct net_context *c, int argc, const char **argv,
const char *whoami, struct functable *table)
{
int i;
+
+ if (!table) {
+ d_fprintf(stderr, "Invalid command. Run \"%s\" for more details.\n",
+ whoami);
+ return 1;
+ }
+
+
if (argc != 0) {
for (i=0; table[i].funcname != NULL; i++) {
if (StrCaseCmp(argv[0], table[i].funcname) == 0)