ld: sprintf sanitizer null destination pointer
authorAlan Modra <amodra@gmail.com>
Wed, 2 Aug 2023 23:10:12 +0000 (08:40 +0930)
committerAlan Modra <amodra@gmail.com>
Thu, 3 Aug 2023 11:49:54 +0000 (21:19 +0930)
commiteaf1fa5ac5972efe5041c835c3ac9fec3c6aa06c
tree8534db6617357257593dabfdc483f8c819e0a47e
parent23f6f86ca03e87883150d21a6ac3c00590ea450a
ld: sprintf sanitizer null destination pointer

* configure.ac (stpcpy): AC_CHECK_DECLS.
* sysdep.h (stpcpy): Add fallback declaraion.
* config.in: Regenerate.
* configure: Regenerate.
* emultempl/pe.em (open_dynamic_archive): Use
stpcpy rather than sprintf plus strlen.
* emultempl/pep.em (open_dynamic_archive): Likewise.
* emultempl/xtensaelf.em (elf_xtensa_before_allocation): Use
auto rather than malloc'd buffer.  Use sprintf count.
* ldelf.c (ldelf_search_needed): Use memcpy in place of sprintf.
* pe-dll.c (pe_process_import_defs): Use string already formed
for alias match rather than recreating.
ld/config.in
ld/configure
ld/configure.ac
ld/emultempl/pe.em
ld/emultempl/pep.em
ld/emultempl/xtensaelf.em
ld/ldelf.c
ld/pe-dll.c
ld/sysdep.h