php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #62525
Patch snprintf.patch revision 2012-07-10 17:06 UTC by perryjp at gmail dot com

Patch snprintf.patch for Reproducible crash Bug #62525

Patch version 2012-07-10 17:06 UTC

Return to Bug #62525 | Download this patch
Patch Revisions:

Developer: perryjp@gmail.com

diff --git a/main/snprintf.c b/main/snprintf.c
index cd038d0..113e220 100644
--- a/main/snprintf.c
+++ b/main/snprintf.c
@@ -94,7 +94,7 @@ static char * __cvt(double value, int ndigit, int *decpt, int *sign, int fmode,
 			*decpt = 0;
 			c = *p;
 			zend_freedtoa(p);
-			return(c == 'I' ? "INF" : "NAN");
+			return(c == 'I' ? strdup("INF") : strdup("NAN"));
 		}
 		/* Make a local copy and adjust rve to be in terms of s */
 		if (pad && fmode) {
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 06 17:01:34 2024 UTC