gsocket: Work around broken CMSG_FIRSTHDR()
authorPHO <pho@cielonegro.org>
Mon, 17 Dec 2012 23:33:50 +0000 (08:33 +0900)
committerDan Winship <danw@gnome.org>
Tue, 18 Dec 2012 18:31:02 +0000 (13:31 -0500)
commitf0f6c8d231b415e5d69575c0c757e10abefdca2b
tree1d6b93a5ff9aa4f149219e5bb1c5955fb59e3103
parent780871d2738091f425afa1573bc1bce6969f85e6
gsocket: Work around broken CMSG_FIRSTHDR()

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 g_socket_receive_message() segfault.

https://bugzilla.gnome.org/show_bug.cgi?id=690388
gio/gsocket.c