From a0e6c88cf30d323351765f73d18358e1ffd9fef0 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 ed7577ac..8d4a33da 100644 --- a/src/xlsx.rs +++ b/src/xlsx.rs @@ -750,7 +750,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; } }