r9774: r11605@blu: tridge | 2005-08-30 12:02:19 +1000
authorAndrew Tridgell <tridge@samba.org>
Tue, 30 Aug 2005 01:58:03 +0000 (01:58 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:34:59 +0000 (13:34 -0500)
 make sure we don't walk off the end of the hash array

source/lib/tdb/common/tdb.c

index d6861efe134b04e390875cd3205df844738ce049..3477d7e4be79ba3b2f0ffb31e77601e097819805 100644 (file)
@@ -1287,6 +1287,9 @@ static int tdb_next_lock(TDB_CONTEXT *tdb, struct tdb_traverse_lock *tlock,
                                                break;
                                        }
                                }
+                               if (tlock->hash == tdb->header.hash_size) {
+                                       continue;
+                               }
                        } else {
                                if (ofs_read(tdb, TDB_HASH_TOP(tlock->hash), &off) == 0 &&
                                    off == 0) {