From patchwork Sat Feb 8 21:18:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 17724 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 ECA6A44B956 for ; Sat, 8 Feb 2020 23:19:21 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D6BFD68B041; Sat, 8 Feb 2020 23:19:21 +0200 (EET) 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 1AE6F68B041 for ; Sat, 8 Feb 2020 23:19:20 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id EE583E3ABE; Sat, 8 Feb 2020 22:19:19 +0100 (CET) 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 2t7zmUe0ecyw; Sat, 8 Feb 2020 22:19:18 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 9F4D7E3B91; Sat, 8 Feb 2020 22:19:18 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Sat, 8 Feb 2020 22:18:20 +0100 Message-Id: <20200208211823.31345-9-cus@passwd.hu> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200208211823.31345-1-cus@passwd.hu> References: <20200208211823.31345-1-cus@passwd.hu> Subject: [FFmpeg-devel] [PATCH 09/12] avformat/httpauth: do not decode plus sign to space in credentials 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" Signed-off-by: Marton Balint --- libavformat/httpauth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/httpauth.c b/libavformat/httpauth.c index 54d0322c6a..4f79c78edc 100644 --- a/libavformat/httpauth.c +++ b/libavformat/httpauth.c @@ -255,7 +255,7 @@ char *ff_http_auth_create_response(HTTPAuthState *state, const char *auth, if (state->auth_type == HTTP_AUTH_BASIC) { int auth_b64_len, len; - char *ptr, *decoded_auth = ff_urldecode(auth, 1); + char *ptr, *decoded_auth = ff_urldecode(auth, 0); if (!decoded_auth) return NULL; @@ -275,7 +275,7 @@ char *ff_http_auth_create_response(HTTPAuthState *state, const char *auth, av_strlcat(ptr, "\r\n", len - (ptr - authstr)); av_free(decoded_auth); } else if (state->auth_type == HTTP_AUTH_DIGEST) { - char *username = ff_urldecode(auth, 1), *password; + char *username = ff_urldecode(auth, 0), *password; if (!username) return NULL;