mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-14 01:00:07 +00:00
Update.
2000-12-08 Jakub Jelinek <jakub@redhat.com> * elf/dl-open.c (_dl_open): If objname points right after errstring, allocate it together with errstring using alloca. * elf/dl-error.c (_dl_signal_error): If malloc failed, set objname to "", because it might point to local stack.
This commit is contained in:
parent
8b80182964
commit
7b70fef6ae
@ -1,3 +1,10 @@
|
|||||||
|
2000-12-08 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
* elf/dl-open.c (_dl_open): If objname points right after errstring,
|
||||||
|
allocate it together with errstring using alloca.
|
||||||
|
* elf/dl-error.c (_dl_signal_error): If malloc failed, set objname
|
||||||
|
to "", because it might point to local stack.
|
||||||
|
|
||||||
2000-12-05 H.J. Lu <hjl@gnu.org>
|
2000-12-05 H.J. Lu <hjl@gnu.org>
|
||||||
|
|
||||||
* nss/Makefile (routines): Add getnssent and getnssent_r.
|
* nss/Makefile (routines): Add getnssent and getnssent_r.
|
||||||
|
@ -88,7 +88,7 @@ _dl_signal_error (int errcode, const char *objname, const char *errstring)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* This is better than nothing. */
|
/* This is better than nothing. */
|
||||||
lcatch->objname = objname;
|
lcatch->objname = "";
|
||||||
lcatch->errstring = _dl_out_of_memory;
|
lcatch->errstring = _dl_out_of_memory;
|
||||||
}
|
}
|
||||||
longjmp (lcatch->env, errcode ?: -1);
|
longjmp (lcatch->env, errcode ?: -1);
|
||||||
|
@ -391,6 +391,7 @@ _dl_open (const char *file, int mode, const void *caller)
|
|||||||
{
|
{
|
||||||
/* Some error occurred during loading. */
|
/* Some error occurred during loading. */
|
||||||
char *local_errstring;
|
char *local_errstring;
|
||||||
|
size_t len_errstring;
|
||||||
|
|
||||||
/* Remove the object from memory. It may be in an inconsistent
|
/* Remove the object from memory. It may be in an inconsistent
|
||||||
state if relocation failed, for example. */
|
state if relocation failed, for example. */
|
||||||
@ -399,7 +400,20 @@ _dl_open (const char *file, int mode, const void *caller)
|
|||||||
|
|
||||||
/* Make a local copy of the error string so that we can release the
|
/* Make a local copy of the error string so that we can release the
|
||||||
memory allocated for it. */
|
memory allocated for it. */
|
||||||
local_errstring = strdupa (errstring);
|
len_errstring = strlen (errstring) + 1;
|
||||||
|
if (objname == errstring + len_errstring)
|
||||||
|
{
|
||||||
|
len_errstring += strlen (objname) + 1;
|
||||||
|
local_errstring = alloca (len_errstring);
|
||||||
|
memcpy (local_errstring, errstring, len_errstring);
|
||||||
|
objname = local_errstring + len_errstring;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
local_errstring = alloca (len_errstring);
|
||||||
|
memcpy (local_errstring, errstring, len_errstring);
|
||||||
|
}
|
||||||
|
|
||||||
if (errstring != _dl_out_of_memory)
|
if (errstring != _dl_out_of_memory)
|
||||||
free ((char *) errstring);
|
free ((char *) errstring);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user