--- embedaddon/php/ext/filter/sanitizing_filters.c 2012/02/21 23:47:56 1.1.1.1 +++ embedaddon/php/ext/filter/sanitizing_filters.c 2012/05/29 12:34:39 1.1.1.2 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: sanitizing_filters.c,v 1.1.1.1 2012/02/21 23:47:56 misho Exp $ */ +/* $Id: sanitizing_filters.c,v 1.1.1.2 2012/05/29 12:34:39 misho Exp $ */ #include "php_filter.h" #include "filter_private.h" @@ -51,7 +51,7 @@ static void php_filter_encode_html(zval *value, const } smart_str_0(&str); - efree(Z_STRVAL_P(value)); + str_efree(Z_STRVAL_P(value)); Z_STRVAL_P(value) = str.c; Z_STRLEN_P(value) = str.len; } @@ -102,7 +102,7 @@ static void php_filter_encode_url(zval *value, const u s++; } *p = '\0'; - efree(Z_STRVAL_P(value)); + str_efree(Z_STRVAL_P(value)); Z_STRVAL_P(value) = (char *)str; Z_STRLEN_P(value) = p - str; } @@ -131,7 +131,7 @@ static void php_filter_strip(zval *value, long flags) } /* update zval string data */ buf[c] = '\0'; - efree(Z_STRVAL_P(value)); + str_efree(Z_STRVAL_P(value)); Z_STRVAL_P(value) = (char *)buf; Z_STRLEN_P(value) = c; } @@ -169,7 +169,7 @@ static void filter_map_apply(zval *value, filter_map * } /* update zval string data */ buf[c] = '\0'; - efree(Z_STRVAL_P(value)); + str_efree(Z_STRVAL_P(value)); Z_STRVAL_P(value) = (char *)buf; Z_STRLEN_P(value) = c; } @@ -250,7 +250,8 @@ void php_filter_special_chars(PHP_INPUT_FILTER_PARAM_D void php_filter_full_special_chars(PHP_INPUT_FILTER_PARAM_DECL) { char *buf; - int len, quotes; + size_t len; + int quotes; if (!(flags & FILTER_FLAG_NO_ENCODE_QUOTES)) { quotes = ENT_QUOTES; @@ -258,7 +259,7 @@ void php_filter_full_special_chars(PHP_INPUT_FILTER_PA quotes = ENT_NOQUOTES; } buf = php_escape_html_entities_ex(Z_STRVAL_P(value), Z_STRLEN_P(value), &len, 1, quotes, SG(default_charset), 0 TSRMLS_CC); - efree(Z_STRVAL_P(value)); + str_efree(Z_STRVAL_P(value)); Z_STRVAL_P(value) = buf; Z_STRLEN_P(value) = len; } @@ -372,7 +373,7 @@ void php_filter_magic_quotes(PHP_INPUT_FILTER_PARAM_DE /* just call php_addslashes quotes */ buf = php_addslashes(Z_STRVAL_P(value), Z_STRLEN_P(value), &len, 0 TSRMLS_CC); - efree(Z_STRVAL_P(value)); + str_efree(Z_STRVAL_P(value)); Z_STRVAL_P(value) = buf; Z_STRLEN_P(value) = len; }