From 44e178e0891ab019b480a4621f22f27a899e2aeb Mon Sep 17 00:00:00 2001 From: Chuck Hagenbuch Date: Tue, 4 Apr 2000 18:10:24 +0000 Subject: [PATCH] return false after determining that a message number is bad, instead of going on to crash. --- ext/imap/php_imap.c | 2 ++ 1 file changed, 2 insertions(+) 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 { -- 2.50.1