From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-2.5 required=3.0 tests=AWL,BAYES_00,NO_RELAYS, URIBL_BLOCKED shortcircuit=no autolearn=ham version=3.3.2 X-Original-To: meta@public-inbox.org Received: by dcvr.yhbt.net (Postfix, from userid 1000) id 06FFF1F81B; Mon, 17 Aug 2015 21:35:26 +0000 (UTC) Content-Type: multipart/mixed; boundary="===============0749175680==" MIME-Version: 1.0 From: Eric Wong To: Debian Bug Tracking System Subject: libmail-thread-perl: [PATCH] avoid failing grouping by subject with missing references Cc: bug-Mail-Thread@rt.cpan.org, meta@public-inbox.org Message-ID: <20150817213526.458.81766.reportbug@dcvr.yhbt.net> X-Mailer: reportbug 6.4.4 Date: Mon, 17 Aug 2015 21:35:26 +0000 List-Id: --===============0749175680== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline Package: libmail-thread-perl Version: 2.55-1 Severity: normal Tags: upstream patch Dear Maintainer, With incomplete threads, It is possible to for the topmost subroutine to return undef, so do not blindy assume the simple_subject call will be made on a Mail::Thread::Container object. Attached is a patch which avoids the issue by skipping as if the subject were empty. Note: upstream hasn't been responsive in years, but Cc-ing the RT address at CPAN just in case. -- System Information: Debian Release: 7.8 APT prefers oldstable-updates APT policy: (500, 'oldstable-updates'), (500, 'oldstable') -- no debconf information --===============0749175680== Content-Type: text/x-diff; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-avoid-failing-grouping-by-subject-with-missing-refer.patch" >>From 9d1837f2118efa614d1acddd09ea7f53aba15ba4 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 17 Aug 2015 21:16:25 +0000 Subject: [PATCH] avoid failing grouping by subject with missing references It is possible to for the topmost subroutine to return undef, so do not blindy assume the simple_subject call will be made on a Mail::Thread::Container object. --- Thread.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Thread.pm b/Thread.pm index c6f3230..941ae31 100644 --- a/Thread.pm +++ b/Thread.pm @@ -70,7 +70,8 @@ sub _group_set_bysubject { my %subject; for (my $walk = $root->child; $walk; $walk = $walk->next) { - my $sub = $walk->topmost->simple_subject or next; + my $topmost = $walk->topmost or next; + my $sub = $topmost->simple_subject or next; # Add this container to the hash if: # - There is no container in the hash with this subject, or # - This one is a dummy container and the old one is not: the dummy @@ -97,7 +98,8 @@ sub _group_set_bysubject { for ($walk = $root->child, $rest = eval{ $walk->next }; $walk; $prev = $walk, $walk = $rest, $rest = eval { $rest->next }) { - my $subj = $walk->topmost->simple_subject or next; + my $topmost = $walk->topmost or next; + my $subj = $topmost->simple_subject or next; my $old = $subject{$subj}; next if $old == $walk; -- EW --===============0749175680==--