From: Eric Wong Date: Sun, 19 Sep 2021 12:50:34 +0000 (+0000) Subject: net_reader: disallow imap.fetchBatchSize=0 X-Git-Tag: v1.7.0~319 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=5b6757c675e41b6d464bfb2ccfa7967a55daa314;p=public-inbox.git net_reader: disallow imap.fetchBatchSize=0 A batch size of zero is nonsensical and causes infinite loops. --- diff --git a/lib/PublicInbox/NetReader.pm b/lib/PublicInbox/NetReader.pm index e305523e..fbe1ac4f 100644 --- a/lib/PublicInbox/NetReader.pm +++ b/lib/PublicInbox/NetReader.pm @@ -344,10 +344,10 @@ sub imap_common_init ($;$) { } my $k = 'imap.fetchBatchSize'; my $bs = $cfg->urlmatch($k, $$uri) // next; - if ($bs =~ /\A([0-9]+)\z/) { + if ($bs =~ /\A([0-9]+)\z/ && $bs > 0) { $self->{cfg_opt}->{$sec}->{batch_size} = $bs; } else { - warn "$k=$bs is not an integer\n"; + warn "$k=$bs is not a positive integer\n"; } } # make sure we can connect and cache the credentials in memory