summaryrefslogtreecommitdiff
path: root/ext/imap
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2005-01-25 14:20:02 +0000
committerAntony Dovgal <tony2001@php.net>2005-01-25 14:20:02 +0000
commitc404bdb9f8b83bf4e2b572d03983c571c1ce5e2d (patch)
tree69e0ca62020dee0fc80c63fa8cd9ce4c5871a4d3 /ext/imap
parentaf854a84099614ed3609267a4623554451c81d12 (diff)
downloadphp-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.c4
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);
}