From ab88e603100738cb71151478dec11f1b323b3860 Mon Sep 17 00:00:00 2001 From: Jani Taskinen Date: Wed, 17 Nov 2010 14:09:46 +0000 Subject: [PATCH] - Fix possible crashes in 64bit builds caused by usage of int instead of size_t --- main/main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/main/main.c b/main/main.c index 223830aab5..bb03f1b16f 100644 --- a/main/main.c +++ b/main/main.c @@ -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
\n%s: %s in %s on line %d
\n%s", STR_PRINT(prepend_string), error_type_str, buf, error_filename, error_lineno, STR_PRINT(append_string)); efree(buf); -- 2.50.1