Skip to content

Commit 9919125

Browse files
author
Zoe Slattery
committed
bug #46837 fix
1 parent 2b5cd5b commit 9919125

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

ext/imap/php_imap.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,6 +1140,13 @@ PHP_FUNCTION(imap_close)
11401140
if (myargcount == 2) {
11411141
convert_to_long_ex(options);
11421142
flags = Z_LVAL_PP(options);
1143+
1144+
/* Check that flags is exactly equal to PHP_EXPUNGE or Zero*/
1145+
if (flags && ((flags & ~PHP_EXPUNGE) != 0)) {
1146+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid value for the flags parameter");
1147+
RETURN_FALSE;
1148+
}
1149+
11431150
/* Do the translation from PHP's internal PHP_EXPUNGE define to c-client's CL_EXPUNGE */
11441151
if (flags & PHP_EXPUNGE) {
11451152
flags ^= PHP_EXPUNGE;

0 commit comments

Comments
 (0)