mirror of
https://github.com/php/php-src.git
synced 2024-11-25 10:54:15 +08:00
fix crash on empty doc_root
This commit is contained in:
parent
87a4f09cbf
commit
f298e6ce6e
@ -828,7 +828,7 @@ static int sapi_cgi_activate(TSRMLS_D)
|
||||
/* DOCUMENT_ROOT should also be defined at this stage..but better check it anyway */
|
||||
if (doc_root) {
|
||||
doc_root_len = strlen(doc_root);
|
||||
if (IS_SLASH(doc_root[doc_root_len - 1])) {
|
||||
if (doc_root_len > 0 && IS_SLASH(doc_root[doc_root_len - 1])) {
|
||||
--doc_root_len;
|
||||
}
|
||||
#ifdef PHP_WIN32
|
||||
|
Loading…
Reference in New Issue
Block a user