summaryrefslogtreecommitdiff
path: root/ext/bz2/bz2.c
diff options
context:
space:
mode:
authorFelipe Pena <felipe@php.net>2011-06-06 21:28:16 +0000
committerFelipe Pena <felipe@php.net>2011-06-06 21:28:16 +0000
commit4737910b69eba83b5ba6dd2d43f88a7bd3461ccf (patch)
treedc6ecafe9a79a17cbb6d4a96b83a1bcbda30e5a8 /ext/bz2/bz2.c
parent6b85eb58b27a60cfc4d78ad0a85afeda373132c5 (diff)
downloadphp-git-4737910b69eba83b5ba6dd2d43f88a7bd3461ccf.tar.gz
- Added new parameter parsing option (p - for valid path (string without null byte in the middle))
# The tests will be fixed in the next commits
Diffstat (limited to 'ext/bz2/bz2.c')
-rw-r--r--ext/bz2/bz2.c6
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),