summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2009-07-12 16:43:32 +0000
committerIlia Alshanetsky <iliaa@php.net>2009-07-12 16:43:32 +0000
commit2edbdcb845460af18054813f2808ae25c213c63c (patch)
tree42f3edfe64d1557540bed0f0f1ef15ea23e4dcc1
parent3efa93cc3eecc44a00bff2b7dfca8ec6b9313f2d (diff)
downloadphp-git-2edbdcb845460af18054813f2808ae25c213c63c.tar.gz
MFB: Fixed a possible crash inside OnUpdateErrorLog() when restoring an empty value
Avoid pointless safe_mode/open_basedir checks on OnUpdateMailLog() if value is empty
-rw-r--r--main/main.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/main/main.c b/main/main.c
index 7617756150..7c58ae3b9d 100644
--- a/main/main.c
+++ b/main/main.c
@@ -467,13 +467,10 @@ static PHP_INI_DISP(display_errors_mode)
static PHP_INI_MH(OnUpdateErrorLog)
{
/* Only do the safemode/open_basedir check at runtime */
- if ((stage == PHP_INI_STAGE_RUNTIME || stage == PHP_INI_STAGE_HTACCESS) &&
- strcmp(new_value, "syslog")) {
-
+ if ((stage == PHP_INI_STAGE_RUNTIME || stage == PHP_INI_STAGE_HTACCESS) && new_value && strcmp(new_value, "syslog")) {
if (PG(open_basedir) && php_check_open_basedir(new_value TSRMLS_CC)) {
return FAILURE;
}
-
}
OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
return SUCCESS;
@@ -485,11 +482,10 @@ static PHP_INI_MH(OnUpdateErrorLog)
static PHP_INI_MH(OnUpdateMailLog)
{
/* Only do the safemode/open_basedir check at runtime */
- if (stage == PHP_INI_STAGE_RUNTIME || stage == PHP_INI_STAGE_HTACCESS) {
+ if ((stage == PHP_INI_STAGE_RUNTIME || stage == PHP_INI_STAGE_HTACCESS) && new_value) {
if (PG(open_basedir) && php_check_open_basedir(new_value TSRMLS_CC)) {
return FAILURE;
}
-
}
OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
return SUCCESS;