commit | 56aa396c1e99ece23b711fb831c5505225b0b1b1 | [log] [tgz] |
---|---|---|
author | Yi Su <mrsuyi@chromium.org> | Thu Mar 21 20:55:24 2019 |
committer | Commit Bot <commit-bot@chromium.org> | Thu Mar 21 20:55:24 2019 |
tree | cf239e713028a54b50094947db747fd3bdab0f18 | |
parent | 4685a848c08a5e0a0597066abb156b4eecfa5ef6 [diff] |
Fix crash caused by dup-sections in Passwords VC. Currently, activating search bar in PasswordsTableViewController will remove the "save passwords" switch section, and deactivating the search bar will add it back. However, PasswordsTableViewController.loadModel doesn't check the status of search bar when adding switch section, so dup-sections will happen in this scenario: 1. PasswordsTableViewController is inited; 2. Switch section is added in |loadModel|; 3. User activates the search bar; 4. Switch section is removed in |willPresentSearchController|; 5. |onGetPasswordStoreResults| is called, which will call |loadModel|; 6. |loadModel| adds the switch section; 7. User deactivates the search bar; 8. Another switch section is added back in |willDismissSearchController|. And dup switch sections will cause a crash in following steps: 1. User taps "Edit"; 2. User selects the switch item in the second switch section; 3. User taps "Delete". The crash happens because the SettingsSwitchItem will be cast to Passwords SavedFormContentItem, which leads to corrupted memory. Bug: 943649 Change-Id: Ic486886cefb1aceda3a8a986502a8ffb1a34e019 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1533945 Commit-Queue: Yi Su <mrsuyi@chromium.org> Auto-Submit: Yi Su <mrsuyi@chromium.org> Reviewed-by: Sergio Collazos <sczs@chromium.org> Cr-Commit-Position: refs/heads/master@{#643106}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .