From: Roland McGrath Date: Wed, 17 Jul 1996 03:34:06 +0000 (+0000) Subject: * elf/dl-lookup.c (_dl_lookup_symbol): Avoid sizeof dynamic auto array X-Git-Tag: cvs/libc-960717~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=184b7b466a34e1e7f3c4824109e66bc1e7fdfe23;p=platform%2Fupstream%2Fglibc.git * elf/dl-lookup.c (_dl_lookup_symbol): Avoid sizeof dynamic auto array because that is broken on alpha. --- diff --git a/ChangeLog b/ChangeLog index 45b890a..3959781 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ Tue Jul 16 16:43:58 1996 Roland McGrath + * elf/dl-lookup.c (_dl_lookup_symbol): Avoid sizeof dynamic auto array + because that is broken on alpha. + * sysdeps/mach/hurd/mmap.c: Use same inheritance arg in second vm_map call as in first. diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c index a1a964f..44f91fc 100644 --- a/elf/dl-lookup.c +++ b/elf/dl-lookup.c @@ -134,10 +134,10 @@ _dl_lookup_symbol (const char *undef_name, const ElfW(Sym) **ref, { /* We could find no value for a strong reference. */ const char msg[] = "undefined symbol: "; - char buf[sizeof msg + strlen (undef_name)]; + const size_t len = strlen (undef_name); + char buf[sizeof msg + len]; memcpy (buf, msg, sizeof msg - 1); - memcpy (&buf[sizeof msg - 1], undef_name, - sizeof buf - sizeof msg + 1); + memcpy (&buf[sizeof msg - 1], undef_name, len + 1); _dl_signal_error (0, reference_name, buf); }