]> Sergey Matveev's repositories - public-inbox.git/commitdiff
config: do not accept non-ASCII digits in cgitrc params
authorEric Wong <e@80x24.org>
Tue, 4 Jun 2019 02:04:29 +0000 (02:04 +0000)
committerEric Wong <e@80x24.org>
Tue, 4 Jun 2019 10:06:18 +0000 (10:06 +0000)
cgit uses atoi(3), and now we can retain compatibility.

lib/PublicInbox/Config.pm

index 09f9179b085a4dd90aed20e0d8b277ede66cc870..6e85750a7832fc927631847199fd5d447d76574a 100644 (file)
@@ -307,7 +307,7 @@ sub parse_cgitrc {
                        }
                } elsif (m!\Ainclude=(.+)\z!) {
                        parse_cgitrc($self, $1, $nesting + 1);
-               } elsif (m!\A(scan-hidden-path|remove-suffix)=(\d+)\z!) {
+               } elsif (m!\A(scan-hidden-path|remove-suffix)=([0-9]+)\z!) {
                        my ($k, $v) = ($1, $2);
                        $k =~ tr/-/_/;
                        $self->{"-cgit_$k"} = $v;