From: Ilia Alshanetsky Date: Tue, 1 Apr 2008 18:29:09 +0000 (+0000) Subject: MFB: Fixed bug #44594 (imap_open() does not validate # of retries parameter) X-Git-Tag: RELEASE_2_0_0b1~519 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=306eb4fad29d485781d7f1a14840886e4429f2c6;p=php MFB: Fixed bug #44594 (imap_open() does not validate # of retries parameter) --- diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c index 2082011c34..3b9e887904 100644 --- a/ext/imap/php_imap.c +++ b/ext/imap/php_imap.c @@ -796,7 +796,11 @@ static void php_imap_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent) #ifdef SET_MAXLOGINTRIALS if (myargc == 5) { convert_to_long_ex(retries); - mail_parameters(NIL, SET_MAXLOGINTRIALS, (void *) Z_LVAL_PP(retries)); + if (retries < 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING ,"Retries must be greater or eqaul to 0"); + } else { + mail_parameters(NIL, SET_MAXLOGINTRIALS, (void *) Z_LVAL_PP(retries)); + } } #endif