From 01dbc4fc00adc933af96e88bfce95c07ef1f3c39 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Fri, 26 Jun 2009 06:21:03 +0000 Subject: [PATCH] 2618. [bug] The sdb and sdlz db_interator_seek() methods could loop infinitely. [RT #19847] --- CHANGES | 5 ++++- lib/dns/sdb.c | 6 ++++-- lib/dns/sdlz.c | 6 ++++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index 64deb4ebb0..20170d4868 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ +2618. [bug] The sdb and sdlz db_interator_seek() methods could + loop infinitely. [RT #19847] + 2617. [bug] ifconfig.sh failed to emit an error message when run from the wrong location. [RT #19375] -ZZ + 2616. [bug] 'host' used the nameservers from resolv.conf even when a explicit nameserver was specified. [RT #19852] diff --git a/lib/dns/sdb.c b/lib/dns/sdb.c index 2777ca359e..6dc02f351a 100644 --- a/lib/dns/sdb.c +++ b/lib/dns/sdb.c @@ -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); } diff --git a/lib/dns/sdlz.c b/lib/dns/sdlz.c index 163791a928..176470d875 100644 --- a/lib/dns/sdlz.c +++ b/lib/dns/sdlz.c @@ -50,7 +50,7 @@ * USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: sdlz.c,v 1.20 2009/04/21 23:48:04 tbox Exp $ */ +/* $Id: sdlz.c,v 1.21 2009/06/26 06:21:03 marka Exp $ */ /*! \file */ @@ -1117,9 +1117,11 @@ dbiterator_seek(dns_dbiterator_t *iterator, dns_name_t *name) { sdlz_dbiterator_t *sdlziter = (sdlz_dbiterator_t *)iterator; sdlziter->current = ISC_LIST_HEAD(sdlziter->nodelist); - while (sdlziter->current != NULL) + while (sdlziter->current != NULL) { if (dns_name_equal(sdlziter->current->name, name)) return (ISC_R_SUCCESS); + sdlziter->current = ISC_LIST_NEXT(sdlziter->current, link); + } return (ISC_R_NOTFOUND); }