mirror of
https://github.com/php/php-src.git
synced 2024-09-22 10:27:25 +00:00
Fixed segfault in imap_bodystruct() when called with an invalid message
number. Now it fails with a warning instead.
This commit is contained in:
parent
0b22425be1
commit
8df03e2814
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user