From dcf0671d905200c449f92ead6cf43c184637a0d5 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 26 Aug 1996 10:28:45 +0000 Subject: handle password file locking. --- elf/dl-error.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'elf/dl-error.c') 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); } -- cgit v1.2.3