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)
committerJeremy Allison <jra@samba.org>
Fri, 22 May 2009 00:27:25 +0000 (17:27 -0700)
Don't indirect a potentially null pointer.
Jeremy.

source3/groupdb/mapping_ldb.c

index 7ad0bbb703efb07908e42bc94497556092daa39b..b95ba0a9f95d2be5a1145a103b5709e43525716e 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;
        }