summaryrefslogtreecommitdiff
path: root/libavformat/httpauth.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-12-05 18:52:29 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-12-08 00:42:48 +0100
commite38eaf47491a864b2180d1ade87ed0ef39dd6d34 (patch)
treeeaf47cc5cd738a86e4e0f05f4657c7ea7114dbca /libavformat/httpauth.c
parentb09ea67b40e342f5e4183e9ebc0c14801ecd218c (diff)
downloadffmpeg-e38eaf47491a864b2180d1ade87ed0ef39dd6d34.tar.gz
avformat/utils: Make ff_data_to_hex() zero-terminate the string
Most callers want it that way anyway. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavformat/httpauth.c')
-rw-r--r--libavformat/httpauth.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/libavformat/httpauth.c b/libavformat/httpauth.c
index 4f79c78edc..0a98ff80a5 100644
--- a/libavformat/httpauth.c
+++ b/libavformat/httpauth.c
@@ -156,7 +156,6 @@ static char *make_digest_auth(HTTPAuthState *state, const char *username,
for (i = 0; i < 2; i++)
cnonce_buf[i] = av_get_random_seed();
ff_data_to_hex(cnonce, (const uint8_t*) cnonce_buf, sizeof(cnonce_buf), 1);
- cnonce[2*sizeof(cnonce_buf)] = 0;
md5ctx = av_md5_alloc();
if (!md5ctx)
@@ -166,7 +165,6 @@ static char *make_digest_auth(HTTPAuthState *state, const char *username,
update_md5_strings(md5ctx, username, ":", state->realm, ":", password, NULL);
av_md5_final(md5ctx, hash);
ff_data_to_hex(A1hash, hash, 16, 1);
- A1hash[32] = 0;
if (!strcmp(digest->algorithm, "") || !strcmp(digest->algorithm, "MD5")) {
} else if (!strcmp(digest->algorithm, "MD5-sess")) {
@@ -174,7 +172,6 @@ static char *make_digest_auth(HTTPAuthState *state, const char *username,
update_md5_strings(md5ctx, A1hash, ":", digest->nonce, ":", cnonce, NULL);
av_md5_final(md5ctx, hash);
ff_data_to_hex(A1hash, hash, 16, 1);
- A1hash[32] = 0;
} else {
/* Unsupported algorithm */
av_free(md5ctx);
@@ -185,7 +182,6 @@ static char *make_digest_auth(HTTPAuthState *state, const char *username,
update_md5_strings(md5ctx, method, ":", uri, NULL);
av_md5_final(md5ctx, hash);
ff_data_to_hex(A2hash, hash, 16, 1);
- A2hash[32] = 0;
av_md5_init(md5ctx);
update_md5_strings(md5ctx, A1hash, ":", digest->nonce, NULL);
@@ -195,7 +191,6 @@ static char *make_digest_auth(HTTPAuthState *state, const char *username,
update_md5_strings(md5ctx, ":", A2hash, NULL);
av_md5_final(md5ctx, hash);
ff_data_to_hex(response, hash, 16, 1);
- response[32] = 0;
av_free(md5ctx);