From db0d8cbd840e31401bcbf039afa1f4ce5429dbc1 Mon Sep 17 00:00:00 2001 From: Zoe Slattery Date: Tue, 16 Dec 2008 21:34:16 +0000 Subject: [PATCH] bug #46837 fix --- ext/imap/php_imap.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c index d1a9b0baa4..23036c0760 100644 --- a/ext/imap/php_imap.c +++ b/ext/imap/php_imap.c @@ -1483,6 +1483,13 @@ PHP_FUNCTION(imap_close) if (argc == 2) { flags = options; + + /* Check that flags is exactly equal to PHP_EXPUNGE or zero */ + if (flags && ((flags & ~PHP_EXPUNGE) != 0)) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid value for the flags parameter"); + RETURN_FALSE; + } + /* Do the translation from PHP's internal PHP_EXPUNGE define to c-client's CL_EXPUNGE */ if (flags & PHP_EXPUNGE) { flags ^= PHP_EXPUNGE; -- 2.50.1