Code clean up : check null for preventing crash in core/layout
Reported by
ddonggom...@gmail.com,
Aug 4 2017
|
|||
Issue descriptionUserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36 Steps to reproduce the problem: It does not have test-case and steps for reproduce. Those defects are reported from static analysis tools. What is the expected behavior? What went wrong? Previous codes can occur crash if some variables have null pointer in each files in core/layout. It does not have problem just now, but it still contains potential issue. We need to remove potential risk factors. Did this work before? N/A Chrome version: 59.0.3071.115 Channel: n/a OS Version: Flash Version:
,
Aug 7 2017
,
Aug 9 2017
,
Aug 17 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/8451e2e0d191b428fd9048d78323c913e6de1921 commit 8451e2e0d191b428fd9048d78323c913e6de1921 Author: DongJun Kim <djmix.kim@samsung.com> Date: Thu Aug 17 18:05:37 2017 Remove unnecessary condition in CounterNode::InsertAfter It will be return in InsertAfter() early, if new_child->first_child_ is nullptr. So, we do not need check for first is nullptr in here. This patch is for cleaning up the codes BUG=752371 Change-Id: I5d854d5b025f62b92e6fc7f0e815bf320243f0c0 Reviewed-on: https://chromium-review.googlesource.com/601647 Reviewed-by: Stephen Chenney <schenney@chromium.org> Commit-Queue: Stephen Chenney <schenney@chromium.org> Cr-Commit-Position: refs/heads/master@{#495221} [modify] https://crrev.com/8451e2e0d191b428fd9048d78323c913e6de1921/third_party/WebKit/Source/core/layout/CounterNode.cpp
,
Aug 17 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/219e1da7d71acae806e2223332504a426f8a6d65 commit 219e1da7d71acae806e2223332504a426f8a6d65 Author: deejay <djmix.kim@samsung.com> Date: Thu Aug 17 18:06:01 2017 fixup! Dispel the myth that enclosingLayer can return zero According from the commit messages of previous commit, enclosingLayer() cannot be nullptr, but it removed a check for container() returning nullptr actually. We need to check nullptr before using it in LayoutObject::ComputeLayerHitTestRects(). This patch is re-organizing the existing conditions to remove potential risk factors. Original patch = https://codereview.chromium.org/215843002 BUG=752371 Change-Id: I29a1d2d98f7daa200bf3f001e430d8e3aa9f38f3 Reviewed-on: https://chromium-review.googlesource.com/587691 Reviewed-by: Stephen Chenney <schenney@chromium.org> Commit-Queue: Stephen Chenney <schenney@chromium.org> Cr-Commit-Position: refs/heads/master@{#495222} [modify] https://crrev.com/219e1da7d71acae806e2223332504a426f8a6d65/third_party/WebKit/Source/core/layout/LayoutObject.cpp
,
Aug 23 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/bf20977ca2b1af2eff9769679dc45015711c0b57 commit bf20977ca2b1af2eff9769679dc45015711c0b57 Author: djmix.kim <djmix.kim@samsung.com> Date: Wed Aug 23 16:29:21 2017 Remove unnecessary condition in LayoutBlock Basically, positioned object can't be the root of a layout tree. So we do not need to check nullptr for "o" in while loop because of parent always exists. This patch is just for cleaning up the codes. BUG=752371 Change-Id: I4b1f10c9b723b0736fa90fd488ca03973c48667e Reviewed-on: https://chromium-review.googlesource.com/601628 Reviewed-by: Stephen Chenney <schenney@chromium.org> Commit-Queue: Stephen Chenney <schenney@chromium.org> Cr-Commit-Position: refs/heads/master@{#496706} [modify] https://crrev.com/bf20977ca2b1af2eff9769679dc45015711c0b57/third_party/WebKit/Source/core/layout/LayoutBlock.cpp |
|||
►
Sign in to add a comment |
|||
Comment 1 by djmix....@samsung.com
, Aug 4 2017