From: Chuck Hagenbuch Date: Tue, 4 Apr 2000 18:10:24 +0000 (+0000) Subject: return false after determining that a message number is bad, instead of X-Git-Tag: php-4.0RC2~490 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=44e178e0891ab019b480a4621f22f27a899e2aeb;p=php return false after determining that a message number is bad, instead of going on to crash. --- diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c index e06bc7b5d7..6cf20e420b 100644 --- a/ext/imap/php_imap.c +++ b/ext/imap/php_imap.c @@ -1566,7 +1566,9 @@ PHP_FUNCTION(imap_headerinfo) if (!msgno->value.lval || msgno->value.lval < 1 || (unsigned) msgno->value.lval > imap_le_struct->imap_stream->nmsgs) { php_error(E_WARNING, "Bad message number"); + RETURN_FALSE; } + if (mail_fetchstructure(imap_le_struct->imap_stream, msgno->value.lval, NIL)) { cache = mail_elt(imap_le_struct->imap_stream, msgno->value.lval); } else {