Fix bug 6014 -- mget shouldn't segfault without arguments
authorVolker Lendecke <vl@samba.org>
Mon, 5 Jan 2009 14:47:19 +0000 (15:47 +0100)
committerKarolin Seeger <kseeger@samba.org>
Mon, 5 Jan 2009 14:53:39 +0000 (15:53 +0100)
Thanks to kevin.paulus@mtm.kuleuven.be for the bug report

Volker
(cherry picked from commit 9c80ce9b4f3d2b130cf58610f36ed46a7e17baf4)

source/client/client.c

index 5e3b1a9ea6af73043a1c47c3e597f091f75012fc..4d7085e5a45a0916579f63c1dfdf7caab35fcbc1 100644 (file)
@@ -1332,6 +1332,11 @@ static int cmd_mget(void)
                do_list(mget_mask, attribute, do_mget, false, true);
        }
 
+       if (mget_mask == NULL) {
+               d_printf("nothing to mget\n");
+               return 0;
+       }
+
        if (!*mget_mask) {
                mget_mask = talloc_asprintf(ctx,
                                        "%s*",