[Pkg-php-commits] [php/debian-sid] Don't strcmp a null value in ini_restore (partially addresses #540605)
Raphael Geissert
geissert at debian.org
Thu Aug 13 19:35:24 UTC 2009
Patch cherry-picked from upstream. Added local test case.
---
debian/patches/series | 1 +
debian/patches/strcmp_null-OnUpdateErrorLog.patch | 29 +++++++++++++++++++++
2 files changed, 30 insertions(+), 0 deletions(-)
create mode 100644 debian/patches/strcmp_null-OnUpdateErrorLog.patch
diff --git a/debian/patches/series b/debian/patches/series
index 9aeea92..cd49127 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -39,3 +39,4 @@ gentoo/009_ob-memory-leaks.patch
mssql-null-exception.patch
exif_read_data-segfault.patch
sybase-alias.patch
+strcmp_null-OnUpdateErrorLog.patch
diff --git a/debian/patches/strcmp_null-OnUpdateErrorLog.patch b/debian/patches/strcmp_null-OnUpdateErrorLog.patch
new file mode 100644
index 0000000..cd1c872
--- /dev/null
+++ b/debian/patches/strcmp_null-OnUpdateErrorLog.patch
@@ -0,0 +1,29 @@
+Index: php/main/main.c
+===================================================================
+--- php.orig/main/main.c
++++ php/main/main.c
+@@ -312,8 +312,7 @@ 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(safe_mode) && (!php_checkuid(new_value, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
+ return FAILURE;
+ }
+Index: php/tests/func/null-new_val.phpt
+===================================================================
+--- /dev/null
++++ php/tests/func/null-new_val.phpt
+@@ -0,0 +1,10 @@
++--TEST--
++ini_restore strcmp NULL new_val
++--FILE--
++<?php
++
++ini_set('error_log','ini_set_works');
++ini_restore('error_log');
++
++?>
++--EXPECT--
--
1.5.6.5
More information about the Pkg-php-commits
mailing list