summaryrefslogtreecommitdiff
path: root/ext/bz2
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2006-06-26 21:13:46 +0000
committerAntony Dovgal <tony2001@php.net>2006-06-26 21:13:46 +0000
commit5d2d2fd5a396cdeafd18d2f688888ffe9f75b1c7 (patch)
tree34132898f0362c94865d84700a81bc01ac422d1c /ext/bz2
parentec420c3df8c68cf7a601798ec4fcdeb951e39147 (diff)
downloadphp-git-5d2d2fd5a396cdeafd18d2f688888ffe9f75b1c7.tar.gz
MFH: detect empty mode string and avoid off-by-one
Diffstat (limited to 'ext/bz2')
-rw-r--r--ext/bz2/bz2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/bz2/bz2.c b/ext/bz2/bz2.c
index eb9f4bc5ac..6b2a5cee06 100644
--- a/ext/bz2/bz2.c
+++ b/ext/bz2/bz2.c
@@ -205,7 +205,7 @@ PHP_BZ2_API php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper,
if (strncasecmp("compress.bzip2://", path, 17) == 0) {
path += 17;
}
- if (mode[0] != 'w' && mode[0] != 'r' && mode[1] != '\0') {
+ if (mode[0] == '\0' || (mode[0] != 'w' && mode[0] != 'r' && mode[1] != '\0')) {
return NULL;
}