aboutsummaryrefslogtreecommitdiff
path: root/ld/configure
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2023-08-03 08:40:12 +0930
committerAlan Modra <amodra@gmail.com>2023-08-03 21:19:54 +0930
commiteaf1fa5ac5972efe5041c835c3ac9fec3c6aa06c (patch)
tree8534db6617357257593dabfdc483f8c819e0a47e /ld/configure
parent23f6f86ca03e87883150d21a6ac3c00590ea450a (diff)
downloadfsf-binutils-gdb-eaf1fa5ac5972efe5041c835c3ac9fec3c6aa06c.zip
fsf-binutils-gdb-eaf1fa5ac5972efe5041c835c3ac9fec3c6aa06c.tar.gz
fsf-binutils-gdb-eaf1fa5ac5972efe5041c835c3ac9fec3c6aa06c.tar.bz2
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.
Diffstat (limited to 'ld/configure')
-rwxr-xr-xld/configure10
1 files changed, 10 insertions, 0 deletions
diff --git a/ld/configure b/ld/configure
index 33e09fc..a4fcb9b 100755
--- a/ld/configure
+++ b/ld/configure
@@ -16771,6 +16771,16 @@ fi
cat >>confdefs.h <<_ACEOF
#define HAVE_DECL_ENVIRON $ac_have_decl
_ACEOF
+ac_fn_c_check_decl "$LINENO" "stpcpy" "ac_cv_have_decl_stpcpy" "$ac_includes_default"
+if test "x$ac_cv_have_decl_stpcpy" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STPCPY $ac_have_decl
+_ACEOF