]> granicus.if.org Git - php/commitdiff
- Fix possible crashes in 64bit builds caused by usage of int instead of size_t
authorJani Taskinen <jani@php.net>
Wed, 17 Nov 2010 14:09:46 +0000 (14:09 +0000)
committerJani Taskinen <jani@php.net>
Wed, 17 Nov 2010 14:09:46 +0000 (14:09 +0000)
main/main.c

index 223830aab56a8f200c4e176181c08e74cd897515..bb03f1b16f2c40faad132b3367d06e2c833b0b5e 100644 (file)
@@ -623,8 +623,9 @@ PHPAPI void php_verror(const char *docref, const char *params, int type, const c
 
        /* 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 @@ PHPAPI void php_verror(const char *docref, const char *params, int type, const c
        }
 
        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 @@ static void php_error_cb(int type, const char *error_filename, const uint error_
 
                                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);