]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* libltdl/ltdl.c (lt_dlexit): Make sure that 'cur' is not NULL
authorDave Brolley <brolley@redhat.com>
Sun, 28 Jan 2007 14:55:37 +0000 (14:55 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sun, 28 Jan 2007 14:55:37 +0000 (14:55 +0000)
before checking that it is still in the list.

ChangeLog
libltdl/ltdl.c

index 12594448c1d742663a85fb88b4cef3ede954656c..484cdf766bb564d5562c8074ffbf2f7515d88f43 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-01-28  Dave Brolley  <brolley@redhat.com>
+
+       * libltdl/ltdl.c (lt_dlexit): Make sure that 'cur' is not NULL
+       before checking that it is still in the list.
+
 2007-01-28  Mike Frysinger  <vapier@gentoo.org>
 
        * ltmain.in (link mode): Pass through `-p' and `-fprofile-*' for
index be30df4beef6356638445c85754b015127ca74a9..5435c31e16c08c06fc42b3a9dc8e53cb929689f5 100644 (file)
@@ -2341,6 +2341,19 @@ lt_dlexit ()
              lt_dlhandle tmp = cur;
              cur = cur->next;
              if (!LT_DLIS_RESIDENT (tmp))
+                 /* Make sure that the handle pointed to by 'cur' still exists.
+                    lt_dlclose recursively closes dependent libraries which removes
+                    them from the linked list.  One of these might be the one
+                    pointed to by 'cur'.  */
+                 if (cur)
+                   {
+                     for (tmp = handles; tmp; tmp = tmp->next)
+                       if (tmp == cur)
+                         break;
+                     if (! tmp)
+                       cur = handles;
+                   }
+
                saw_nonresident = 1;
              if (!LT_DLIS_RESIDENT (tmp) && tmp->info.ref_count <= level)
                {