After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 575256 - rtspsrc fails to resolve hostnames
rtspsrc fails to resolve hostnames
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal normal
: 0.10.23
Assigned To: Wim Taymans
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-03-13 14:44 UTC by Fredrik Olofsson
Modified: 2009-03-13 15:22 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Fredrik Olofsson 2009-03-13 14:44:52 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.
Comment 1 Wim Taymans 2009-03-13 15:11:14 UTC
ah, that's the reason it didn't work for me either!
Comment 2 Wim Taymans 2009-03-13 15:22:10 UTC
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.