Bug 72253 - Test the value of msg_controllen for platforms whose CMSG_FIRSTHDR() does not test it for us.
Summary: Test the value of msg_controllen for platforms whose CMSG_FIRSTHDR() does not...
Status: RESOLVED FIXED
Alias: None
Product: XCB
Classification: Unclassified
Component: Library (show other bugs)
Version: 1.9.3
Hardware: All Mac OS X (All)
: medium normal
Assignee: xcb mailing list dummy
QA Contact: xcb mailing list dummy
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: xcb-1.10
  Show dependency treegraph
 
Reported: 2013-12-03 04:03 UTC by PHO
Modified: 2013-12-21 13:57 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
The patch to fix the problem. (1.66 KB, text/plain)
2013-12-03 04:03 UTC, PHO
Details

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.