diff options
Diffstat (limited to 'ext/bz2/bz2.c')
-rw-r--r-- | ext/bz2/bz2.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/bz2/bz2.c b/ext/bz2/bz2.c index dafe4b25ab..1e3c7b7617 100644 --- a/ext/bz2/bz2.c +++ b/ext/bz2/bz2.c @@ -385,12 +385,14 @@ static PHP_FUNCTION(bzopen) /* If it's not a resource its a string containing the filename to open */ if (Z_TYPE_PP(file) == IS_STRING) { - convert_to_string_ex(file); - if (Z_STRLEN_PP(file) == 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "filename cannot be empty"); RETURN_FALSE; } + + if (CHECK_ZVAL_NULL_PATH(*file)) { + RETURN_FALSE; + } stream = php_stream_bz2open(NULL, Z_STRVAL_PP(file), |