s3-net: fix crash in rap_share_add().
authorGünther Deschner <gd@samba.org>
Wed, 5 May 2010 15:17:12 +0000 (17:17 +0200)
committerGünther Deschner <gd@samba.org>
Wed, 5 May 2010 15:21:06 +0000 (17:21 +0200)
Guenther

source3/utils/net_rap.c

index 605043734ccc203db14df52123531e2db1dbcd93..8d5a3dbf15344bf237debc9d7e530df940fe0989 100644 (file)
@@ -249,7 +249,7 @@ static int rap_share_add(struct net_context *c, int argc, const char **argv)
        strlcpy((char *)sinfo.share_name, sharename, sizeof(sinfo.share_name));
        sinfo.reserved1 = '\0';
        sinfo.share_type = 0;
-       sinfo.comment = smb_xstrdup(c->opt_comment);
+       sinfo.comment = c->opt_comment ? smb_xstrdup(c->opt_comment) : "";
        sinfo.perms = 0;
        sinfo.maximum_users = c->opt_maxusers;
        sinfo.active_users = 0;