WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
90560
SurroundingText should not advance character iterators if they are at end
https://bugs.webkit.org/show_bug.cgi?id=90560
Summary
SurroundingText should not advance character iterators if they are at end
Leandro Graciá Gil
Reported
2012-07-04 08:58:55 PDT
Both the CharacterIterator and BackwardsCharacterIterator classes try to advance their internal iterator before actually checking if this iterator is at its end position. If this is the case TextIterator::advance might try to dereference a null m_node and crash. The character iterator classes should make sure they never try to advance when already at end.
Attachments
Patch
(4.85 KB, patch)
2012-07-04 09:24 PDT
,
Leandro Graciá Gil
no flags
Details
Formatted Diff
Diff
Patch
(6.35 KB, patch)
2012-07-05 07:57 PDT
,
Leandro Graciá Gil
no flags
Details
Formatted Diff
Diff
Patch
(6.89 KB, patch)
2012-07-06 02:28 PDT
,
Leandro Graciá Gil
no flags
Details
Formatted Diff
Diff
Patch
(8.82 KB, patch)
2012-07-09 11:08 PDT
,
Leandro Graciá Gil
no flags
Details
Formatted Diff
Diff
Show Obsolete
(3)
View All
Add attachment
proposed patch, testcase, etc.
Leandro Graciá Gil
Comment 1
2012-07-04 09:24:03 PDT
Created
attachment 150813
[details]
Patch
Alexey Proskuryakov
Comment 2
2012-07-04 12:40:45 PDT
How did you measure performance impact?
Ryosuke Niwa
Comment 3
2012-07-04 12:45:23 PDT
Comment on
attachment 150813
[details]
Patch I don't think we should be making this change. If anything, we should be asserting that !atEnd() in these two functions. What we should be fixing is the caller of these functions.
Leandro Graciá Gil
Comment 4
2012-07-05 07:56:43 PDT
(In reply to
comment #3
)
> (From update of
attachment 150813
[details]
) > I don't think we should be making this change. If anything, we should be asserting that !atEnd() in these two functions. What we should be fixing is the caller of these functions.
Good point. I'll be updating the patch to do that.
Leandro Graciá Gil
Comment 5
2012-07-05 07:57:26 PDT
Created
attachment 150938
[details]
Patch
Leandro Graciá Gil
Comment 6
2012-07-05 08:03:58 PDT
(In reply to
comment #2
)
> How did you measure performance impact?
No longer making the check in the character iterators for release builds. Checking in SurroundingText which is out of the critical path.
Leandro Graciá Gil
Comment 7
2012-07-05 11:54:55 PDT
Comment on
attachment 150938
[details]
Patch Thanks for the review.
WebKit Review Bot
Comment 8
2012-07-05 13:03:59 PDT
Comment on
attachment 150938
[details]
Patch Clearing flags on attachment: 150938 Committed
r121921
: <
http://trac.webkit.org/changeset/121921
>
WebKit Review Bot
Comment 9
2012-07-05 13:04:12 PDT
All reviewed patches have been landed. Closing bug.
WebKit Review Bot
Comment 10
2012-07-05 18:19:18 PDT
Re-opened since this is blocked by 90648
Ryosuke Niwa
Comment 11
2012-07-05 18:33:44 PDT
Comment on
attachment 150938
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=150938&action=review
> Source/WebCore/editing/TextIterator.cpp:1410 > + ASSERT(!atEnd()); > +
We need to get rid of these assertions or fix callers.
Leandro Graciá Gil
Comment 12
2012-07-06 02:28:40 PDT
Created
attachment 151045
[details]
Patch
Leandro Graciá Gil
Comment 13
2012-07-06 02:31:24 PDT
Comment on
attachment 151045
[details]
Patch Assertions moved out of character iterators to SurroundingText. Also adding a few more checks to properly handle any possible null ranges that might come from this case.
Ryosuke Niwa
Comment 14
2012-07-08 21:50:41 PDT
(In reply to
comment #13
)
> (From update of
attachment 151045
[details]
) > Assertions moved out of character iterators to SurroundingText. Also adding a few more checks to properly handle any possible null ranges that might come from this case.
We need add tests for these new checks.
Leandro Graciá Gil
Comment 15
2012-07-09 11:08:42 PDT
Created
attachment 151283
[details]
Patch
Leandro Graciá Gil
Comment 16
2012-07-09 11:09:42 PDT
Comment on
attachment 151283
[details]
Patch Moving the null visible position check to the WebCore side as discussed in IRC.
WebKit Review Bot
Comment 17
2012-07-09 12:37:16 PDT
Comment on
attachment 151283
[details]
Patch Clearing flags on attachment: 151283 Committed
r122139
: <
http://trac.webkit.org/changeset/122139
>
WebKit Review Bot
Comment 18
2012-07-09 12:37:21 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug