commit 8c3dd08f6a361a24799f5ec958668e477b8127d0
Author: Jim McDonough <jmcd@samba.org>
Date:   Wed Dec 30 15:04:55 2009 -0500

    Prevent NULL dereference if group has no members

Index: source3/winbindd/winbindd_rpc.c
===================================================================
--- source3/winbindd/winbindd_rpc.c.orig
+++ source3/winbindd/winbindd_rpc.c
@@ -789,16 +789,16 @@ static NTSTATUS lookup_groupmem(struct w
         if (!NT_STATUS_IS_OK(result))
 		return result;
 
-	*num_names = rids->count;
-	rid_mem = rids->rids;
-
-	if (!*num_names) {
+	if (!rids || !rids->count) {
 		names = NULL;
 		name_types = NULL;
 		sid_mem = NULL;
 		return NT_STATUS_OK;
 	}
 
+	*num_names = rids->count;
+	rid_mem = rids->rids;
+
         /* Step #2: Convert list of rids into list of usernames.  Do this
            in bunches of ~1000 to avoid crashing NT4.  It looks like there
            is a buffer overflow or something like that lurking around
