Skip to content

Commit

Permalink
httpauth/digest: fix digest_response possible NULL deref
Browse files Browse the repository at this point in the history
found by coverity
  • Loading branch information
sreimers committed Nov 19, 2023
1 parent 5a39786 commit 24cf59e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 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

0 comments on commit 24cf59e

Please sign in to comment.