From 621bd2d56d38a665ea5b017a38031960f5e5ac3c Mon Sep 17 00:00:00 2001 From: Johann Tuffe Date: Wed, 25 Oct 2023 22:29:37 +0800 Subject: [PATCH] restore length protection --- src/xlsx.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/xlsx.rs b/src/xlsx.rs index ba7c7c48..9421a748 100644 --- a/src/xlsx.rs +++ b/src/xlsx.rs @@ -747,7 +747,9 @@ where } = a.map_err(XlsxError::XmlAttr)? { let len = get_dimension(&rdim)?.len(); - cells.reserve(len as usize); + if len < 1_000_000 { + cells.reserve(len as usize); + } continue 'xml; } }