Skip to content

Commit 6084844

Browse files
committed
Fix bug #69814 Enabling php_curl, php_mysqli, and php_openssl causes php-cgi to crash
1 parent 336cfac commit 6084844

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Zend/zend_virtual_cwd.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,11 @@ CWD_API char *virtual_getcwd_ex(size_t *length) /* {{{ */
553553
return retval;
554554
}
555555
#endif
556+
if (!state->cwd) {
557+
*length = 0;
558+
return NULL;
559+
}
560+
556561
*length = state->cwd_length;
557562
return estrdup(state->cwd);
558563
}
@@ -574,6 +579,9 @@ CWD_API char *virtual_getcwd(char *buf, size_t size) /* {{{ */
574579
errno = ERANGE; /* Is this OK? */
575580
return NULL;
576581
}
582+
if (!cwd) {
583+
return NULL;
584+
}
577585
memcpy(buf, cwd, length+1);
578586
efree(cwd);
579587
return buf;

0 commit comments

Comments
 (0)