On Thu, 22 Sep 2022 12:23:36 GMT, Prasanta Sadhukhan <[email protected]>
wrote:
>> If there is invalid tag, stack terminates but it still tries to recurse
>> through by calling legalElementContext() which results in StackOverflowError.
>> Fix is to return if stack is terminated after checking current tag is not
>> valid in current context
>>
>> All other test/html/parser as well as other jtreg suite tests are ok with
>> the fix.
>
> Prasanta Sadhukhan has updated the pull request incrementally with one
> additional commit since the last revision:
>
> Return only if current tag is not valid in current context
test/jdk/javax/swing/text/html/parser/ParserCrash.java line 35:
> 33: import java.io.Reader;
> 34:
> 35: public class ParserCrash {
It is not a **crash**, it is `StackOverflowError`, a better name would be
`ParserStackOverflow(InInvalidTagContext)`.
test/jdk/javax/swing/text/html/parser/ParserCrash.java line 48:
> 46: kit.read(reader, doc, 0); // StackOverflowError here
> 47:
> 48: System.out.println("Succeeded! (expected StackOverflowError");
Suggestion:
System.out.println("Succeeded! (no StackOverflowError)");
You *do not expect* it but it was thrown before the fix.
-------------
PR: https://git.openjdk.org/jdk/pull/10279