From def515a241c013d38e1adc98dd83acce4303cb13 Mon Sep 17 00:00:00 2001 From: Jian Wan Date: Thu, 17 Jan 2019 15:19:53 +1100 Subject: [PATCH] fix segfault when pipe --- configure | 4 ++-- configure.in | 4 ++-- contrib/ipv6calc.spec | 2 +- ipv6calc/ipv6calc.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/configure b/configure index 434c2897..85a820ae 100755 --- a/configure +++ b/configure @@ -3076,7 +3076,7 @@ if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes + ac_c_werror_flag=no ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4196,7 +4196,7 @@ if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: *** CFLAGS supported: -Werror=format-security" >&5 $as_echo "*** CFLAGS supported: -Werror=format-security" >&6; } - CFLAGS_EXTRA="-Wformat -Werror -Werror=format-security" + CFLAGS_EXTRA="-Wformat -Werror=format-security" else diff --git a/configure.in b/configure.in index 9534dd3d..8a78efd5 100644 --- a/configure.in +++ b/configure.in @@ -77,13 +77,13 @@ AC_ARG_ENABLE([compiler-warning-to-error], ],[ AC_MSG_RESULT([*** check for CFLAGS: -Werror=format-security]) CFLAGS_SAVE="$CFLAGS" - CFLAGS="$CFLAGS -Wformat -Werror -Werror=format-security" + CFLAGS="$CFLAGS -Wformat -Werror=format-security" AC_COMPILE_IFELSE([AC_LANG_PROGRAM( [[int a=1;]]) ], [ AC_MSG_RESULT([*** CFLAGS supported: -Werror=format-security]) - CFLAGS_EXTRA="-Wformat -Werror -Werror=format-security" + CFLAGS_EXTRA="-Wformat -Werror=format-security" ], [ AC_MSG_WARN([*** missing CFLAGS support: -Werror=format-security]) diff --git a/contrib/ipv6calc.spec b/contrib/ipv6calc.spec index 87115636..f613b8ea 100644 --- a/contrib/ipv6calc.spec +++ b/contrib/ipv6calc.spec @@ -1,7 +1,7 @@ # Project : ipv6calc # File : contrib/ipv6calc.spec # Copyright : 2001-2018 by Peter Bieringer -# $Id: 0df17afba6c435c28b3c3d0323e0739d2f88678e $ +# $Id: 14c55e02c404183d20337376ae3a55f42ffaab0e $ # enable the following for intermediate builds #%#define gitcommit d3a4108cb7aeb6f731bb07989f91d8a7f449f0f0 diff --git a/ipv6calc/ipv6calc.c b/ipv6calc/ipv6calc.c index 796caff5..64d80560 100644 --- a/ipv6calc/ipv6calc.c +++ b/ipv6calc/ipv6calc.c @@ -884,7 +884,7 @@ int main(int argc, char *argv[]) { DEBUGPRINT_WA(DEBUG_ipv6calc_general, "Token 1: '%s'", input1); /* check for second token */ - if (*ptrptr[0] != '\0') { + if (ptrptr && ptrptr[0] && *ptrptr[0] != '\0') { input2 = *ptrptr; inputc = 2;