New issue
Advanced search Search tips

Issue 752371 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner: ----
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug



Sign in to add a comment

Code clean up : check null for preventing crash in core/layout

Reported by ddonggom...@gmail.com, Aug 4 2017

Issue description

UserAgent: 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:
 
Now I've prepare patch-set for this issue.

Comment 3 by kochi@chromium.org, Aug 7 2017

Components: Blink>Layout

Comment 4 by e...@chromium.org, Aug 9 2017

Status: Assigned (was: Unconfirmed)
Project Member

Comment 5 by bugdroid1@chromium.org, 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

Project Member

Comment 6 by bugdroid1@chromium.org, 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

Project Member

Comment 7 by bugdroid1@chromium.org, 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