Skip to content

Commit

Permalink
Update.
Browse files Browse the repository at this point in the history
	* elf/dl-load.c (fillin_rpath): Make local copy of where string
	since the object being loaded can be unloaded.
  • Loading branch information
Ulrich Drepper committed Aug 30, 2000
1 parent b4f95b7 commit 32ee8d9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
2000-08-30 Ulrich Drepper <drepper@redhat.com>

* elf/dl-load.c (fillin_rpath): Make local copy of where string
since the object being loaded can be unloaded.

* iconvdata/Makefile (tests): Add tst-loading.
* iconvdata/tst-loading.c: New file.

Expand Down
8 changes: 6 additions & 2 deletions elf/dl-load.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,10 +408,12 @@ fillin_rpath (char *rpath, struct r_search_path_elem **result, const char *sep,
{
size_t cnt;
enum r_dir_status init_val;
size_t where_len = strlen (where) + 1;

/* It's a new directory. Create an entry and add it. */
dirp = (struct r_search_path_elem *)
malloc (sizeof (*dirp) + ncapstr * sizeof (enum r_dir_status));
malloc (sizeof (*dirp) + ncapstr * sizeof (enum r_dir_status)
+ where_len);
if (dirp == NULL)
_dl_signal_error (ENOMEM, NULL,
N_("cannot create cache for search path"));
Expand All @@ -430,7 +432,9 @@ fillin_rpath (char *rpath, struct r_search_path_elem **result, const char *sep,
dirp->status[cnt] = init_val;

dirp->what = what;
dirp->where = where;
dirp->where = memcpy ((char *) dirp + sizeof (*dirp)
+ ncapstr * sizeof (enum r_dir_status),
where, where_len);

dirp->next = all_dirs;
all_dirs = dirp;
Expand Down

0 comments on commit 32ee8d9

Please sign in to comment.