mirror of
https://github.com/php/php-src.git
synced 2025-01-10 21:14:37 +08:00
detect empty mode string and avoid off-by-one
This commit is contained in:
parent
e9c59b98ac
commit
d4bb248ae0
@ -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