From 37ae3f9c20b9882522abb33276e716dca296d63f Mon Sep 17 00:00:00 2001 From: root Date: Thu, 19 Jun 2008 12:14:32 -0500 Subject: net: Fix crash when specifying invalid options on the command line (This used to be commit 4c3bfea9f8d238f9100eaa264b9b2941dff5a6dd) --- source3/utils/net_util.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source3/utils/net_util.c') 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) -- cgit