OSX: Workaround CMSG_FIRSTHDR bug
OSX: Workaround CMSG_FIRSTHDR bug

On OSX, CMSG_FIRSTHDR will return a pointer into the control buffer
space when controllen == 0. We work around by testing for a non-zero
controllen before trying to parse control messages.

Test case:

int
main() {
  struct msghdr msg;

  msg.msg_control = &msg;
  msg.msg_controllen = 0;
  if (CMSG_FIRSTHDR(&msg))
    printf("Bug found!\n");
}

Review URL: http://codereview.chromium.org/21283


git-svn-id: dd90618784b6a4b323ea0c23a071cb1c9e6f2ac7@9640 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser