From 1e3ec9b81008d0b87524db567017d60e24f6601c Mon Sep 17 00:00:00 2001 From: Rahix Date: Tue, 12 May 2020 20:29:00 +0200 Subject: collapse_posts: Fix segfault when depth is too big When an account already has less depth than collapse_depth, a segfault was caused by attempting to move up the account parents until parent is NULL. Fix this by exiting early if the depth is already less than collapse_depth. --- src/filters.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/filters.cc') diff --git a/src/filters.cc b/src/filters.cc index 3e481139..574aac3b 100644 --- a/src/filters.cc +++ b/src/filters.cc @@ -475,7 +475,7 @@ value_t& collapse_posts::find_totals(account_t* account) if (collapse_depth == 0) return totals[_("")]; - if (account->depth == collapse_depth) + if (account->depth <= collapse_depth) return totals[account->fullname()]; //else recurse -- cgit v1.2.3