Skip to content
This repository was archived by the owner on Nov 1, 2024. It is now read-only.

Fix infinite loop with bad button close tag #128

Merged
merged 2 commits into from
Sep 25, 2020

Conversation

natebosch
Copy link
Contributor

@natebosch natebosch commented Sep 24, 2020

Closes dart-lang/tools#1036

Add 'button' to the tags that are processed with endTagBlock. The spec
at https://html.spec.whatwg.org/multipage/parsing.html includes 'button'
in the list of end tags with this treatment.

Add a new .dat file for regression test. It include an #info field
which is new but can be parsed safely to mark the issue for which it is
a test. This test loops endlessly before the fix and passes after the
fix.

Note that since errors are currently untested and tests fail if they are
tested the error will be left without content for now.

Closes #122

Add 'button' to the tags that are processed with `endTagBlock`. The spec
at https://html.spec.whatwg.org/multipage/parsing.html includes 'button'
in the list of end tags with this treatement.

Add a new `.dat` file for regression test. It include an `#info` field
which is new but can be parsed safety to mark the issue for which it is
a test. This test loops endlessly before the fix and passes after the
fix.

Note that since errors are currently untested and test fail if they are
tested the error will be left without content for now.
@natebosch
Copy link
Contributor Author

image

@natebosch
Copy link
Contributor Author

Note that 'main' is also missing from this list, but I don't know the implications of adding it - we don't mention that tag anywhere in this package and I have no idea the consequences of supporting the end tag and nothing else.

@jonasfj
Copy link

jonasfj commented Sep 24, 2020

That's a far more elegant fix :)

@isoos
Copy link

isoos commented Sep 25, 2020

+1

Copy link
Contributor

@nshahan nshahan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Nate!

@natebosch natebosch merged commit 22f17e9 into master Sep 25, 2020
@natebosch natebosch deleted the infinite-loop-bad-input branch September 25, 2020 16:43
mosuem pushed a commit to dart-lang/tools that referenced this pull request Oct 25, 2024
Closes dart-lang/html#122

Add 'button' to the tags that are processed with `endTagBlock`. The spec
at https://html.spec.whatwg.org/multipage/parsing.html includes 'button'
in the list of end tags with this treatment.

Add a new `.dat` file for regression test. It include an `#info` field
which is new but can be parsed safely to mark the issue for which it is
a test. This test loops endlessly before the fix and passes after the
fix.

Note that since errors are currently untested and tests fail if they are
tested the error will be left without content for now.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes Google CLA signed
Development

Successfully merging this pull request may close these issues.

parsing of bad HTML goes into out-of-memory
5 participants