Bug 72253

Summary: Test the value of msg_controllen for platforms whose CMSG_FIRSTHDR() does not test it for us.
Product: XCB Reporter: PHO <pho>
Component: LibraryAssignee: xcb mailing list dummy <xcb>
Status: RESOLVED FIXED QA Contact: xcb mailing list dummy <xcb>
Severity: normal    
Priority: medium    
Version: 1.9.3   
Hardware: All   
OS: Mac OS X (All)   
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 71752    
Attachments: The patch to fix the problem.

Description PHO 2013-12-03 04:03:02 UTC
Created attachment 90138 [details]
The patch to fix the problem.

As RFC 2292 points out, some platforms (e.g. Darwin 9.8.0) provide CMSG_FIRSTHDR(msg) which just returns msg.msg_control without first checking if msg.msg_controllen is non-zero. We need a workaround for such platforms not to let _xcb_in_read() segfault.
Comment 1 Mark Kettenis 2013-12-03 10:52:08 UTC
POSIX mandates that CMSG_FIRSTHDR() checks, and Darwin 10.0.0 (OS X 10.6) has this fixed.  Must say I am a bit surprised that older versions don't do the check.  Anyway, the fix looks right to me.
Comment 2 Uli Schlachter 2013-12-21 13:57:16 UTC
Merged as commit a1299eb2a210b5788a2b827b82a3d825caa1f201

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.