]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
* elf/dl-lookup.c (_dl_lookup_symbol): Avoid sizeof dynamic auto array
authorRoland McGrath <roland@gnu.org>
Wed, 17 Jul 1996 03:34:06 +0000 (03:34 +0000)
committerRoland McGrath <roland@gnu.org>
Wed, 17 Jul 1996 03:34:06 +0000 (03:34 +0000)
because that is broken on alpha.

ChangeLog
elf/dl-lookup.c

index 45b890aae9541574b8760ed929e45bf19d895c0e..3959781d03a9b65cfc572a974cc19cf4f39ca678 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 Tue Jul 16 16:43:58 1996  Roland McGrath  <roland@delasyd.gnu.ai.mit.edu>
 
+       * 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.
 
index a1a964fa6a031d8d6e3079fc74aa5ade3cf123b2..44f91fca7d8ac85a9fd83ee82f1cc29db4819141 100644 (file)
@@ -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);
     }