From patchwork Sun May 5 18:51:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 12997 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 715664479DD for ; Sun, 5 May 2019 21:51:28 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 53F4168AD11; Sun, 5 May 2019 21:51:28 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 052F568ACFF for ; Sun, 5 May 2019 21:51:22 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id DFCD3E1A92; Sun, 5 May 2019 20:51:21 +0200 (CEST) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kE_iURworfBh; Sun, 5 May 2019 20:51:20 +0200 (CEST) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id DAA44E1D7A; Sun, 5 May 2019 20:51:19 +0200 (CEST) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Sun, 5 May 2019 20:51:09 +0200 Message-Id: <20190505185109.20957-2-cus@passwd.hu> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190505185109.20957-1-cus@passwd.hu> References: <20190505185109.20957-1-cus@passwd.hu> Subject: [FFmpeg-devel] [PATCH 2/2] Revert "lavf/utils: Allow url credentials to contain a slash." X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Marton Balint MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" 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 --- 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)