GNOME Bugzilla – Bug 575256
rtspsrc fails to resolve hostnames
Last modified: 2009-03-13 15:22:10 UTC
The function do_resolve() in gstrtspconnection.c returns a pointer to data in a local buffer. When the caller references this pointer it may no longer contain the correct data. static const gchar * do_resolve (const gchar * host) { ... gchar ipbuf[INET_ADDRSTRLEN]; ... ip = inet_ntop (AF_INET, (struct in_addr *) addrs[0], ipbuf, sizeof (ipbuf)); ... return ip; ... } The return value of inet_ntop() is a pointer to ipbuf, which then is returned as the result from do_resolve(). This bug prevents me from using rtspsrc with hostnames at the moment (ip addresses work). A simple workaround is to change the ipbuf declaration to static.
ah, that's the reason it didn't work for me either!
commit f4b7cbbf1639776a4c066b04462bed13d22d02ae Author: Wim Taymans <wim.taymans@collabora.co.uk> Date: Fri Mar 13 16:19:41 2009 +0100 rtsp: fix resolving of hostnames We were returning a pointer to a stack variable with the resolved hostname, which doesn't work. return a copy of the resolved ip address instead. Fixes #575256.