Attempt to fix bug #6386 - Samba Panic triggered by Sophos Control Centre.
authorJeremy Allison <jra@samba.org>
Fri, 22 May 2009 00:27:25 +0000 (17:27 -0700)
committerKarolin Seeger <kseeger@samba.org>
Tue, 26 May 2009 07:39:46 +0000 (09:39 +0200)
Don't indirect a potentially null pointer.
Jeremy.
(cherry picked from commit b4f6bb84d1bcd5a09d7c20c2a7dac0bfb11f199f)

source3/groupdb/mapping_ldb.c

index a162c194d6e353264d1cd53effed393f7442c941..fffc684cdcfdd38096876ccdfe144bdd457267dd 100644 (file)
@@ -276,7 +276,7 @@ static bool get_group_map_from_ntname(const char *name, GROUP_MAP *map)
 
        ret = ldb_search(ldb, talloc_tos(), &res, NULL, LDB_SCOPE_SUBTREE,
                         NULL, "(&(ntName=%s)(objectClass=groupMap))", name);
-       if (ret != LDB_SUCCESS || res->count != 1) {
+       if (ret != LDB_SUCCESS || (res && res->count != 1)) {
                goto failed;
        }