Chromium Code Reviews
DescriptionHandle 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
Committed: https://crrev.com/49ebcf7d64e71c7d3ac71bca66f65d61180bfb8c
Cr-Commit-Position: refs/heads/master@{#434482}
Patch Set 1 #
Total comments: 6
Patch Set 2 : Better test clean-up #
Total comments: 2
Patch Set 3 : EXPECT_THAT #
Messages
Total messages: 21 (13 generated)
|
||||||||||||||||||||||||||||