Bug 184090

Summary: Avoid uninitialized mach ports
Product: WebKit Reporter: Brent Fulgham <bfulgham>
Component: WebKit Misc.Assignee: Brent Fulgham <bfulgham>
Status: RESOLVED FIXED    
Severity: Normal CC: beidson, benjamin, bfulgham, cdumez, cmarcelo, dbates, ddkilzer, dino, ews-watchlist, graouts, kondapallykalyan, rniwa, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch cdumez: review+

Brent Fulgham
Reported 2018-03-28 09:20:47 PDT
It is possible for mach_port_allocate to return an error, but we rarely check its return value. The value of the argument passed to mach_port_allocate is not guaranteed to be valid when it returns an error, so there is a potential for us to try to use invalid ports. We should always check return values, and ensure that the mach port variables we seek to initialize are kept in a valid state. While we're at it, we should add some additional assertions to confirm we aren't dealing with invalid ports.
Attachments
Patch (42.79 KB, patch)
2018-03-28 09:48 PDT, Brent Fulgham
cdumez: review+
Brent Fulgham
Comment 1 2018-03-28 09:37:40 PDT
Brent Fulgham
Comment 2 2018-03-28 09:48:40 PDT
Chris Dumez
Comment 3 2018-03-28 10:00:58 PDT
Comment on attachment 336666 [details] Patch r=me if the bots are happy.
Brent Fulgham
Comment 4 2018-03-28 11:07:02 PDT
Note You need to log in before you can comment on or make changes to this bug.