Tighten up matching of bare words inside directives

Do not allow an unterminated """ string to be treated as a series of bare
words. Fixes runaway regexp recursion/backtracking in strange situations.

(See 1d57a21c98 for test case.)
master
Joey Hess 2009-06-05 16:14:51 -04:00
parent 763f4b91da
commit bd78168f71
2 changed files with 6 additions and 2 deletions

View File

@ -1253,7 +1253,7 @@ sub preprocess ($$$;$$) {
| |
"[^"]+" # single-quoted value "[^"]+" # single-quoted value
| |
[^\s\]]+ # unquoted value [^"\s\]]+ # unquoted value
) )
\s* # whitespace or end \s* # whitespace or end
# of directive # of directive
@ -1276,7 +1276,7 @@ sub preprocess ($$$;$$) {
| |
"[^"]+" # single-quoted value "[^"]+" # single-quoted value
| |
[^\s\]]+ # unquoted value [^"\s\]]+ # unquoted value
) )
\s* # whitespace or end \s* # whitespace or end
# of directive # of directive

4
debian/changelog vendored
View File

@ -5,6 +5,10 @@ ikiwiki (3.15) UNRELEASED; urgency=low
* Avoid relying on translators preserving the case when translating * Avoid relying on translators preserving the case when translating
"discussion", which caused Discussion pages to get unwanted Discussion "discussion", which caused Discussion pages to get unwanted Discussion
links. links.
* Tighten up matching of bare words inside directives; do not
allow an unterminated """ string to be treated as a series
of bare words. Fixes runaway regexp recursion/backtracking
in strange situations.
-- Joey Hess <joeyh@debian.org> Tue, 02 Jun 2009 17:03:41 -0400 -- Joey Hess <joeyh@debian.org> Tue, 02 Jun 2009 17:03:41 -0400