From f21cb8fcba4a56769d80601369326da20e2e0a68 Mon Sep 17 00:00:00 2001 From: alexhultman-2fa <58995996+alexhultman-2fa@users.noreply.github.com> Date: Sun, 9 Aug 2020 10:24:15 +0200 Subject: [PATCH] Quick-fix stack overflow while fuzzing --- src/TopicTree.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/TopicTree.h b/src/TopicTree.h index 7895f72..e50ca78 100644 --- a/src/TopicTree.h +++ b/src/TopicTree.h @@ -80,6 +80,7 @@ private: /* Cull or trim unused Topic nodes from leaf to root */ void trimTree(Topic *topic) { + repeat: if (!topic->subs.size() && !topic->children.size() && !topic->terminatingWildcardChild && !topic->wildcardChild) { Topic *parent = topic->parent; @@ -114,7 +115,9 @@ private: delete topic; if (parent != root) { - trimTree(parent); + topic = parent; + goto repeat; + //trimTree(parent); } } }