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 | f298e6ce6e8d61d333a8c3970834bcffccdb9825 (patch) | |
tree | fea1533e227681971d473929ef87809cc6d6d3de /sapi/cgi | |
parent | 87a4f09cbf8a2970969d9a03d28f2242932b16a3 (diff) | |
download | php-git-f298e6ce6e8d61d333a8c3970834bcffccdb9825.tar.gz |
fix crash on empty doc_root
Diffstat (limited to 'sapi/cgi')
-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 |