jani                                     Wed, 17 Nov 2010 14:09:46 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=305458

Log:
- Fix possible crashes in 64bit builds caused by usage of int instead of size_t

Changed paths:
    U   php/php-src/trunk/main/main.c

Modified: php/php-src/trunk/main/main.c
===================================================================
--- php/php-src/trunk/main/main.c       2010-11-17 14:08:39 UTC (rev 305457)
+++ php/php-src/trunk/main/main.c       2010-11-17 14:09:46 UTC (rev 305458)
@@ -623,8 +623,9 @@

        /* get error text into buffer and escape for html if necessary */
        buffer_len = vspprintf(&buffer, 0, format, args);
+
        if (PG(html_errors)) {
-               int len;
+               size_t len;
                char *replace = php_escape_html_entities(buffer, buffer_len, 
&len, 0, ENT_COMPAT, NULL TSRMLS_CC);
                efree(buffer);
                buffer = replace;
@@ -682,7 +683,7 @@
        }

        if (PG(html_errors)) {
-               int len;
+               size_t len;
                char *replace = php_escape_html_entities(origin, origin_len, 
&len, 0, ENT_COMPAT, NULL TSRMLS_CC);
                efree(origin);
                origin = replace;
@@ -981,7 +982,7 @@

                                if (PG(html_errors)) {
                                        if (type == E_ERROR) {
-                                               int len;
+                                               size_t len;
                                                char *buf = 
php_escape_html_entities(buffer, buffer_len, &len, 0, ENT_COMPAT, NULL 
TSRMLS_CC);
                                                php_printf("%s<br 
/>\n<b>%s</b>:  %s in <b>%s</b> on line <b>%d</b><br />\n%s", 
STR_PRINT(prepend_string), error_type_str, buf, error_filename, error_lineno, 
STR_PRINT(append_string));
                                                efree(buf);

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

Reply via email to