Closed Bug 1477875 Opened Last year Closed 6 months ago

_getErrorMessageFromCode in NetErrorContent.jsm doesn't handle e.g. NSPR errors well

Categories

(Firefox :: Security, defect, P3)

defect

Tracking

()

RESOLVED FIXED
Firefox 68
Tracking Status
firefox68 --- fixed

People

(Reporter: keeler, Assigned: aqadri)

References

Details

Attachments

(1 file)

STR: run `nc -l 4433 -k < /dev/null > /dev/null`, connect to "https://localhost:4433" in firefox, then ctrl+c the netcat instance. Firefox should report a PR_END_OF_FILE_ERROR error. What I'm seeing is the error "JavaScript error: resource:///modules/NetErrorContent.jsm, line 525: NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIStringBundle.GetStringFromName]" in the console and I'm not sure that the error page gets set up correctly. (At the very least, we shouldn't be seeing that error in the console.)
Priority: -- → P3

The error occurs here: https://searchfox.org/mozilla-central/rev/92d11a33250a8e368c8ca3e962e15ca67117f765/browser/actors/NetErrorChild.jsm#694

We're trying to load a translation string that doesn't exist. Now, I would suggest we could just try-catch this block and leave the "msg" parameter empty if getting the string failed, but I haven't seen the consequences of that. Right now the error page that gets shown looks okay to me. That means we may want to bail out early if no string was found.

This needs some investigation :)

Hi Johann, thanks for pointing me here! I'd be happy to help out with this.

Great, thanks!

Assignee: nobody → jjo.su1822
Status: NEW → ASSIGNED

Hi Joanna, are you still looking into this or should we unassign you? :)

Thanks!

Flags: needinfo?(jjo.su1822)

That string that Comment 1 refers to is "PR_END_OF_FILE_ERROR" for me in bug 1541315

Duplicate of this bug: 1541315

Unassigning due to inactivity, let me know if you want to pick it up again!

Assignee: jjo.su1822 → nobody
Status: ASSIGNED → NEW
Flags: needinfo?(jjo.su1822)

:aqadri, would you like to take this bug? See comment 1, you could try doing what is suggested in that comment and see how it looks.

Thanks!

Flags: needinfo?(asra.qadri)

Thanks! will start working on it.

Flags: needinfo?(asra.qadri)
Assignee: nobody → asra.qadri
Keywords: checkin-needed

Pushed by cbrindusan@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/148516daeb06
_getErrorMessageFromCode in NetErrorContent.jsm doesn't handle e.g. NSPR errors well. r=johannh

Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 68
You need to log in before you can comment on or make changes to this bug.