From 827afa206d8c9675f2a7af402396552c2ed1df09 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Sat, 1 Aug 2020 02:12:21 +0530 Subject: webrtc, rtmp2: Fix parsing of userinfo in URI strings While parsing the string, `gst_uri_from_string()` also unescapes the userinfo. This is bad if your username contains a `:` character, since we will then split the userinfo at the wrong location when parsing it. To fix this, we can use the new `gst_uri_from_string_escaped()` API that was added in https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/583 Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/831 Part-of: --- ext/webrtc/gstwebrtcice.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ext/webrtc') diff --git a/ext/webrtc/gstwebrtcice.c b/ext/webrtc/gstwebrtcice.c index 9a9630d3c..9b2cc6620 100644 --- a/ext/webrtc/gstwebrtcice.c +++ b/ext/webrtc/gstwebrtcice.c @@ -780,7 +780,7 @@ _clear_ice_stream (struct NiceStreamItem *item) static GstUri * _validate_turn_server (GstWebRTCICE * ice, const gchar * s) { - GstUri *uri = gst_uri_from_string (s); + GstUri *uri = gst_uri_from_string_escaped (s); const gchar *userinfo, *scheme; GList *keys = NULL, *l; gchar *user = NULL, *pass = NULL; @@ -855,7 +855,7 @@ out: void gst_webrtc_ice_set_stun_server (GstWebRTCICE * ice, const gchar * uri_s) { - GstUri *uri = gst_uri_from_string (uri_s); + GstUri *uri = gst_uri_from_string_escaped (uri_s); const gchar *msg = "must be of the form stun://:"; GST_DEBUG_OBJECT (ice, "setting stun server, %s", uri_s); -- cgit v1.2.1