nss_wrapper: fix segfault in print_group() in the testsuite
authorMichael Adam <obnox@samba.org>
Thu, 18 Feb 2010 23:33:45 +0000 (00:33 +0100)
committerMichael Adam <obnox@samba.org>
Thu, 18 Feb 2010 23:37:41 +0000 (00:37 +0100)
Running
'TESTS=posix_s3 POSIX_SUBTESTS="RPC-SAMR-LARGE-DC LOCAL-NSS-WRAPPER" make test'
from s3 made smbtorture4 crash on my box.

Michael

lib/nss_wrapper/testsuite.c

index d6b48393182ab8bc7c21d7dbba827d4dec95a6df..da1a2675a2726c930804327fbf46bf0bf9a64e31 100644 (file)
@@ -175,7 +175,7 @@ static void print_group(struct group *grp)
               grp->gr_passwd,
               (unsigned long)grp->gr_gid);
 
-       if (!grp->gr_mem[0]) {
+       if ((grp->gr_mem == NULL) || !grp->gr_mem[0]) {
                printf("\n");
                return;
        }