? imap_PHP_5.diff Index: php_imap.c =================================================================== RCS file: /repository/php-src/ext/imap/php_imap.c,v retrieving revision 1.184 diff -u -r1.184 php_imap.c --- php_imap.c 4 Jul 2004 16:52:59 -0000 1.184 +++ php_imap.c 15 Jul 2004 08:43:30 -0000 @@ -1816,6 +1816,11 @@ 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);