Skip to content

Reject empty tables during XML parsing - #2923

Merged
giuspen merged 1 commit into
giuspen:masterfrom
acts-1631:reject-empty-table-rows
Sep 13, 2026
Merged

giuspen merged 1 commit into
giuspen:masterfrom
acts-1631:reject-empty-table-rows

Conversation

@acts-1631

Copy link
Copy Markdown
Contributor

Table XML is parsed by CtStorageXmlHelper::populate_table_matrix()
before _create_table_from_xml() constructs the table widget. With no
row elements, the parser called tableMatrix.back() on an empty vector.
The clipboard path could also index an unvalidated empty matrix.

Return failure for tables without rows or cells, and handle that result
before table construction or clipboard indexing. This prevents a
crafted document or clipboard payload from crashing CherryTree through
out-of-bounds access while preserving valid tables.

Return an error for tables without rows or cells so malformed XML cannot reach table construction or clipboard indexing.
@giuspen
giuspen merged commit 6fd6574 into giuspen:master Sep 13, 2026
@giuspen

giuspen commented Sep 13, 2026

Copy link
Copy Markdown
Owner

Thanks @acts-1631

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants