Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(244)

Issue 26168008: [blink] Avoid null pointer dereference in HitTestResult::isMisspelled() (Closed)

Created:
7 years, 2 months ago by please use gerrit instead
Modified:
6 years, 9 months ago
Reviewers:
tony, eseidel
CC:
eae+blinkwatch, leviw+renderwatch, jchaffraix+rendering, groby-ooo-7-16, yosin_UTC9
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

[blink] Avoid null pointer dereference in HitTestResult::isMisspelled() The method HitTestResult::isMisspelled() assumed that renderer would always be present in the right-clicked editable item. This is not the case when right-clicking on an item in an editable combobox created by jQuery Searchable DropDown Plugin (http://jsearchdropdown.sf.net). This patch changes HitTestResult::isMisspelled() to check if the renderer is present. If there's no renderer, then the method returns false (there shouldn't be spellcheck related items in the context menu). Manual test 1: Click on the drop-down on http://jsearchdropdown.sf.net and right-click on any of the items. The page should not crash. Manual test 2: Run the following script and right-click anywhere on the page. The page should not crash. <html> <head> <script> window.onload = function() { var element = document.getElementsByTagName('html')[0]; document.adoptNode(element); var newElement = document.createElementNS('http://www.w3.org/2000/svg', 'title'); document.appendChild(newElement); document.execCommand('SelectAll', false) document.designMode = 'on'; }; </script> </head> </html> TEST=LayoutTests/editing/spelling/right-click-no-renderer-crash.html BUG=304165 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=168490

Patch Set 1 #

Patch Set 2 : Add a layout test #

Patch Set 3 : Add expectations. #

Total comments: 6

Patch Set 4 : Select HTML element, click on position 10x10. #

Patch Set 5 : Move is-misspelled logic to event handler. #

Patch Set 6 : Original fix #

Unified diffs Side-by-side diffs Delta from patch set Stats (+32 lines, -1 line) Patch
A LayoutTests/editing/spelling/right-click-no-renderer-crash.html View 1 2 3 1 chunk +27 lines, -0 lines 0 comments Download
A LayoutTests/editing/spelling/right-click-no-renderer-crash-expected.txt View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M Source/core/rendering/HitTestResult.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 34 (0 generated)
please use gerrit instead
Tony: PTAL.
7 years, 2 months ago (2013-10-07 18:53:52 UTC) #1
tony
Please create a manual test and add it to the ManualTests directory. I would be ...
7 years, 2 months ago (2013-10-07 19:11:21 UTC) #2
groby-ooo-7-16
Seems the bug now has a repro case. Rouslan, any chance you can add a ...
6 years, 10 months ago (2014-02-21 03:55:30 UTC) #3
please use gerrit instead
Sounds good. (Although the "minimized" repro case is 130 lines long, which makes me think ...
6 years, 10 months ago (2014-02-21 16:56:55 UTC) #4
please use gerrit instead
Sounds good. (Although the "minimized" repro case is 130 lines long, which makes me think ...
6 years, 10 months ago (2014-02-21 16:56:56 UTC) #5
please use gerrit instead
Eric: PTAL.
6 years, 10 months ago (2014-02-25 00:06:19 UTC) #6
tony
FWIW, I'm happy to LGTM this change since it's simple.
6 years, 10 months ago (2014-02-25 00:08:29 UTC) #7
please use gerrit instead
Try-bots failing due to the issue being private.
6 years, 10 months ago (2014-02-25 00:17:13 UTC) #8
eseidel
The fix looks generally good, I'm just not sure it's the right place to fix ...
6 years, 10 months ago (2014-02-25 00:30:01 UTC) #9
please use gerrit instead
Eric: PTAL Patch Set 4. https://codereview.chromium.org/26168008/diff/55001/LayoutTests/editing/spelling/right-click-no-renderer-crash.html File LayoutTests/editing/spelling/right-click-no-renderer-crash.html (right): https://codereview.chromium.org/26168008/diff/55001/LayoutTests/editing/spelling/right-click-no-renderer-crash.html#newcode7 LayoutTests/editing/spelling/right-click-no-renderer-crash.html:7: var element = document.getElementsByTagName('*')[0]; ...
6 years, 10 months ago (2014-02-25 01:14:53 UTC) #10
yosin_UTC9
On 2014/02/25 00:30:01, eseidel wrote: > The fix looks generally good, I'm just not sure ...
6 years, 10 months ago (2014-02-25 01:19:05 UTC) #11
please use gerrit instead
Yoshi & Eric: PTAL. I've moved is-misspelled logic into EventHandlerr::sendContextMenuEvent().
6 years, 10 months ago (2014-02-25 18:37:10 UTC) #12
eseidel
6 years, 10 months ago (2014-02-25 19:10:16 UTC) #13
please use gerrit instead
ping...
6 years, 9 months ago (2014-02-28 18:27:06 UTC) #14
eseidel
I don't like this fix. We took code which logically made sense as a function ...
6 years, 9 months ago (2014-02-28 22:01:46 UTC) #15
eseidel
My apologies for being slow to review. It looks like targetNode()->renderer() is null checked in ...
6 years, 9 months ago (2014-02-28 22:04:27 UTC) #16
please use gerrit instead
Eric: PTAL Patch Set 6. Patch Set 6 has the original fix, which I also ...
6 years, 9 months ago (2014-02-28 23:56:03 UTC) #17
eseidel
lgtm
6 years, 9 months ago (2014-03-01 00:16:20 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rouslan@chromium.org/26168008/115001
6 years, 9 months ago (2014-03-01 00:16:31 UTC) #19
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-01 00:41:03 UTC) #20
commit-bot: I haz the power
Retried try job too often on blink_presubmit for step(s) presubmit http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=blink_presubmit&number=17037
6 years, 9 months ago (2014-03-01 00:41:04 UTC) #21
please use gerrit instead
Removed the "private" bit to enable commit.
6 years, 9 months ago (2014-03-03 17:25:04 UTC) #22
please use gerrit instead
The CQ bit was checked by rouslan@chromium.org
6 years, 9 months ago (2014-03-03 17:25:10 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rouslan@chromium.org/26168008/115001
6 years, 9 months ago (2014-03-03 17:25:44 UTC) #24
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-03 19:29:40 UTC) #25
commit-bot: I haz the power
Retried try job too often on linux_blink for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_blink&number=14908
6 years, 9 months ago (2014-03-03 19:29:41 UTC) #26
please use gerrit instead
The CQ bit was checked by rouslan@chromium.org
6 years, 9 months ago (2014-03-03 22:37:40 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rouslan@chromium.org/26168008/115001
6 years, 9 months ago (2014-03-03 22:38:06 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rouslan@chromium.org/26168008/115001
6 years, 9 months ago (2014-03-03 23:23:13 UTC) #29
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-04 15:55:31 UTC) #30
commit-bot: I haz the power
Retried try job too often on win_layout for step(s) webkit_lint http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_layout&number=25490
6 years, 9 months ago (2014-03-04 15:55:32 UTC) #31
please use gerrit instead
The CQ bit was checked by rouslan@chromium.org
6 years, 9 months ago (2014-03-04 18:57:53 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rouslan@chromium.org/26168008/115001
6 years, 9 months ago (2014-03-04 18:58:32 UTC) #33
commit-bot: I haz the power
6 years, 9 months ago (2014-03-05 15:46:28 UTC) #34
Message was sent while issue was closed.
Change committed as 168490

Powered by Google App Engine
This is Rietveld 408576698