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>
Kazuki Yamaguchi committed
Apr 8, 2016 at 23:02 UTC
eb94ee7f0f38cd24270bfb2f655cdec214a4d6e0
1 file changed
+1
-1
imap-send.c
+1
-1
@@ -890,7 +890,7 @@ static char *cram(const char *challenge_64, const char *user, const char *pass)
890
891
/* response: "<user> <digest in hex>" */
892
response = xstrfmt("%s %s", user, hex);
893
- resp_len = strlen(response) + 1;
893
+ resp_len = strlen(response);
894
895
response_64 = xmallocz(ENCODED_SIZE(resp_len));
896
encoded_len = EVP_EncodeBlock((unsigned char *)response_64,