[vlc-commits] src: fix crash in getaddrinfo due to bugs in the OSX runtime

Felix Paul Kühne git at videolan.org
Thu Jul 4 18:39:59 CEST 2013


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Wed Jul  3 23:34:26 2013 +0200| [db8ff4e3b10677399292eef7c20d192d9dc3cecd] | committer: Felix Paul Kühne

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

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=db8ff4e3b10677399292eef7c20d192d9dc3cecd
---

 src/network/getaddrinfo.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/network/getaddrinfo.c b/src/network/getaddrinfo.c
index 16dd68e..85b322e 100644
--- a/src/network/getaddrinfo.c
+++ b/src/network/getaddrinfo.c
@@ -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);
 }



More information about the vlc-commits mailing list