mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
MFH: detect empty mode string and avoid off-by-one
This commit is contained in:
parent
ec420c3df8
commit
5d2d2fd5a3
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user