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 /gst | |
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 'gst')
-rw-r--r-- | gst/rtmp2/gstrtmp2locationhandler.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gst/rtmp2/gstrtmp2locationhandler.c b/gst/rtmp2/gstrtmp2locationhandler.c index 7c79c79d6..d8e4367ca 100644 --- a/gst/rtmp2/gstrtmp2locationhandler.c +++ b/gst/rtmp2/gstrtmp2locationhandler.c @@ -221,6 +221,11 @@ uri_handler_set_uri (GstURIHandler * handler, const gchar * string, goto out; } + if (g_strrstr (split[1], ":") != NULL) + GST_WARNING_OBJECT (self, "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); + g_object_set (self, "username", split[0], "password", split[1], NULL); g_strfreev (split); } |