Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Issue 2534113002: Handle empty string in GetSavePasswordDialogTitleTextAndLinkRange gracefully (Closed)

Created:
4 years ago by vabr (Chromium)
Modified:
4 years ago
Reviewers:
CC:
chromium-reviews
Target Ref:
refs/pending/branch-heads/2883
Project:
chromium
Visibility:
Public.

Description

Handle empty string in GetSavePasswordDialogTitleTextAndLinkRange gracefully GetSavePasswordDialogTitleTextAndLinkRange currently assumes that localised strings for particular IDs contain placeholders, and attempts to access the vector of offsets corresponding to such placeholders. However, in some situations (http://crbug.com/658902#c18) the localised string may be empty. This led to an out-of-bounds access and crash on Android. This CL is the smallest change to handle such situation gracefully -- it checks the length of the vector with offsets and gives up accessing it if it is empty. This avoids the crash but results in displaying a UI with empty strings. Ideally, the UI would also be supressed on these occasions, but that is left for follow-up CLs. The current situation is already an improvement (password manager is still not very useful, but at least the browser has a chance to continue). The CL also removes the temporary logging put in for the crash investigation. BUG=658902 Review-Url: https://codereview.chromium.org/2526283002 Cr-Commit-Position: refs/heads/master@{#434482} (cherry picked from commit 49ebcf7d64e71c7d3ac71bca66f65d61180bfb8c) Committed: https://chromium.googlesource.com/chromium/src/+/910f52d5209148d0ad1afa8cbfb9360d65fcb00e

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+84 lines, -2 lines) Patch
M chrome/browser/ui/passwords/manage_passwords_view_utils.cc View 1 chunk +7 lines, -2 lines 0 comments Download
M chrome/browser/ui/passwords/manage_passwords_view_utils_unittest.cc View 2 chunks +77 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (1 generated)
vabr (Chromium)
Committed patchset #1 (id:1) manually as 910f52d5209148d0ad1afa8cbfb9360d65fcb00e.
4 years ago (2016-11-29 07:20:25 UTC) #2
vabr (Chromium)
4 years ago (2016-11-29 08:11:11 UTC) #3
Message was sent while issue was closed.
A revert of this CL (patchset #1 id:1) has been created in
https://codereview.chromium.org/2535183002/ by vabr@chromium.org.

The reason for reverting is: Compile failure.
BUG=669394.

Powered by Google App Engine
This is Rietveld 408576698