summaryrefslogtreecommitdiff
path: root/sapi/cgi/cgi_main.c
diff options
context:
space:
mode:
authorPierre Joye <pajoye@php.net>2010-04-30 08:15:09 +0000
committerPierre Joye <pajoye@php.net>2010-04-30 08:15:09 +0000
commit91bcba0343f58ab6a3702606957dd0c7a4d95862 (patch)
treec51bff0005e1910fb4cfbbc5aaf132e9c2f0b01c /sapi/cgi/cgi_main.c
parenta3168a398c4bcb8b8b6800799ba6fee817a239d6 (diff)
downloadphp-git-91bcba0343f58ab6a3702606957dd0c7a4d95862.tar.gz
- Fix #51688, ini per dir crashes when invalid document root are given
Diffstat (limited to 'sapi/cgi/cgi_main.c')
-rw-r--r--sapi/cgi/cgi_main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index 90158fb616..4c7d020a50 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -735,6 +735,10 @@ static void php_cgi_ini_activate_user_config(char *path, int path_len, const cha
if (!IS_ABSOLUTE_PATH(path, path_len)) {
real_path = tsrm_realpath(path, NULL TSRMLS_CC);
+ /* see #51688, looks like we may get invalid path as doc root using cgi with apache */
+ if (real_path == NULL) {
+ return;
+ }
real_path_len = strlen(real_path);
path = real_path;
path_len = real_path_len;