Summary: | Web Inspector: HTML Formatting: Handle infinite loop for incomplete script data | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Joseph Pecoraro <joepeck> | ||||||
Component: | Web Inspector | Assignee: | Joseph Pecoraro <joepeck> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | hi, inspector-bugzilla-changes, joepeck, webkit-bug-importer | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | All | ||||||||
OS: | All | ||||||||
Attachments: |
|
Description
Joseph Pecoraro
2019-09-13 13:05:54 PDT
Created attachment 378749 [details]
[PATCH] Proposed Fix
Comment on attachment 378749 [details]
[PATCH] Proposed Fix
Revising this with some more edge cases.
Created attachment 378762 [details]
[PATCH] Proposed Fix
Comment on attachment 378762 [details] [PATCH] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=378762&action=review r=me, looks reasonable :) > Source/WebInspectorUI/UserInterface/Workers/Formatter/HTMLParser.js:181 > + if (this._isEOF() && this._data.endsWith("<")) Could you move this check into the `if (text)` above, since we would’ve consumed up to a “<“ there anyways? I think then we could still use `_handleEOF`. > Source/WebInspectorUI/UserInterface/Workers/Formatter/HTMLParser.js:199 > + this._handleEOF(startPos); Could we have `_handleEOF` return whether `_isEOF` so we don’t have to check it twice? Comment on attachment 378762 [details] [PATCH] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=378762&action=review >> Source/WebInspectorUI/UserInterface/Workers/Formatter/HTMLParser.js:181 >> + if (this._isEOF() && this._data.endsWith("<")) > > Could you move this check into the `if (text)` above, since we would’ve consumed up to a “<“ there anyways? I think then we could still use `_handleEOF`. I think we will need to do both anyways. For example `<` (empty text, but last character is "<"), and `a<` (non-empty text, but last character is "<"). Or am I overlooking something? >> Source/WebInspectorUI/UserInterface/Workers/Formatter/HTMLParser.js:199 >> + this._handleEOF(startPos); > > Could we have `_handleEOF` return whether `_isEOF` so we don’t have to check it twice? Sure |