Open Bug 2089981 Opened 14 days ago

Check the result of PrincipalToPrincipalInfo for the interception triggering principal

Categories

(Core :: IPC, task)

task

Tracking

()

People

(Reporter: Sylvestre, Unassigned, Mentored)

References

(Blocks 1 open bug)

Details

(Keywords: good-first-bug, Whiteboard: [lang=c++])

Filing as a good first bug to learn workflows.

In LoadInfoToLoadInfoArgs, every other PrincipalToPrincipalInfo call is followed by NS_ENSURE_SUCCESS(rv, rv);, but the one for interceptionInfo->TriggeringPrincipal() is not, so a failure is overwritten by the next assignment. Add the same check.

Current code:

      triggeringPrincipalInfo.emplace();
      rv = PrincipalToPrincipalInfo(interceptionInfo->TriggeringPrincipal(),
                                    triggeringPrincipalInfo.ptr());

Link to the code:
https://searchfox.org/firefox-main/source/ipc/glue/BackgroundUtils.cpp

To verify the fix:

./mach build

This was reported by Coverity Scan (CID 1539705). The analyzer will stop reporting it once the change lands.

Tutorial to contribute:
https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html
https://firefox-source-docs.mozilla.org/contributing/stack_quickref.html

Please don't ask for the bug to be assigned. It will be automatically assigned to the first patch.

You need to log in before you can comment on or make changes to this bug.