From: Volker Lendecke Date: Thu, 7 May 2009 08:09:32 +0000 (+0200) Subject: Fix bug 6336: "net groupmap set" segfaults X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f97e37d0130752dded728a29f5b1024ca19a0733;p=thirdparty%2Fsamba.git Fix bug 6336: "net groupmap set" segfaults --- diff --git a/source/utils/net_groupmap.c b/source/utils/net_groupmap.c index b160d840a07..0a3a2972e4b 100644 --- a/source/utils/net_groupmap.c +++ b/source/utils/net_groupmap.c @@ -619,11 +619,13 @@ static int net_groupmap_set(struct net_context *c, int argc, const char **argv) /* The case (opt_domaingroup && opt_localgroup) was tested for above */ - if (strlen(c->opt_comment) > 0) + if ((c->opt_comment != NULL) && (strlen(c->opt_comment) > 0)) { fstrcpy(map.comment, c->opt_comment); + } - if (strlen(c->opt_newntname) > 0) + if ((c->opt_newntname != NULL) && (strlen(c->opt_newntname) > 0)) { fstrcpy(map.nt_name, c->opt_newntname); + } if (grp != NULL) map.gid = grp->gr_gid;