From: Antony Dovgal Date: Tue, 25 Jan 2005 14:20:02 +0000 (+0000) Subject: check body for NULL before using and prevent segfaults X-Git-Tag: RELEASE_0_2~154 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c404bdb9f8b83bf4e2b572d03983c571c1ce5e2d;p=php check body for NULL before using and prevent segfaults --- diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c index dfcc790fe4..f900c9b03c 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); }