On 29.08.2006 16:54, Stefan Esser wrote:
  fix win32 build
  EG(precision) can be changed in runtime, even in php_implode() (hint: 
__toString()), so please think twice before optimizing
... case IS_DOUBLE: {
-                               char stmp[MAX_LENGTH_OF_DOUBLE + EG(precision) 
+ 1];
+                               char *stmp;
+                               stmp = emalloc(MAX_LENGTH_OF_DOUBLE + 
EG(precision) + 1);
                                str_len = sprintf(stmp, "%.*G", (int) 
EG(precision), Z_DVAL_PP(tmp));
                                smart_str_appendl(&implstr, stmp, str_len);
+                               efree(stmp);
Well as usual critizicing the commits of others but not seeing the
obvious integer overflow in memory allocation in your own commit...

Your imagination is just fabulous.
"so please think twice before optimizing" means "be careful and do not try to 
optimize this code, even though it looks like it can be optimized by moving the emalloc() call to 
the beginning of the function".
Please try to understand what I've really said before posting your comments 
again.

--
Wbr, Antony Dovgal

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to