From 7057307e044b0b63e2517e125c0f971630966072 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 14 Aug 2021 07:42:39 +0000 Subject: www: avoid uninitialized vars from shadowed Message-IDs For /all/ (extindex) and like, Message-ID reuse from client errors or list-injected footers can cause threading weirdness. Avoid auto-vivification in the mapping table and dereferencing of unknown messages. --- lib/PublicInbox/Reply.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/PublicInbox/Reply.pm') diff --git a/lib/PublicInbox/Reply.pm b/lib/PublicInbox/Reply.pm index 79dd46a7..d96fadfc 100644 --- a/lib/PublicInbox/Reply.pm +++ b/lib/PublicInbox/Reply.pm @@ -28,7 +28,7 @@ my $reply_headers = join('|', @reply_headers); sub mailto_arg_link { my ($ibx, $hdr) = @_; my $cc = {}; # everyone else - my $to; # this is the From address by defaultq + my $to; # this is the From address by default my $reply_to_all = 'reply-to-all'; # the only good default :P my $reply_to_cfg = $ibx->{replyto}; @@ -72,6 +72,7 @@ sub mailto_arg_link { my $mid = $hdr->header_raw('Message-ID'); push @arg, '--in-reply-to='.squote_maybe(mid_clean($mid)); my $irt = mid_href($mid); + add_addrs(\$to, $cc, $ibx->{-primary_address}) unless defined($to); delete $cc->{$to}; if ($obfs) { my $arg_to = $to; -- cgit v1.2.3-24-ge0c7