Skip to content

Commit

Permalink
avformat/httpauth: do not decode plus sign to space in credentials
Browse files Browse the repository at this point in the history
Signed-off-by: Marton Balint <[email protected]>
  • Loading branch information
cus committed Feb 15, 2020
1 parent 8224f1e commit 3004ef1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libavformat/httpauth.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 3004ef1

Please sign in to comment.