imap-send: fix CRAM-MD5 response calculation

Remove extra + 1 from resp_len, the length of the byte sequence to be
Base64 encoded and passed to the server as the response. Or the response
incorrectly contains an extra \0.

Signed-off-by: Kazuki Yamaguchi <k@rhe.jp>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Kazuki Yamaguchi 2016-04-08 23:02:30 +09:00 committed by Junio C Hamano
parent 6c50a57595
commit eb94ee7f0f

View File

@ -890,7 +890,7 @@ static char *cram(const char *challenge_64, const char *user, const char *pass)
/* response: "<user> <digest in hex>" */
response = xstrfmt("%s %s", user, hex);
resp_len = strlen(response) + 1;
resp_len = strlen(response);
response_64 = xmallocz(ENCODED_SIZE(resp_len));
encoded_len = EVP_EncodeBlock((unsigned char *)response_64,