Don't use dangling reference in...
Don't use dangling reference in ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline This patch changes to avoid dangling reference in ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline(). In this function, we hold pointer to inlineStyle member in ElemendData from |node|. The |node| doesn't change in loop body unless it doesn't have a self-conflicting inline style, e.g. <b style="font-weight: normal">. In this case, we should update |inlineStyle| variable to new value from ElementData of newly created element. Note: Attached test case is failed only on ASAN build by heap-use-after-free. BUG=356517 TEST=LayoutTests/editing/execCommand/remove-redundant-styles-and-keep-style-span-inline-crashed.html Review URL: https://codereview.chromium.org/212323004 git-svn-id: svn://svn.chromium.org/blink/trunk@170133 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Showing
Please register or sign in to comment