Closed Bug 726796 Opened 8 years ago Closed Last year

passwords.search function "crashes" with some profiles

Categories

(Add-on SDK Graveyard :: General, defect, major)

defect
Not set
major

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: nmaier, Unassigned)

Details

The passwords module tries to convert retrieved logins to it's internal Login() type, however nsILoginInfo does not guarantee that all "url" fields, in particular the formSubmitURL member, are in fact URLs.
Some other add-ons might store information that cannot be parsed as an URL, and hence will crash passwords.search() in a way that it never calls the onComplete callback, with a stack similar to the following:

Error: An exception occurred.
Traceback (most recent call last):
  File "resource://jid1-8bd4ev1healr7w-at-jetpack/api-utils/lib/url.js", line 99, in URL
    var uri = newURI(url, base);
  File "resource://jid1-8bd4ev1healr7w-at-jetpack/api-utils/lib/url.js", line 53, in newURI
    throw new Error("malformed URI: " + uriStr);
Error: malformed URI: FireFTP

(That URI was obviously created by the FireFTP login).

While the other add-on (such as FireFTP) might actually violate convention here, the SDK passwords module should still not simply crash here.

STR:
1) Execute the following code once, e.g. in an about:memory ScratchPad:
Components.utils.import("resource://gre/modules/Services.jsm");
var nsLoginInfo = new Components.Constructor(
    "@mozilla.org/login-manager/loginInfo;1",
    Components.interfaces.nsILoginInfo,
    "init"
    );
Services.logins.addLogin(new nsLoginInfo(
    "testHost",
    "testForm",
    null,
    "testUser",
    "testPassword",
    "", ""
    ));

2) require("passwords").search({onComplete: function() {}});

-> Observe the crash in the error console, and also that onComplete is never called.
Might be also important for add-on reviews: CC'ing Jorgev
Summary: passwords.search modules "crashes" with some profile → passwords.search function "crashes" with some profiles
Irakli, can you look at this?
Whiteboard: [triage:followup]
Assignee: nobody → rFobic
Priority: -- → P1
Whiteboard: [triage:followup]
Assignee: rFobic → jsantell
Unassigning myself from bugs I haven't gotten around to
Assignee: jsantell → nobody
Priority: P1 → --
Add-on SDK is no longer supported so resolving bugs as INCOMPLETE
Status: NEW → RESOLVED
Closed: Last year
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.