mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-25 02:38:59 +00:00
Spreadsheet: Prevent infinite loop in Range ctor
This commit is contained in:
parent
54b4eb6bd1
commit
b3591d28df
Notes:
sideshowbarker
2024-07-17 18:28:27 +09:00
Author: https://github.com/u9g
Commit: b3591d28df
Pull-request: https://github.com/SerenityOS/serenity/pull/12691
Reviewed-by: https://github.com/Smrtnyk
Reviewed-by: https://github.com/alimpfard
1 changed files with 3 additions and 0 deletions
|
@ -162,6 +162,9 @@ class Ranges {
|
|||
|
||||
class Range {
|
||||
constructor(startingColumnName, endingColumnName, startingRow, endingRow, columnStep, rowStep) {
|
||||
// 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");
|
||||
this.startingColumnName = startingColumnName;
|
||||
this.endingColumnName = endingColumnName;
|
||||
this.startingRow = startingRow;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue