diff options
author | Antony Dovgal <tony2001@php.net> | 2006-06-26 21:13:46 +0000 |
---|---|---|
committer | Antony Dovgal <tony2001@php.net> | 2006-06-26 21:13:46 +0000 |
commit | 5d2d2fd5a396cdeafd18d2f688888ffe9f75b1c7 (patch) | |
tree | 34132898f0362c94865d84700a81bc01ac422d1c /ext/bz2/bz2.c | |
parent | ec420c3df8c68cf7a601798ec4fcdeb951e39147 (diff) | |
download | php-git-5d2d2fd5a396cdeafd18d2f688888ffe9f75b1c7.tar.gz |
MFH: detect empty mode string and avoid off-by-one
Diffstat (limited to 'ext/bz2/bz2.c')
-rw-r--r-- | ext/bz2/bz2.c | 2 |
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; } |