summaryrefslogtreecommitdiffstats
path: root/imap/auth_cram.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>2001-01-08 16:57:20 +0000
committerThomas Roessler <roessler@does-not-exist.org>2001-01-08 16:57:20 +0000
commitd5a336245304225932d3b5d18f82336bebb01efe (patch)
treead754228c008f9b1a3dc0ff8b60efe1d326c1927 /imap/auth_cram.c
parent0fc518a9da9ec8af36af17fbcb305cd6abd5d50e (diff)
Fix and/or check more fishy code.
Diffstat (limited to 'imap/auth_cram.c')
-rw-r--r--imap/auth_cram.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/imap/auth_cram.c b/imap/auth_cram.c
index 54330c01..0528ccf1 100644
--- a/imap/auth_cram.c
+++ b/imap/auth_cram.c
@@ -33,7 +33,7 @@ static void hmac_md5 (const char* password, char* challenge,
/* imap_auth_cram_md5: AUTH=CRAM-MD5 support. */
imap_auth_res_t imap_auth_cram_md5 (IMAP_DATA* idata)
{
- char ibuf[LONG_STRING*4+10], obuf[LONG_STRING];
+ char ibuf[LONG_STRING*2], obuf[LONG_STRING];
unsigned char hmac_response[MD5_DIGEST_LEN];
int len;
int rc;
@@ -102,8 +102,9 @@ imap_auth_res_t imap_auth_cram_md5 (IMAP_DATA* idata)
* plus the additional debris
*/
- mutt_to_base64 ((unsigned char*) ibuf, (unsigned char*) obuf, strlen (obuf));
- strcat (ibuf, "\r\n"); /* __STRCAT_CHECKED__ */
+ mutt_to_base64 ((unsigned char*) ibuf, (unsigned char*) obuf, strlen (obuf),
+ sizeof (ibuf) - 2);
+ strncat (ibuf, "\r\n", sizeof (ibuf));
mutt_socket_write (idata->conn, ibuf);
do