From: Vsevolod Stakhov Date: Tue, 8 Jun 2021 11:09:59 +0000 (+0100) Subject: [Minor] Html: Check for null before traversing X-Git-Tag: 3.0~333 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b3355c2ce40fb78906711a990cda0b5d54fedf58;p=rspamd.git [Minor] Html: Check for null before traversing --- diff --git a/src/libserver/html/html.hxx b/src/libserver/html/html.hxx index 5624f5d2e..99948ebbd 100644 --- a/src/libserver/html/html.hxx +++ b/src/libserver/html/html.hxx @@ -72,6 +72,10 @@ struct html_content { auto traverse_tags(fu2::function &&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)) {