summaryrefslogtreecommitdiff
path: root/Base/res/js
diff options
context:
space:
mode:
authoru9g <git@u9g.dev>2022-03-03 18:04:03 -0500
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2022-03-04 04:29:20 +0330
commit9fcd3f7920795fd02415dc82cca3498f443f06e6 (patch)
tree86629dce7875bbae7916bc3d93ab08fd13ef61e2 /Base/res/js
parent12ef20b8690451b1b66dc72f18b309bcb777a322 (diff)
downloadserenity-9fcd3f7920795fd02415dc82cca3498f443f06e6.zip
Spreadsheet: Prevent infinite loop in Range ctor
Diffstat (limited to 'Base/res/js')
-rw-r--r--Base/res/js/Spreadsheet/runtime.js4
1 files changed, 4 insertions, 0 deletions
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;