A heap-based buffer overflow occurs in the `add to challenge()` function within the DIGEST-MD5 plugin. The issue arises because the function calculates the required buffer size for a challenge/response field before applying DIGEST-MD5 quoting, but fails to recompute the size after escaping special characters, which increases the value length. This results in an under-sized buffer being passed to `strcat()`, leading to a heap-based out-of-bounds write. A malicious or on-path DIGEST-MD5 or HTTP Digest server can trigger this by providing a crafted challenge field, such as `realm` or `nonce`, typically causing the client application to crash.