Check for null tdb context in tdb_exists()
authorTim Potter <tpot@samba.org>
Wed, 1 Mar 2000 01:10:25 +0000 (01:10 +0000)
committerTim Potter <tpot@samba.org>
Wed, 1 Mar 2000 01:10:25 +0000 (01:10 +0000)
(This used to be commit bbacdb834f9c8f8c34368664def42dabe78d90c9)

source3/tdb/tdb.c

index c7b70aa15338f3d9058ae2d17e8d6a13dd84b2cb..388f4f419fe63e3ffcb0a20de84328dfaefa3a6c 100644 (file)
@@ -703,6 +703,13 @@ int tdb_exists(TDB_CONTEXT *tdb, TDB_DATA key)
        tdb_off rec_ptr;
        struct list_struct rec;
        
+        if (tdb == NULL) {
+#ifdef TDB_DEBUG
+            printf("tdb_exists() called with null context\n");
+#endif
+            return 0;
+        }
+
        /* find which hash bucket it is in */
        hash = tdb_hash(&key);