mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-21 20:40:05 +00:00
elf: Replace strcpy
call with memcpy
[BZ #29454]
GCC normally does this optimization for us in strlen_pass::handle_builtin_strcpy but only for optimized build. To avoid needing to include strcpy.S in the rtld build to support the debug build, just do the optimization by hand.
This commit is contained in:
parent
8bc3f94a06
commit
483cfe1a6a
@ -509,8 +509,9 @@ _dl_load_cache_lookup (const char *name)
|
||||
we are accessing. Therefore we must make the copy of the
|
||||
mapping data without using malloc. */
|
||||
char *temp;
|
||||
temp = alloca (strlen (best) + 1);
|
||||
strcpy (temp, best);
|
||||
size_t best_len = strlen (best) + 1;
|
||||
temp = alloca (best_len);
|
||||
memcpy (temp, best, best_len);
|
||||
return __strdup (temp);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user