httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject cvs commit: apache-1.3/src/ap ap_snprintf.c
Date Thu, 10 May 2001 14:04:25 GMT
jim         01/05/10 07:04:24

  Modified:    src      CHANGES Configure
               src/ap   ap_snprintf.c
  Log:
  Prevent nasty problems when platforms lack isinf() and/or isnan().
  
  Revision  Changes    Path
  1.1680    +3 -0      apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1679
  retrieving revision 1.1680
  diff -u -r1.1679 -r1.1680
  --- CHANGES	2001/05/10 04:07:55	1.1679
  +++ CHANGES	2001/05/10 14:04:13	1.1680
  @@ -1,5 +1,8 @@
   Changes with Apache 1.3.20
   
  +  *) Autodetect if platforms have isnan() and/or isinf() for use in
  +     ap_snprintf.c. [Jim Jagielski]
  +
     *) Correct a vulnerability in the Win32 and OS2 ports, by which a 
        client submitting a carefully constructed URI could cause a GP
        (segment) fault in the child process, which would have to be
  
  
  
  1.424     +35 -0     apache-1.3/src/Configure
  
  Index: Configure
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/Configure,v
  retrieving revision 1.423
  retrieving revision 1.424
  diff -u -r1.423 -r1.424
  --- Configure	2001/04/02 09:22:04	1.423
  +++ Configure	2001/05/10 14:04:16	1.424
  @@ -2190,6 +2190,41 @@
   ####################################################################
   ## More building ap_config_auto.h
   ##
  +## Check for availability of isinf() and isnan()
  +##
  +if ./helpers/TestCompile func isinf ; then
  +    echo "" >>$AP_CONFIG_AUTO_H
  +    echo "/* determine: isinf() found in libc */ " >>$AP_CONFIG_AUTO_H
  +    echo "#ifndef HAVE_ISINF" >>$AP_CONFIG_AUTO_H
  +    echo "#define HAVE_ISINF 1" >>$AP_CONFIG_AUTO_H
  +    echo "#endif" >>$AP_CONFIG_AUTO_H
  +elif ./helpers/TestCompile lib m isinf ; then
  +    echo "" >>$AP_CONFIG_AUTO_H
  +    echo "/* determine: isinf() found in libm */ " >>$AP_CONFIG_AUTO_H
  +    echo "#ifndef HAVE_ISINF" >>$AP_CONFIG_AUTO_H
  +    echo "#define HAVE_ISINF 1" >>$AP_CONFIG_AUTO_H
  +    echo "#endif" >>$AP_CONFIG_AUTO_H
  +    LIBS="$LIBS -lm"
  +    ADDED_LM="yes"
  +fi
  +
  +if ./helpers/TestCompile func isnan ; then
  +    echo "" >>$AP_CONFIG_AUTO_H
  +    echo "/* determine: isnan() found in libc */ " >>$AP_CONFIG_AUTO_H
  +    echo "#ifndef HAVE_ISNAN" >>$AP_CONFIG_AUTO_H
  +    echo "#define HAVE_ISNAN 1" >>$AP_CONFIG_AUTO_H
  +    echo "#endif" >>$AP_CONFIG_AUTO_H
  +elif ./helpers/TestCompile lib m isnan ; then
  +    echo "" >>$AP_CONFIG_AUTO_H
  +    echo "/* determine: isnan() found in libm */ " >>$AP_CONFIG_AUTO_H
  +    echo "#ifndef HAVE_ISNAN" >>$AP_CONFIG_AUTO_H
  +    echo "#define HAVE_ISNAN 1" >>$AP_CONFIG_AUTO_H
  +    echo "#endif" >>$AP_CONFIG_AUTO_H
  +    if [ "x$ADDED_LM" != "xyes" ]; then
  +        LIBS="$LIBS -lm"
  +    fi
  +fi
  +
   ## We check for the endianess of the machine
   ##
   AP_BYTE_ORDER=`./helpers/TestCompile -r byteorder`
  
  
  
  1.46      +8 -2      apache-1.3/src/ap/ap_snprintf.c
  
  Index: ap_snprintf.c
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/ap/ap_snprintf.c,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- ap_snprintf.c	2001/05/03 02:24:59	1.45
  +++ ap_snprintf.c	2001/05/10 14:04:22	1.46
  @@ -934,15 +934,21 @@
   		/*
   		 * * We use &num_buf[ 1 ], so that we have room for the sign
   		 */
  +#ifdef HAVE_ISNAN
   		if (isnan(fp_num)) {
   		    s = "nan";
   		    s_len = 3;
   		}
  -		else if (isinf(fp_num)) {
  +		else
  +#endif
  +#ifdef HAVE_ISINF
  +		if (isinf(fp_num)) {
   		    s = "inf";
   		    s_len = 3;
   		}
  -		else {
  +		else
  +#endif
  +		{
   		    s = conv_fp(*fmt, fp_num, alternate_form,
   			    (adjust_precision == NO) ? FLOAT_DIGITS : precision,
   				&is_negative, &num_buf[1], &s_len);
  
  
  

Mime
View raw message