* libltdl/ltdl.c (find_module): initialize filename if dir is NULL

Reported by Godmar Back <gback@cs.utah.edu>

1999-02-04  Godmar Back  <gback@cs.utah.edu>

* libltdl/ltdl.c (lt_dlopenext): missing space for terminator when
allocating memory for shlib_ext
This commit is contained in:
Alexandre Oliva 1999-02-04 12:39:24 +00:00 committed by Alexandre Oliva
parent 3fe7947205
commit 425940e0ab
2 changed files with 17 additions and 3 deletions

View File

@ -1,7 +1,17 @@
1999-02-04 Alexandre Oliva <oliva@dcc.unicamp.br>
* libltdl/ltdl.c (find_module): initialize filename if dir is NULL
Reported by Godmar Back <gback@cs.utah.edu>
1999-02-04 Godmar Back <gback@cs.utah.edu>
* libltdl/ltdl.c (lt_dlopenext): missing space for terminator when
allocating memory for shlib_ext
1999-02-03 Alexandre Oliva <oliva@dcc.unicamp.br>
* ltdl.c (lt_dlopenext): tmp would be trashed if shlib_ext was
longer than 3 characters
* libltdl/ltdl.c (lt_dlopenext): tmp would be trashed if shlib_ext
was longer than 3 characters
1999-02-02 Gary V. Vaughan <gvaughan@oranda.demon.co.uk>

View File

@ -840,6 +840,8 @@ find_module (handle, dir, libdir, dlname, old_name, installed)
}
if (dir)
strcpy(filename, dir);
else
*filename = 0;
strcat(filename, objdir);
strcat(filename, dlname);
@ -857,6 +859,8 @@ find_module (handle, dir, libdir, dlname, old_name, installed)
+ strlen(dlname) + 1);
if (dir)
strcpy(filename, dir);
else
*filename = 0;
strcat(filename, dlname);
ret = tryall_dlopen(handle, filename) == 0;
free(filename);
@ -1240,7 +1244,7 @@ lt_dlopenext (filename)
/* try "filename.EXT" */
if (strlen(shlib_ext) > 3) {
free(tmp);
tmp = (char*) malloc(len + strlen(shlib_ext));
tmp = (char*) malloc(len + strlen(shlib_ext) + 1);
if (!tmp) {
last_error = memory_error;
return 0;