diff --git a/ext/standard/file.c b/ext/standard/file.c index 900e29304ea..9bf77ccd854 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -973,7 +973,8 @@ PHP_FUNCTION(fgetss) RETURN_FALSE; } - _php3_strip_tags(buf, len, fgetss_state, allow->value.str.val); + /* strlen() can be used here since we are doing it on the return of an fgets() anyway */ + _php3_strip_tags(buf, strlen(buf), fgetss_state, allow?allow->value.str.val:NULL); RETURN_STRING(buf, 0); } /* }}} */ diff --git a/ext/standard/string.c b/ext/standard/string.c index 5cff5d43ba3..22bcbc6c3bb 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -1789,7 +1789,7 @@ PHP_FUNCTION(strip_tags) } convert_to_string(str); buf = estrdup(str->value.str.val); - _php3_strip_tags(buf, str->value.str.len, 0, allow->value.str.val); + _php3_strip_tags(buf, str->value.str.len, 0, allow?allow->value.str.val:NULL); RETURN_STRING(buf, 0); } /* }}} */ diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index 3e505f04256..b4717e40ffd 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -518,7 +518,8 @@ PHP_FUNCTION(gzgetss) RETURN_FALSE; } - _php3_strip_tags(buf, len, ZLIBG(gzgetss_state), allow->value.str.val); + /* strlen() can be used here since we are doing it on the return of an fgets() anyway */ + _php3_strip_tags(buf, strlen, ZLIBG(gzgetss_state), allow?allow->value.str.val:NULL); RETURN_STRING(buf, 0); }