Skip to content

Commit eb94ee7

Browse files
rheniumgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6c50a57 commit eb94ee7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

imap-send.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,7 @@ static char *cram(const char *challenge_64, const char *user, const char *pass)
890890

891891
/* response: "<user> <digest in hex>" */
892892
response = xstrfmt("%s %s", user, hex);
893-
resp_len = strlen(response) + 1;
893+
resp_len = strlen(response);
894894

895895
response_64 = xmallocz(ENCODED_SIZE(resp_len));
896896
encoded_len = EVP_EncodeBlock((unsigned char *)response_64,

0 commit comments

Comments
 (0)