From 9fcd3f7920795fd02415dc82cca3498f443f06e6 Mon Sep 17 00:00:00 2001 From: u9g Date: Thu, 3 Mar 2022 18:04:03 -0500 Subject: [PATCH] Spreadsheet: Prevent infinite loop in Range ctor --- Base/res/js/Spreadsheet/runtime.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Base/res/js/Spreadsheet/runtime.js b/Base/res/js/Spreadsheet/runtime.js index dc1b7fda01..5bff2f269b 100644 --- a/Base/res/js/Spreadsheet/runtime.js +++ b/Base/res/js/Spreadsheet/runtime.js @@ -187,6 +187,10 @@ class Range { // using == to account for '0' since js will parse `+'0'` to 0 if (columnStep == 0 || rowStep == 0) throw new Error("rowStep or columnStep is 0, this will cause an infinite loop"); + if (typeof startingRow === "string" || typeof endingRow === "string") + throw new Error( + "startingRow or endingRow is a string, this will cause an infinite loop" + ); this.startingColumnName = startingColumnName; this.endingColumnName = endingColumnName; this.startingRow = startingRow;