[openssh-commits] [openssh] 01/01: Add a function call stackprotector tests.
git+noreply at mindrot.org
git+noreply at mindrot.org
Thu Oct 24 14:43:08 AEDT 2019
This is an automated email from the git hooks/post-receive script.
dtucker pushed a commit to branch master
in repository openssh.
commit 9239a18f96905cc1a353e861e33af093652f24e7
Author: Darren Tucker <dtucker at dtucker.net>
Date: Thu Oct 24 14:39:49 2019 +1100
Add a function call stackprotector tests.
Including a function call in the test programs for the gcc stack
protector flag tests exercises more of the compiler and makes it more
likely it'll detect problems.
---
configure.ac | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/configure.ac b/configure.ac
index 3e93c027..8bc96bb4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -213,20 +213,26 @@ if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
CFLAGS="$CFLAGS $t -Werror"
LDFLAGS="$LDFLAGS $t -Werror"
AC_LINK_IFELSE(
- [AC_LANG_PROGRAM([[ #include <stdio.h> ]],
+ [AC_LANG_PROGRAM([[
+ #include <stdio.h>
+ int func (int t) {char b[100]; snprintf(b,sizeof b,"%d",t); return t;}
+ ]],
[[
char x[256];
- snprintf(x, sizeof(x), "XXX");
+ snprintf(x, sizeof(x), "XXX%d", func(1));
]])],
[ AC_MSG_RESULT([yes])
CFLAGS="$saved_CFLAGS $t"
LDFLAGS="$saved_LDFLAGS $t"
AC_MSG_CHECKING([if $t works])
AC_RUN_IFELSE(
- [AC_LANG_PROGRAM([[ #include <stdio.h> ]],
+ [AC_LANG_PROGRAM([[
+ #include <stdio.h>
+ int func (int t) {char b[100]; snprintf(b,sizeof b,"%d",t); return t;}
+ ]],
[[
char x[256];
- snprintf(x, sizeof(x), "XXX");
+ snprintf(x, sizeof(x), "XXX%d", func(1));
]])],
[ AC_MSG_RESULT([yes])
break ],
--
To stop receiving notification emails like this one, please contact
djm at mindrot.org.
More information about the openssh-commits
mailing list