GNOME Bugzilla – Bug 783787
gsturi: Fixed incorrect escaping of path in gst_uri_construct
Last modified: 2017-06-15 08:41:55 UTC
gst_uri_construct was handling the 'location' component of the uri as a generic URI string to be encoded. This is incorrect since the string is actually a path and based on RFC 3986, 'A path consists of a sequence of path segments separated by a slash ("/") character.'. This patch changes the 'escape_string' function to use 'escape_string_internal' with the "UNSAFE_PATH" option. A side effect is that the escape_string function is unused so I have flagged it as such so that gcc can compile gsturl with the -Werror=unused-function flag.
Created attachment 353743 [details] [review]
Created attachment 353749 [details] [review]
Updated verison of patch witch suggestions from slomo
Review of attachment 353743 [details] [review]:
Makes sense to me, but let's at the same time deprecate this function in favour of the GstUri API. Can you add the GST_DISABLE_DEPRECATED/GST_REMOVE_DEPRECATED markers here like in other places?
@@ +259,3 @@
* but with all special characters escaped
+G_GNUC_UNUSED static gchar *
Please just remove this function :)
Created attachment 353802 [details] [review]
Patch with added deprecation macros
Author: Dimitrios Katsaros <firstname.lastname@example.org>
Date: Wed Jun 14 17:36:57 2017 +0200
gsturi: Fixed incorrect escaping of path as a generic string
The gst_uri_construct function was escaping the location string
as a generic uri string. This is incorrect since the slash('/')
characters are reserved for use in this exact case. The patch
changes the escape_string function mode to handle the path correctly.
I have deleted the escape_string function since it is no longer being
used and have created a unit test for the function. I have also
deprecated this function in favour of the GstUri API.
And 1.12.1 without the deprecation