From: Sebastian Dröge Date: Wed, 30 Oct 2013 21:16:54 +0000 (+0100) Subject: rtsp-session-pool: Make sure session IDs are properly URI-escaped X-Git-Tag: 1.19.3~495^2~949 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=935e8f852d050b4939f1d0f44b38e9b55a2fbe36;p=platform%2Fupstream%2Fgstreamer.git rtsp-session-pool: Make sure session IDs are properly URI-escaped https://bugzilla.gnome.org/show_bug.cgi?id=643812 --- diff --git a/gst/rtsp-server/rtsp-session-pool.c b/gst/rtsp-server/rtsp-session-pool.c index d18c11c..be07820 100644 --- a/gst/rtsp-server/rtsp-session-pool.c +++ b/gst/rtsp-server/rtsp-session-pool.c @@ -293,7 +293,7 @@ gst_rtsp_session_pool_find (GstRTSPSessionPool * pool, const gchar * sessionid) static gchar * create_session_id (GstRTSPSessionPool * pool) { - gchar id[16]; + gchar id[17]; gint i; for (i = 0; i < 16; i++) { @@ -301,8 +301,9 @@ create_session_id (GstRTSPSessionPool * pool) session_id_charset[g_random_int_range (0, G_N_ELEMENTS (session_id_charset))]; } + id[16] = 0; - return g_strndup (id, 16); + return g_uri_escape_string (id, NULL, FALSE); } static GstRTSPSession *