Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coverity httpauth fixes #1007

Merged
merged 2 commits into from
Nov 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/httpauth/digest.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,12 +635,13 @@ static int digest_response(struct httpauth_digest_enc_resp *resp,
uint8_t *hash1 = NULL;
uint8_t *hash2 = NULL;
struct mbuf *mb = NULL;
size_t hashstringl = (resp->hash_length * 2) + 1;
int err = 0, n = 0;

if (!resp || !resp->hashh)
return EINVAL;

size_t hashstringl = (resp->hash_length * 2) + 1;

mb = mbuf_alloc(str_len(user) + str_len(passwd) + chall->realm.l + 2);
if (!mb)
return ENOMEM;
Expand Down Expand Up @@ -961,6 +962,9 @@ int httpauth_digest_response_full(struct httpauth_digest_enc_resp **presp,
goto out;
}

if (err)
goto out;

err = digest_response(resp, chall, method, user, passwd, entitybody);

out:
Expand Down
Loading