[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: libltdl apparently totally broken
From: |
stefan |
Subject: |
Re: libltdl apparently totally broken |
Date: |
Tue, 6 Nov 2001 19:35:04 +0100 (CET) |
Paul Davis address@hidden wrote:
> i recently upgraded to libtool 1.4.2, only to find myself back in a
> place i'd rather not be: cursing expletives at libtool. a program that
> uses ltdl extensively now crashes without fail. a quick check in gdb
> reveals that
>
> 1) its easy to cause a NULL dirname argument to be sent
> to tryall_dlopen_module(), causing a segv
> 2) it seems remarkably easy to cause handle->loader to be
> unset on an apparently successful call to lt_dlopen(),
> causing a segv later.
I ran into this either. The following patch removes the bug once for a
while:
=======================================================================
@@ -1955,8 +1962,9 @@
assert (strchr (dirname, LT_DIRSEP_CHAR) == 0);
#endif
- if (dirname[dirname_len -1] == '/')
- --dirname_len;
+ if (dirname_len > 0)
+ if (dirname[dirname_len -1] == '/')
+ --dirname_len;
filename_len = dirname_len + 1 + LT_STRLEN (dlname);
/* Allocate memory, and combine DIRNAME and MODULENAME into it.
=======================================================================
Cheers,
address@hidden