summaryrefslogtreecommitdiff
path: root/ext/webrtc
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2020-08-01 02:12:21 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2020-08-03 18:12:50 +0000
commit827afa206d8c9675f2a7af402396552c2ed1df09 (patch)
tree2dde087116c742fdf925ee6c13ab2d524666d55a /ext/webrtc
parent962ebebe066169592837af1227234e23191f286b (diff)
downloadgstreamer-plugins-bad-827afa206d8c9675f2a7af402396552c2ed1df09.tar.gz
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: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1481>
Diffstat (limited to 'ext/webrtc')
-rw-r--r--ext/webrtc/gstwebrtcice.c4
1 files changed, 2 insertions, 2 deletions
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://<host>:<port>";
GST_DEBUG_OBJECT (ice, "setting stun server, %s", uri_s);