Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

7172359: HTML parser StackOverflowError on invalid HTML: <li> tag inside an <option> #10279

Closed
wants to merge 6 commits into from

Conversation

prsadhuk
Copy link
Contributor

@prsadhuk prsadhuk commented Sep 15, 2022

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.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-7172359: HTML parser StackOverflowError on invalid HTML:
  • tag inside an

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/10279/head:pull/10279
$ git checkout pull/10279

Update a local copy of the PR:
$ git checkout pull/10279
$ git pull https://git.openjdk.org/jdk pull/10279/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 10279

View PR using the GUI difftool:
$ git pr show -t 10279

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/10279.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 15, 2022

👋 Welcome back psadhukhan! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Sep 15, 2022

@prsadhuk The following label will be automatically applied to this pull request:

  • client

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the client client-libs-dev@openjdk.org label Sep 15, 2022
@openjdk openjdk bot added the rfr Pull request is ready for review label Sep 15, 2022
@mlbridge
Copy link

mlbridge bot commented Sep 15, 2022

Webrevs

@prsadhuk prsadhuk marked this pull request as draft September 19, 2022 06:42
@openjdk openjdk bot removed the rfr Pull request is ready for review label Sep 19, 2022
@prsadhuk prsadhuk marked this pull request as ready for review September 22, 2022 12:21
@openjdk openjdk bot added the rfr Pull request is ready for review label Sep 22, 2022
Copy link
Contributor

@TejeshR13 TejeshR13 left a comment

Choose a reason for hiding this comment

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

Fix is tested and works fine.

@openjdk
Copy link

openjdk bot commented Sep 28, 2022

@prsadhuk This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

7172359: HTML parser StackOverflowError on invalid HTML: <li> tag inside an <option>

Reviewed-by: tr, jdv, aivanov

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 405 new commits pushed to the master branch:

  • 3d75e88: 8295270: RISC-V: Clean up and refactoring for assembler functions
  • be3b335: 8295026: Remove unused fields in StyleSheet
  • 67046ae: 8276687: Remove support for JDK 1.4.1 PerfData shared memory files
  • b30d922: 8292876: Do not include the deprecated userinfo component of the URI in HTTP/2 headers
  • 2b4830a: 8295017: Remove Windows specific workaround in JLI_Snprintf
  • fdb74ed: 8295301: Problem list TrayIcon tests that fail on Ubuntu 22.04
  • 21407de: 8295173: (tz) Update Timezone Data to 2022e
  • f5f8df1: 8295295: CDS ArchivedEnumTest fails with StaticProperty::JAVA_LOCALE_USE_OLD_ISO_CODES
  • 18dd9ee: 8295025: (bf) ByteBuffer "Access to binary data" section suggests putFloat is void
  • 4224d45: 8295232: "java.locale.useOldISOCodes" property is read lazily
  • ... and 395 more: https://git.openjdk.org/jdk/compare/524af949370990df6f58a84ad2493eb1dcba2231...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Sep 28, 2022
@@ -45,7 +45,7 @@ public static void main( String[] argv ) throws Exception {
Reader reader = new StringReader(badHtml);
kit.read(reader, doc, 0); // StackOverflowError here

System.out.println("Succeeded! (expected StackOverflowError");
System.out.println("Succeeded! (no StackOverflowError");
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
System.out.println("Succeeded! (no StackOverflowError");
System.out.println("Succeeded! (no StackOverflowError)");

The closing parenthesis is missing in the string.

@prsadhuk
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Oct 14, 2022

Going to push as commit 7133fc9.
Since your change was applied there have been 405 commits pushed to the master branch:

  • 3d75e88: 8295270: RISC-V: Clean up and refactoring for assembler functions
  • be3b335: 8295026: Remove unused fields in StyleSheet
  • 67046ae: 8276687: Remove support for JDK 1.4.1 PerfData shared memory files
  • b30d922: 8292876: Do not include the deprecated userinfo component of the URI in HTTP/2 headers
  • 2b4830a: 8295017: Remove Windows specific workaround in JLI_Snprintf
  • fdb74ed: 8295301: Problem list TrayIcon tests that fail on Ubuntu 22.04
  • 21407de: 8295173: (tz) Update Timezone Data to 2022e
  • f5f8df1: 8295295: CDS ArchivedEnumTest fails with StaticProperty::JAVA_LOCALE_USE_OLD_ISO_CODES
  • 18dd9ee: 8295025: (bf) ByteBuffer "Access to binary data" section suggests putFloat is void
  • 4224d45: 8295232: "java.locale.useOldISOCodes" property is read lazily
  • ... and 395 more: https://git.openjdk.org/jdk/compare/524af949370990df6f58a84ad2493eb1dcba2231...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Oct 14, 2022
@openjdk openjdk bot closed this Oct 14, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Oct 14, 2022
@openjdk
Copy link

openjdk bot commented Oct 14, 2022

@prsadhuk Pushed as commit 7133fc9.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@prsadhuk prsadhuk deleted the JDK-7172359 branch October 14, 2022 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client client-libs-dev@openjdk.org integrated Pull request has been integrated
4 participants