summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/standard/file.c3
-rw-r--r--ext/standard/string.c2
-rw-r--r--ext/zlib/zlib.c3
3 files changed, 5 insertions, 3 deletions
diff --git a/ext/standard/file.c b/ext/standard/file.c
index 900e29304e..9bf77ccd85 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 5cff5d43ba..22bcbc6c3b 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 3e505f0425..b4717e40ff 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);
}