diff options
author | Antony Dovgal <tony2001@php.net> | 2009-10-20 12:57:44 +0000 |
---|---|---|
committer | Antony Dovgal <tony2001@php.net> | 2009-10-20 12:57:44 +0000 |
commit | cdcfd121083ea89b959a262843948b264952501a (patch) | |
tree | 9ae5240d7a3a4a9eeeb6445b7a386c59855538d7 | |
parent | 432f0d138045994ab51bdc1e5438a8825496e124 (diff) | |
download | php-git-cdcfd121083ea89b959a262843948b264952501a.tar.gz |
fix crash on empty doc_root
-rw-r--r-- | sapi/cgi/cgi_main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index f78cc484aa..449e0cf172 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -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 |