summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2009-10-20 12:57:44 +0000
committerAntony Dovgal <tony2001@php.net>2009-10-20 12:57:44 +0000
commitcdcfd121083ea89b959a262843948b264952501a (patch)
tree9ae5240d7a3a4a9eeeb6445b7a386c59855538d7
parent432f0d138045994ab51bdc1e5438a8825496e124 (diff)
downloadphp-git-cdcfd121083ea89b959a262843948b264952501a.tar.gz
fix crash on empty doc_root
-rw-r--r--sapi/cgi/cgi_main.c2
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