ChromeHttpAuthHandler with null Activity crashes Chromium
Reported by
artyo...@gmail.com,
Oct 31 2017
|
|||||
Issue descriptionSteps to reproduce the problem: There is no easy way to repro the issue, it requires custom code mods. However, the bug is obvious: ChromeHttpAuthHandler attempts to create LoginPrompt even when activity == null. What is the expected behavior? Shouldn't crash What went wrong? java/org/chromium/chrome/browser/ChromeHttpAuthHandler.java, method showDialog (https://cs.chromium.org/chromium/src/chrome/android/java/src/org/chromium/chrome/browser/ChromeHttpAuthHandler.java?q=ChromeHttpAuthHandler&sq=package:chromium&dr=CSs&l=21) @CalledByNative private void showDialog(WindowAndroid windowAndroid) { if (windowAndroid == null) { cancel(); } Activity activity = windowAndroid.getActivity().get(); if (activity == null) { cancel(); } //!!! LoginPrompt is still being created even if activity == null !!! LoginPrompt authDialog = new LoginPrompt(activity, this); setAutofillObserver(authDialog); authDialog.show(); } It crashes inside the LoginPrompt where the null activity is used to get the dialog layout. I guess, the fix should be like that: @CalledByNative private void showDialog(WindowAndroid windowAndroid) { if (windowAndroid == null) { cancel(); } Activity activity = windowAndroid.getActivity().get(); if (activity == null) { cancel(); } else { //!AB, do not try to create LoginPrompt with the null activity. LoginPrompt authDialog = new LoginPrompt(activity, this); setAutofillObserver(authDialog); authDialog.show(); } } Did this work before? No Chrome version: 61.0.3163.100 Channel: n/a OS Version: 10.0 Flash Version:
,
Nov 1 2017
Like I said, we use a customized version of Chromium with no Activities, thus it is impossible to make a test file. We are on Android M / N. The quoted code should be self-descriptive for the bug.
,
Nov 1 2017
Thank you for providing more feedback. Adding requester "sandeepkumars@chromium.org" to the cc list and removing "Needs-Feedback" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Nov 2 2017
Attaching TE-NeedsTriageHelp label for further triage of the issue as we cannot create a customized Chrome. Thanks!!
,
Nov 12 2017
,
Mar 9 2018
***Bulk edit*** Since there is no valid updates, closing for now. Feel free to reopen if needed. |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by sandeepkumars@chromium.org
, Nov 1 2017Labels: Needs-triage-Mobile Triaged-Mobile Needs-Feedback