diff options
author | Antony Dovgal <tony2001@php.net> | 2005-01-25 14:20:02 +0000 |
---|---|---|
committer | Antony Dovgal <tony2001@php.net> | 2005-01-25 14:20:02 +0000 |
commit | c404bdb9f8b83bf4e2b572d03983c571c1ce5e2d (patch) | |
tree | 69e0ca62020dee0fc80c63fa8cd9ce4c5871a4d3 /ext/imap | |
parent | af854a84099614ed3609267a4623554451c81d12 (diff) | |
download | php-git-c404bdb9f8b83bf4e2b572d03983c571c1ce5e2d.tar.gz |
check body for NULL before using and prevent segfaults
Diffstat (limited to 'ext/imap')
-rw-r--r-- | ext/imap/php_imap.c | 4 |
1 files changed, 4 insertions, 0 deletions
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); } |