lol

isync: Fix "Buffer too small" error

+39
+34
pkgs/tools/networking/isync/0001-Increase-imap_vprintf-buffer-size.patch
··· 1 + From e8a3a20aed135272a9ec0103f4055411c075f043 Mon Sep 17 00:00:00 2001 2 + From: Michal Sojka <michal.sojka@cvut.cz> 3 + Date: Mon, 7 Nov 2022 00:07:22 +0100 4 + Subject: [PATCH] Increase imap_vprintf buffer size 5 + 6 + This fixes "Fatal: buffer too small. Please report a bug." error. See 7 + https://sourceforge.net/p/isync/mailman/isync-devel/thread/87fsevvebj.fsf%40steelpick.2x.cz/#msg37731590 8 + for related discussion. 9 + 10 + When using mbsync with XOAUTH2 authentication (needed for Office365 11 + mailboxes), the access token used for the LOGIN command may not fit 12 + into the currently used buffer of 1000 characters. In my case, I need 13 + the buffer to be at least 2000 characters long. To make this more 14 + future-proof, I increase the buffer size to 4000 characters. 15 + --- 16 + src/drv_imap.c | 2 +- 17 + 1 file changed, 1 insertion(+), 1 deletion(-) 18 + 19 + diff --git a/src/drv_imap.c b/src/drv_imap.c 20 + index c5a7aed..7847192 100644 21 + --- a/src/drv_imap.c 22 + +++ b/src/drv_imap.c 23 + @@ -528,7 +528,7 @@ imap_vprintf( const char *fmt, va_list ap ) 24 + uint totlen = 0; 25 + const char *segs[MAX_SEGS]; 26 + uint segls[MAX_SEGS]; 27 + - char buf[1000]; 28 + + char buf[4000]; 29 + 30 + d = buf; 31 + ed = d + sizeof(buf); 32 + -- 33 + 2.38.1 34 +
+5
pkgs/tools/networking/isync/default.nix
··· 12 12 sha256 = "1zq0wwvmqsl9y71546dr0aygzn9gjjfiw19hlcq87s929y4p6ckw"; 13 13 }; 14 14 15 + patches = [ 16 + # Fixes "Fatal: buffer too small" error 17 + ./0001-Increase-imap_vprintf-buffer-size.patch 18 + ]; 19 + 15 20 nativeBuildInputs = [ pkg-config perl ]; 16 21 buildInputs = [ openssl db cyrus_sasl zlib ] 17 22 ++ lib.optionals stdenv.isDarwin [ Security ];