* libltdl/ltdl.c (try_dlopen): Fix null pointer dereference in

case the name given to lt_dlopen contains no extension.
This commit is contained in:
Ralf Wildenhues 2004-10-01 02:55:50 +00:00 committed by Gary V. Vaughan
parent 8286085803
commit 228e9808f8
2 changed files with 7 additions and 0 deletions

View File

@ -1,5 +1,8 @@
2004-09-30 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* libltdl/ltdl.c (try_dlopen): Fix null pointer dereference in
case the name given to lt_dlopen contains no extension.
* libltdl/lt_dlloader.c (lt_dlloader_remove), libltdl/ltdl.c
(tryall_dlopen, lt_dlhandle_next): Show usage of function pointers.

View File

@ -986,6 +986,10 @@ try_dlopen (lt_dlhandle *phandle, const char *filename)
assert (base_name && *base_name);
ext = strrchr (base_name, '.');
if (!ext)
{
ext = base_name + LT_STRLEN (base_name);
}
/* extract the module name from the file name */
name = MALLOC (char, ext - base_name + 1);