From: Antony Dovgal Date: Tue, 25 Jan 2005 14:22:13 +0000 (+0000) Subject: MFH: fix segfault in imap_bodystruct() X-Git-Tag: php-5.0.4RC1~247 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b539bb6a07b8c1c9b13893623acdb4a837c28c49;p=php MFH: fix segfault in imap_bodystruct() --- diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c index cff804c6d4..ba3db05785 100644 --- a/ext/imap/php_imap.c +++ b/ext/imap/php_imap.c @@ -2653,6 +2653,10 @@ PHP_FUNCTION(imap_bodystruct) object_init(return_value); body=mail_body(imap_le_struct->imap_stream, Z_LVAL_PP(msg), Z_STRVAL_PP(section)); + if (body == NULL) { + zval_dtor(return_value); + RETURN_FALSE; + } if (body->type <= TYPEMAX) { add_property_long(return_value, "type", body->type); }