]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
2618. [bug] The sdb and sdlz db_interator_seek() methods could
authorMark Andrews <marka@isc.org>
Fri, 26 Jun 2009 06:21:03 +0000 (06:21 +0000)
committerMark Andrews <marka@isc.org>
Fri, 26 Jun 2009 06:21:03 +0000 (06:21 +0000)
                        loop infinitely. [RT #19847]

CHANGES
lib/dns/sdb.c
lib/dns/sdlz.c

diff --git a/CHANGES b/CHANGES
index 64deb4ebb02ae82280d98b1bd8f9c800957111eb..20170d48682f887bd880fd21164fac2044722b15 100644 (file)
--- 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]
 
index 2777ca359ea412514ba3015106de6ad5b2b2810a..6dc02f351a1134b972dd92f9016f6c832570e0cc 100644 (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);
 }
 
index 163791a9288c2efd5b1a90d6f54b7e4f52ade973..176470d8757b3b47edf07ea39a53f3759969ae63 100644 (file)
@@ -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);
 }