Commit db8ff4e3 authored by Felix Paul Kühne's avatar Felix Paul Kühne

src: fix crash in getaddrinfo due to bugs in the OSX runtime

parent 4b238dc7
......@@ -121,5 +121,13 @@ int vlc_getaddrinfo (const char *node, unsigned port,
node = NULL;
}
#if defined(__APPLE__) && defined(AI_NUMERICSERV)
/* work-around a segfault in libSystem on Darwin 12 and later
* if AI_NUMERICSERV is set and servname is either NULL or "0"
* radar://13058317 */
if ((hints->ai_flags & AI_NUMERICSERV) && (servname == NULL || (servname[0] == '0' && servname[1] == 0)))
servname = (char *)"00";
#endif
return getaddrinfo (node, servname, hints, res);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment