about summary refs log tree commit diff
path: root/elf/dl-error.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1996-08-26 10:28:45 +0000
committerUlrich Drepper <drepper@redhat.com>1996-08-26 10:28:45 +0000
commitdcf0671d905200c449f92ead6cf43c184637a0d5 (patch)
tree91dc217311db41e89545d487b991865a6433205e /elf/dl-error.c
parent4884d0f03c5a3b3d2459655e76fa2d0684d389dc (diff)
downloadglibc-dcf0671d905200c449f92ead6cf43c184637a0d5.tar.gz
glibc-dcf0671d905200c449f92ead6cf43c184637a0d5.tar.xz
glibc-dcf0671d905200c449f92ead6cf43c184637a0d5.zip
handle password file locking. cvs/libc-960826
Diffstat (limited to 'elf/dl-error.c')
-rw-r--r--elf/dl-error.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/elf/dl-error.c b/elf/dl-error.c
index 737bba7421..2eaa7e03d1 100644
--- a/elf/dl-error.c
+++ b/elf/dl-error.c
@@ -46,8 +46,13 @@ _dl_signal_error (int errcode,
 
   if (catch)
     {
-      /* We are inside _dl_catch_error.  Return to it.  */
-      catch->errstring = errstring;
+      /* We are inside _dl_catch_error.  Return to it.  We have to
+	 duplicate the error string since it might be allocated on the
+	 stack.  */
+      size_t len = strlen (errstring) + 1;
+      catch->errstring = malloc (len);
+      if (catch->errstring != NULL)
+	memcpy (catch->errstring, errstring, len);
       catch->objname = objname;
       longjmp (catch->env, errcode ?: -1);
     }