diff options
Diffstat (limited to 'ext/imap/php_imap.c')
-rw-r--r-- | ext/imap/php_imap.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c index 6b7de31ab3..cb26d7f644 100644 --- a/ext/imap/php_imap.c +++ b/ext/imap/php_imap.c @@ -2690,6 +2690,11 @@ PHP_FUNCTION(imap_bodystruct) convert_to_long_ex(msg); convert_to_string_ex(section); + if (!Z_LVAL_PP(msg) || Z_LVAL_PP(msg) < 1 || (unsigned) Z_LVAL_PP(msg) > imap_le_struct->imap_stream->nmsgs) { + php_error(E_WARNING, "Bad message number"); + RETURN_FALSE; + } + if (object_init(return_value) == FAILURE) { RETURN_FALSE; } |