summaryrefslogtreecommitdiff
path: root/source3/utils/net_groupmap.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-05-07 10:09:32 +0200
committerVolker Lendecke <vl@samba.org>2009-05-07 10:11:38 +0200
commit974223b927119a1cd38fd58b215b14d81bfa0a8c (patch)
treed36f2170e0c161543a8f5d08c2c7824d077d7936 /source3/utils/net_groupmap.c
parent6f7cd213dd38e770224cf131054862b76069aed8 (diff)
downloadsamba-974223b927119a1cd38fd58b215b14d81bfa0a8c.tar.gz
samba-974223b927119a1cd38fd58b215b14d81bfa0a8c.tar.bz2
samba-974223b927119a1cd38fd58b215b14d81bfa0a8c.zip
Fix bug 6336: "net groupmap set" segfaults
Diffstat (limited to 'source3/utils/net_groupmap.c')
-rw-r--r--source3/utils/net_groupmap.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source3/utils/net_groupmap.c b/source3/utils/net_groupmap.c
index b160d840a0..0a3a2972e4 100644
--- a/source3/utils/net_groupmap.c
+++ b/source3/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;