From 376784438a7c5ca87dd0b86450ef68bc2e0502a6 Mon Sep 17 00:00:00 2001 From: Ondřej Surý Date: Mon, 21 Jan 2013 11:01:37 +0100 Subject: Apply two workaround patches for crashes caused by infinite recursion in php_rfc1867_callback (Closes: #694473, #691318) --- debian/patches/series | 1 + ...fc1867_crashes_php_even_though_turned_off.patch | 33 ++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 debian/patches/session.c_rfc1867_crashes_php_even_though_turned_off.patch diff --git a/debian/patches/series b/debian/patches/series index 315aac3de..96b5b6dbd 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -75,3 +75,4 @@ PHP-5.4.6-PHP62594-fix-segfault-in-mysqlnd.patch PHP-5.4.6-PHP62616-fix-segfault-in-SPL.patch PHP-5.4.6-PHP62653-fix-unset_array_float-crash.patch expose_all_built_and_installed_apis.patch +session.c_rfc1867_crashes_php_even_though_turned_off.patch diff --git a/debian/patches/session.c_rfc1867_crashes_php_even_though_turned_off.patch b/debian/patches/session.c_rfc1867_crashes_php_even_though_turned_off.patch new file mode 100644 index 000000000..0463887e4 --- /dev/null +++ b/debian/patches/session.c_rfc1867_crashes_php_even_though_turned_off.patch @@ -0,0 +1,33 @@ +--- a/ext/session/session.c ++++ b/ext/session/session.c +@@ -2192,8 +2192,10 @@ static PHP_MINIT_FUNCTION(session) /* {{ + #ifdef HAVE_LIBMM + PHP_MINIT(ps_mm) (INIT_FUNC_ARGS_PASSTHRU); + #endif +- php_session_rfc1867_orig_callback = php_rfc1867_callback; +- php_rfc1867_callback = php_session_rfc1867_callback; ++ if (php_rfc1867_callback != php_session_rfc1867_callback) { ++ php_session_rfc1867_orig_callback = php_rfc1867_callback; ++ php_rfc1867_callback = php_session_rfc1867_callback; ++ } + + /* Register interface */ + INIT_CLASS_ENTRY(ce, PS_IFACE_NAME, php_session_iface_functions); +@@ -2384,13 +2386,14 @@ static int php_session_rfc1867_callback( + php_session_rfc1867_progress *progress; + int retval = SUCCESS; + +- if (php_session_rfc1867_orig_callback) { +- retval = php_session_rfc1867_orig_callback(event, event_data, extra TSRMLS_CC); +- } + if (!PS(rfc1867_enabled)) { + return retval; + } + ++ if (php_session_rfc1867_orig_callback) { ++ retval = php_session_rfc1867_orig_callback(event, event_data, extra TSRMLS_CC); ++ } ++ + progress = PS(rfc1867_progress); + + switch(event) { -- cgit v1.2.3