Skip to content

Commit bcc2f07

Browse files
committed
Prevent bailout during imap shutdown error reporting
This is a non-intrusive, minimal fix for bug #81316, which prevents a bailout during imap RSHUTDOWN and prevents the basic shutdown handler from being skipped. I wasn't able to make the issue reproduce in a small test.
1 parent d1e956f commit bcc2f07

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ext/imap/php_imap.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,7 +1099,9 @@ PHP_RSHUTDOWN_FUNCTION(imap)
10991099
if (EG(error_reporting) & E_NOTICE) {
11001100
ecur = IMAPG(imap_errorstack);
11011101
while (ecur != NIL) {
1102-
php_error_docref(NULL, E_NOTICE, "%s (errflg=%ld)", ecur->LTEXT, ecur->errflg);
1102+
zend_try {
1103+
php_error_docref(NULL, E_NOTICE, "%s (errflg=%ld)", ecur->LTEXT, ecur->errflg);
1104+
} zend_end_try();
11031105
ecur = ecur->next;
11041106
}
11051107
}
@@ -1112,7 +1114,9 @@ PHP_RSHUTDOWN_FUNCTION(imap)
11121114
if (EG(error_reporting) & E_NOTICE) {
11131115
acur = IMAPG(imap_alertstack);
11141116
while (acur != NIL) {
1115-
php_error_docref(NULL, E_NOTICE, "%s", acur->LTEXT);
1117+
zend_try {
1118+
php_error_docref(NULL, E_NOTICE, "%s", acur->LTEXT);
1119+
} zend_end_try();
11161120
acur = acur->next;
11171121
}
11181122
}

0 commit comments

Comments
 (0)