]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
* nscd/connections.c (verify_persistent_db): Recognize circular lists.
authorUlrich Drepper <drepper@redhat.com>
Sat, 6 Oct 2007 19:03:13 +0000 (19:03 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sat, 6 Oct 2007 19:03:13 +0000 (19:03 +0000)
ChangeLog
nscd/connections.c

index 65c96fe8a663924735e3d0c1793352ed3288d3ad..24ca28fdd58f98f4836d8a29629c690d4c20a8b8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2007-10-06  Ulrich Drepper  <drepper@redhat.com>
 
        * nscd/nscd_helper.c (__nscd_cache_search): Prevent endless loops.
+       * nscd/connections.c (verify_persistent_db): Recognize circular lists.
 
        [BZ #4407]
        * sysdeps/ieee754/dbl-64/e_lgamma_r.c: Fix *signgamp for -0.0.
index 0687a2661f79f9c7260b44b4a040ef8cef31f85f..2572a42ee7fec85e7e1bc60910ab09e34206aa8a 100644 (file)
@@ -378,7 +378,8 @@ verify_persistent_db (void *mem, struct database_pers_head *readhead, int dbnr)
   nscd_ssize_t he_cnt = 0;
   for (nscd_ssize_t cnt = 0; cnt < head->module; ++cnt)
     {
-      ref_t work = head->array[cnt];
+      ref_t first = head->array[cnt];
+      ref_t work = first;
 
       while (work != ENDREF)
        {
@@ -437,6 +438,10 @@ verify_persistent_db (void *mem, struct database_pers_head *readhead, int dbnr)
            }
 
          work = here->next;
+
+         if (work == first)
+           /* A circular list, this must not happen.  */
+           goto fail;
        }
     }