Blob Blame History Raw
From df17cee615377f2474c86eb6a5b3fe5caa8b70fe Mon Sep 17 00:00:00 2001
From: Timo Sirainen <timo.sirainen@open-xchange.com>
Date: Mon, 4 Feb 2019 19:25:13 -0800
Subject: [PATCH] fts: Fix buffer overflow when reading oversized fts header

---
 src/plugins/fts/fts-api.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/plugins/fts/fts-api.c b/src/plugins/fts/fts-api.c
index 5a5b2a919e..4f8a1c125d 100644
--- a/src/plugins/fts/fts-api.c
+++ b/src/plugins/fts/fts-api.c
@@ -425,7 +425,7 @@ bool fts_index_get_header(struct mailbox *box, struct fts_index_header *hdr_r)
 		i_zero(hdr_r);
 		ret = FALSE;
 	} else {
-		memcpy(hdr_r, data, data_size);
+		memcpy(hdr_r, data, sizeof(*hdr_r));
 		ret = TRUE;
 	}
 	mail_index_view_close(&view);