NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: xsrc/58872: libXfont and libXfont2 fixes with ssp [patch]



The following reply was made to PR xsrc/58872; it has been noted by GNATS.

From: Nat Sloss <nathanialsloss%yahoo.com.au@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: xsrc/58872: libXfont and libXfont2 fixes with ssp [patch]
Date: Wed, 4 Dec 2024 10:07:24 +1100

 --Boundary-00=_t84Tnan2FFL4K1F
 Content-Type: Text/Plain;
   charset="iso-8859-15"
 Content-Transfer-Encoding: 7bit
 
 Attached is the patch:
 
 Best regards,
 
 Nat
 
 --Boundary-00=_t84Tnan2FFL4K1F
 Content-Type: text/x-patch;
   charset="ISO-8859-1";
   name="libXfont.diff"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
 	filename="libXfont.diff"
 
 diff -r 5c99459784f3 external/mit/libXfont/dist/src/util/fontxlfd.c
 --- a/external/mit/libXfont/dist/src/util/fontxlfd.c	Sun Nov 17 21:24:37 2024 +0000
 +++ b/external/mit/libXfont/dist/src/util/fontxlfd.c	Wed Dec 04 10:04:51 2024 +1100
 @@ -260,10 +260,13 @@ xlfd_round_double(double x)
  	 * If not IEEE 754:  Let printf() do it for you.
  	 */
  
 +	volatile double result;
  	char buffer[40];
  
 -	sprintf(buffer, "%.*lg", XLFD_NDIGITS, x);
 -	return atof(buffer);
 +	snprintf(buffer, sizeof(buffer), "%.*lg", XLFD_NDIGITS, x);
 +	result = atof(buffer);
 +
 +	return result;
      }
  }
  
 diff -r 5c99459784f3 external/mit/libXfont2/dist/src/util/fontxlfd.c
 --- a/external/mit/libXfont2/dist/src/util/fontxlfd.c	Sun Nov 17 21:24:37 2024 +0000
 +++ b/external/mit/libXfont2/dist/src/util/fontxlfd.c	Wed Dec 04 10:04:51 2024 +1100
 @@ -250,10 +250,13 @@ xlfd_round_double(double x)
  	 * If not IEEE 754:  Let printf() do it for you.
  	 */
  
 +	volatile double result;
  	char buffer[40];
  
  	snprintf(buffer, sizeof(buffer), "%.*lg", XLFD_NDIGITS, x);
 -	return atof(buffer);
 +	result =  atof(buffer);
 +
 +	return result;
      }
  }
  
 
 --Boundary-00=_t84Tnan2FFL4K1F--
 


Home | Main Index | Thread Index | Old Index