[FFmpeg-cvslog] Revert "lavf/utils: Allow url credentials to contain a slash."

Marton Balint git at videolan.org
Sun May 19 01:41:18 EEST 2019


ffmpeg | branch: master | Marton Balint <cus at passwd.hu> | Sun May  5 20:40:06 2019 +0200| [c61d16cf3b815388c076c2a35b5c91e84b45d7be] | committer: Marton Balint

Revert "lavf/utils: Allow url credentials to contain a slash."

This reverts commit dd06f022b07438d650c82255dff16908ba04244a.

Fixes ticket #7871 and reopens ticket #7816.

The introduced regression caused URL's with @ in them to be parsed incorrectly
which is a bigger issue then not being able to specify the slash character as a
password.

I think there are better ways to fix the original issue, like being able to
specify HTTP username and password as a protocol option, or adding a protocol
option to percent-decode the URL first.

Signed-off-by: Marton Balint <cus at passwd.hu>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c61d16cf3b815388c076c2a35b5c91e84b45d7be
---

 libavformat/utils.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index a63d71b0f4..6ef94239a4 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -4730,7 +4730,7 @@ void av_url_split(char *proto, int proto_size,
                   char *hostname, int hostname_size,
                   int *port_ptr, char *path, int path_size, const char *url)
 {
-    const char *p, *ls, *ls2, *ls3, *at, *at2, *col, *brk;
+    const char *p, *ls, *ls2, *at, *at2, *col, *brk;
 
     if (port_ptr)
         *port_ptr = -1;
@@ -4760,9 +4760,6 @@ void av_url_split(char *proto, int proto_size,
     /* separate path from hostname */
     ls = strchr(p, '/');
     ls2 = strchr(p, '?');
-    ls3 = strchr(p, '@');
-    if (ls3 && ls3 > ls && (!ls2 || ls2 > ls3))
-        ls = strchr(ls3, '/');
     if (!ls)
         ls = ls2;
     else if (ls && ls2)



More information about the ffmpeg-cvslog mailing list