? imap_4_3.diff Index: php_imap.c =================================================================== RCS file: /repository/php-src/ext/imap/php_imap.c,v retrieving revision 1.142.2.24 diff -u -r1.142.2.24 php_imap.c --- php_imap.c 4 Jul 2004 16:53:02 -0000 1.142.2.24 +++ php_imap.c 15 Jul 2004 08:42:38 -0000 @@ -1774,7 +1774,12 @@ if (myargc == 4) { convert_to_long_ex(flags); } - + + if ((Z_LVAL_PP(msgno) < 1) || ((unsigned) Z_LVAL_PP(msgno) > imap_le_struct->imap_stream->nmsgs)) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad message number"); + RETURN_FALSE; + } + body = mail_fetchbody_full(imap_le_struct->imap_stream, Z_LVAL_PP(msgno), Z_STRVAL_PP(sec), &len, myargc==4 ? Z_LVAL_PP(flags) : NIL); if (!body) {