New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 780314 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Mar 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

ChromeHttpAuthHandler with null Activity crashes Chromium

Reported by artyo...@gmail.com, Oct 31 2017

Issue description

Steps 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:
 
Cc: sandeepkumars@chromium.org
Labels: Needs-triage-Mobile Triaged-Mobile Needs-Feedback
@artyom17: Thanks for the report!!

Could you please help us with the sample test file, OS and details of your device, Android Chrome version and if possible attach a screencast to check the issue from our end.

Thanks!!

Comment 2 by artyo...@gmail.com, 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.
Project Member

Comment 3 by sheriffbot@chromium.org, Nov 1 2017

Labels: -Needs-Feedback
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
Labels: TE-NeedsTriageHelp
Attaching TE-NeedsTriageHelp label for further triage of the issue as we cannot create a customized Chrome.

Thanks!!
Components: Mobile
Status: WontFix (was: Unconfirmed)
***Bulk edit***

Since there is no valid updates, closing for now. Feel free to reopen if needed.

Sign in to add a comment