Bug 159986 - WebBackForwardList's currentIndex could get out of bounds when filtering items.
Summary: WebBackForwardList's currentIndex could get out of bounds when filtering items.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-07-20 14:22 PDT by Yongjun Zhang
Modified: 2016-07-21 10:02 PDT (History)
6 users (show)

See Also:


Attachments
Patch. (10.12 KB, patch)
2016-07-20 15:31 PDT, Yongjun Zhang
no flags Details | Formatted Diff | Diff
Fix style issues. (10.12 KB, patch)
2016-07-20 15:43 PDT, Yongjun Zhang
no flags Details | Formatted Diff | Diff
Fix style issues. (10.13 KB, patch)
2016-07-20 16:37 PDT, Yongjun Zhang
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews126 for ios-simulator-wk2 (3.48 MB, application/zip)
2016-07-20 17:36 PDT, Build Bot
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yongjun Zhang 2016-07-20 14:22:50 PDT
In WebBackForwardList::backForwardListState, if we are filtering multiple items and generating a new BackForwardListState, the new list's currentIndex could get out of bounds. If we restore the new state to a web view, accessing to its currentItem later could lead to a crash.
Comment 1 Yongjun Zhang 2016-07-20 14:23:53 PDT
rdar://problem/27392691
Comment 2 Yongjun Zhang 2016-07-20 15:31:51 PDT
Created attachment 284156 [details]
Patch.
Comment 3 WebKit Commit Bot 2016-07-20 15:34:25 PDT
Attachment 284156 [details] did not pass style-queue:


ERROR: Tools/TestWebKitAPI/Tests/WebKit2/WKBackForwardList.mm:31:  Alphabetical sorting problem.  [build/include_order] [4]
ERROR: Tools/TestWebKitAPI/Tests/WebKit2/WKBackForwardList.mm:80:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
Total errors found: 2 in 5 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Yongjun Zhang 2016-07-20 15:43:08 PDT
Created attachment 284158 [details]
Fix style issues.
Comment 5 Ryosuke Niwa 2016-07-20 16:16:04 PDT
Comment on attachment 284158 [details]
Fix style issues.

Oops, sorry, reverting the flag change.
Comment 6 Yongjun Zhang 2016-07-20 16:37:33 PDT
Created attachment 284169 [details]
Fix style issues.
Comment 7 Build Bot 2016-07-20 17:36:29 PDT
Comment on attachment 284169 [details]
Fix style issues.

Attachment 284169 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/1718233

New failing tests:
imported/w3c/web-platform-tests/html/semantics/embedded-content/the-embed-element/embed-represent-nothing-03.html
Comment 8 Build Bot 2016-07-20 17:36:32 PDT
Created attachment 284175 [details]
Archive of layout-test-results from ews126 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews126  Port: ios-simulator-wk2  Platform: Mac OS X 10.11.5
Comment 9 Yongjun Zhang 2016-07-21 09:49:41 PDT
The iOS simulator test failure doesn't seem to be related with this patch.
Comment 10 WebKit Commit Bot 2016-07-21 10:02:08 PDT
Comment on attachment 284169 [details]
Fix style issues.

Clearing flags on attachment: 284169

Committed r203508: <http://trac.webkit.org/changeset/203508>
Comment 11 WebKit Commit Bot 2016-07-21 10:02:12 PDT
All reviewed patches have been landed.  Closing bug.