2618. [bug] The sdb and sdlz db_interator_seek() methods could

loop infinitely. [RT #19847]
This commit is contained in:
Mark Andrews
2009-06-26 06:21:03 +00:00
parent 870332fb6d
commit 01dbc4fc00
3 changed files with 12 additions and 5 deletions

View File

@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: sdb.c,v 1.68 2009/04/21 23:48:04 tbox Exp $ */
/* $Id: sdb.c,v 1.69 2009/06/26 06:21:02 marka Exp $ */
/*! \file */
@@ -1458,9 +1458,11 @@ dbiterator_seek(dns_dbiterator_t *iterator, dns_name_t *name) {
sdb_dbiterator_t *sdbiter = (sdb_dbiterator_t *)iterator;
sdbiter->current = ISC_LIST_HEAD(sdbiter->nodelist);
while (sdbiter->current != NULL)
while (sdbiter->current != NULL) {
if (dns_name_equal(sdbiter->current->name, name))
return (ISC_R_SUCCESS);
sdbiter->current = ISC_LIST_NEXT(sdbiter->current, link);
}
return (ISC_R_NOTFOUND);
}