diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2020-08-01 02:18:39 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2020-08-03 18:12:50 +0000 |
commit | d4ca8820e7918b9ae1a16d776588da90eeb2e0a4 (patch) | |
tree | 8197841949a1131d65f0808544fe31fe615249df /ext/webrtc/gstwebrtcice.c | |
parent | 827afa206d8c9675f2a7af402396552c2ed1df09 (diff) | |
download | gstreamer-plugins-bad-d4ca8820e7918b9ae1a16d776588da90eeb2e0a4.tar.gz |
webrtc, rtmp2: Warn if the user or password aren't escaped
If the user/pass aren't escaped, the userinfo will be ambiguous and we
won't know where to split. We will accidentally get it right if the :
belongs in the password.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1481>
Diffstat (limited to 'ext/webrtc/gstwebrtcice.c')
-rw-r--r-- | ext/webrtc/gstwebrtcice.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/webrtc/gstwebrtcice.c b/ext/webrtc/gstwebrtcice.c index 9b2cc6620..23a490baa 100644 --- a/ext/webrtc/gstwebrtcice.c +++ b/ext/webrtc/gstwebrtcice.c @@ -291,6 +291,12 @@ _parse_userinfo (const gchar * userinfo, gchar ** user, gchar ** pass) return; } + /* Check that the first occurence is also the last occurence */ + if (colon != g_strrstr (userinfo, ":")) + GST_WARNING ("userinfo %s contains more than one ':', will assume that the " + "first ':' delineates user:pass. You should escape the user and pass " + "before adding to the URI.", userinfo); + *user = g_strndup (userinfo, colon - userinfo); *pass = g_strdup (&colon[1]); } |