]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Html: Check for null before traversing
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 8 Jun 2021 11:09:59 +0000 (12:09 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 8 Jun 2021 11:09:59 +0000 (12:09 +0100)
src/libserver/html/html.hxx

index 5624f5d2e70e0bfd10d2c1142418ee1223ad556b..99948ebbd62f91d5ba0be0c68597c4e9f8fd7925 100644 (file)
@@ -72,6 +72,10 @@ struct html_content {
        auto traverse_tags(fu2::function<bool(const html_tag *)> &&func,
                                        traverse_type how = traverse_type::PRE_ORDER) const -> bool {
 
+               if (root_tag == nullptr) {
+                       return false;
+               }
+
                auto rec_functor_pre_order = [&](const html_tag *root, auto &&rec) -> bool {
                        if (func(root)) {