Closed Bug 1570786 Opened 5 years ago Closed 3 years ago

[@ mozilla::ContentPrincipal::GetURI ] null deref

Categories

(Core :: Networking, defect, P2)

62 Branch
defect

Tracking

()

RESOLVED FIXED
91 Branch
Tracking Status
firefox-esr60 --- unaffected
firefox-esr68 --- wontfix
firefox-esr78 --- wontfix
firefox68 --- wontfix
firefox69 --- wontfix
firefox70 --- wontfix
firefox89 --- wontfix
firefox90 --- wontfix
firefox91 --- fixed

People

(Reporter: Oriol, Assigned: valentin)

References

(Regression)

Details

(Keywords: crash, regression, Whiteboard: [necko-triaged])

Crash Data

Attachments

(1 file)

Open browser console and run

Cc["@mozilla.org/principal;1"].createInstance(Ci.nsIPrincipal).URI

Expected: it returns null
Actual: browser crashes (null deref)

Regression window: https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=96b37ba12225d580f2b201d26915f88c5cb0d8a6&tochange=aabfe960ab59fea2e85896b1f8050786e16ab23b

Probably bug 1448058

Priority: -- → P2
Whiteboard: [necko-triaged]
Assignee: nobody → valentin.gosu
Severity: normal → S3

The testcase from comment 0 does no longer work because bug 1711078 removed Cc["@mozilla.org/principal;1"].
I can still use

Cc["@mozilla.org/systemprincipal;1"].createInstance(Ci.nsIPrincipal).URI;

but that just returns null as expected.

So not sure if you patch is actually needed.

Technically true, there don't seem to be any ways of creating a contentPrincipal from JS with a null URI.
SystemPrincipal always returns a null URI.

For correctness I'd still like to land this. NS_ADDREF(*x = member) is a bad pattern anyway.

Pushed by valentin.gosu@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/56888fc83da3
Avoid ContentPrincipal::GetURI null deref r=necko-reviewers,kershaw
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 91 Branch
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: