]> git.sesse.net Git - ffmpeg/commitdiff
avformat/httpauth: do not decode plus sign to space in credentials
authorMarton Balint <cus@passwd.hu>
Tue, 4 Feb 2020 22:46:23 +0000 (23:46 +0100)
committerMarton Balint <cus@passwd.hu>
Sat, 15 Feb 2020 17:41:36 +0000 (18:41 +0100)
Signed-off-by: Marton Balint <cus@passwd.hu>
libavformat/httpauth.c

index 54d0322c6ae1a16322f07730d754e141ff179c70..4f79c78edc0fa7e18f3af620d40649b59c18f30b 100644 (file)
@@ -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;