]> granicus.if.org Git - php/commitdiff
bug #46837 fix
authorZoe Slattery <zoe@php.net>
Tue, 16 Dec 2008 21:35:01 +0000 (21:35 +0000)
committerZoe Slattery <zoe@php.net>
Tue, 16 Dec 2008 21:35:01 +0000 (21:35 +0000)
ext/imap/php_imap.c

index fd89734e45c300babecc717324b30fa51af1391c..fecaf42dfbc9f8a78bc775e935971c54d8bef87d 100644 (file)
@@ -1498,6 +1498,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;