]> granicus.if.org Git - php/commitdiff
MFH: fix segfault in imap_bodystruct()
authorAntony Dovgal <tony2001@php.net>
Tue, 25 Jan 2005 14:22:13 +0000 (14:22 +0000)
committerAntony Dovgal <tony2001@php.net>
Tue, 25 Jan 2005 14:22:13 +0000 (14:22 +0000)
ext/imap/php_imap.c

index cff804c6d45d01338706610231a40b9b4a1282e7..ba3db057852f3e204a266632bb620577b3da12a1 100644 (file)
@@ -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);
        }