Fixed segfault in imap_bodystruct() when called with an invalid message

number. Now it fails with a warning instead.
This commit is contained in:
Vlad Krupin 2002-01-12 05:39:07 +00:00
parent 0b22425be1
commit 8df03e2814

View File

@ -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;
}