]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
net: Fix crash when specifying invalid options on the command line
authorroot <root@dolby.ad.plainjoe.org>
Thu, 19 Jun 2008 17:14:32 +0000 (12:14 -0500)
committerGerald Carter <coffeedude@plainjoe.org>
Thu, 19 Jun 2008 18:41:47 +0000 (13:41 -0500)
source/utils/net_util.c

index 6029231d7462e628a9a18a448e36297ef70b4806..8938b9cf014d94713301b8c83337d4287f86a38b 100644 (file)
@@ -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)