Infinite loop in XLSX.stream.to_json due to hidden row in Excel sheet #3176
Labels
No Label
DBF
Dates
Defined Names
Features
Formula
HTML
Images
Infrastructure
Integration
International
ODS
Operations
Performance
PivotTables
Pro
Protection
Read Bug
SSF
SYLK
Style
Write Bug
good first issue
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sheetjs/sheetjs#3176
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
97_node.js
Hi @SheetJSDev !
This line
if ((rowinfo[R-1]||{}).hidden) continue;
checks if the current rowR
is hidden in the spreadsheet. If the row is hidden, the loop uses the continue statement to skip processing the current row and move to the next iteration of the loop but without incrementing R. This leads to an infinite loop and XLSX.stream.to_json doesn't ends.Also
(rowinfo[R-1] || {}).hidden
accesses the current row information assuming the current row numberR
in a one-based index but on debugging i found out the current RowR
is a zero-based index.So even using
if ((rowinfo[R-1]||{}).hidden) { ++R; continue; };
will push wrong data where the hidden row is included in the stream and the next non-hidden row is skipped.I'll be submitting a pull request to fix this issue that I have found.
Please verify and merge the changes as soon as possible as I am using this library in production in my system.