···11+From e8a3a20aed135272a9ec0103f4055411c075f043 Mon Sep 17 00:00:00 2001
22+From: Michal Sojka <michal.sojka@cvut.cz>
33+Date: Mon, 7 Nov 2022 00:07:22 +0100
44+Subject: [PATCH] Increase imap_vprintf buffer size
55+66+This fixes "Fatal: buffer too small. Please report a bug." error. See
77+https://sourceforge.net/p/isync/mailman/isync-devel/thread/87fsevvebj.fsf%40steelpick.2x.cz/#msg37731590
88+for related discussion.
99+1010+When using mbsync with XOAUTH2 authentication (needed for Office365
1111+mailboxes), the access token used for the LOGIN command may not fit
1212+into the currently used buffer of 1000 characters. In my case, I need
1313+the buffer to be at least 2000 characters long. To make this more
1414+future-proof, I increase the buffer size to 4000 characters.
1515+---
1616+ src/drv_imap.c | 2 +-
1717+ 1 file changed, 1 insertion(+), 1 deletion(-)
1818+1919+diff --git a/src/drv_imap.c b/src/drv_imap.c
2020+index c5a7aed..7847192 100644
2121+--- a/src/drv_imap.c
2222++++ b/src/drv_imap.c
2323+@@ -528,7 +528,7 @@ imap_vprintf( const char *fmt, va_list ap )
2424+ uint totlen = 0;
2525+ const char *segs[MAX_SEGS];
2626+ uint segls[MAX_SEGS];
2727+- char buf[1000];
2828++ char buf[4000];
2929+3030+ d = buf;
3131+ ed = d + sizeof(buf);
3232+--
3333+2.38.1
3434+